diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3f03bf4c..ed6ca243 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,6 +9,7 @@ updates: directory: "/" schedule: interval: "weekly" + target-branch: "dev" reviewers: - "rocboss" - "alimy" diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6d5dca69..a38b564a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,7 +7,9 @@ on: - dev - 'jc/**' - 'feature/**' + - 'r/**' - 'x/**' + - 't/**' paths: - '**.go' - 'go.mod' @@ -45,7 +47,7 @@ jobs: name: Test strategy: matrix: - go-version: [ 1.18.x, 1.19.x ] + go-version: [ 1.20.x ] platform: [ ubuntu-latest, macos-latest ] runs-on: ${{ matrix.platform }} steps: @@ -64,7 +66,7 @@ jobs: name: TestOnWindows strategy: matrix: - go-version: [ 1.18.x, 1.19.x ] + go-version: [ 1.20.x ] platform: [ windows-latest ] runs-on: ${{ matrix.platform }} steps: diff --git a/.gitignore b/.gitignore index c67a6e18..96f9f38d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ +.DS_Store .idea -.vscode +__debug_bin !*.example /config.yaml *.log @@ -7,3 +8,4 @@ paopao-ce* /release /data /custom +/.custom diff --git a/.vscode/.gitignore b/.vscode/.gitignore new file mode 100644 index 00000000..577ebbbe --- /dev/null +++ b/.vscode/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +*.log +__debug_bin +settings.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..fb60435b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "paopao-ce [debug]", + "type": "go", + "request": "launch", + "mode": "exec", + "program": "${workspaceFolder}/.vscode/__debug_bin", + "preLaunchTask": "go: build (debug)", + "cwd": "${workspaceFolder}" + } + ] +} diff --git a/.vscode/sort_launch.js b/.vscode/sort_launch.js new file mode 100644 index 00000000..58d379e3 --- /dev/null +++ b/.vscode/sort_launch.js @@ -0,0 +1,4 @@ +let launch = require('./launch.json'); +launch.configurations.sort((a, b) => a.name.localeCompare(b.name)); +let fs = require('fs'); +fs.writeFileSync('launch.json', JSON.stringify(launch, null, 4)); diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..b716d1a8 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,21 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "go: build (debug)", + "type": "shell", + "command": "go", + "args": [ + "build", + "-gcflags=all=-N -l", + "-tags", + "'embed go_json'", + "-o", + "${workspaceFolder}/.vscode/__debug_bin" + ], + "options": { + "cwd": "${workspaceFolder}" + } + } + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..7e917b31 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,178 @@ +# Changelog + +All notable changes to paopao-ce are documented in this file. +## 0.4.0+dev ([`dev`](https://github.com/rocboss/paopao-ce/tree/dev)) +### Added +- add `pprof` feature support [#327](https://github.com/rocboss/paopao-ce/pull/327) +- use compiler profile-guided optimization (PGO) to further optimize builds. [#327](https://github.com/rocboss/paopao-ce/pull/327) +- frontend: re-add stars page embed to profile page. [#339](https://github.com/rocboss/paopao-ce/pull/339) +- simple support for user posts filter by style(post/comment/media/star). [#345](https://github.com/rocboss/paopao-ce/pull/345) +- add user highlight tweet support include custom tweet set to highlight and list in user/profile page. + +### Changed +- change man content width to 600px and optimize tweet/comment/replay text length. [#333](https://github.com/rocboss/paopao-ce/pull/333) + +## 0.3.1 +### Fixed +- fixed: video player assets cdn error. [&caff8c0](https://github.com/rocboss/paopao-ce/commit/caff8c052be6c8d59576011192f830fd98e17ab3 'commit caff8c0') + +## 0.3.0 +### Added + +- add custom comment sort strategy support [#243](https://github.com/rocboss/paopao-ce/pull/243) +- add `RedisCacheIndex` feature [#250](https://github.com/rocboss/paopao-ce/pull/250) +- add `Sentry` feature [#258](https://github.com/rocboss/paopao-ce/pull/258) +- add simple tweet share feature(just copy tweet link to clipboard now) support [#264](https://github.com/rocboss/paopao-ce/pull/264) +- add default tweet max length configure in web/.env support. [&a1160ca](https://github.com/rocboss/paopao-ce/commit/a1160ca79380445157146d9eae1710543c153cce 'commit a1160ca') + Set the value of `VITE_DEFAULT_TWEET_MAX_LENGTH` in file web/.env to change the tweet max default length. + - add custom whether provide user register configure in web/.env support. [#267](https://github.com/rocboss/paopao-ce/pull/267) + Set the value of `VITE_ALLOW_USER_REGISTER` in file web/.env to custom whether provide user register feature. + ``` + # file: web/.env or web/.env.local + ... + # 局部参数 + VITE_ALLOW_USER_REGISTER=true + ... + ``` + and disallow user register in backend(add `Web:DisallowUserRegister` feature in `config.yaml`): + ```yaml + # file config.yaml + ... + Features: + Default: ["Base", "Postgres", "Zinc", "LocalOSS", "LoggerZinc", "BigCacheIndex", "Friendship", "Service", "Web:DisallowUserRegister"] + ... + ``` +- add topic follow feature support [#273](https://github.com/rocboss/paopao-ce/pull/273) + mirgration database first(sql ddl file in `scripts/migration/**/*_topic_follow.up.sql`): + ```sql + CREATE TABLE `p_topic_user` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + `topic_id` BIGINT UNSIGNED NOT NULL COMMENT '标签ID', + `user_id` BIGINT UNSIGNED NOT NULL COMMENT '创建者ID', + `alias_name` VARCHAR ( 255 ) COMMENT '别名', + `remark` VARCHAR ( 512 ) COMMENT '备注', + `quote_num` BIGINT UNSIGNED COMMENT '引用数', + `is_top` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否置顶 0 为未置顶、1 为已置顶', + `created_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `reserve_a` VARCHAR ( 255 ) COMMENT '保留字段a', + `reserve_b` VARCHAR ( 255 ) COMMENT '保留字段b', + PRIMARY KEY ( `id` ) USING BTREE, + UNIQUE KEY `idx_topic_user_uid_tid` ( `topic_id`, `user_id` ) USING BTREE + ) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户话题'; + ``` +- add tweet comment thumbs up/down feature support [#275](https://github.com/rocboss/paopao-ce/pull/275) + mirgration database first(sql ddl file in `scripts/migration/**/*_comment_thumbs.up.sql`): +- add load more comments feature support [&60b217b](https://github.com/rocboss/paopao-ce/commit/60b217bcd950c69ba45cebcaa17efdf8048d5a4f 'commit 60b217b') + +### Fixed + +- fixed sql ddl p_contact's column `is_delete` define error (change to `is_del`) in scripts/paopao-mysql.sql [&afd8fe1](https://github.com/rocboss/paopao-ce/commit/afd8fe18d2dce08a4af846c2f822379d99a3d3b3 'commit afd8fe1') +- fixed cache index not expire in delete/add tweet error [#266](https://github.com/rocboss/paopao-ce/pull/266) +- fixed tweet's owner not allow star/collection action when tweet is private error [#274](https://github.com/rocboss/paopao-ce/pull/274) +- fixed user not list owner's collectioned private tweet error [#274](https://github.com/rocboss/paopao-ce/pull/274) +- fixed comments thumbs up/down state incorrect error [#283](https://github.com/rocboss/paopao-ce/pull/283) + +### Fixed + +- fixed sql ddl p_contact's column `is_delete` define error (change to `is_del`) in scripts/paopao-mysql.sql [&afd8fe1](https://github.com/rocboss/paopao-ce/commit/afd8fe18d2dce08a4af846c2f822379d99a3d3b3 'commit afd8fe1') + +### Changed + +- use [github.com/rueian/rueidis](https://github.com/rueian/rueidis) as Redis client [#249](https://github.com/rocboss/paopao-ce/pull/249) + the **Old** redis client configure field + ```yaml + ... + Redis: + Host: redis:6379 + Password: + DB: + ``` + the **New** redis client configure field + ```yaml + ... + Redis: + InitAddress: + - redis:6379 + Username: + Password: + SelectDB: + ConnWriteTimeout: 60 # 连接写超时时间 多少秒 默认 60秒 + ``` +- optimize web frontend dark theme [&b082a8f](https://github.com/rocboss/paopao-ce/commit/b082a8fa5e43dd6dacf459df93fa7e243dd901ea 'commit b082a8f') +- change web frontend main content layout default size to 544px [&b082a8f](https://github.com/rocboss/paopao-ce/commit/b082a8fa5e43dd6dacf459df93fa7e243dd901ea 'commit b082a8f') +- optimize web frontend in mobile environment use Drawer to display menu [#265](https://github.com/rocboss/paopao-ce/pull/265) +- optimize Dockerfile use pre-build builder/runner image to prevent network latency problem (`bitbus/paopao-ce-backend-builder` `bitbus/paopao-ce-backend-runner`) [#265](https://github.com/rocboss/paopao-ce/pull/265) +- optimize web ui in mobile environment [#280](https://github.com/rocboss/paopao-ce/pull/280) +- optimize upload zip attachment compatible with different browsers for uploading zip mimetype [#286](https://github.com/rocboss/paopao-ce/pull/286) +- adapte meilisearch to version v1.1 [#288](https://github.com/rocboss/paopao-ce/pull/288) + +### Removed + +- remove `Deprecated:OldWeb` feature [#256](https://github.com/rocboss/paopao-ce/pull/256) + +## 0.2.5 + +### Changed + +- fixed sql ddl error for contact table [#281](https://github.com/rocboss/paopao-ce/pull/281) + +## 0.2.4 + +### Added + +- add PWA support for web frontend [#242](https://github.com/rocboss/paopao-ce/pull/242) + + +## 0.2.3 + +### Added + +- add PostgreSQL DDL file [#229](https://github.com/rocboss/paopao-ce/pull/229) + +### Changed + +- optimize MySQL DDL file [#229](https://github.com/rocboss/paopao-ce/pull/229) +- optimize Sqlite3 DDL file [#229](https://github.com/rocboss/paopao-ce/pull/229) + +## 0.2.2 + +### Fixed + +- fixed add star to tweet error [#222](https://github.com/rocboss/paopao-ce/pull/222) + +## 0.2.1 + +### Changed + +- optimize docker-compose.yaml use bitbus/paopao-ce:latest as release image [#217](https://github.com/rocboss/paopao-ce/pull/217) + +### Fixed + +- fixed sql ddl in scripts/paopao-mysql.sql and scripts/paopao-sqlite3.sql [#217](https://github.com/rocboss/paopao-ce/pull/217) + +## 0.2.0 + +### Added + +- add `Friendship` feature [#192](https://github.com/rocboss/paopao-ce/pull/192) +- add `Lightship` feature [#198](https://github.com/rocboss/paopao-ce/pull/198) +- add `Pyroscope` feature [#199](https://github.com/rocboss/paopao-ce/pull/199) +- add new `Web` service [#196](https://github.com/rocboss/paopao-ce/pull/196) +- add `Frontend:Web` feature [#196](https://github.com/rocboss/paopao-ce/pull/196) +- add `Deprecated:OldWeb` feature [#196](https://github.com/rocboss/paopao-ce/pull/196) + +### Changes + +- support run multiple service in single paopao-ce instance [#196](https://github.com/rocboss/paopao-ce/pull/196) +- use [go-mir](https://github.com/alimy/mir) optimize paopao-ce source code architecture [#196](https://github.com/rocboss/paopao-ce/pull/196) + +### Fixed + +- some other features optimize and bug fix + +--- + +**Older change logs can be found on [GitHub](https://github.com/rocboss/paopao-ce/releases?after=v0.2.0).** \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 65e9eba9..48190375 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ +# syntax=docker/dockerfile:experimental + # build frontend -FROM node:18-alpine as frontend +FROM node:19-alpine as frontend ARG API_HOST ARG USE_API_HOST=yes ARG EMBED_UI=yes @@ -11,15 +13,11 @@ RUN [ $EMBED_UI != yes ] || [ $USE_DIST != no ] || (yarn && yarn build) RUN [ $EMBED_UI = yes ] || mkdir dist || echo "" # build backend -FROM golang:1.18-alpine AS backend +FROM bitbus/paopao-ce-backend-builder:latest AS backend ARG API_HOST ARG USE_API_HOST=yes ARG EMBED_UI=yes ARG USE_DIST=no -RUN apk --no-cache --no-progress add --virtual \ - build-deps \ - build-base \ - git WORKDIR /paopao-ce COPY . . @@ -28,19 +26,18 @@ ENV GOPROXY=https://goproxy.cn RUN [ $EMBED_UI != yes ] || make build TAGS='embed go_json' RUN [ $EMBED_UI = yes ] || make build TAGS='go_json' -FROM alpine:3.16 +FROM bitbus/paopao-ce-backend-runner:latest ARG API_HOST ARG USE_API_HOST=yes ARG EMBED_UI=yes ARG USE_DIST=no ENV TZ=Asia/Shanghai -RUN apk update && apk add --no-cache ca-certificates && update-ca-certificates WORKDIR /app/paopao-ce COPY --from=backend /paopao-ce/release/paopao-ce . -COPY configs ./configs +COPY --from=backend /paopao-ce/config.yaml.sample config.yaml -VOLUME ["/app/paopao-ce/configs"] +VOLUME ["/app/paopao-ce/custom"] EXPOSE 8008 HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD ps -ef | grep paopao-ce || exit 1 ENTRYPOINT ["/app/paopao-ce/paopao-ce"] diff --git a/Makefile b/Makefile index 3104045c..8b1d1dae 100644 --- a/Makefile +++ b/Makefile @@ -4,37 +4,38 @@ TARGET = paopao-ce ifeq ($(OS),Windows_NT) TARGET := $(TARGET).exe endif +TARGET_BIN = $(basename $(TARGET)) ifeq (n$(CGO_ENABLED),n) CGO_ENABLED := 1 endif RELEASE_ROOT = release -RELEASE_FILES = LICENSE README.md config.yaml.sample scripts configs +RELEASE_FILES = LICENSE README.md CHANGELOG.md config.yaml.sample docker-compose.yaml scripts docs RELEASE_LINUX_AMD64 = $(RELEASE_ROOT)/linux-amd64/$(TARGET) RELEASE_DARWIN_AMD64 = $(RELEASE_ROOT)/darwin-amd64/$(TARGET) RELEASE_DARWIN_ARM64 = $(RELEASE_ROOT)/darwin-arm64/$(TARGET) RELEASE_WINDOWS_AMD64 = $(RELEASE_ROOT)/windows-amd64/$(TARGET) -BUILD_VERSION := $(shell git describe --tags | cut -f 1 -d "-") +BUILD_VERSION := $(shell git describe --tags --always | cut -f1 -f2 -d "-") BUILD_DATE := $(shell date +'%Y-%m-%d %H:%M:%S') SHA_SHORT := $(shell git rev-parse --short HEAD) TAGS = "" MOD_NAME = github.com/rocboss/paopao-ce -LDFLAGS = -X "${MOD_NAME}/pkg/debug.version=${BUILD_VERSION}" \ - -X "${MOD_NAME}/pkg/debug.buildDate=${BUILD_DATE}" \ - -X "${MOD_NAME}/pkg/debug.commitID=${SHA_SHORT}" -w -s +LDFLAGS = -X "${MOD_NAME}/pkg/version.version=${BUILD_VERSION}" \ + -X "${MOD_NAME}/pkg/version.buildDate=${BUILD_DATE}" \ + -X "${MOD_NAME}/pkg/version.commitID=${SHA_SHORT}" -w -s all: fmt build build: @go mod download @echo Build paopao-ce - @go build -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_ROOT)/$(TARGET) + @go build -pgo=auto -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_ROOT)/$(TARGET) run: - @go run -trimpath -gcflags "all=-N -l" -tags '$(TAGS)' -ldflags '$(LDFLAGS)' . + @go run -pgo=auto -trimpath -gcflags "all=-N -l" -tags '$(TAGS)' -ldflags '$(LDFLAGS)' . .PHONY: release release: linux-amd64 darwin-amd64 darwin-arm64 windows-x64 @@ -50,37 +51,37 @@ release: linux-amd64 darwin-amd64 darwin-arm64 windows-x64 .PHONY: linux-amd64 linux-amd64: - @echo Build paopao-ce [linux-amd64] CGO_ENABLED=$(CGO_ENABLED) - @CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 go build -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_LINUX_AMD64)/$(TARGET) + @echo Build paopao-ce [linux-amd64] CGO_ENABLED=$(CGO_ENABLED) TAGS="'$(TAGS)'" + @CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 go build -pgo=auto -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_LINUX_AMD64)/$(TARGET_BIN) .PHONY: darwin-amd64 darwin-amd64: - @echo Build paopao-ce [darwin-amd64] CGO_ENABLED=$(CGO_ENABLED) - @CGO_ENABLED=$(CGO_ENABLED) GOOS=darwin GOARCH=amd64 go build -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_DARWIN_AMD64)/$(TARGET) + @echo Build paopao-ce [darwin-amd64] CGO_ENABLED=$(CGO_ENABLED) TAGS="'$(TAGS)'" + @CGO_ENABLED=$(CGO_ENABLED) GOOS=darwin GOARCH=amd64 go build -pgo=auto -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_DARWIN_AMD64)/$(TARGET_BIN) .PHONY: darwin-arm64 darwin-arm64: - @echo Build paopao-ce [darwin-arm64] CGO_ENABLED=$(CGO_ENABLED) - @CGO_ENABLED=$(CGO_ENABLED) GOOS=darwin GOARCH=arm64 go build -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_DARWIN_ARM64)/$(TARGET) + @echo Build paopao-ce [darwin-arm64] CGO_ENABLED=$(CGO_ENABLED) TAGS="'$(TAGS)'" + @CGO_ENABLED=$(CGO_ENABLED) GOOS=darwin GOARCH=arm64 go build -pgo=auto -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_DARWIN_ARM64)/$(TARGET_BIN) .PHONY: windows-x64 windows-x64: - @echo Build paopao-ce [windows-x64] CGO_ENABLED=$(CGO_ENABLED) - @CGO_ENABLED=$(CGO_ENABLED) GOOS=windows GOARCH=amd64 go build -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_WINDOWS_AMD64)/$(basename $(TARGET)).exe + @echo Build paopao-ce [windows-x64] CGO_ENABLED=$(CGO_ENABLED) TAGS="'$(TAGS)'" + @CGO_ENABLED=$(CGO_ENABLED) GOOS=windows GOARCH=amd64 go build -pgo=auto -trimpath -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(RELEASE_WINDOWS_AMD64)/$(TARGET_BIN).exe .PHONY: generate -generate: gen-mir gen-grpc +generate: gen-mir gen-rpc .PHONY: gen-mir gen-mir: - @go generate mirc/main.go + @go generate mirc/gen.go @go fmt ./auto/api/... -.PHONY: gen-grpc -gen-grpc: - @rm -rf auto/rpc +.PHONY: gen-rpc +gen-rpc: + @rm -rf auto/rpc auto/connect @buf generate proto - @go fmt ./auto/rpc/... + @go fmt ./auto/rpc/... ./auto/connect/... .PHONY: proto-mod proto-mod: @@ -109,9 +110,11 @@ pre-commit: fmt .PHONY: install-protobuf-plugins install-protobuf-plugins: - @go install github.com/bufbuild/buf/cmd/buf@v1.11.0 - @go install github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking@v1.11.0 - @go install github.com/bufbuild/buf/cmd/protoc-gen-buf-lint@v1.11.0 + @go install github.com/bufbuild/buf/cmd/buf@v1.25.0 + @go install github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking@v1.25.0 + @go install github.com/bufbuild/buf/cmd/protoc-gen-buf-lint@v1.25.0 + @go install github.com/bufbuild/connect-go/cmd/protoc-gen-connect-go@latest + @go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest @go install google.golang.org/protobuf/cmd/protoc-gen-go@latest @go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest diff --git a/README.md b/README.md index d86d454d..7cf224b7 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ PaoPao主要由以下优秀的开源项目/工具构建 ### 环境要求 -* Go (1.18+) +* Go (1.20+) * Node.js (14+) * MySQL (5.7+) * Redis @@ -194,7 +194,10 @@ PaoPao主要由以下优秀的开源项目/工具构建 docker build -t your/paopao-ce:tag --build-arg EMBED_UI=no . # 运行 - docker run -d -p 8008:8008 -v ${PWD}/config.yaml.sample:/app/paopao-ce/config.yaml your/paopao-ce:tag + mkdir custom && docker run -d -p 8008:8008 -v ${PWD}/custom:/app/paopao-ce/custom -v ${PWD}/config.yaml.sample:/app/paopao-ce/config.yaml your/paopao-ce:tag + + # 或者直接运行构建好的docker image + mkdir custom && docker run -d -p 8008:8008 -v ${PWD}/custom:/app/paopao-ce/custom -v ${PWD}/config.yaml.sample:/app/paopao-ce/config.yaml bitbus/paopao-ce:latest ``` * 前端: @@ -217,8 +220,10 @@ PaoPao主要由以下优秀的开源项目/工具构建 ### 方式三. 使用 docker-compose 运行 ```sh git clone https://github.com/rocboss/paopao-ce.git -docker compose up --build -# visit paopao-ce(http://127.0.0.1:8008) and phpMyadmin(http://127.0.0.1:8080) +cd paopao-ce && docker compose up -d +# visit http://localhost:8008 👀 paopao-ce +# visit http://localhost:8001 👀 RedisInsight +# visit http://localhost:8080 👀 phpMyAdmin ``` 默认是使用config.yaml.sample的配置,如果需要自定义配置,请拷贝默认配置文件(比如config.yaml),修改后再同步配置到docker-compose.yaml如下: @@ -227,8 +232,7 @@ docker compose up --build # file: docker-compose.yaml ... backend: - build: - context: . + image: bitbus/paopao-ce:latest restart: always depends_on: - db @@ -246,8 +250,18 @@ docker compose up --build > 注意:默认提供的 docker-compose.yaml 初衷是搭建本机开发调试环境,如果需要产品部署供外网访问,请自行调优配置参数或使用其他方式部署。 -### API 文档 -* `config.yaml` 添加 `Docs:OpenAPI` 功能项: +### 开发文档 +#### Docs文档说明 +`docs`目录提供了各种开发文档,包括: +* [deploy](docs/deploy/) - paopao-ce部署文档 +* [discuss](docs/discuss/) - 开发相关的问题交流论述文档 +* [openapi](docs/openapi/) - paopao-ce后端导出API文档 +* [proposal](docs/proposal/) - paopao-ce功能特性提按文档 +> 比如,关于paopao-ce的设计定位,可以参考[docs/proposal/001-关于paopao-ce的设计定位](docs/proposal/001-关于paopao-ce的设计定位.md),简要阐述了paopao-ce是如何定位自身的。 + +#### API文档 +开发者可以在本地开启`Docs`服务,浏览后端导出的API服务接口文档。 +* `config.yaml` 添加 `Docs` 功能项: ```yaml ... Features: @@ -260,7 +274,7 @@ Features: ```sh make run TAGS='docs' -# visit http://127.0.0.1:8008/docs/openapi +# visit http://127.0.0.1:8011/docs/openapi ``` ### 配置说明 @@ -328,11 +342,11 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r |`Bot` | 子服务 | WIP | 开启Bot服务| |`NativeOBS` | 子服务 | WIP | 开启NativeOBS服务| |`Docs` | 子服务 | WIP | 开启开发者文档服务| -|`Frontend:Web` | 子服务 | 内测 | 开启独立前端服务| -|`Frontend:EmbedWeb` | 子服务 | 内测 | 开启内嵌于后端Web API服务中的前端服务| -|`Deprecated:Web` | 子服务 | 稳定 | 开启旧的Web服务| +|`Frontend:Web` | 子服务 | 稳定 | 开启独立前端服务| +|`Frontend:EmbedWeb` | 子服务 | 稳定 | 开启内嵌于后端Web API服务中的前端服务| |`Gorm` | 数据库 | 稳定(默认) | 使用[gorm](https://github.com/go-gorm/gorm)作为数据库的ORM,默认使用 `Gorm` + `MySQL`组合| |`Sqlx`| 数据库 | WIP | 使用[sqlx](https://github.com/jmoiron/sqlx)作为数据库的ORM| +|`Sqlc`| 数据库 | WIP | 使用[sqlc](https://github.com/kyleconroy/sqlc)自动生成ORM代码| |`MySQL`| 数据库 | 稳定(默认) | 使用MySQL作为数据库| |`Postgres`| 数据库 | 稳定 | 使用PostgreSQL作为数据库| |`Sqlite3`| 数据库 | 稳定 | 使用Sqlite3作为数据库| @@ -345,20 +359,26 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r |`OSS:Retention` | 对象存储 | 内测 |基于对象存储系统的对象过期自动删除特性实现 先创建临时对象再持久化的功能| |`OSS:TempDir` | 对象存储 | 内测 |基于对象存储系统的对象拷贝/移动特性实现 先创建临时对象再持久化的功能| |`Redis` | 缓存 | 稳定 | Redis缓存功能 | -|`SimpleCacheIndex` | 缓存 | 稳定 | 提供简单的 广场推文列表 的缓存功能 | +|`SimpleCacheIndex` | 缓存 | Deprecated | 提供简单的 广场推文列表 的缓存功能 | |`BigCacheIndex` | 缓存 | 稳定(推荐) | 使用[BigCache](https://github.com/allegro/bigcache)缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面 | +|`RedisCacheIndex` | 缓存 | 内测(推荐) | 使用Redis缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面 | |`Zinc` | 搜索 | 稳定(推荐) | 基于[Zinc](https://github.com/zinclabs/zinc)搜索引擎提供推文搜索服务 | |`Meili` | 搜索 | 稳定(推荐) | 基于[Meilisearch](https://github.com/meilisearch/meilisearch)搜索引擎提供推文搜索服务 | |`Bleve` | 搜索 | WIP | 基于[Bleve](https://github.com/blevesearch/bleve)搜索引擎提供推文搜索服务 | +|[`Sentry`](docs/proposal/23040412-关于使用sentry用于错误追踪与性能检测的设计.md) | 监控 | 内测 | 使用Sentry进行错误跟踪与性能监控 | |`LoggerFile` | 日志 | 稳定 | 使用文件写日志 | |`LoggerZinc` | 日志 | 稳定(推荐) | 使用[Zinc](https://github.com/zinclabs/zinc)写日志 | |`LoggerMeili` | 日志 | 内测 | 使用[Meilisearch](https://github.com/meilisearch/meilisearch)写日志 | -|`Friendship` | 关系模式 | 内测(默认) | 弱关系好友模式,类似微信朋友圈 | -|`Followship` | 关系模式 | WIP | 关注者模式,类似Twitter的Follow模式 | +|[`Friendship`](docs/proposal/002-关于Friendship功能项的设计.md) | 关系模式 | 内测 | 弱关系好友模式,类似微信朋友圈 | +|[`Followship`](docs/proposal/003-关于Followship功能项的设计.md) | 关系模式 | WIP | 关注者模式,类似Twitter的Follow模式 | +|[`Lightship`](docs/proposal/011-关于Lightship功能项的设计.md) | 关系模式 | 内测(默认) | 开放模式,所有推文都公开可见 | |`Alipay` | 支付 | 稳定 | 开启基于[支付宝开放平台](https://open.alipay.com/)的钱包功能 | |`Sms` | 短信验证 | 稳定 | 开启短信验证码功能,用于手机绑定验证手机是否注册者的;功能如果没有开启,手机绑定时任意短信验证码都可以绑定手机 | |`Docs:OpenAPI` | 开发文档 | 稳定 | 开启openapi文档功能,提供web api文档说明(visit http://127.0.0.1:8008/docs/openapi) | +|[`Pyroscope`](docs/proposal/23021510-关于使用pyroscope用于性能调试的设计.md)| 性能优化 | 内测 | 开启Pyroscope功能用于性能调试 | +|[`Pprof`](docs/proposal/23062905-添加Pprof功能特性用于获取Profile.md)| 性能优化 | 内测 | 开启Pprof功能收集Profile信息 | |`PhoneBind` | 其他 | 稳定 | 手机绑定功能 | +|`Web:DisallowUserRegister` | 功能特性 | 稳定 | 不允许用户注册 | > 功能项状态详情参考 [features-status](features-status.md). @@ -416,19 +436,10 @@ docker run -d --name meili -v ${PWD}/data/meili/data:/meili_data -p 7700:7700 -e # 使用docker compose运行,需要删除docker-compose.yaml中关于meili的注释 docker compose up -d meili -# 使用docker运行meilisearch的ui管理前端 -docker run -d --name uirecord -p 7701:3000 bitriory/uirecord -# visit http://localhost:7701 - -# 使用docker compose运行meilisearch的ui管理前端,需要删除docker-compose.yaml中关于uirecord的注释 -docker compose up -d uirecord -# visit http://loclahost:7701 - # 查看meili运行状态 docker compose ps NAME COMMAND SERVICE STATUS PORTS paopao-ce-meili-1 "tini -- /bin/sh -c …" meili running 0.0.0.0:7700->7700/tcp -paopao-ce-uirecord-1 "docker-entrypoint.s…" uirecord running 0.0.0.0:7701->3000/tcp ``` * 修改Meili配置 @@ -480,6 +491,32 @@ MinIO: # MinIO 存储配置 ... ``` +#### [Pyroscope](https://github.com/pyroscope-io/pyroscope) 性能剖析 +* Pyroscope运行 +```sh +mkdir -p data/minio/data + +# 使用Docker运行 +docker run -it -p 4040:4040 pyroscope/pyroscope:latest server +# 使用docker compose运行, 需要删除docker-compose.yaml中关于pyroscope的注释 +docker compose up -d pyroscope +# visit http://loclahost:4040 +``` + +* 修改Pyroscope配置 +```yaml +# features中加上 MinIO +Features: + Default: ["Meili", "LoggerMeili", "Base", "Sqlite3", "BigCacheIndex", "Pyroscope"] +... +Pyroscope: # Pyroscope配置 + AppName: "paopao-ce" + Endpoint: "http://localhost:4040" # Pyroscope server address + AuthToken: # Pyroscope authentication token + Logger: none # Pyroscope logger (standard | logrus | none) +... +``` + ### 源代码分支管理 **主代码库`github.com/rocboss/paopao-ce`** ```bash @@ -492,20 +529,48 @@ feature/followship feature/mir feature/localoss jc/alimy +r/paopao-plus +r/paopao-pro x/sqlc x/sqlx ``` -**分支说明** -* 分支`main`是主分支,也是paopao-ce的稳定版本发布分支,只有经过内部测试,没有重大bug出现的稳定代码才会推进到这个分支;该分支主要由`beta`分支代码演进而来,原则上**只接受bug修复PR**。`rc版本/稳定版本` 发布都应该在`main`主分支中进行。 -* 分支`beta`是公测分支,代码推进到`main`主分支的候选分支;该分支主要由`dev`分支代码演进而来,**接受bug修复以及新功能优化的PR**,原则上不接受新功能PR。`alpha/beta版本` 发布都应该在`beta`公测分支下进行。 -* 分支`dev`是开发分支,**不定期频繁更新**,接受 *新功能PR、代码优化PR、bug修复PR*;**新功能PR** 都应该首先提交给`dev`分支进行合并,bug修复/代码优化 后 **冻结新功能** 将代码演进合并到`beta`分支。 -* `feature/*`是新功能子分支,一般新功能子分支都是 *从`dev`开发分支fork出来的*;子功能分支 **只专注于该新功能** 代码的开发/优化,待开发接近内测阶段 *提交新功能PR给`dev`分支进行review/merge*,待新功能代码演进到`beta`分支后,原则上是可以删除该分支,但也可以保留到稳定版本发布。**该分支专注于新功能的开发,只接受新功能的bug修复/优化PR**。 -* `jc/*`是代码库维护者的开发分支,一般包含一些局部优化或者bug修复代码,有时可以直接将代码merge到`dev/beta`分支,原则上不允许直接merge代码到`main`主分支。 -* `x/*`是技术实验分支,某些技术的引入需要经过具体的代码实现与真实场景的测评,考量评估后如果某项技术适合引入到paopao-ce,就fork出一个`feature/*`分支,作为新功能引入到paopao-ce。一般一些比较激进的技术,从`dev`分支fork出一个新的`x/*`分支,各种尝试、考量、评估后,或丢弃、或引入到paopao-ce。 +**分支说明** +| 名称 | 说明 | 备注| +| ----- | ----- | ----- | +| [`main`](https://github.com/rocboss/paopao-ce) | 主分支 |分支`main`是主分支,也是paopao-ce的稳定版本发布分支,只有经过内部测试,没有重大bug出现的稳定代码才会推进到这个分支;该分支主要由`beta`分支代码演进而来,原则上**只接受bug修复PR**。`rc版本/稳定版本` 发布都应该在`main`主分支中进行。| +| [`beta`](https://github.com/rocboss/paopao-ce/tree/beta) | 公测分支 |分支`beta`是公测分支,代码推进到`main`主分支的候选分支;该分支主要由`alpha`分支代码演进而来,**接受bug修复以及新功能优化的PR**,原则上不接受新功能PR。`beta版本` 发布都应该在`beta`公测分支下进行。| +| [`alpha`](https://github.com/rocboss/paopao-ce/tree/alpha) | 内测分支 |分支`alpha`是内测分支,代码推进到`beta`分支的候选分支;该分支主要由`dev`分支代码演进而来,**接受bug修复以及新功能相关的PR**,接受新功能PR。分支代码演进到一个里程碑式的阶段后**冻结所有新功能**,合并代码到`beta`公测分支进行下一阶段的持续演进。`alpha版本` 发布都应该在`alpha`内测分支下进行。| +| [`dev`](https://github.com/rocboss/paopao-ce/tree/dev) | 开发分支 | 分支`dev`是开发分支,**不定期频繁更新**,接受 *新功能PR、代码优化PR、bug修复PR*;**新功能PR** 都应该首先提交给`dev`分支进行合并,bug修复/新功能开发/代码优化 **阶段性冻结** 后将代码演进合并到`alpha`分支。| +| `feature/*` | 子功能分支 |`feature/*`是新功能子分支,一般新功能子分支都是 *从`dev`开发分支fork出来的*;子功能分支 **只专注于该新功能** 代码的开发/优化,待开发接近内测阶段 *提交新功能PR给`dev`分支进行review/merge*,待新功能代码演进到`beta`分支后,原则上是可以删除该分支,但也可以保留到稳定版本发布。**该分支专注于新功能的开发,只接受新功能的bug修复/优化PR**。| +| `jc/*` |维护者的开发分支|`jc/*`是代码库维护者的开发分支,一般包含一些局部优化或者bug修复代码,有时可以直接将代码merge到`dev/beta`分支,原则上不允许直接merge代码到`main`主分支。| +| `x/*` |实验分支|`x/*`是技术实验分支,某些技术的引入需要经过具体的代码实现与真实场景的测评,考量评估后如果某项技术适合引入到paopao-ce,就fork出一个`feature/*`分支,作为新功能引入到paopao-ce。一般一些比较激进的技术,从`dev`分支fork出一个新的`x/*`分支,各种尝试、考量、评估后,或丢弃、或引入到paopao-ce。| +| `t/*` | 临时分支 |`t/*`是临时发版本分支,一般 `beta` 分支演进到正式版本发布前的最后某个beta版本(比如v0.2.0-beta)就从beta分支fork出一个 `t/*` 分支用于向 `main` 分支提交 PR 用于Review,待 PR Reviewed 合并到 `main` 分支后,可以删除这个临时创建的分支。这样设计主要是考虑到有时合并到 `main` 分支时,需要Review的时间可能会长一些,而dev分支的代码又急需推进到beta分支以发布下一个alpha版本用于内测,相当于为下一个测试版本发布腾地方。| +| `r/*` |发行版本分支|`r/*`是不同发行版本分支,不同发行版本各有不同的侧重点,可以根据需要选择适合的发行版本。| + +**发行版本分支说明** +| 名称 | 说明 | 维护者 | 备注 | +| ----- | ----- | ----- | ----- | +|[`paopao-ce`](https://github.com/rocboss/paopao-ce/tree/dev)|paopao-ce 主发行版本|[ROC](https://github.com/rocboss 'ROC')|该分支 [数据逻辑层](https://github.com/rocboss/paopao-ce/tree/dev/internal/dao/jinzhu) 使用[gorm](https://github.com/go-gorm/gorm)作为数据逻辑层的ORM框架,适配MySQL/PostgreSQL/Sqlite3数据库。| +|[`r/paopao-ce`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce)|paopao-ce 主分支预览版本|[ROC](https://github.com/rocboss 'ROC')
[北野](https://github.com/alimy 'Michael Li')|该分支 [数据逻辑层](https://github.com/rocboss/paopao-ce/tree/dev/internal/dao/jinzhu) 使用[gorm](https://github.com/go-gorm/gorm)作为数据逻辑层的ORM框架,适配MySQL/PostgreSQL/Sqlite3数据库。代码较`main`分支新,是主发行版本的前瞻预览版本。| +|[`r/paopao-ce-plus`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-plus)|paopao-ce-plus 发行版本|[北野](https://github.com/alimy 'Michael Li')|该分支 [数据逻辑层](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-plus/internal/dao/sakila) 使用[sqlx](https://github.com/jmoiron/sqlx)作为数据逻辑层的ORM框架,专注于为MySQL/PostgreSQL/Sqlite3使用更优化的查询语句以提升数据检索效率。建议熟悉[sqlx](https://github.com/jmoiron/sqlx)的开发人员可以基于此版本来做 二次开发。| +|[`r/paopao-ce-pro`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-pro)|paopao-ce-pro 发行版本|[北野](https://github.com/alimy 'Michael Li')|该分支 [数据逻辑层](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-pro/internal/dao/slonik) 使用[sqlc](https://github.com/kyleconroy/sqlc)作为sql语句生成器自动生成ORM代码,专门针对特定数据库MySQL/PostgreSQL进行查询优化,熟悉[sqlc](https://github.com/kyleconroy/sqlc)的开发人员可以基于此版本来做 二次开发。(另:分支目前只使用[pgx-v5](https://github.com/jackc/pgx)适配了PostgreSQL数据库,后续或许会适配MySQL/TiDB数据库。)| +|[`r/paopao-ce-xtra`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-xtra)|paopao-ce-xtra 发行版本|[北野](https://github.com/alimy 'Michael Li')|该分支 是r/paopao-ce、r/paopao-ce-plus、r/paopao-ce-pro的合集| +|[`r/paopao-ce-mini`](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-mini)|paopao-ce-mini 发行版本|[北野](https://github.com/alimy 'Michael Li')|该分支是paopao-ce最小可用版本,专注于个人部署、一键傻瓜式最简部署| **代码分支演进图** ![](docs/proposal/.assets/000-01.png) +### 部署站点信息 +* [官方 paopao.info](https://www.paopao.info) +> 具体部署站点信息请查阅 [deployed-sites](./deployed-sites.md 'deployed sites'). 欢迎站长将已部署PaoPao实例的站点信息添加到 [deployed-sites](./deployed-sites.md 'deployed sites') 列表中。 + +#### Collaborator's paopao account +| 昵称 | [@GitHub](https://github.com 'github.com') | [@PaoPao](https://www.paopao.info 'paopao.info') | +| ----- | ----- | ----- | +| ROC | [ROC](https://github.com/rocboss 'ROC')|[ROC](https://www.paopao.info/#/user?username=roc 'ROC @roc')| +| [北野](https://alimy.me '糊涂小栈') | [Michael Li](https://github.com/alimy 'Michael Li') | [alimy](https://www.paopao.info/#/user?username=alimy '北野 @alimy')| +| orzi!| [orzi!](https://github.com/orziz 'orzi!')|| + ### 其他说明 建议后端服务使用 `supervisor` 守护进程,并通过 `nginx` 反向代理后,提供API给前端服务调用。 diff --git a/ROADMAP.md b/ROADMAP.md index fc0e6681..fa77d3be 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,18 +1,35 @@ ## Roadmap for paopao-ce -paopao-ce roadmap. +[paopao-ce](https://github.com/rocboss/paopao-ce/tree/dev)/[paopao-ce-plus](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-plus)/[paopao-ce-pro](https://github.com/rocboss/paopao-ce/tree/r/paopao-ce-pro) features develop or optimize and bug fix roadmap. -### v0.2.0 +## paopao-ce roadmap +#### dev+ +* [ ] add `Followship` feature +* [ ] add `Auth:Bcrypt` feature +* [ ] add `Auth:MD5` feature (just for compatible) +* [x] add extend base ORM code for implement data logic base sqlx/sqlc +* [ ] optimize media tweet submit logic +* [ ] optimize search logic service + +#### v0.3.0 +* [x] remove `Deprecated:OldWeb` feature +* [x] add user topic follow feature support +* [x] add tweet link share support +* [ ] add comment thumbsUp/thumbsDown support +* [x] add `RedisCacheIndex` feature +* [x] add `Sentry` feature + +#### v0.2.0 * [x] add `Friendship` feature -* [ ] add `Lightship` feature -* [ ] add `Sqlx` feature +* [x] add `Lightship` feature +* [ ] add extend base ORM code for implement data logic base sqlx/sqlc +* [x] add `Pyroscope` feature * [x] add new `Web` service * [x] add `Frontend:Web` feature * [x] add `Deprecated:OldWeb` feature * [x] support run multiple service in single paopao-ce instance * [x] use [go-mir](https://github.com/alimy/mir) optimize paopao-ce source code architecture -### Next -* [ ] add `Followship` feature +#### Next * [ ] add `Bleve` feature * [ ] add `SpaceX` feature * [ ] add `Bot` feature @@ -24,8 +41,30 @@ paopao-ce roadmap. * [ ] add tweet resource access control base on simple RBAC support * [ ] add user's `Activation Code` feature support * [ ] add user block feature support -* [ ] optimize current message push logic service use `ims` module -* [ ] optimize media tweet submit logic +* [ ] add i18n support +* [ ] add reactions support +* [ ] add tweet thread like twitter support +* [ ] add short link support * [ ] optimize topics service +* [ ] optimize current message push logic service use `ims` module * [ ] optimize backend data logic service(optimize database CRUD operate) -* [ ] optimize search logic service + +## paopao-ce-plus roadmap +#### paopao-ce-plus/v0.4.0 +* [ ] adapt for paopao-ce v0.4.0 + +#### paopao-ce-plus/v0.3.0 +* [ ] adapt for paopao-ce v0.3.0 + +#### paopao-ce-plus/v0.2.0 +* [ ] adapt for paopao-ce v0.2.0 + +## paopao-ce-pro roadmap +#### paopao-ce-pro/v0.4.0 +* [ ] adapt for paopao-ce v0.4.0 + +#### paopao-ce-pro/v0.3.0 +* [ ] adapt for paopao-ce v0.3.0 + +#### paopao-ce-pro/v0.2.0 +* [ ] adapt for paopao-ce v0.2.0 diff --git a/auto/api/m/v1/user.go b/auto/api/m/v1/user.go index 431343e7..8918a199 100644 --- a/auto/api/m/v1/user.go +++ b/auto/api/m/v1/user.go @@ -1,14 +1,29 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" ) +type _binding_ interface { + Bind(*gin.Context) mir.Error +} + +type _render_ interface { + Render(*gin.Context) +} + +type _default_ interface { + Bind(*gin.Context, any) mir.Error + Render(*gin.Context, any, mir.Error) +} + type LoginReq struct { AgentInfo AgentInfo `json:"agent_info"` Name string `json:"name"` @@ -35,6 +50,8 @@ type UserInfo struct { } type User interface { + _default_ + // Chain provide handlers chain for gin Chain() gin.HandlersChain @@ -44,21 +61,8 @@ type User interface { mustEmbedUnimplementedUserServant() } -type UserBinding interface { - BindLogin(*gin.Context) (*LoginReq, mir.Error) - - mustEmbedUnimplementedUserBinding() -} - -type UserRender interface { - RenderLogout(*gin.Context, mir.Error) - RenderLogin(*gin.Context, *LoginResp, mir.Error) - - mustEmbedUnimplementedUserRender() -} - // RegisterUserServant register User servant to gin -func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) { +func RegisterUserServant(e *gin.Engine, s User) { router := e.Group("m/v1") // use chain for router middlewares := s.Chain() @@ -72,30 +76,26 @@ func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) { default: } - r.RenderLogout(c, s.Logout()) + s.Render(c, nil, s.Logout()) }) - router.Handle("POST", "/user/login/", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindLogin(c) - if err != nil { - r.RenderLogin(c, nil, err) + req := new(LoginReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.Login(req) - r.RenderLogin(c, resp, err) + s.Render(c, resp, err) }) - } // UnimplementedUserServant can be embedded to have forward compatible implementations. -type UnimplementedUserServant struct { -} +type UnimplementedUserServant struct{} func (UnimplementedUserServant) Chain() gin.HandlersChain { return nil @@ -110,31 +110,3 @@ func (UnimplementedUserServant) Login(req *LoginReq) (*LoginResp, mir.Error) { } func (UnimplementedUserServant) mustEmbedUnimplementedUserServant() {} - -// UnimplementedUserRender can be embedded to have forward compatible implementations. -type UnimplementedUserRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedUserRender) RenderLogout(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedUserRender) RenderLogin(c *gin.Context, data *LoginResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedUserRender) mustEmbedUnimplementedUserRender() {} - -// UnimplementedUserBinding can be embedded to have forward compatible implementations. -type UnimplementedUserBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedUserBinding) BindLogin(c *gin.Context) (*LoginReq, mir.Error) { - obj := new(LoginReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedUserBinding) mustEmbedUnimplementedUserBinding() {} diff --git a/auto/api/r/v1/user.go b/auto/api/r/v1/user.go index 1850b157..e7f98082 100644 --- a/auto/api/r/v1/user.go +++ b/auto/api/r/v1/user.go @@ -1,14 +1,29 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" ) +type _binding_ interface { + Bind(*gin.Context) mir.Error +} + +type _render_ interface { + Render(*gin.Context) +} + +type _default_ interface { + Bind(*gin.Context, any) mir.Error + Render(*gin.Context, any, mir.Error) +} + type LoginReq struct { AgentInfo AgentInfo `json:"agent_info"` Name string `json:"name"` @@ -35,6 +50,8 @@ type UserInfo struct { } type User interface { + _default_ + // Chain provide handlers chain for gin Chain() gin.HandlersChain @@ -44,21 +61,8 @@ type User interface { mustEmbedUnimplementedUserServant() } -type UserBinding interface { - BindLogin(*gin.Context) (*LoginReq, mir.Error) - - mustEmbedUnimplementedUserBinding() -} - -type UserRender interface { - RenderLogout(*gin.Context, mir.Error) - RenderLogin(*gin.Context, *LoginResp, mir.Error) - - mustEmbedUnimplementedUserRender() -} - // RegisterUserServant register User servant to gin -func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) { +func RegisterUserServant(e *gin.Engine, s User) { router := e.Group("r/v1") // use chain for router middlewares := s.Chain() @@ -72,30 +76,26 @@ func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) { default: } - r.RenderLogout(c, s.Logout()) + s.Render(c, nil, s.Logout()) }) - router.Handle("POST", "/user/login/", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindLogin(c) - if err != nil { - r.RenderLogin(c, nil, err) + req := new(LoginReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.Login(req) - r.RenderLogin(c, resp, err) + s.Render(c, resp, err) }) - } // UnimplementedUserServant can be embedded to have forward compatible implementations. -type UnimplementedUserServant struct { -} +type UnimplementedUserServant struct{} func (UnimplementedUserServant) Chain() gin.HandlersChain { return nil @@ -110,31 +110,3 @@ func (UnimplementedUserServant) Login(req *LoginReq) (*LoginResp, mir.Error) { } func (UnimplementedUserServant) mustEmbedUnimplementedUserServant() {} - -// UnimplementedUserRender can be embedded to have forward compatible implementations. -type UnimplementedUserRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedUserRender) RenderLogout(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedUserRender) RenderLogin(c *gin.Context, data *LoginResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedUserRender) mustEmbedUnimplementedUserRender() {} - -// UnimplementedUserBinding can be embedded to have forward compatible implementations. -type UnimplementedUserBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedUserBinding) BindLogin(c *gin.Context) (*LoginReq, mir.Error) { - obj := new(LoginReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedUserBinding) mustEmbedUnimplementedUserBinding() {} diff --git a/auto/api/s/v1/user.go b/auto/api/s/v1/user.go index ef2c855b..c0b7dae3 100644 --- a/auto/api/s/v1/user.go +++ b/auto/api/s/v1/user.go @@ -1,14 +1,29 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" ) +type _binding_ interface { + Bind(*gin.Context) mir.Error +} + +type _render_ interface { + Render(*gin.Context) +} + +type _default_ interface { + Bind(*gin.Context, any) mir.Error + Render(*gin.Context, any, mir.Error) +} + type LoginReq struct { AgentInfo AgentInfo `json:"agent_info"` Name string `json:"name"` @@ -35,6 +50,8 @@ type UserInfo struct { } type User interface { + _default_ + Logout() mir.Error Login(*LoginReq) (*LoginResp, mir.Error) Index() mir.Error @@ -42,22 +59,8 @@ type User interface { mustEmbedUnimplementedUserServant() } -type UserBinding interface { - BindLogin(*gin.Context) (*LoginReq, mir.Error) - - mustEmbedUnimplementedUserBinding() -} - -type UserRender interface { - RenderLogout(*gin.Context, mir.Error) - RenderLogin(*gin.Context, *LoginResp, mir.Error) - RenderIndex(*gin.Context, mir.Error) - - mustEmbedUnimplementedUserRender() -} - // RegisterUserServant register User servant to gin -func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) { +func RegisterUserServant(e *gin.Engine, s User) { router := e.Group("s/v1") // register routes info to router @@ -68,25 +71,22 @@ func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) { default: } - r.RenderLogout(c, s.Logout()) + s.Render(c, nil, s.Logout()) }) - router.Handle("POST", "/user/login/", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindLogin(c) - if err != nil { - r.RenderLogin(c, nil, err) + req := new(LoginReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.Login(req) - r.RenderLogin(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/index/", func(c *gin.Context) { select { case <-c.Request.Context().Done(): @@ -94,14 +94,12 @@ func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) { default: } - r.RenderIndex(c, s.Index()) + s.Render(c, nil, s.Index()) }) - } // UnimplementedUserServant can be embedded to have forward compatible implementations. -type UnimplementedUserServant struct { -} +type UnimplementedUserServant struct{} func (UnimplementedUserServant) Logout() mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) @@ -116,35 +114,3 @@ func (UnimplementedUserServant) Index() mir.Error { } func (UnimplementedUserServant) mustEmbedUnimplementedUserServant() {} - -// UnimplementedUserRender can be embedded to have forward compatible implementations. -type UnimplementedUserRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedUserRender) RenderLogout(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedUserRender) RenderLogin(c *gin.Context, data *LoginResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedUserRender) RenderIndex(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedUserRender) mustEmbedUnimplementedUserRender() {} - -// UnimplementedUserBinding can be embedded to have forward compatible implementations. -type UnimplementedUserBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedUserBinding) BindLogin(c *gin.Context) (*LoginReq, mir.Error) { - obj := new(LoginReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedUserBinding) mustEmbedUnimplementedUserBinding() {} diff --git a/auto/api/v1/admin.go b/auto/api/v1/admin.go index 6872d123..ad4ac308 100644 --- a/auto/api/v1/admin.go +++ b/auto/api/v1/admin.go @@ -1,38 +1,43 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) -type Admin interface { - // Chain provide handlers chain for gin - Chain() gin.HandlersChain +type _binding_ interface { + Bind(*gin.Context) mir.Error +} - ChangeUserStatus(*web.ChangeUserStatusReq) mir.Error +type _render_ interface { + Render(*gin.Context) +} - mustEmbedUnimplementedAdminServant() +type _default_ interface { + Bind(*gin.Context, any) mir.Error + Render(*gin.Context, any, mir.Error) } -type AdminBinding interface { - BindChangeUserStatus(*gin.Context) (*web.ChangeUserStatusReq, mir.Error) +type Admin interface { + _default_ - mustEmbedUnimplementedAdminBinding() -} + // Chain provide handlers chain for gin + Chain() gin.HandlersChain -type AdminRender interface { - RenderChangeUserStatus(*gin.Context, mir.Error) + ChangeUserStatus(*web.ChangeUserStatusReq) mir.Error - mustEmbedUnimplementedAdminRender() + mustEmbedUnimplementedAdminServant() } // RegisterAdminServant register Admin servant to gin -func RegisterAdminServant(e *gin.Engine, s Admin, b AdminBinding, r AdminRender) { +func RegisterAdminServant(e *gin.Engine, s Admin) { router := e.Group("v1") // use chain for router middlewares := s.Chain() @@ -45,20 +50,17 @@ func RegisterAdminServant(e *gin.Engine, s Admin, b AdminBinding, r AdminRender) return default: } - - req, err := b.BindChangeUserStatus(c) - if err != nil { - r.RenderChangeUserStatus(c, err) + req := new(web.ChangeUserStatusReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderChangeUserStatus(c, s.ChangeUserStatus(req)) + s.Render(c, nil, s.ChangeUserStatus(req)) }) - } // UnimplementedAdminServant can be embedded to have forward compatible implementations. -type UnimplementedAdminServant struct { -} +type UnimplementedAdminServant struct{} func (UnimplementedAdminServant) Chain() gin.HandlersChain { return nil @@ -69,27 +71,3 @@ func (UnimplementedAdminServant) ChangeUserStatus(req *web.ChangeUserStatusReq) } func (UnimplementedAdminServant) mustEmbedUnimplementedAdminServant() {} - -// UnimplementedAdminRender can be embedded to have forward compatible implementations. -type UnimplementedAdminRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedAdminRender) RenderChangeUserStatus(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedAdminRender) mustEmbedUnimplementedAdminRender() {} - -// UnimplementedAdminBinding can be embedded to have forward compatible implementations. -type UnimplementedAdminBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedAdminBinding) BindChangeUserStatus(c *gin.Context) (*web.ChangeUserStatusReq, mir.Error) { - obj := new(web.ChangeUserStatusReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedAdminBinding) mustEmbedUnimplementedAdminBinding() {} diff --git a/auto/api/v1/alipay_priv.go b/auto/api/v1/alipay_priv.go index 4cb3fe0a..02500522 100644 --- a/auto/api/v1/alipay_priv.go +++ b/auto/api/v1/alipay_priv.go @@ -1,16 +1,20 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) type AlipayPriv interface { + _default_ + // Chain provide handlers chain for gin Chain() gin.HandlersChain @@ -21,24 +25,8 @@ type AlipayPriv interface { mustEmbedUnimplementedAlipayPrivServant() } -type AlipayPrivBinding interface { - BindUserWalletBills(*gin.Context) (*web.UserWalletBillsReq, mir.Error) - BindUserRechargeResult(*gin.Context) (*web.UserRechargeResultReq, mir.Error) - BindUserRechargeLink(*gin.Context) (*web.UserRechargeLinkReq, mir.Error) - - mustEmbedUnimplementedAlipayPrivBinding() -} - -type AlipayPrivRender interface { - RenderUserWalletBills(*gin.Context, *web.UserWalletBillsResp, mir.Error) - RenderUserRechargeResult(*gin.Context, *web.UserRechargeResultResp, mir.Error) - RenderUserRechargeLink(*gin.Context, *web.UserRechargeLinkResp, mir.Error) - - mustEmbedUnimplementedAlipayPrivRender() -} - // RegisterAlipayPrivServant register AlipayPriv servant to gin -func RegisterAlipayPrivServant(e *gin.Engine, s AlipayPriv, b AlipayPrivBinding, r AlipayPrivRender) { +func RegisterAlipayPrivServant(e *gin.Engine, s AlipayPriv) { router := e.Group("v1") // use chain for router middlewares := s.Chain() @@ -51,53 +39,49 @@ func RegisterAlipayPrivServant(e *gin.Engine, s AlipayPriv, b AlipayPrivBinding, return default: } - - req, err := b.BindUserWalletBills(c) - if err != nil { - r.RenderUserWalletBills(c, nil, err) + req := new(web.UserWalletBillsReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.UserWalletBills(req) - r.RenderUserWalletBills(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/user/recharge", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindUserRechargeResult(c) - if err != nil { - r.RenderUserRechargeResult(c, nil, err) + req := new(web.UserRechargeResultReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.UserRechargeResult(req) - r.RenderUserRechargeResult(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("POST", "/user/recharge", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindUserRechargeLink(c) - if err != nil { - r.RenderUserRechargeLink(c, nil, err) + req := new(web.UserRechargeLinkReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.UserRechargeLink(req) - r.RenderUserRechargeLink(c, resp, err) + s.Render(c, resp, err) }) - } // UnimplementedAlipayPrivServant can be embedded to have forward compatible implementations. -type UnimplementedAlipayPrivServant struct { -} +type UnimplementedAlipayPrivServant struct{} func (UnimplementedAlipayPrivServant) Chain() gin.HandlersChain { return nil @@ -116,47 +100,3 @@ func (UnimplementedAlipayPrivServant) UserRechargeLink(req *web.UserRechargeLink } func (UnimplementedAlipayPrivServant) mustEmbedUnimplementedAlipayPrivServant() {} - -// UnimplementedAlipayPrivRender can be embedded to have forward compatible implementations. -type UnimplementedAlipayPrivRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedAlipayPrivRender) RenderUserWalletBills(c *gin.Context, data *web.UserWalletBillsResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedAlipayPrivRender) RenderUserRechargeResult(c *gin.Context, data *web.UserRechargeResultResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedAlipayPrivRender) RenderUserRechargeLink(c *gin.Context, data *web.UserRechargeLinkResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedAlipayPrivRender) mustEmbedUnimplementedAlipayPrivRender() {} - -// UnimplementedAlipayPrivBinding can be embedded to have forward compatible implementations. -type UnimplementedAlipayPrivBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedAlipayPrivBinding) BindUserWalletBills(c *gin.Context) (*web.UserWalletBillsReq, mir.Error) { - obj := new(web.UserWalletBillsReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedAlipayPrivBinding) BindUserRechargeResult(c *gin.Context) (*web.UserRechargeResultReq, mir.Error) { - obj := new(web.UserRechargeResultReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedAlipayPrivBinding) BindUserRechargeLink(c *gin.Context) (*web.UserRechargeLinkReq, mir.Error) { - obj := new(web.UserRechargeLinkReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedAlipayPrivBinding) mustEmbedUnimplementedAlipayPrivBinding() {} diff --git a/auto/api/v1/alipay_pub.go b/auto/api/v1/alipay_pub.go index 3119119e..b31172ad 100644 --- a/auto/api/v1/alipay_pub.go +++ b/auto/api/v1/alipay_pub.go @@ -1,35 +1,27 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) type AlipayPub interface { + _default_ + AlipayNotify(*web.AlipayNotifyReq) mir.Error mustEmbedUnimplementedAlipayPubServant() } -type AlipayPubBinding interface { - BindAlipayNotify(*gin.Context) (*web.AlipayNotifyReq, mir.Error) - - mustEmbedUnimplementedAlipayPubBinding() -} - -type AlipayPubRender interface { - RenderAlipayNotify(*gin.Context, mir.Error) - - mustEmbedUnimplementedAlipayPubRender() -} - // RegisterAlipayPubServant register AlipayPub servant to gin -func RegisterAlipayPubServant(e *gin.Engine, s AlipayPub, b AlipayPubBinding, r AlipayPubRender) { +func RegisterAlipayPubServant(e *gin.Engine, s AlipayPub) { router := e.Group("v1") // register routes info to router @@ -39,47 +31,21 @@ func RegisterAlipayPubServant(e *gin.Engine, s AlipayPub, b AlipayPubBinding, r return default: } - - req, err := b.BindAlipayNotify(c) - if err != nil { - r.RenderAlipayNotify(c, err) + req := new(web.AlipayNotifyReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } - r.RenderAlipayNotify(c, s.AlipayNotify(req)) + s.Render(c, nil, s.AlipayNotify(req)) }) - } // UnimplementedAlipayPubServant can be embedded to have forward compatible implementations. -type UnimplementedAlipayPubServant struct { -} +type UnimplementedAlipayPubServant struct{} func (UnimplementedAlipayPubServant) AlipayNotify(req *web.AlipayNotifyReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } func (UnimplementedAlipayPubServant) mustEmbedUnimplementedAlipayPubServant() {} - -// UnimplementedAlipayPubRender can be embedded to have forward compatible implementations. -type UnimplementedAlipayPubRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedAlipayPubRender) RenderAlipayNotify(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedAlipayPubRender) mustEmbedUnimplementedAlipayPubRender() {} - -// UnimplementedAlipayPubBinding can be embedded to have forward compatible implementations. -type UnimplementedAlipayPubBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedAlipayPubBinding) BindAlipayNotify(c *gin.Context) (*web.AlipayNotifyReq, mir.Error) { - obj := new(web.AlipayNotifyReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedAlipayPubBinding) mustEmbedUnimplementedAlipayPubBinding() {} diff --git a/auto/api/v1/core.go b/auto/api/v1/core.go index 8e633c53..159e938f 100644 --- a/auto/api/v1/core.go +++ b/auto/api/v1/core.go @@ -1,16 +1,20 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) type Core interface { + _default_ + // Chain provide handlers chain for gin Chain() gin.HandlersChain @@ -34,50 +38,8 @@ type Core interface { mustEmbedUnimplementedCoreServant() } -type CoreBinding interface { - BindTweetCollectionStatus(*gin.Context) (*web.TweetCollectionStatusReq, mir.Error) - BindTweetStarStatus(*gin.Context) (*web.TweetStarStatusReq, mir.Error) - BindSuggestTags(*gin.Context) (*web.SuggestTagsReq, mir.Error) - BindSuggestUsers(*gin.Context) (*web.SuggestUsersReq, mir.Error) - BindChangeAvatar(*gin.Context) (*web.ChangeAvatarReq, mir.Error) - BindChangeNickname(*gin.Context) (*web.ChangeNicknameReq, mir.Error) - BindChangePassword(*gin.Context) (*web.ChangePasswordReq, mir.Error) - BindUserPhoneBind(*gin.Context) (*web.UserPhoneBindReq, mir.Error) - BindGetStars(*gin.Context) (*web.GetStarsReq, mir.Error) - BindGetCollections(*gin.Context) (*web.GetCollectionsReq, mir.Error) - BindSendUserWhisper(*gin.Context) (*web.SendWhisperReq, mir.Error) - BindReadMessage(*gin.Context) (*web.ReadMessageReq, mir.Error) - BindGetMessages(*gin.Context) (*web.GetMessagesReq, mir.Error) - BindGetUnreadMsgCount(*gin.Context) (*web.GetUnreadMsgCountReq, mir.Error) - BindGetUserInfo(*gin.Context) (*web.UserInfoReq, mir.Error) - BindSyncSearchIndex(*gin.Context) (*web.SyncSearchIndexReq, mir.Error) - - mustEmbedUnimplementedCoreBinding() -} - -type CoreRender interface { - RenderTweetCollectionStatus(*gin.Context, *web.TweetCollectionStatusResp, mir.Error) - RenderTweetStarStatus(*gin.Context, *web.TweetStarStatusResp, mir.Error) - RenderSuggestTags(*gin.Context, *web.SuggestTagsResp, mir.Error) - RenderSuggestUsers(*gin.Context, *web.SuggestUsersResp, mir.Error) - RenderChangeAvatar(*gin.Context, mir.Error) - RenderChangeNickname(*gin.Context, mir.Error) - RenderChangePassword(*gin.Context, mir.Error) - RenderUserPhoneBind(*gin.Context, mir.Error) - RenderGetStars(*gin.Context, *web.GetStarsResp, mir.Error) - RenderGetCollections(*gin.Context, *web.GetCollectionsResp, mir.Error) - RenderSendUserWhisper(*gin.Context, mir.Error) - RenderReadMessage(*gin.Context, mir.Error) - RenderGetMessages(*gin.Context, *web.GetMessagesResp, mir.Error) - RenderGetUnreadMsgCount(*gin.Context, *web.GetUnreadMsgCountResp, mir.Error) - RenderGetUserInfo(*gin.Context, *web.UserInfoResp, mir.Error) - RenderSyncSearchIndex(*gin.Context, mir.Error) - - mustEmbedUnimplementedCoreRender() -} - // RegisterCoreServant register Core servant to gin -func RegisterCoreServant(e *gin.Engine, s Core, b CoreBinding, r CoreRender) { +func RegisterCoreServant(e *gin.Engine, s Core) { router := e.Group("v1") // use chain for router middlewares := s.Chain() @@ -90,254 +52,229 @@ func RegisterCoreServant(e *gin.Engine, s Core, b CoreBinding, r CoreRender) { return default: } - - req, err := b.BindTweetCollectionStatus(c) - if err != nil { - r.RenderTweetCollectionStatus(c, nil, err) + req := new(web.TweetCollectionStatusReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.TweetCollectionStatus(req) - r.RenderTweetCollectionStatus(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/post/star", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindTweetStarStatus(c) - if err != nil { - r.RenderTweetStarStatus(c, nil, err) + req := new(web.TweetStarStatusReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.TweetStarStatus(req) - r.RenderTweetStarStatus(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/suggest/tags", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindSuggestTags(c) - if err != nil { - r.RenderSuggestTags(c, nil, err) + req := new(web.SuggestTagsReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.SuggestTags(req) - r.RenderSuggestTags(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/suggest/users", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindSuggestUsers(c) - if err != nil { - r.RenderSuggestUsers(c, nil, err) + req := new(web.SuggestUsersReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.SuggestUsers(req) - r.RenderSuggestUsers(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("POST", "/user/avatar", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindChangeAvatar(c) - if err != nil { - r.RenderChangeAvatar(c, err) + req := new(web.ChangeAvatarReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderChangeAvatar(c, s.ChangeAvatar(req)) + s.Render(c, nil, s.ChangeAvatar(req)) }) - router.Handle("POST", "/user/nickname", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindChangeNickname(c) - if err != nil { - r.RenderChangeNickname(c, err) + req := new(web.ChangeNicknameReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderChangeNickname(c, s.ChangeNickname(req)) + s.Render(c, nil, s.ChangeNickname(req)) }) - router.Handle("POST", "/user/password", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindChangePassword(c) - if err != nil { - r.RenderChangePassword(c, err) + req := new(web.ChangePasswordReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderChangePassword(c, s.ChangePassword(req)) + s.Render(c, nil, s.ChangePassword(req)) }) - router.Handle("POST", "/user/phone", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindUserPhoneBind(c) - if err != nil { - r.RenderUserPhoneBind(c, err) + req := new(web.UserPhoneBindReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderUserPhoneBind(c, s.UserPhoneBind(req)) + s.Render(c, nil, s.UserPhoneBind(req)) }) - router.Handle("GET", "/user/stars", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindGetStars(c) - if err != nil { - r.RenderGetStars(c, nil, err) + req := new(web.GetStarsReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.GetStars(req) - r.RenderGetStars(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/user/collections", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindGetCollections(c) - if err != nil { - r.RenderGetCollections(c, nil, err) + req := new(web.GetCollectionsReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.GetCollections(req) - r.RenderGetCollections(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("POST", "/user/whisper", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindSendUserWhisper(c) - if err != nil { - r.RenderSendUserWhisper(c, err) + req := new(web.SendWhisperReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderSendUserWhisper(c, s.SendUserWhisper(req)) + s.Render(c, nil, s.SendUserWhisper(req)) }) - router.Handle("POST", "/user/message/read", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindReadMessage(c) - if err != nil { - r.RenderReadMessage(c, err) + req := new(web.ReadMessageReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderReadMessage(c, s.ReadMessage(req)) + s.Render(c, nil, s.ReadMessage(req)) }) - router.Handle("GET", "/user/messages", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindGetMessages(c) - if err != nil { - r.RenderGetMessages(c, nil, err) + req := new(web.GetMessagesReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.GetMessages(req) - r.RenderGetMessages(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/user/msgcount/unread", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindGetUnreadMsgCount(c) - if err != nil { - r.RenderGetUnreadMsgCount(c, nil, err) + req := new(web.GetUnreadMsgCountReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.GetUnreadMsgCount(req) - r.RenderGetUnreadMsgCount(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/user/info", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindGetUserInfo(c) - if err != nil { - r.RenderGetUserInfo(c, nil, err) + req := new(web.UserInfoReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.GetUserInfo(req) - r.RenderGetUserInfo(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/sync/index", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindSyncSearchIndex(c) - if err != nil { - r.RenderSyncSearchIndex(c, err) + req := new(web.SyncSearchIndexReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderSyncSearchIndex(c, s.SyncSearchIndex(req)) + s.Render(c, nil, s.SyncSearchIndex(req)) }) - } // UnimplementedCoreServant can be embedded to have forward compatible implementations. -type UnimplementedCoreServant struct { -} +type UnimplementedCoreServant struct{} func (UnimplementedCoreServant) Chain() gin.HandlersChain { return nil @@ -408,177 +345,3 @@ func (UnimplementedCoreServant) SyncSearchIndex(req *web.SyncSearchIndexReq) mir } func (UnimplementedCoreServant) mustEmbedUnimplementedCoreServant() {} - -// UnimplementedCoreRender can be embedded to have forward compatible implementations. -type UnimplementedCoreRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedCoreRender) RenderTweetCollectionStatus(c *gin.Context, data *web.TweetCollectionStatusResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedCoreRender) RenderTweetStarStatus(c *gin.Context, data *web.TweetStarStatusResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedCoreRender) RenderSuggestTags(c *gin.Context, data *web.SuggestTagsResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedCoreRender) RenderSuggestUsers(c *gin.Context, data *web.SuggestUsersResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedCoreRender) RenderChangeAvatar(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedCoreRender) RenderChangeNickname(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedCoreRender) RenderChangePassword(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedCoreRender) RenderUserPhoneBind(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedCoreRender) RenderGetStars(c *gin.Context, data *web.GetStarsResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedCoreRender) RenderGetCollections(c *gin.Context, data *web.GetCollectionsResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedCoreRender) RenderSendUserWhisper(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedCoreRender) RenderReadMessage(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedCoreRender) RenderGetMessages(c *gin.Context, data *web.GetMessagesResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedCoreRender) RenderGetUnreadMsgCount(c *gin.Context, data *web.GetUnreadMsgCountResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedCoreRender) RenderGetUserInfo(c *gin.Context, data *web.UserInfoResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedCoreRender) RenderSyncSearchIndex(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedCoreRender) mustEmbedUnimplementedCoreRender() {} - -// UnimplementedCoreBinding can be embedded to have forward compatible implementations. -type UnimplementedCoreBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedCoreBinding) BindTweetCollectionStatus(c *gin.Context) (*web.TweetCollectionStatusReq, mir.Error) { - obj := new(web.TweetCollectionStatusReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindTweetStarStatus(c *gin.Context) (*web.TweetStarStatusReq, mir.Error) { - obj := new(web.TweetStarStatusReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindSuggestTags(c *gin.Context) (*web.SuggestTagsReq, mir.Error) { - obj := new(web.SuggestTagsReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindSuggestUsers(c *gin.Context) (*web.SuggestUsersReq, mir.Error) { - obj := new(web.SuggestUsersReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindChangeAvatar(c *gin.Context) (*web.ChangeAvatarReq, mir.Error) { - obj := new(web.ChangeAvatarReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindChangeNickname(c *gin.Context) (*web.ChangeNicknameReq, mir.Error) { - obj := new(web.ChangeNicknameReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindChangePassword(c *gin.Context) (*web.ChangePasswordReq, mir.Error) { - obj := new(web.ChangePasswordReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindUserPhoneBind(c *gin.Context) (*web.UserPhoneBindReq, mir.Error) { - obj := new(web.UserPhoneBindReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindGetStars(c *gin.Context) (*web.GetStarsReq, mir.Error) { - obj := new(web.GetStarsReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindGetCollections(c *gin.Context) (*web.GetCollectionsReq, mir.Error) { - obj := new(web.GetCollectionsReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindSendUserWhisper(c *gin.Context) (*web.SendWhisperReq, mir.Error) { - obj := new(web.SendWhisperReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindReadMessage(c *gin.Context) (*web.ReadMessageReq, mir.Error) { - obj := new(web.ReadMessageReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindGetMessages(c *gin.Context) (*web.GetMessagesReq, mir.Error) { - obj := new(web.GetMessagesReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindGetUnreadMsgCount(c *gin.Context) (*web.GetUnreadMsgCountReq, mir.Error) { - obj := new(web.GetUnreadMsgCountReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindGetUserInfo(c *gin.Context) (*web.UserInfoReq, mir.Error) { - obj := new(web.UserInfoReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) BindSyncSearchIndex(c *gin.Context) (*web.SyncSearchIndexReq, mir.Error) { - obj := new(web.SyncSearchIndexReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedCoreBinding) mustEmbedUnimplementedCoreBinding() {} diff --git a/auto/api/v1/followship.go b/auto/api/v1/followship.go index 7e83efc9..fa6c0f8b 100644 --- a/auto/api/v1/followship.go +++ b/auto/api/v1/followship.go @@ -1,16 +1,20 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) type Followship interface { + _default_ + // Chain provide handlers chain for gin Chain() gin.HandlersChain @@ -22,26 +26,8 @@ type Followship interface { mustEmbedUnimplementedFollowshipServant() } -type FollowshipBinding interface { - BindListFollowers(*gin.Context) (*web.ListFollowersReq, mir.Error) - BindListFollowings(*gin.Context) (*web.ListFollowingsReq, mir.Error) - BindDeleteFollowing(*gin.Context) (*web.DeleteFollowingReq, mir.Error) - BindAddFollowing(*gin.Context) (*web.AddFollowingReq, mir.Error) - - mustEmbedUnimplementedFollowshipBinding() -} - -type FollowshipRender interface { - RenderListFollowers(*gin.Context, *web.ListFollowersResp, mir.Error) - RenderListFollowings(*gin.Context, *web.ListFollowingsResp, mir.Error) - RenderDeleteFollowing(*gin.Context, mir.Error) - RenderAddFollowing(*gin.Context, mir.Error) - - mustEmbedUnimplementedFollowshipRender() -} - // RegisterFollowshipServant register Followship servant to gin -func RegisterFollowshipServant(e *gin.Engine, s Followship, b FollowshipBinding, r FollowshipRender) { +func RegisterFollowshipServant(e *gin.Engine, s Followship) { router := e.Group("v1") // use chain for router middlewares := s.Chain() @@ -54,67 +40,58 @@ func RegisterFollowshipServant(e *gin.Engine, s Followship, b FollowshipBinding, return default: } - - req, err := b.BindListFollowers(c) - if err != nil { - r.RenderListFollowers(c, nil, err) + req := new(web.ListFollowersReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.ListFollowers(req) - r.RenderListFollowers(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/following/list", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindListFollowings(c) - if err != nil { - r.RenderListFollowings(c, nil, err) + req := new(web.ListFollowingsReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.ListFollowings(req) - r.RenderListFollowings(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("POST", "/following/delete", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindDeleteFollowing(c) - if err != nil { - r.RenderDeleteFollowing(c, err) + req := new(web.DeleteFollowingReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderDeleteFollowing(c, s.DeleteFollowing(req)) + s.Render(c, nil, s.DeleteFollowing(req)) }) - router.Handle("POST", "/following/add", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindAddFollowing(c) - if err != nil { - r.RenderAddFollowing(c, err) + req := new(web.AddFollowingReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderAddFollowing(c, s.AddFollowing(req)) + s.Render(c, nil, s.AddFollowing(req)) }) - } // UnimplementedFollowshipServant can be embedded to have forward compatible implementations. -type UnimplementedFollowshipServant struct { -} +type UnimplementedFollowshipServant struct{} func (UnimplementedFollowshipServant) Chain() gin.HandlersChain { return nil @@ -137,57 +114,3 @@ func (UnimplementedFollowshipServant) AddFollowing(req *web.AddFollowingReq) mir } func (UnimplementedFollowshipServant) mustEmbedUnimplementedFollowshipServant() {} - -// UnimplementedFollowshipRender can be embedded to have forward compatible implementations. -type UnimplementedFollowshipRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedFollowshipRender) RenderListFollowers(c *gin.Context, data *web.ListFollowersResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedFollowshipRender) RenderListFollowings(c *gin.Context, data *web.ListFollowingsResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedFollowshipRender) RenderDeleteFollowing(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedFollowshipRender) RenderAddFollowing(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedFollowshipRender) mustEmbedUnimplementedFollowshipRender() {} - -// UnimplementedFollowshipBinding can be embedded to have forward compatible implementations. -type UnimplementedFollowshipBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedFollowshipBinding) BindListFollowers(c *gin.Context) (*web.ListFollowersReq, mir.Error) { - obj := new(web.ListFollowersReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedFollowshipBinding) BindListFollowings(c *gin.Context) (*web.ListFollowingsReq, mir.Error) { - obj := new(web.ListFollowingsReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedFollowshipBinding) BindDeleteFollowing(c *gin.Context) (*web.DeleteFollowingReq, mir.Error) { - obj := new(web.DeleteFollowingReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedFollowshipBinding) BindAddFollowing(c *gin.Context) (*web.AddFollowingReq, mir.Error) { - obj := new(web.AddFollowingReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedFollowshipBinding) mustEmbedUnimplementedFollowshipBinding() {} diff --git a/auto/api/v1/friendship.go b/auto/api/v1/friendship.go index fbec2417..e6e912fe 100644 --- a/auto/api/v1/friendship.go +++ b/auto/api/v1/friendship.go @@ -1,16 +1,20 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) type Friendship interface { + _default_ + // Chain provide handlers chain for gin Chain() gin.HandlersChain @@ -23,28 +27,8 @@ type Friendship interface { mustEmbedUnimplementedFriendshipServant() } -type FriendshipBinding interface { - BindGetContacts(*gin.Context) (*web.GetContactsReq, mir.Error) - BindDeleteFriend(*gin.Context) (*web.DeleteFriendReq, mir.Error) - BindRejectFriend(*gin.Context) (*web.RejectFriendReq, mir.Error) - BindAddFriend(*gin.Context) (*web.AddFriendReq, mir.Error) - BindRequestingFriend(*gin.Context) (*web.RequestingFriendReq, mir.Error) - - mustEmbedUnimplementedFriendshipBinding() -} - -type FriendshipRender interface { - RenderGetContacts(*gin.Context, *web.GetContactsResp, mir.Error) - RenderDeleteFriend(*gin.Context, mir.Error) - RenderRejectFriend(*gin.Context, mir.Error) - RenderAddFriend(*gin.Context, mir.Error) - RenderRequestingFriend(*gin.Context, mir.Error) - - mustEmbedUnimplementedFriendshipRender() -} - // RegisterFriendshipServant register Friendship servant to gin -func RegisterFriendshipServant(e *gin.Engine, s Friendship, b FriendshipBinding, r FriendshipRender) { +func RegisterFriendshipServant(e *gin.Engine, s Friendship) { router := e.Group("v1") // use chain for router middlewares := s.Chain() @@ -57,81 +41,70 @@ func RegisterFriendshipServant(e *gin.Engine, s Friendship, b FriendshipBinding, return default: } - - req, err := b.BindGetContacts(c) - if err != nil { - r.RenderGetContacts(c, nil, err) + req := new(web.GetContactsReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.GetContacts(req) - r.RenderGetContacts(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("POST", "/friend/delete", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindDeleteFriend(c) - if err != nil { - r.RenderDeleteFriend(c, err) + req := new(web.DeleteFriendReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderDeleteFriend(c, s.DeleteFriend(req)) + s.Render(c, nil, s.DeleteFriend(req)) }) - router.Handle("POST", "/friend/reject", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindRejectFriend(c) - if err != nil { - r.RenderRejectFriend(c, err) + req := new(web.RejectFriendReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderRejectFriend(c, s.RejectFriend(req)) + s.Render(c, nil, s.RejectFriend(req)) }) - router.Handle("POST", "/friend/add", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindAddFriend(c) - if err != nil { - r.RenderAddFriend(c, err) + req := new(web.AddFriendReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderAddFriend(c, s.AddFriend(req)) + s.Render(c, nil, s.AddFriend(req)) }) - router.Handle("POST", "/friend/requesting", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindRequestingFriend(c) - if err != nil { - r.RenderRequestingFriend(c, err) + req := new(web.RequestingFriendReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderRequestingFriend(c, s.RequestingFriend(req)) + s.Render(c, nil, s.RequestingFriend(req)) }) - } // UnimplementedFriendshipServant can be embedded to have forward compatible implementations. -type UnimplementedFriendshipServant struct { -} +type UnimplementedFriendshipServant struct{} func (UnimplementedFriendshipServant) Chain() gin.HandlersChain { return nil @@ -158,67 +131,3 @@ func (UnimplementedFriendshipServant) RequestingFriend(req *web.RequestingFriend } func (UnimplementedFriendshipServant) mustEmbedUnimplementedFriendshipServant() {} - -// UnimplementedFriendshipRender can be embedded to have forward compatible implementations. -type UnimplementedFriendshipRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedFriendshipRender) RenderGetContacts(c *gin.Context, data *web.GetContactsResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedFriendshipRender) RenderDeleteFriend(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedFriendshipRender) RenderRejectFriend(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedFriendshipRender) RenderAddFriend(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedFriendshipRender) RenderRequestingFriend(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedFriendshipRender) mustEmbedUnimplementedFriendshipRender() {} - -// UnimplementedFriendshipBinding can be embedded to have forward compatible implementations. -type UnimplementedFriendshipBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedFriendshipBinding) BindGetContacts(c *gin.Context) (*web.GetContactsReq, mir.Error) { - obj := new(web.GetContactsReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedFriendshipBinding) BindDeleteFriend(c *gin.Context) (*web.DeleteFriendReq, mir.Error) { - obj := new(web.DeleteFriendReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedFriendshipBinding) BindRejectFriend(c *gin.Context) (*web.RejectFriendReq, mir.Error) { - obj := new(web.RejectFriendReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedFriendshipBinding) BindAddFriend(c *gin.Context) (*web.AddFriendReq, mir.Error) { - obj := new(web.AddFriendReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedFriendshipBinding) BindRequestingFriend(c *gin.Context) (*web.RequestingFriendReq, mir.Error) { - obj := new(web.RequestingFriendReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedFriendshipBinding) mustEmbedUnimplementedFriendshipBinding() {} diff --git a/auto/api/v1/loose.go b/auto/api/v1/loose.go index 7d4d1046..4c9f9c6f 100644 --- a/auto/api/v1/loose.go +++ b/auto/api/v1/loose.go @@ -1,19 +1,25 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) type Loose interface { + _default_ + // Chain provide handlers chain for gin Chain() gin.HandlersChain + TweetComments(*web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error) + TopicList(*web.TopicListReq) (*web.TopicListResp, mir.Error) GetUserProfile(*web.GetUserProfileReq) (*web.GetUserProfileResp, mir.Error) GetUserTweets(*web.GetUserTweetsReq) (*web.GetUserTweetsResp, mir.Error) Timeline(*web.TimelineReq) (*web.TimelineResp, mir.Error) @@ -21,142 +27,112 @@ type Loose interface { mustEmbedUnimplementedLooseServant() } -type LooseBinding interface { - BindGetUserProfile(*gin.Context) (*web.GetUserProfileReq, mir.Error) - BindGetUserTweets(*gin.Context) (*web.GetUserTweetsReq, mir.Error) - BindTimeline(*gin.Context) (*web.TimelineReq, mir.Error) - - mustEmbedUnimplementedLooseBinding() -} - -type LooseRender interface { - RenderGetUserProfile(*gin.Context, *web.GetUserProfileResp, mir.Error) - RenderGetUserTweets(*gin.Context, *web.GetUserTweetsResp, mir.Error) - RenderTimeline(*gin.Context, *web.TimelineResp, mir.Error) - - mustEmbedUnimplementedLooseRender() -} - // RegisterLooseServant register Loose servant to gin -func RegisterLooseServant(e *gin.Engine, s Loose, b LooseBinding, r LooseRender) { +func RegisterLooseServant(e *gin.Engine, s Loose) { router := e.Group("v1") // use chain for router middlewares := s.Chain() router.Use(middlewares...) // register routes info to router + router.Handle("GET", "/post/comments", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.TweetCommentsReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + resp, err := s.TweetComments(req) + s.Render(c, resp, err) + }) + router.Handle("GET", "/tags", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.TopicListReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + resp, err := s.TopicList(req) + s.Render(c, resp, err) + }) router.Handle("GET", "/user/profile", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindGetUserProfile(c) - if err != nil { - r.RenderGetUserProfile(c, nil, err) + req := new(web.GetUserProfileReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.GetUserProfile(req) - r.RenderGetUserProfile(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/user/posts", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindGetUserTweets(c) - if err != nil { - r.RenderGetUserTweets(c, nil, err) + req := new(web.GetUserTweetsReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.GetUserTweets(req) - r.RenderGetUserTweets(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/posts", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindTimeline(c) - if err != nil { - r.RenderTimeline(c, nil, err) + req := new(web.TimelineReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.Timeline(req) - r.RenderTimeline(c, resp, err) + s.Render(c, resp, err) }) - } // UnimplementedLooseServant can be embedded to have forward compatible implementations. -type UnimplementedLooseServant struct { -} +type UnimplementedLooseServant struct{} func (UnimplementedLooseServant) Chain() gin.HandlersChain { return nil } -func (UnimplementedLooseServant) GetUserProfile(req *web.GetUserProfileReq) (*web.GetUserProfileResp, mir.Error) { +func (UnimplementedLooseServant) TweetComments(req *web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } -func (UnimplementedLooseServant) GetUserTweets(req *web.GetUserTweetsReq) (*web.GetUserTweetsResp, mir.Error) { +func (UnimplementedLooseServant) TopicList(req *web.TopicListReq) (*web.TopicListResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } -func (UnimplementedLooseServant) Timeline(req *web.TimelineReq) (*web.TimelineResp, mir.Error) { +func (UnimplementedLooseServant) GetUserProfile(req *web.GetUserProfileReq) (*web.GetUserProfileResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } -func (UnimplementedLooseServant) mustEmbedUnimplementedLooseServant() {} - -// UnimplementedLooseRender can be embedded to have forward compatible implementations. -type UnimplementedLooseRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedLooseRender) RenderGetUserProfile(c *gin.Context, data *web.GetUserProfileResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedLooseRender) RenderGetUserTweets(c *gin.Context, data *web.GetUserTweetsResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedLooseRender) RenderTimeline(c *gin.Context, data *web.TimelineResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedLooseRender) mustEmbedUnimplementedLooseRender() {} - -// UnimplementedLooseBinding can be embedded to have forward compatible implementations. -type UnimplementedLooseBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedLooseBinding) BindGetUserProfile(c *gin.Context) (*web.GetUserProfileReq, mir.Error) { - obj := new(web.GetUserProfileReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedLooseBinding) BindGetUserTweets(c *gin.Context) (*web.GetUserTweetsReq, mir.Error) { - obj := new(web.GetUserTweetsReq) - err := b.BindAny(c, obj) - return obj, err +func (UnimplementedLooseServant) GetUserTweets(req *web.GetUserTweetsReq) (*web.GetUserTweetsResp, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } -func (b *UnimplementedLooseBinding) BindTimeline(c *gin.Context) (*web.TimelineReq, mir.Error) { - obj := new(web.TimelineReq) - err := b.BindAny(c, obj) - return obj, err +func (UnimplementedLooseServant) Timeline(req *web.TimelineReq) (*web.TimelineResp, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } -func (b *UnimplementedLooseBinding) mustEmbedUnimplementedLooseBinding() {} +func (UnimplementedLooseServant) mustEmbedUnimplementedLooseServant() {} diff --git a/auto/api/v1/priv.go b/auto/api/v1/priv.go index 42c88ade..f4adccfc 100644 --- a/auto/api/v1/priv.go +++ b/auto/api/v1/priv.go @@ -1,24 +1,36 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) type Priv interface { + _default_ + // Chain provide handlers chain for gin Chain() gin.HandlersChain + UnfollowTopic(*web.UnfollowTopicReq) mir.Error + FollowTopic(*web.FollowTopicReq) mir.Error + StickTopic(*web.StickTopicReq) (*web.StickTopicResp, mir.Error) + ThumbsDownTweetReply(*web.TweetReplyThumbsReq) mir.Error + ThumbsUpTweetReply(*web.TweetReplyThumbsReq) mir.Error + ThumbsDownTweetComment(*web.TweetCommentThumbsReq) mir.Error + ThumbsUpTweetComment(*web.TweetCommentThumbsReq) mir.Error DeleteCommentReply(*web.DeleteCommentReplyReq) mir.Error CreateCommentReply(*web.CreateCommentReplyReq) (*web.CreateCommentReplyResp, mir.Error) DeleteComment(*web.DeleteCommentReq) mir.Error CreateComment(*web.CreateCommentReq) (*web.CreateCommentResp, mir.Error) VisibleTweet(*web.VisibleTweetReq) (*web.VisibleTweetResp, mir.Error) + HighlightTweet(*web.HighlightTweetReq) (*web.HighlightTweetResp, mir.Error) StickTweet(*web.StickTweetReq) (*web.StickTweetResp, mir.Error) LockTweet(*web.LockTweetReq) (*web.LockTweetResp, mir.Error) CollectionTweet(*web.CollectionTweetReq) (*web.CollectionTweetResp, mir.Error) @@ -32,283 +44,356 @@ type Priv interface { mustEmbedUnimplementedPrivServant() } -type PrivBinding interface { - BindDeleteCommentReply(*gin.Context) (*web.DeleteCommentReplyReq, mir.Error) - BindCreateCommentReply(*gin.Context) (*web.CreateCommentReplyReq, mir.Error) - BindDeleteComment(*gin.Context) (*web.DeleteCommentReq, mir.Error) - BindCreateComment(*gin.Context) (*web.CreateCommentReq, mir.Error) - BindVisibleTweet(*gin.Context) (*web.VisibleTweetReq, mir.Error) - BindStickTweet(*gin.Context) (*web.StickTweetReq, mir.Error) - BindLockTweet(*gin.Context) (*web.LockTweetReq, mir.Error) - BindCollectionTweet(*gin.Context) (*web.CollectionTweetReq, mir.Error) - BindStarTweet(*gin.Context) (*web.StarTweetReq, mir.Error) - BindDeleteTweet(*gin.Context) (*web.DeleteTweetReq, mir.Error) - BindCreateTweet(*gin.Context) (*web.CreateTweetReq, mir.Error) - BindDownloadAttachment(*gin.Context) (*web.DownloadAttachmentReq, mir.Error) - BindDownloadAttachmentPrecheck(*gin.Context) (*web.DownloadAttachmentPrecheckReq, mir.Error) - BindUploadAttachment(*gin.Context) (*web.UploadAttachmentReq, mir.Error) - - mustEmbedUnimplementedPrivBinding() -} - -type PrivRender interface { - RenderDeleteCommentReply(*gin.Context, mir.Error) - RenderCreateCommentReply(*gin.Context, *web.CreateCommentReplyResp, mir.Error) - RenderDeleteComment(*gin.Context, mir.Error) - RenderCreateComment(*gin.Context, *web.CreateCommentResp, mir.Error) - RenderVisibleTweet(*gin.Context, *web.VisibleTweetResp, mir.Error) - RenderStickTweet(*gin.Context, *web.StickTweetResp, mir.Error) - RenderLockTweet(*gin.Context, *web.LockTweetResp, mir.Error) - RenderCollectionTweet(*gin.Context, *web.CollectionTweetResp, mir.Error) - RenderStarTweet(*gin.Context, *web.StarTweetResp, mir.Error) - RenderDeleteTweet(*gin.Context, mir.Error) - RenderCreateTweet(*gin.Context, *web.CreateTweetResp, mir.Error) - RenderDownloadAttachment(*gin.Context, *web.DownloadAttachmentResp, mir.Error) - RenderDownloadAttachmentPrecheck(*gin.Context, *web.DownloadAttachmentPrecheckResp, mir.Error) - RenderUploadAttachment(*gin.Context, *web.UploadAttachmentResp, mir.Error) - - mustEmbedUnimplementedPrivRender() -} - // RegisterPrivServant register Priv servant to gin -func RegisterPrivServant(e *gin.Engine, s Priv, b PrivBinding, r PrivRender) { +func RegisterPrivServant(e *gin.Engine, s Priv) { router := e.Group("v1") // use chain for router middlewares := s.Chain() router.Use(middlewares...) // register routes info to router + router.Handle("POST", "/topic/unfollow", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.UnfollowTopicReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + s.Render(c, nil, s.UnfollowTopic(req)) + }) + router.Handle("POST", "/topic/follow", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.FollowTopicReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + s.Render(c, nil, s.FollowTopic(req)) + }) + router.Handle("POST", "/topic/stick", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.StickTopicReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + resp, err := s.StickTopic(req) + s.Render(c, resp, err) + }) + router.Handle("POST", "/tweet/reply/thumbsdown", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.TweetReplyThumbsReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + s.Render(c, nil, s.ThumbsDownTweetReply(req)) + }) + router.Handle("POST", "/tweet/reply/thumbsup", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.TweetReplyThumbsReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + s.Render(c, nil, s.ThumbsUpTweetReply(req)) + }) + router.Handle("POST", "/tweet/comment/thumbsdown", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.TweetCommentThumbsReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + s.Render(c, nil, s.ThumbsDownTweetComment(req)) + }) + router.Handle("POST", "/tweet/comment/thumbsup", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.TweetCommentThumbsReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + s.Render(c, nil, s.ThumbsUpTweetComment(req)) + }) router.Handle("DELETE", "/post/comment/reply", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindDeleteCommentReply(c) - if err != nil { - r.RenderDeleteCommentReply(c, err) + req := new(web.DeleteCommentReplyReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderDeleteCommentReply(c, s.DeleteCommentReply(req)) + s.Render(c, nil, s.DeleteCommentReply(req)) }) - router.Handle("POST", "/post/comment/reply", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindCreateCommentReply(c) - if err != nil { - r.RenderCreateCommentReply(c, nil, err) + req := new(web.CreateCommentReplyReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.CreateCommentReply(req) - r.RenderCreateCommentReply(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("DELETE", "/post/comment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindDeleteComment(c) - if err != nil { - r.RenderDeleteComment(c, err) + req := new(web.DeleteCommentReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderDeleteComment(c, s.DeleteComment(req)) + s.Render(c, nil, s.DeleteComment(req)) }) - router.Handle("POST", "/post/comment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindCreateComment(c) - if err != nil { - r.RenderCreateComment(c, nil, err) + req := new(web.CreateCommentReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.CreateComment(req) - r.RenderCreateComment(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("POST", "/post/visibility", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindVisibleTweet(c) - if err != nil { - r.RenderVisibleTweet(c, nil, err) + req := new(web.VisibleTweetReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.VisibleTweet(req) - r.RenderVisibleTweet(c, resp, err) + s.Render(c, resp, err) + }) + router.Handle("POST", "/post/highlight", func(c *gin.Context) { + select { + case <-c.Request.Context().Done(): + return + default: + } + req := new(web.HighlightTweetReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) + return + } + resp, err := s.HighlightTweet(req) + s.Render(c, resp, err) }) - router.Handle("POST", "/post/stick", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindStickTweet(c) - if err != nil { - r.RenderStickTweet(c, nil, err) + req := new(web.StickTweetReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.StickTweet(req) - r.RenderStickTweet(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("POST", "/post/lock", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindLockTweet(c) - if err != nil { - r.RenderLockTweet(c, nil, err) + req := new(web.LockTweetReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.LockTweet(req) - r.RenderLockTweet(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("POST", "/post/collection", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindCollectionTweet(c) - if err != nil { - r.RenderCollectionTweet(c, nil, err) + req := new(web.CollectionTweetReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.CollectionTweet(req) - r.RenderCollectionTweet(c, resp, err) + s.Render(c, resp, err) }) - - router.Handle("POST", "/post/start", func(c *gin.Context) { + router.Handle("POST", "/post/star", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindStarTweet(c) - if err != nil { - r.RenderStarTweet(c, nil, err) + req := new(web.StarTweetReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.StarTweet(req) - r.RenderStarTweet(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("DELETE", "/post", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindDeleteTweet(c) - if err != nil { - r.RenderDeleteTweet(c, err) + req := new(web.DeleteTweetReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderDeleteTweet(c, s.DeleteTweet(req)) + s.Render(c, nil, s.DeleteTweet(req)) }) - router.Handle("POST", "/post", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindCreateTweet(c) - if err != nil { - r.RenderCreateTweet(c, nil, err) + req := new(web.CreateTweetReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.CreateTweet(req) - r.RenderCreateTweet(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/attachment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindDownloadAttachment(c) - if err != nil { - r.RenderDownloadAttachment(c, nil, err) + req := new(web.DownloadAttachmentReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.DownloadAttachment(req) - r.RenderDownloadAttachment(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/attachment/precheck", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindDownloadAttachmentPrecheck(c) - if err != nil { - r.RenderDownloadAttachmentPrecheck(c, nil, err) + req := new(web.DownloadAttachmentPrecheckReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.DownloadAttachmentPrecheck(req) - r.RenderDownloadAttachmentPrecheck(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("POST", "/attachment", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindUploadAttachment(c) - if err != nil { - r.RenderUploadAttachment(c, nil, err) + req := new(web.UploadAttachmentReq) + var bv _binding_ = req + if err := bv.Bind(c); err != nil { + s.Render(c, nil, err) return } resp, err := s.UploadAttachment(req) - r.RenderUploadAttachment(c, resp, err) + s.Render(c, resp, err) }) - } // UnimplementedPrivServant can be embedded to have forward compatible implementations. -type UnimplementedPrivServant struct { -} +type UnimplementedPrivServant struct{} func (UnimplementedPrivServant) Chain() gin.HandlersChain { return nil } +func (UnimplementedPrivServant) UnfollowTopic(req *web.UnfollowTopicReq) mir.Error { + return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + +func (UnimplementedPrivServant) FollowTopic(req *web.FollowTopicReq) mir.Error { + return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + +func (UnimplementedPrivServant) StickTopic(req *web.StickTopicReq) (*web.StickTopicResp, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + +func (UnimplementedPrivServant) ThumbsDownTweetReply(req *web.TweetReplyThumbsReq) mir.Error { + return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + +func (UnimplementedPrivServant) ThumbsUpTweetReply(req *web.TweetReplyThumbsReq) mir.Error { + return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + +func (UnimplementedPrivServant) ThumbsDownTweetComment(req *web.TweetCommentThumbsReq) mir.Error { + return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + +func (UnimplementedPrivServant) ThumbsUpTweetComment(req *web.TweetCommentThumbsReq) mir.Error { + return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + func (UnimplementedPrivServant) DeleteCommentReply(req *web.DeleteCommentReplyReq) mir.Error { return mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } @@ -329,6 +414,10 @@ func (UnimplementedPrivServant) VisibleTweet(req *web.VisibleTweetReq) (*web.Vis return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } +func (UnimplementedPrivServant) HighlightTweet(req *web.HighlightTweetReq) (*web.HighlightTweetResp, mir.Error) { + return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) +} + func (UnimplementedPrivServant) StickTweet(req *web.StickTweetReq) (*web.StickTweetResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) } @@ -366,157 +455,3 @@ func (UnimplementedPrivServant) UploadAttachment(req *web.UploadAttachmentReq) ( } func (UnimplementedPrivServant) mustEmbedUnimplementedPrivServant() {} - -// UnimplementedPrivRender can be embedded to have forward compatible implementations. -type UnimplementedPrivRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedPrivRender) RenderDeleteCommentReply(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedPrivRender) RenderCreateCommentReply(c *gin.Context, data *web.CreateCommentReplyResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPrivRender) RenderDeleteComment(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedPrivRender) RenderCreateComment(c *gin.Context, data *web.CreateCommentResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPrivRender) RenderVisibleTweet(c *gin.Context, data *web.VisibleTweetResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPrivRender) RenderStickTweet(c *gin.Context, data *web.StickTweetResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPrivRender) RenderLockTweet(c *gin.Context, data *web.LockTweetResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPrivRender) RenderCollectionTweet(c *gin.Context, data *web.CollectionTweetResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPrivRender) RenderStarTweet(c *gin.Context, data *web.StarTweetResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPrivRender) RenderDeleteTweet(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedPrivRender) RenderCreateTweet(c *gin.Context, data *web.CreateTweetResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPrivRender) RenderDownloadAttachment(c *gin.Context, data *web.DownloadAttachmentResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPrivRender) RenderDownloadAttachmentPrecheck(c *gin.Context, data *web.DownloadAttachmentPrecheckResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPrivRender) RenderUploadAttachment(c *gin.Context, data *web.UploadAttachmentResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPrivRender) mustEmbedUnimplementedPrivRender() {} - -// UnimplementedPrivBinding can be embedded to have forward compatible implementations. -type UnimplementedPrivBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedPrivBinding) BindDeleteCommentReply(c *gin.Context) (*web.DeleteCommentReplyReq, mir.Error) { - obj := new(web.DeleteCommentReplyReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindCreateCommentReply(c *gin.Context) (*web.CreateCommentReplyReq, mir.Error) { - obj := new(web.CreateCommentReplyReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindDeleteComment(c *gin.Context) (*web.DeleteCommentReq, mir.Error) { - obj := new(web.DeleteCommentReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindCreateComment(c *gin.Context) (*web.CreateCommentReq, mir.Error) { - obj := new(web.CreateCommentReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindVisibleTweet(c *gin.Context) (*web.VisibleTweetReq, mir.Error) { - obj := new(web.VisibleTweetReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindStickTweet(c *gin.Context) (*web.StickTweetReq, mir.Error) { - obj := new(web.StickTweetReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindLockTweet(c *gin.Context) (*web.LockTweetReq, mir.Error) { - obj := new(web.LockTweetReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindCollectionTweet(c *gin.Context) (*web.CollectionTweetReq, mir.Error) { - obj := new(web.CollectionTweetReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindStarTweet(c *gin.Context) (*web.StarTweetReq, mir.Error) { - obj := new(web.StarTweetReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindDeleteTweet(c *gin.Context) (*web.DeleteTweetReq, mir.Error) { - obj := new(web.DeleteTweetReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindCreateTweet(c *gin.Context) (*web.CreateTweetReq, mir.Error) { - obj := new(web.CreateTweetReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindDownloadAttachment(c *gin.Context) (*web.DownloadAttachmentReq, mir.Error) { - obj := new(web.DownloadAttachmentReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindDownloadAttachmentPrecheck(c *gin.Context) (*web.DownloadAttachmentPrecheckReq, mir.Error) { - obj := new(web.DownloadAttachmentPrecheckReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) BindUploadAttachment(c *gin.Context) (*web.UploadAttachmentReq, mir.Error) { - obj := new(web.UploadAttachmentReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPrivBinding) mustEmbedUnimplementedPrivBinding() {} diff --git a/auto/api/v1/pub.go b/auto/api/v1/pub.go index 7fe417e7..850a7906 100644 --- a/auto/api/v1/pub.go +++ b/auto/api/v1/pub.go @@ -1,18 +1,20 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/model/web" ) type Pub interface { - TopicList(*web.TopicListReq) (*web.TopicListResp, mir.Error) - TweetComments(*web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error) + _default_ + TweetDetail(*web.TweetDetailReq) (*web.TweetDetailResp, mir.Error) SendCaptcha(*web.SendCaptchaReq) mir.Error GetCaptcha() (*web.GetCaptchaResp, mir.Error) @@ -23,98 +25,38 @@ type Pub interface { mustEmbedUnimplementedPubServant() } -type PubBinding interface { - BindTopicList(*gin.Context) (*web.TopicListReq, mir.Error) - BindTweetComments(*gin.Context) (*web.TweetCommentsReq, mir.Error) - BindTweetDetail(*gin.Context) (*web.TweetDetailReq, mir.Error) - BindSendCaptcha(*gin.Context) (*web.SendCaptchaReq, mir.Error) - BindRegister(*gin.Context) (*web.RegisterReq, mir.Error) - BindLogin(*gin.Context) (*web.LoginReq, mir.Error) - - mustEmbedUnimplementedPubBinding() -} - -type PubRender interface { - RenderTopicList(*gin.Context, *web.TopicListResp, mir.Error) - RenderTweetComments(*gin.Context, *web.TweetCommentsResp, mir.Error) - RenderTweetDetail(*gin.Context, *web.TweetDetailResp, mir.Error) - RenderSendCaptcha(*gin.Context, mir.Error) - RenderGetCaptcha(*gin.Context, *web.GetCaptchaResp, mir.Error) - RenderRegister(*gin.Context, *web.RegisterResp, mir.Error) - RenderLogin(*gin.Context, *web.LoginResp, mir.Error) - RenderVersion(*gin.Context, *web.VersionResp, mir.Error) - - mustEmbedUnimplementedPubRender() -} - // RegisterPubServant register Pub servant to gin -func RegisterPubServant(e *gin.Engine, s Pub, b PubBinding, r PubRender) { +func RegisterPubServant(e *gin.Engine, s Pub) { router := e.Group("v1") // register routes info to router - router.Handle("GET", "/tags", func(c *gin.Context) { - select { - case <-c.Request.Context().Done(): - return - default: - } - - req, err := b.BindTopicList(c) - if err != nil { - r.RenderTopicList(c, nil, err) - return - } - resp, err := s.TopicList(req) - r.RenderTopicList(c, resp, err) - }) - - router.Handle("GET", "/post/comments", func(c *gin.Context) { - select { - case <-c.Request.Context().Done(): - return - default: - } - - req, err := b.BindTweetComments(c) - if err != nil { - r.RenderTweetComments(c, nil, err) - return - } - resp, err := s.TweetComments(req) - r.RenderTweetComments(c, resp, err) - }) - router.Handle("GET", "/post", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindTweetDetail(c) - if err != nil { - r.RenderTweetDetail(c, nil, err) + req := new(web.TweetDetailReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.TweetDetail(req) - r.RenderTweetDetail(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("POST", "/captcha", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindSendCaptcha(c) - if err != nil { - r.RenderSendCaptcha(c, err) + req := new(web.SendCaptchaReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } - r.RenderSendCaptcha(c, s.SendCaptcha(req)) + s.Render(c, nil, s.SendCaptcha(req)) }) - router.Handle("GET", "/captcha", func(c *gin.Context) { select { case <-c.Request.Context().Done(): @@ -123,41 +65,36 @@ func RegisterPubServant(e *gin.Engine, s Pub, b PubBinding, r PubRender) { } resp, err := s.GetCaptcha() - r.RenderGetCaptcha(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("POST", "/auth/register", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindRegister(c) - if err != nil { - r.RenderRegister(c, nil, err) + req := new(web.RegisterReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.Register(req) - r.RenderRegister(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("POST", "/auth/login", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindLogin(c) - if err != nil { - r.RenderLogin(c, nil, err) + req := new(web.LoginReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.Login(req) - r.RenderLogin(c, resp, err) + s.Render(c, resp, err) }) - router.Handle("GET", "/", func(c *gin.Context) { select { case <-c.Request.Context().Done(): @@ -166,22 +103,12 @@ func RegisterPubServant(e *gin.Engine, s Pub, b PubBinding, r PubRender) { } resp, err := s.Version() - r.RenderVersion(c, resp, err) + s.Render(c, resp, err) }) - } // UnimplementedPubServant can be embedded to have forward compatible implementations. -type UnimplementedPubServant struct { -} - -func (UnimplementedPubServant) TopicList(req *web.TopicListReq) (*web.TopicListResp, mir.Error) { - return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) -} - -func (UnimplementedPubServant) TweetComments(req *web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error) { - return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) -} +type UnimplementedPubServant struct{} func (UnimplementedPubServant) TweetDetail(req *web.TweetDetailReq) (*web.TweetDetailResp, mir.Error) { return nil, mir.Errorln(http.StatusNotImplemented, http.StatusText(http.StatusNotImplemented)) @@ -208,85 +135,3 @@ func (UnimplementedPubServant) Version() (*web.VersionResp, mir.Error) { } func (UnimplementedPubServant) mustEmbedUnimplementedPubServant() {} - -// UnimplementedPubRender can be embedded to have forward compatible implementations. -type UnimplementedPubRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedPubRender) RenderTopicList(c *gin.Context, data *web.TopicListResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPubRender) RenderTweetComments(c *gin.Context, data *web.TweetCommentsResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPubRender) RenderTweetDetail(c *gin.Context, data *web.TweetDetailResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPubRender) RenderSendCaptcha(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedPubRender) RenderGetCaptcha(c *gin.Context, data *web.GetCaptchaResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPubRender) RenderRegister(c *gin.Context, data *web.RegisterResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPubRender) RenderLogin(c *gin.Context, data *web.LoginResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPubRender) RenderVersion(c *gin.Context, data *web.VersionResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedPubRender) mustEmbedUnimplementedPubRender() {} - -// UnimplementedPubBinding can be embedded to have forward compatible implementations. -type UnimplementedPubBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedPubBinding) BindTopicList(c *gin.Context) (*web.TopicListReq, mir.Error) { - obj := new(web.TopicListReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPubBinding) BindTweetComments(c *gin.Context) (*web.TweetCommentsReq, mir.Error) { - obj := new(web.TweetCommentsReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPubBinding) BindTweetDetail(c *gin.Context) (*web.TweetDetailReq, mir.Error) { - obj := new(web.TweetDetailReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPubBinding) BindSendCaptcha(c *gin.Context) (*web.SendCaptchaReq, mir.Error) { - obj := new(web.SendCaptchaReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPubBinding) BindRegister(c *gin.Context) (*web.RegisterReq, mir.Error) { - obj := new(web.RegisterReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPubBinding) BindLogin(c *gin.Context) (*web.LoginReq, mir.Error) { - obj := new(web.LoginReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedPubBinding) mustEmbedUnimplementedPubBinding() {} diff --git a/auto/api/x/v1/user.go b/auto/api/x/v1/user.go index 89a3b086..9de31b49 100644 --- a/auto/api/x/v1/user.go +++ b/auto/api/x/v1/user.go @@ -1,14 +1,29 @@ // Code generated by go-mir. DO NOT EDIT. +// versions: +// - mir v4.0.0 package v1 import ( "net/http" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" ) +type _binding_ interface { + Bind(*gin.Context) mir.Error +} + +type _render_ interface { + Render(*gin.Context) +} + +type _default_ interface { + Bind(*gin.Context, any) mir.Error + Render(*gin.Context, any, mir.Error) +} + type LoginReq struct { AgentInfo AgentInfo `json:"agent_info"` Name string `json:"name"` @@ -35,6 +50,8 @@ type UserInfo struct { } type User interface { + _default_ + // Chain provide handlers chain for gin Chain() gin.HandlersChain @@ -44,21 +61,8 @@ type User interface { mustEmbedUnimplementedUserServant() } -type UserBinding interface { - BindLogin(*gin.Context) (*LoginReq, mir.Error) - - mustEmbedUnimplementedUserBinding() -} - -type UserRender interface { - RenderLogout(*gin.Context, mir.Error) - RenderLogin(*gin.Context, *LoginResp, mir.Error) - - mustEmbedUnimplementedUserRender() -} - // RegisterUserServant register User servant to gin -func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) { +func RegisterUserServant(e *gin.Engine, s User) { router := e.Group("x/v1") // use chain for router middlewares := s.Chain() @@ -72,30 +76,26 @@ func RegisterUserServant(e *gin.Engine, s User, b UserBinding, r UserRender) { default: } - r.RenderLogout(c, s.Logout()) + s.Render(c, nil, s.Logout()) }) - router.Handle("POST", "/user/login/", func(c *gin.Context) { select { case <-c.Request.Context().Done(): return default: } - - req, err := b.BindLogin(c) - if err != nil { - r.RenderLogin(c, nil, err) + req := new(LoginReq) + if err := s.Bind(c, req); err != nil { + s.Render(c, nil, err) return } resp, err := s.Login(req) - r.RenderLogin(c, resp, err) + s.Render(c, resp, err) }) - } // UnimplementedUserServant can be embedded to have forward compatible implementations. -type UnimplementedUserServant struct { -} +type UnimplementedUserServant struct{} func (UnimplementedUserServant) Chain() gin.HandlersChain { return nil @@ -110,31 +110,3 @@ func (UnimplementedUserServant) Login(req *LoginReq) (*LoginResp, mir.Error) { } func (UnimplementedUserServant) mustEmbedUnimplementedUserServant() {} - -// UnimplementedUserRender can be embedded to have forward compatible implementations. -type UnimplementedUserRender struct { - RenderAny func(*gin.Context, any, mir.Error) -} - -func (r *UnimplementedUserRender) RenderLogout(c *gin.Context, err mir.Error) { - r.RenderAny(c, nil, err) -} - -func (r *UnimplementedUserRender) RenderLogin(c *gin.Context, data *LoginResp, err mir.Error) { - r.RenderAny(c, data, err) -} - -func (r *UnimplementedUserRender) mustEmbedUnimplementedUserRender() {} - -// UnimplementedUserBinding can be embedded to have forward compatible implementations. -type UnimplementedUserBinding struct { - BindAny func(*gin.Context, any) mir.Error -} - -func (b *UnimplementedUserBinding) BindLogin(c *gin.Context) (*LoginReq, mir.Error) { - obj := new(LoginReq) - err := b.BindAny(c, obj) - return obj, err -} - -func (b *UnimplementedUserBinding) mustEmbedUnimplementedUserBinding() {} diff --git a/auto/connect/core/v1/corev1connect/auth.connect.go b/auto/connect/core/v1/corev1connect/auth.connect.go new file mode 100644 index 00000000..f15ea068 --- /dev/null +++ b/auto/connect/core/v1/corev1connect/auth.connect.go @@ -0,0 +1,159 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: core/v1/auth.proto + +package corev1connect + +import ( + context "context" + errors "errors" + connect_go "github.com/bufbuild/connect-go" + v1 "github.com/rocboss/paopao-ce/auto/rpc/core/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect_go.IsAtLeastVersion0_1_0 + +const ( + // AuthenticateServiceName is the fully-qualified name of the AuthenticateService service. + AuthenticateServiceName = "core.v1.AuthenticateService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // AuthenticateServicePreLoginProcedure is the fully-qualified name of the AuthenticateService's + // preLogin RPC. + AuthenticateServicePreLoginProcedure = "/core.v1.AuthenticateService/preLogin" + // AuthenticateServiceLoginProcedure is the fully-qualified name of the AuthenticateService's login + // RPC. + AuthenticateServiceLoginProcedure = "/core.v1.AuthenticateService/login" + // AuthenticateServiceLogoutProcedure is the fully-qualified name of the AuthenticateService's + // logout RPC. + AuthenticateServiceLogoutProcedure = "/core.v1.AuthenticateService/logout" +) + +// AuthenticateServiceClient is a client for the core.v1.AuthenticateService service. +type AuthenticateServiceClient interface { + PreLogin(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) + Login(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.LoginReply], error) + Logout(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) +} + +// NewAuthenticateServiceClient constructs a client for the core.v1.AuthenticateService service. By +// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, +// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewAuthenticateServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) AuthenticateServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &authenticateServiceClient{ + preLogin: connect_go.NewClient[v1.User, v1.ActionReply]( + httpClient, + baseURL+AuthenticateServicePreLoginProcedure, + opts..., + ), + login: connect_go.NewClient[v1.User, v1.LoginReply]( + httpClient, + baseURL+AuthenticateServiceLoginProcedure, + opts..., + ), + logout: connect_go.NewClient[v1.User, v1.ActionReply]( + httpClient, + baseURL+AuthenticateServiceLogoutProcedure, + opts..., + ), + } +} + +// authenticateServiceClient implements AuthenticateServiceClient. +type authenticateServiceClient struct { + preLogin *connect_go.Client[v1.User, v1.ActionReply] + login *connect_go.Client[v1.User, v1.LoginReply] + logout *connect_go.Client[v1.User, v1.ActionReply] +} + +// PreLogin calls core.v1.AuthenticateService.preLogin. +func (c *authenticateServiceClient) PreLogin(ctx context.Context, req *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) { + return c.preLogin.CallUnary(ctx, req) +} + +// Login calls core.v1.AuthenticateService.login. +func (c *authenticateServiceClient) Login(ctx context.Context, req *connect_go.Request[v1.User]) (*connect_go.Response[v1.LoginReply], error) { + return c.login.CallUnary(ctx, req) +} + +// Logout calls core.v1.AuthenticateService.logout. +func (c *authenticateServiceClient) Logout(ctx context.Context, req *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) { + return c.logout.CallUnary(ctx, req) +} + +// AuthenticateServiceHandler is an implementation of the core.v1.AuthenticateService service. +type AuthenticateServiceHandler interface { + PreLogin(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) + Login(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.LoginReply], error) + Logout(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) +} + +// NewAuthenticateServiceHandler builds an HTTP handler from the service implementation. It returns +// the path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewAuthenticateServiceHandler(svc AuthenticateServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) { + authenticateServicePreLoginHandler := connect_go.NewUnaryHandler( + AuthenticateServicePreLoginProcedure, + svc.PreLogin, + opts..., + ) + authenticateServiceLoginHandler := connect_go.NewUnaryHandler( + AuthenticateServiceLoginProcedure, + svc.Login, + opts..., + ) + authenticateServiceLogoutHandler := connect_go.NewUnaryHandler( + AuthenticateServiceLogoutProcedure, + svc.Logout, + opts..., + ) + return "/core.v1.AuthenticateService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case AuthenticateServicePreLoginProcedure: + authenticateServicePreLoginHandler.ServeHTTP(w, r) + case AuthenticateServiceLoginProcedure: + authenticateServiceLoginHandler.ServeHTTP(w, r) + case AuthenticateServiceLogoutProcedure: + authenticateServiceLogoutHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedAuthenticateServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedAuthenticateServiceHandler struct{} + +func (UnimplementedAuthenticateServiceHandler) PreLogin(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("core.v1.AuthenticateService.preLogin is not implemented")) +} + +func (UnimplementedAuthenticateServiceHandler) Login(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.LoginReply], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("core.v1.AuthenticateService.login is not implemented")) +} + +func (UnimplementedAuthenticateServiceHandler) Logout(context.Context, *connect_go.Request[v1.User]) (*connect_go.Response[v1.ActionReply], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("core.v1.AuthenticateService.logout is not implemented")) +} diff --git a/auto/connect/greet/v1/greetv1connect/greet.connect.go b/auto/connect/greet/v1/greetv1connect/greet.connect.go new file mode 100644 index 00000000..c06f8e69 --- /dev/null +++ b/auto/connect/greet/v1/greetv1connect/greet.connect.go @@ -0,0 +1,104 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: greet/v1/greet.proto + +package greetv1connect + +import ( + context "context" + errors "errors" + connect_go "github.com/bufbuild/connect-go" + v1 "github.com/rocboss/paopao-ce/auto/rpc/greet/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect_go.IsAtLeastVersion0_1_0 + +const ( + // GreetServiceName is the fully-qualified name of the GreetService service. + GreetServiceName = "greet.v1.GreetService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // GreetServiceGreetProcedure is the fully-qualified name of the GreetService's Greet RPC. + GreetServiceGreetProcedure = "/greet.v1.GreetService/Greet" +) + +// GreetServiceClient is a client for the greet.v1.GreetService service. +type GreetServiceClient interface { + Greet(context.Context, *connect_go.Request[v1.GreetRequest]) (*connect_go.Response[v1.GreetResponse], error) +} + +// NewGreetServiceClient constructs a client for the greet.v1.GreetService service. By default, it +// uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends +// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or +// connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewGreetServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) GreetServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &greetServiceClient{ + greet: connect_go.NewClient[v1.GreetRequest, v1.GreetResponse]( + httpClient, + baseURL+GreetServiceGreetProcedure, + opts..., + ), + } +} + +// greetServiceClient implements GreetServiceClient. +type greetServiceClient struct { + greet *connect_go.Client[v1.GreetRequest, v1.GreetResponse] +} + +// Greet calls greet.v1.GreetService.Greet. +func (c *greetServiceClient) Greet(ctx context.Context, req *connect_go.Request[v1.GreetRequest]) (*connect_go.Response[v1.GreetResponse], error) { + return c.greet.CallUnary(ctx, req) +} + +// GreetServiceHandler is an implementation of the greet.v1.GreetService service. +type GreetServiceHandler interface { + Greet(context.Context, *connect_go.Request[v1.GreetRequest]) (*connect_go.Response[v1.GreetResponse], error) +} + +// NewGreetServiceHandler builds an HTTP handler from the service implementation. It returns the +// path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewGreetServiceHandler(svc GreetServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) { + greetServiceGreetHandler := connect_go.NewUnaryHandler( + GreetServiceGreetProcedure, + svc.Greet, + opts..., + ) + return "/greet.v1.GreetService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case GreetServiceGreetProcedure: + greetServiceGreetHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedGreetServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedGreetServiceHandler struct{} + +func (UnimplementedGreetServiceHandler) Greet(context.Context, *connect_go.Request[v1.GreetRequest]) (*connect_go.Response[v1.GreetResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("greet.v1.GreetService.Greet is not implemented")) +} diff --git a/auto/rpc/core/v1/auth.pb.go b/auto/rpc/core/v1/auth.pb.go new file mode 100644 index 00000000..c3f6fdae --- /dev/null +++ b/auto/rpc/core/v1/auth.pb.go @@ -0,0 +1,375 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: core/v1/auth.proto + +package corev1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PhoneNum string `protobuf:"bytes,1,opt,name=phone_num,json=phoneNum,proto3" json:"phone_num,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_core_v1_auth_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_core_v1_auth_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_core_v1_auth_proto_rawDescGZIP(), []int{0} +} + +func (x *User) GetPhoneNum() string { + if x != nil { + return x.PhoneNum + } + return "" +} + +type UserVerify struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PhoneNum string `protobuf:"bytes,1,opt,name=phone_num,json=phoneNum,proto3" json:"phone_num,omitempty"` + VerificationCode string `protobuf:"bytes,2,opt,name=verification_code,json=verificationCode,proto3" json:"verification_code,omitempty"` +} + +func (x *UserVerify) Reset() { + *x = UserVerify{} + if protoimpl.UnsafeEnabled { + mi := &file_core_v1_auth_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserVerify) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserVerify) ProtoMessage() {} + +func (x *UserVerify) ProtoReflect() protoreflect.Message { + mi := &file_core_v1_auth_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserVerify.ProtoReflect.Descriptor instead. +func (*UserVerify) Descriptor() ([]byte, []int) { + return file_core_v1_auth_proto_rawDescGZIP(), []int{1} +} + +func (x *UserVerify) GetPhoneNum() string { + if x != nil { + return x.PhoneNum + } + return "" +} + +func (x *UserVerify) GetVerificationCode() string { + if x != nil { + return x.VerificationCode + } + return "" +} + +type LoginReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` + Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *LoginReply) Reset() { + *x = LoginReply{} + if protoimpl.UnsafeEnabled { + mi := &file_core_v1_auth_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginReply) ProtoMessage() {} + +func (x *LoginReply) ProtoReflect() protoreflect.Message { + mi := &file_core_v1_auth_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginReply.ProtoReflect.Descriptor instead. +func (*LoginReply) Descriptor() ([]byte, []int) { + return file_core_v1_auth_proto_rawDescGZIP(), []int{2} +} + +func (x *LoginReply) GetStatusCode() int32 { + if x != nil { + return x.StatusCode + } + return 0 +} + +func (x *LoginReply) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +type ActionReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` +} + +func (x *ActionReply) Reset() { + *x = ActionReply{} + if protoimpl.UnsafeEnabled { + mi := &file_core_v1_auth_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActionReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActionReply) ProtoMessage() {} + +func (x *ActionReply) ProtoReflect() protoreflect.Message { + mi := &file_core_v1_auth_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ActionReply.ProtoReflect.Descriptor instead. +func (*ActionReply) Descriptor() ([]byte, []int) { + return file_core_v1_auth_proto_rawDescGZIP(), []int{3} +} + +func (x *ActionReply) GetStatusCode() int32 { + if x != nil { + return x.StatusCode + } + return 0 +} + +var File_core_v1_auth_proto protoreflect.FileDescriptor + +var file_core_v1_auth_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x23, 0x0a, + 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, + 0x75, 0x6d, 0x22, 0x56, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x2b, 0x0a, + 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x43, 0x0a, 0x0a, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, + 0x2e, 0x0a, 0x0b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1f, + 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x32, + 0xa2, 0x01, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x1a, 0x14, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2b, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, + 0x6e, 0x12, 0x0d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, + 0x1a, 0x13, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2d, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, + 0x0d, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x14, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x42, 0x8b, 0x01, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, + 0x63, 0x62, 0x6f, 0x73, 0x73, 0x2f, 0x70, 0x61, 0x6f, 0x70, 0x61, 0x6f, 0x2d, 0x63, 0x65, 0x2f, + 0x61, 0x75, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x63, 0x6f, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x07, + 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x07, 0x43, 0x6f, 0x72, 0x65, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x13, 0x43, 0x6f, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x08, 0x43, 0x6f, 0x72, 0x65, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_core_v1_auth_proto_rawDescOnce sync.Once + file_core_v1_auth_proto_rawDescData = file_core_v1_auth_proto_rawDesc +) + +func file_core_v1_auth_proto_rawDescGZIP() []byte { + file_core_v1_auth_proto_rawDescOnce.Do(func() { + file_core_v1_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_core_v1_auth_proto_rawDescData) + }) + return file_core_v1_auth_proto_rawDescData +} + +var file_core_v1_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_core_v1_auth_proto_goTypes = []interface{}{ + (*User)(nil), // 0: core.v1.User + (*UserVerify)(nil), // 1: core.v1.UserVerify + (*LoginReply)(nil), // 2: core.v1.LoginReply + (*ActionReply)(nil), // 3: core.v1.ActionReply +} +var file_core_v1_auth_proto_depIdxs = []int32{ + 0, // 0: core.v1.AuthenticateService.preLogin:input_type -> core.v1.User + 0, // 1: core.v1.AuthenticateService.login:input_type -> core.v1.User + 0, // 2: core.v1.AuthenticateService.logout:input_type -> core.v1.User + 3, // 3: core.v1.AuthenticateService.preLogin:output_type -> core.v1.ActionReply + 2, // 4: core.v1.AuthenticateService.login:output_type -> core.v1.LoginReply + 3, // 5: core.v1.AuthenticateService.logout:output_type -> core.v1.ActionReply + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_core_v1_auth_proto_init() } +func file_core_v1_auth_proto_init() { + if File_core_v1_auth_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_core_v1_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_core_v1_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserVerify); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_core_v1_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_core_v1_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ActionReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_core_v1_auth_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_core_v1_auth_proto_goTypes, + DependencyIndexes: file_core_v1_auth_proto_depIdxs, + MessageInfos: file_core_v1_auth_proto_msgTypes, + }.Build() + File_core_v1_auth_proto = out.File + file_core_v1_auth_proto_rawDesc = nil + file_core_v1_auth_proto_goTypes = nil + file_core_v1_auth_proto_depIdxs = nil +} diff --git a/auto/rpc/core/v1/auth_grpc.pb.go b/auto/rpc/core/v1/auth_grpc.pb.go new file mode 100644 index 00000000..7cec3d85 --- /dev/null +++ b/auto/rpc/core/v1/auth_grpc.pb.go @@ -0,0 +1,183 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: core/v1/auth.proto + +package corev1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + AuthenticateService_PreLogin_FullMethodName = "/core.v1.AuthenticateService/preLogin" + AuthenticateService_Login_FullMethodName = "/core.v1.AuthenticateService/login" + AuthenticateService_Logout_FullMethodName = "/core.v1.AuthenticateService/logout" +) + +// AuthenticateServiceClient is the client API for AuthenticateService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AuthenticateServiceClient interface { + PreLogin(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) + Login(ctx context.Context, in *User, opts ...grpc.CallOption) (*LoginReply, error) + Logout(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) +} + +type authenticateServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAuthenticateServiceClient(cc grpc.ClientConnInterface) AuthenticateServiceClient { + return &authenticateServiceClient{cc} +} + +func (c *authenticateServiceClient) PreLogin(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) { + out := new(ActionReply) + err := c.cc.Invoke(ctx, AuthenticateService_PreLogin_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authenticateServiceClient) Login(ctx context.Context, in *User, opts ...grpc.CallOption) (*LoginReply, error) { + out := new(LoginReply) + err := c.cc.Invoke(ctx, AuthenticateService_Login_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authenticateServiceClient) Logout(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) { + out := new(ActionReply) + err := c.cc.Invoke(ctx, AuthenticateService_Logout_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AuthenticateServiceServer is the server API for AuthenticateService service. +// All implementations must embed UnimplementedAuthenticateServiceServer +// for forward compatibility +type AuthenticateServiceServer interface { + PreLogin(context.Context, *User) (*ActionReply, error) + Login(context.Context, *User) (*LoginReply, error) + Logout(context.Context, *User) (*ActionReply, error) + mustEmbedUnimplementedAuthenticateServiceServer() +} + +// UnimplementedAuthenticateServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAuthenticateServiceServer struct { +} + +func (UnimplementedAuthenticateServiceServer) PreLogin(context.Context, *User) (*ActionReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method PreLogin not implemented") +} +func (UnimplementedAuthenticateServiceServer) Login(context.Context, *User) (*LoginReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") +} +func (UnimplementedAuthenticateServiceServer) Logout(context.Context, *User) (*ActionReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented") +} +func (UnimplementedAuthenticateServiceServer) mustEmbedUnimplementedAuthenticateServiceServer() {} + +// UnsafeAuthenticateServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AuthenticateServiceServer will +// result in compilation errors. +type UnsafeAuthenticateServiceServer interface { + mustEmbedUnimplementedAuthenticateServiceServer() +} + +func RegisterAuthenticateServiceServer(s grpc.ServiceRegistrar, srv AuthenticateServiceServer) { + s.RegisterService(&AuthenticateService_ServiceDesc, srv) +} + +func _AuthenticateService_PreLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(User) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthenticateServiceServer).PreLogin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthenticateService_PreLogin_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthenticateServiceServer).PreLogin(ctx, req.(*User)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthenticateService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(User) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthenticateServiceServer).Login(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthenticateService_Login_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthenticateServiceServer).Login(ctx, req.(*User)) + } + return interceptor(ctx, in, info, handler) +} + +func _AuthenticateService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(User) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthenticateServiceServer).Logout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthenticateService_Logout_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthenticateServiceServer).Logout(ctx, req.(*User)) + } + return interceptor(ctx, in, info, handler) +} + +// AuthenticateService_ServiceDesc is the grpc.ServiceDesc for AuthenticateService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AuthenticateService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "core.v1.AuthenticateService", + HandlerType: (*AuthenticateServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "preLogin", + Handler: _AuthenticateService_PreLogin_Handler, + }, + { + MethodName: "login", + Handler: _AuthenticateService_Login_Handler, + }, + { + MethodName: "logout", + Handler: _AuthenticateService_Logout_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "core/v1/auth.proto", +} diff --git a/auto/rpc/greet/v1/greet.pb.go b/auto/rpc/greet/v1/greet.pb.go new file mode 100644 index 00000000..ca79b86e --- /dev/null +++ b/auto/rpc/greet/v1/greet.pb.go @@ -0,0 +1,220 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: greet/v1/greet.proto + +package greetv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GreetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GreetRequest) Reset() { + *x = GreetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greet_v1_greet_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GreetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GreetRequest) ProtoMessage() {} + +func (x *GreetRequest) ProtoReflect() protoreflect.Message { + mi := &file_greet_v1_greet_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GreetRequest.ProtoReflect.Descriptor instead. +func (*GreetRequest) Descriptor() ([]byte, []int) { + return file_greet_v1_greet_proto_rawDescGZIP(), []int{0} +} + +func (x *GreetRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GreetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"` +} + +func (x *GreetResponse) Reset() { + *x = GreetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greet_v1_greet_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GreetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GreetResponse) ProtoMessage() {} + +func (x *GreetResponse) ProtoReflect() protoreflect.Message { + mi := &file_greet_v1_greet_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GreetResponse.ProtoReflect.Descriptor instead. +func (*GreetResponse) Descriptor() ([]byte, []int) { + return file_greet_v1_greet_proto_rawDescGZIP(), []int{1} +} + +func (x *GreetResponse) GetGreeting() string { + if x != nil { + return x.Greeting + } + return "" +} + +var File_greet_v1_greet_proto protoreflect.FileDescriptor + +var file_greet_v1_greet_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x65, 0x65, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2e, 0x76, 0x31, + 0x22, 0x22, 0x0a, 0x0c, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2b, 0x0a, 0x0d, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x69, 0x6e, + 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x65, 0x65, 0x74, 0x69, 0x6e, + 0x67, 0x32, 0x4a, 0x0a, 0x0c, 0x47, 0x72, 0x65, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x3a, 0x0a, 0x05, 0x47, 0x72, 0x65, 0x65, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x72, 0x65, + 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, + 0x65, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x93, 0x01, + 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, + 0x47, 0x72, 0x65, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x6f, 0x63, 0x62, 0x6f, 0x73, 0x73, + 0x2f, 0x70, 0x61, 0x6f, 0x70, 0x61, 0x6f, 0x2d, 0x63, 0x65, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x2f, + 0x72, 0x70, 0x63, 0x2f, 0x67, 0x72, 0x65, 0x65, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x72, 0x65, + 0x65, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x47, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x47, 0x72, 0x65, + 0x65, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x47, 0x72, 0x65, 0x65, 0x74, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x14, 0x47, 0x72, 0x65, 0x65, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x47, 0x72, 0x65, 0x65, 0x74, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_greet_v1_greet_proto_rawDescOnce sync.Once + file_greet_v1_greet_proto_rawDescData = file_greet_v1_greet_proto_rawDesc +) + +func file_greet_v1_greet_proto_rawDescGZIP() []byte { + file_greet_v1_greet_proto_rawDescOnce.Do(func() { + file_greet_v1_greet_proto_rawDescData = protoimpl.X.CompressGZIP(file_greet_v1_greet_proto_rawDescData) + }) + return file_greet_v1_greet_proto_rawDescData +} + +var file_greet_v1_greet_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_greet_v1_greet_proto_goTypes = []interface{}{ + (*GreetRequest)(nil), // 0: greet.v1.GreetRequest + (*GreetResponse)(nil), // 1: greet.v1.GreetResponse +} +var file_greet_v1_greet_proto_depIdxs = []int32{ + 0, // 0: greet.v1.GreetService.Greet:input_type -> greet.v1.GreetRequest + 1, // 1: greet.v1.GreetService.Greet:output_type -> greet.v1.GreetResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_greet_v1_greet_proto_init() } +func file_greet_v1_greet_proto_init() { + if File_greet_v1_greet_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_greet_v1_greet_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GreetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greet_v1_greet_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GreetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_greet_v1_greet_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_greet_v1_greet_proto_goTypes, + DependencyIndexes: file_greet_v1_greet_proto_depIdxs, + MessageInfos: file_greet_v1_greet_proto_msgTypes, + }.Build() + File_greet_v1_greet_proto = out.File + file_greet_v1_greet_proto_rawDesc = nil + file_greet_v1_greet_proto_goTypes = nil + file_greet_v1_greet_proto_depIdxs = nil +} diff --git a/auto/rpc/greet/v1/greet_grpc.pb.go b/auto/rpc/greet/v1/greet_grpc.pb.go new file mode 100644 index 00000000..f1667a54 --- /dev/null +++ b/auto/rpc/greet/v1/greet_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: greet/v1/greet.proto + +package greetv1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + GreetService_Greet_FullMethodName = "/greet.v1.GreetService/Greet" +) + +// GreetServiceClient is the client API for GreetService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type GreetServiceClient interface { + Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error) +} + +type greetServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewGreetServiceClient(cc grpc.ClientConnInterface) GreetServiceClient { + return &greetServiceClient{cc} +} + +func (c *greetServiceClient) Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error) { + out := new(GreetResponse) + err := c.cc.Invoke(ctx, GreetService_Greet_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// GreetServiceServer is the server API for GreetService service. +// All implementations must embed UnimplementedGreetServiceServer +// for forward compatibility +type GreetServiceServer interface { + Greet(context.Context, *GreetRequest) (*GreetResponse, error) + mustEmbedUnimplementedGreetServiceServer() +} + +// UnimplementedGreetServiceServer must be embedded to have forward compatible implementations. +type UnimplementedGreetServiceServer struct { +} + +func (UnimplementedGreetServiceServer) Greet(context.Context, *GreetRequest) (*GreetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Greet not implemented") +} +func (UnimplementedGreetServiceServer) mustEmbedUnimplementedGreetServiceServer() {} + +// UnsafeGreetServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to GreetServiceServer will +// result in compilation errors. +type UnsafeGreetServiceServer interface { + mustEmbedUnimplementedGreetServiceServer() +} + +func RegisterGreetServiceServer(s grpc.ServiceRegistrar, srv GreetServiceServer) { + s.RegisterService(&GreetService_ServiceDesc, srv) +} + +func _GreetService_Greet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GreetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreetServiceServer).Greet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: GreetService_Greet_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreetServiceServer).Greet(ctx, req.(*GreetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// GreetService_ServiceDesc is the grpc.ServiceDesc for GreetService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var GreetService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "greet.v1.GreetService", + HandlerType: (*GreetServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Greet", + Handler: _GreetService_Greet_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "greet/v1/greet.proto", +} diff --git a/auto/rpc/v1/auth.pb.go b/auto/rpc/v1/auth.pb.go deleted file mode 100644 index ab5109a6..00000000 --- a/auto/rpc/v1/auth.pb.go +++ /dev/null @@ -1,371 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: v1/auth.proto - -package v1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PhoneNum string `protobuf:"bytes,1,opt,name=phoneNum,proto3" json:"phoneNum,omitempty"` -} - -func (x *User) Reset() { - *x = User{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_auth_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *User) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*User) ProtoMessage() {} - -func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_v1_auth_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use User.ProtoReflect.Descriptor instead. -func (*User) Descriptor() ([]byte, []int) { - return file_v1_auth_proto_rawDescGZIP(), []int{0} -} - -func (x *User) GetPhoneNum() string { - if x != nil { - return x.PhoneNum - } - return "" -} - -type UserVerify struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PhoneNum string `protobuf:"bytes,1,opt,name=phoneNum,proto3" json:"phoneNum,omitempty"` - VerificationCode string `protobuf:"bytes,2,opt,name=VerificationCode,proto3" json:"VerificationCode,omitempty"` -} - -func (x *UserVerify) Reset() { - *x = UserVerify{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_auth_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserVerify) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserVerify) ProtoMessage() {} - -func (x *UserVerify) ProtoReflect() protoreflect.Message { - mi := &file_v1_auth_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserVerify.ProtoReflect.Descriptor instead. -func (*UserVerify) Descriptor() ([]byte, []int) { - return file_v1_auth_proto_rawDescGZIP(), []int{1} -} - -func (x *UserVerify) GetPhoneNum() string { - if x != nil { - return x.PhoneNum - } - return "" -} - -func (x *UserVerify) GetVerificationCode() string { - if x != nil { - return x.VerificationCode - } - return "" -} - -type LoginReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - StatuCode int32 `protobuf:"varint,1,opt,name=statuCode,proto3" json:"statuCode,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` -} - -func (x *LoginReply) Reset() { - *x = LoginReply{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_auth_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoginReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoginReply) ProtoMessage() {} - -func (x *LoginReply) ProtoReflect() protoreflect.Message { - mi := &file_v1_auth_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LoginReply.ProtoReflect.Descriptor instead. -func (*LoginReply) Descriptor() ([]byte, []int) { - return file_v1_auth_proto_rawDescGZIP(), []int{2} -} - -func (x *LoginReply) GetStatuCode() int32 { - if x != nil { - return x.StatuCode - } - return 0 -} - -func (x *LoginReply) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -type ActionReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - StatusCode int32 `protobuf:"varint,1,opt,name=statusCode,proto3" json:"statusCode,omitempty"` -} - -func (x *ActionReply) Reset() { - *x = ActionReply{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_auth_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ActionReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ActionReply) ProtoMessage() {} - -func (x *ActionReply) ProtoReflect() protoreflect.Message { - mi := &file_v1_auth_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ActionReply.ProtoReflect.Descriptor instead. -func (*ActionReply) Descriptor() ([]byte, []int) { - return file_v1_auth_proto_rawDescGZIP(), []int{3} -} - -func (x *ActionReply) GetStatusCode() int32 { - if x != nil { - return x.StatusCode - } - return 0 -} - -var File_v1_auth_proto protoreflect.FileDescriptor - -var file_v1_auth_proto_rawDesc = []byte{ - 0x0a, 0x0d, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x04, 0x61, 0x75, 0x74, 0x68, 0x22, 0x22, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a, - 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x22, 0x54, 0x0a, 0x0a, 0x55, 0x73, 0x65, - 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, - 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65, - 0x4e, 0x75, 0x6d, 0x12, 0x2a, 0x0a, 0x10, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x56, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x22, - 0x40, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, 0x0a, - 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x75, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x22, 0x2d, 0x0a, 0x0b, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, - 0x32, 0x89, 0x01, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x12, 0x29, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x0a, 0x2e, - 0x61, 0x75, 0x74, 0x68, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x11, 0x2e, 0x61, 0x75, 0x74, 0x68, - 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x05, - 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x0a, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x1a, 0x10, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x12, 0x27, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x0a, 0x2e, - 0x61, 0x75, 0x74, 0x68, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x11, 0x2e, 0x61, 0x75, 0x74, 0x68, - 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x6f, 0x0a, 0x08, - 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x42, 0x09, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x72, 0x6f, 0x63, 0x62, 0x6f, 0x73, 0x73, 0x2f, 0x70, 0x61, 0x6f, 0x70, 0x61, 0x6f, - 0x2d, 0x63, 0x65, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0xa2, - 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x04, 0x41, 0x75, 0x74, 0x68, 0xca, 0x02, 0x04, 0x41, - 0x75, 0x74, 0x68, 0xe2, 0x02, 0x10, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x04, 0x41, 0x75, 0x74, 0x68, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_v1_auth_proto_rawDescOnce sync.Once - file_v1_auth_proto_rawDescData = file_v1_auth_proto_rawDesc -) - -func file_v1_auth_proto_rawDescGZIP() []byte { - file_v1_auth_proto_rawDescOnce.Do(func() { - file_v1_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_auth_proto_rawDescData) - }) - return file_v1_auth_proto_rawDescData -} - -var file_v1_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_v1_auth_proto_goTypes = []interface{}{ - (*User)(nil), // 0: auth.User - (*UserVerify)(nil), // 1: auth.UserVerify - (*LoginReply)(nil), // 2: auth.LoginReply - (*ActionReply)(nil), // 3: auth.ActionReply -} -var file_v1_auth_proto_depIdxs = []int32{ - 0, // 0: auth.Authenticate.preLogin:input_type -> auth.User - 0, // 1: auth.Authenticate.login:input_type -> auth.User - 0, // 2: auth.Authenticate.logout:input_type -> auth.User - 3, // 3: auth.Authenticate.preLogin:output_type -> auth.ActionReply - 2, // 4: auth.Authenticate.login:output_type -> auth.LoginReply - 3, // 5: auth.Authenticate.logout:output_type -> auth.ActionReply - 3, // [3:6] is the sub-list for method output_type - 0, // [0:3] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_v1_auth_proto_init() } -func file_v1_auth_proto_init() { - if File_v1_auth_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_v1_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*User); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserVerify); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoginReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ActionReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v1_auth_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_v1_auth_proto_goTypes, - DependencyIndexes: file_v1_auth_proto_depIdxs, - MessageInfos: file_v1_auth_proto_msgTypes, - }.Build() - File_v1_auth_proto = out.File - file_v1_auth_proto_rawDesc = nil - file_v1_auth_proto_goTypes = nil - file_v1_auth_proto_depIdxs = nil -} diff --git a/auto/rpc/v1/auth_grpc.pb.go b/auto/rpc/v1/auth_grpc.pb.go deleted file mode 100644 index 64fdc1d1..00000000 --- a/auto/rpc/v1/auth_grpc.pb.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) -// source: v1/auth.proto - -package v1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// AuthenticateClient is the client API for Authenticate service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type AuthenticateClient interface { - PreLogin(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) - Login(ctx context.Context, in *User, opts ...grpc.CallOption) (*LoginReply, error) - Logout(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) -} - -type authenticateClient struct { - cc grpc.ClientConnInterface -} - -func NewAuthenticateClient(cc grpc.ClientConnInterface) AuthenticateClient { - return &authenticateClient{cc} -} - -func (c *authenticateClient) PreLogin(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) { - out := new(ActionReply) - err := c.cc.Invoke(ctx, "/auth.Authenticate/preLogin", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authenticateClient) Login(ctx context.Context, in *User, opts ...grpc.CallOption) (*LoginReply, error) { - out := new(LoginReply) - err := c.cc.Invoke(ctx, "/auth.Authenticate/login", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authenticateClient) Logout(ctx context.Context, in *User, opts ...grpc.CallOption) (*ActionReply, error) { - out := new(ActionReply) - err := c.cc.Invoke(ctx, "/auth.Authenticate/logout", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AuthenticateServer is the server API for Authenticate service. -// All implementations must embed UnimplementedAuthenticateServer -// for forward compatibility -type AuthenticateServer interface { - PreLogin(context.Context, *User) (*ActionReply, error) - Login(context.Context, *User) (*LoginReply, error) - Logout(context.Context, *User) (*ActionReply, error) - mustEmbedUnimplementedAuthenticateServer() -} - -// UnimplementedAuthenticateServer must be embedded to have forward compatible implementations. -type UnimplementedAuthenticateServer struct { -} - -func (UnimplementedAuthenticateServer) PreLogin(context.Context, *User) (*ActionReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method PreLogin not implemented") -} -func (UnimplementedAuthenticateServer) Login(context.Context, *User) (*LoginReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") -} -func (UnimplementedAuthenticateServer) Logout(context.Context, *User) (*ActionReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented") -} -func (UnimplementedAuthenticateServer) mustEmbedUnimplementedAuthenticateServer() {} - -// UnsafeAuthenticateServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AuthenticateServer will -// result in compilation errors. -type UnsafeAuthenticateServer interface { - mustEmbedUnimplementedAuthenticateServer() -} - -func RegisterAuthenticateServer(s grpc.ServiceRegistrar, srv AuthenticateServer) { - s.RegisterService(&Authenticate_ServiceDesc, srv) -} - -func _Authenticate_PreLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(User) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthenticateServer).PreLogin(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/auth.Authenticate/preLogin", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthenticateServer).PreLogin(ctx, req.(*User)) - } - return interceptor(ctx, in, info, handler) -} - -func _Authenticate_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(User) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthenticateServer).Login(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/auth.Authenticate/login", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthenticateServer).Login(ctx, req.(*User)) - } - return interceptor(ctx, in, info, handler) -} - -func _Authenticate_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(User) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthenticateServer).Logout(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/auth.Authenticate/logout", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthenticateServer).Logout(ctx, req.(*User)) - } - return interceptor(ctx, in, info, handler) -} - -// Authenticate_ServiceDesc is the grpc.ServiceDesc for Authenticate service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Authenticate_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "auth.Authenticate", - HandlerType: (*AuthenticateServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "preLogin", - Handler: _Authenticate_PreLogin_Handler, - }, - { - MethodName: "login", - Handler: _Authenticate_Login_Handler, - }, - { - MethodName: "logout", - Handler: _Authenticate_Logout_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "v1/auth.proto", -} diff --git a/buf.gen.yaml b/buf.gen.yaml index bf9ba452..5de35a1f 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -14,3 +14,6 @@ plugins: opt: - paths=source_relative - require_unimplemented_servers=true + - plugin: connect-go + out: auto/connect + opt: paths=source_relative diff --git a/build-image.sh b/build-image.sh new file mode 100755 index 00000000..dba722d3 --- /dev/null +++ b/build-image.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# eg.1 : sh build-image.sh +# eg.2, set image: sh build-image.sh bitbus/paopao-ce + +VERSION=`git describe --tags --always | cut -f1 -f2 -d "-"` # eg.: 0.2.5 +IMAGE="bitbus/paopao-ce" + +if [ -n "$1" ]; then + IMAGE="$1" +fi +if [ -n "$2" ]; then + VERSION="$2" +fi + +# build image +docker buildx build \ + --build-arg USE_DIST="yes" \ + --tag "$IMAGE:${VERSION}" \ + --tag "$IMAGE:latest" \ + . -f Dockerfile + +# push to image rep +# if [ -n "$1" ]; then +# docker push "$IMAGE:${VERSION}" +# docker push "$IMAGE:latest" +# fi diff --git a/build-release.sh b/build-release.sh new file mode 100755 index 00000000..9530c07f --- /dev/null +++ b/build-release.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# eg.1 : sh build-image.sh +# eg.2, set tags: sh build-image.sh 'embed go_json' + +TAGS='embed go_json' + +if [ -n "$1" ]; then + TAGS="$1" +fi + +make release CGO_ENABLED=0 TAGS="$TAGS" diff --git a/config.yaml.sample b/config.yaml.sample index ec33d9eb..0617a717 100644 --- a/config.yaml.sample +++ b/config.yaml.sample @@ -8,23 +8,23 @@ App: # APP基础设置项 Server: # 服务设置 RunMode: debug HttpIp: 0.0.0.0 - HttpPort: 8008 + HttpPort: 8010 ReadTimeout: 60 WriteTimeout: 60 Features: - Default: ["Base", "MySQL", "Option", "Zinc", "LocalOSS", "LoggerFile", "Friendship", "Deprecated"] + Default: ["Web", "Frontend:EmbedWeb", "Zinc", "LocalOSS", "MySQL", "BigCacheIndex", "LoggerZinc", "Friendship"] Develop: ["Base", "MySQL", "BigCacheIndex", "Meili", "Sms", "AliOSS", "LoggerMeili", "OSS:Retention"] Demo: ["Base", "MySQL", "Option", "Zinc", "Sms", "MinIO", "LoggerZinc", "Migration"] Slim: ["Base", "Sqlite3", "LocalOSS", "LoggerFile", "OSS:TempDir"] Base: ["Redis", "PhoneBind"] Docs: ["Docs:OpenAPI"] Deprecated: ["Deprecated:OldWeb"] - Service: ["Web", "Admin", "SpaceX", "Bot", "LocalOSS", "Mobile", "Frontend:Web", "Fronetend:EmbedWeb", "Docs"] + Service: ["Web", "Admin", "SpaceX", "Bot", "LocalOSS", "Mobile", "Frontend:Web", "Frontend:EmbedWeb", "Docs"] Option: ["SimpleCacheIndex"] Sms: "SmsJuhe" WebServer: # Web服务 HttpIp: 0.0.0.0 - HttpPort: 8010 + HttpPort: 8008 ReadTimeout: 60 WriteTimeout: 60 AdminServer: # Admin后台运维服务 @@ -84,7 +84,7 @@ BigCacheIndex: # 使用BigCache缓存泡泡广场消息流 Logger: # 日志通用配置 Level: debug # 日志级别 panic|fatal|error|warn|info|debug|trace LoggerFile: # 使用File写日志 - SavePath: data/paopao-ce/logs + SavePath: custom/data/paopao-ce/logs FileName: app FileExt: .log LoggerZinc: # 使用Zinc写日志 @@ -154,7 +154,7 @@ S3: # Amazon S3 存储配置 Bucket: paopao Domain: LocalOSS: # 本地文件OSS存储配置 - SavePath: data/paopao-ce/oss + SavePath: custom/data/paopao-ce/oss Secure: False Bucket: paopao Domain: 127.0.0.1:8008 @@ -179,9 +179,8 @@ Postgres: # PostgreSQL数据库 SSLMode: disable TimeZone: Asia/Shanghai Sqlite3: # Sqlite3数据库 - Path: data/sqlite3/paopao-ce.db + Path: custom/data/sqlite3/paopao-ce.db Redis: - Host: redis:6379 - Password: - DB: + InitAddress: + - redis:6379 \ No newline at end of file diff --git a/default.pgo b/default.pgo new file mode 100644 index 00000000..a4f2bc98 Binary files /dev/null and b/default.pgo differ diff --git a/deployed-sites.md b/deployed-sites.md new file mode 100644 index 00000000..a5ea4e8d --- /dev/null +++ b/deployed-sites.md @@ -0,0 +1,9 @@ +## 部署站点 +PaoPao部署站点信息。 + +| 名称 | 网址 | 站长 | 备注 | +| ----- | ----- | ----- | ----- | +|泡泡|[www.paopao.info](https://www.paopao.info)|[ROC](https://www.paopao.info/#/user?username=roc 'roc(@paopao.info)')|PaoPao官方站点| +|布里塔|[bulita.cn](https://bulita.cn)|[chendong](https://www.paopao.info/#/user?username=chendong 'chendong(@paopao.info)')|招聘求职等信息| +|提示词社区|[promptser.cn](https://promptser.cn)|[henryspace](https://paopao.info/#/user?username=henryspace 'henryspace(@paopao.info)')|提示词社区| +|iiBiuBiu|[iibiubiu.com](https://iibiubiu.com)|[北野](https://www.paopao.info/#/user?username=alimy 'alimy(@paopao.info)')|开发、测试备用机,可以体验最新版本paopao-ce| diff --git a/docker-compose.yaml b/docker-compose.yaml index d458f94e..45bb0d82 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -11,9 +11,9 @@ services: MYSQL_RANDOM_ROOT_PASSWORD: yes volumes: - ./scripts/paopao-mysql.sql:/docker-entrypoint-initdb.d/paopao.sql - - ./data/mysql/data:/var/lib/mysql + - ./custom/data/mysql/data:/var/lib/mysql ports: - - 127.0.0.1::3306 + - 3306:3306 networks: - paopao-network @@ -28,15 +28,26 @@ services: # - 9000:9000 # - 9001:9001 # volumes: - # - ./data/minio/data:/data + # - ./custom/data/minio/data:/data + # networks: + # - paopao-network + + # redis: + # image: redis:7.0-alpine + # restart: always + # ports: + # - 6379:6379 # networks: # - paopao-network redis: - image: redis:7.0-alpine + image: redis/redis-stack:7.0.6-RC8 restart: always ports: - 6379:6379 + - 8001:8001 + environment: + REDISEARCH_ARGS: "MAXSEARCHRESULTS 5" networks: - paopao-network @@ -47,7 +58,7 @@ services: ports: - 4080:4080 volumes: - - ./data/zinc/data:/data + - ./custom/data/zinc/data:/data environment: ZINC_FIRST_ADMIN_USER: admin ZINC_FIRST_ADMIN_PASSWORD: admin @@ -56,23 +67,24 @@ services: - paopao-network # meili: - # image: getmeili/meilisearch:v0.29.0 + # image: getmeili/meilisearch:v1.2 # restart: always # ports: # - 7700:7700 # volumes: - # - ./data/meili/data:/meili_data + # - ./custom/data/meili/data:/meili_data # environment: # - MEILI_MASTER_KEY=paopao-meilisearch # networks: # - paopao-network - - # # a ui for managing your meilisearch instances - # uirecord: - # image: bitriory/uirecord:latest + + # pyroscope: + # image: pyroscope/pyroscope:latest # restart: always # ports: - # - 7701:3000 + # - 4040:4040 + # command: + # - 'server' # networks: # - paopao-network @@ -90,8 +102,7 @@ services: - paopao-network backend: - build: - context: . + image: bitbus/paopao-ce:0.3 restart: always depends_on: - db @@ -100,7 +111,7 @@ services: # modify below to reflect your custom configure volumes: - ./config.yaml.sample:/app/paopao-ce/config.yaml - - ./data/paopao-ce/data:/app/paopao-ce/data + - ./custom:/app/paopao-ce/custom ports: - 8008:8008 networks: diff --git a/docs/deploy/core/001-配置文件说明.md b/docs/deploy/core/001-配置文件说明.md index b1af7e2b..29282f01 100644 --- a/docs/deploy/core/001-配置文件说明.md +++ b/docs/deploy/core/001-配置文件说明.md @@ -56,13 +56,15 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r 目前支持的功能集合: | 功能项 | 类别 | 状态 | 备注 | | ----- | ----- | ----- | ----- | -|`OldWeb` | 子服务 | 稳定(默认) | 开启旧的Web服务 | -|`Web` | 子服务 | WIP | 开启Web服务| +|`Web` | 子服务 | 内测 | 开启Web服务| |`Admin` | 子服务 | WIP | 开启Admin后台运维服务| |`SpaceX` | 子服务 | WIP | 开启SpaceX服务| |`Bot` | 子服务 | WIP | 开启Bot服务| |`NativeOBS` | 子服务 | WIP | 开启NativeOBS服务| -|`Deprecated:Web` | 子服务 | 稳定 | Deprecated(关闭) OldWeb服务| +|`Docs` | 子服务 | WIP | 开启开发者文档服务| +|`Frontend:Web` | 子服务 | 稳定 | 开启独立前端服务| +|`Frontend:EmbedWeb` | 子服务 | 稳定 | 开启内嵌于后端Web API服务中的前端服务| +|`Deprecated:Web` | 子服务 | 稳定 | 开启旧的Web服务| |`Gorm` | 数据库 | 稳定(默认) | 使用[gorm](https://github.com/go-gorm/gorm)作为数据库的ORM,默认使用 `Gorm` + `MySQL`组合| |`Sqlx`| 数据库 | WIP | 使用[sqlx](https://github.com/jmoiron/sqlx)作为数据库的ORM| |`MySQL`| 数据库 | 稳定(默认) | 使用MySQL作为数据库| @@ -77,7 +79,7 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r |`OSS:Retention` | 对象存储 | 内测 |基于对象存储系统的对象过期自动删除特性实现 先创建临时对象再持久化的功能| |`OSS:TempDir` | 对象存储 | 内测 |基于对象存储系统的对象拷贝/移动特性实现 先创建临时对象再持久化的功能| |`Redis` | 缓存 | 稳定 | Redis缓存功能 | -|`SimpleCacheIndex` | 缓存 | 稳定 | 提供简单的 广场推文列表 的缓存功能 | +|`SimpleCacheIndex` | 缓存 | Deprecated | 提供简单的 广场推文列表 的缓存功能 | |`BigCacheIndex` | 缓存 | 稳定(推荐) | 使用[BigCache](https://github.com/allegro/bigcache)缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面 | |`Zinc` | 搜索 | 稳定(推荐) | 基于[Zinc](https://github.com/zinclabs/zinc)搜索引擎提供推文搜索服务 | |`Meili` | 搜索 | 稳定(推荐) | 基于[Meilisearch](https://github.com/meilisearch/meilisearch)搜索引擎提供推文搜索服务 | @@ -85,11 +87,65 @@ release/paopao-ce --no-default-features --features sqlite3,localoss,loggerfile,r |`LoggerFile` | 日志 | 稳定 | 使用文件写日志 | |`LoggerZinc` | 日志 | 稳定(推荐) | 使用[Zinc](https://github.com/zinclabs/zinc)写日志 | |`LoggerMeili` | 日志 | 内测 | 使用[Meilisearch](https://github.com/meilisearch/meilisearch)写日志 | -|`Friendship` | 关系模式 | 内测(默认) | 弱关系好友模式,类似微信朋友圈 | -|`Followship` | 关系模式 | WIP | 关注者模式,类似Twitter的Follow模式 | +|[`Friendship`](../../docs/proposal/002-关于Friendship功能项的设计.md) | 关系模式 | 内测 | 弱关系好友模式,类似微信朋友圈 | +|[`Followship`](../../docs/proposal/003-关于Followship功能项的设计.md) | 关系模式 | WIP | 关注者模式,类似Twitter的Follow模式 | +|[`Lightship`](../../docs/proposal/011-关于Lightship功能项的设计.md) | 关系模式 | 内测(默认) | 开放模式,所有推文都公开可见 | |`Alipay` | 支付 | 稳定 | 开启基于[支付宝开放平台](https://open.alipay.com/)的钱包功能 | |`Sms` | 短信验证 | 稳定 | 开启短信验证码功能,用于手机绑定验证手机是否注册者的;功能如果没有开启,手机绑定时任意短信验证码都可以绑定手机 | |`Docs:OpenAPI` | 开发文档 | 稳定 | 开启openapi文档功能,提供web api文档说明(visit http://127.0.0.1:8008/docs/openapi) | |`PhoneBind` | 其他 | 稳定 | 手机绑定功能 | +|`Web:DisallowUserRegister` | 功能特性 | 稳定 | 不允许用户注册 | > 功能项状态详情参考 [features-status](../../../features-status.md). + +### 按需添加自定义配置 +paopao-ce提供了按需添加配置的机制,paopao-ce在internal/conf/config.yaml中内嵌了一份完整的默认配置,内嵌的默认配置与自定义配置config.yaml在paopao-ce启动时自动进行了配置项合并,自定义的配置(./config.yaml或者./custom/config.yaml)中只需要自定义 运行时 声明Features 的相应配置即可。比如只运行Web 子服务,config.yaml可以只包含如下配置(其他配置使用默认值): +```yaml +# file: config.yaml + +Features: + Default: ["Sqlite3", "Zinc", "LocalOSS", "BigCacheIndex", "Web"] +WebServer: # Web服务 + HttpIp: 0.0.0.0 + HttpPort: 8010 + ReadTimeout: 60 + WriteTimeout: 60 +LocalOSS: # 本地文件OSS存储配置 + SavePath: data/paopao-ce/oss + Secure: True + Bucket: paopao + Domain: api.paopao.info +Zinc: # Zinc搜索配置 + Host: 127.0.0.1:4080 + Index: paopao-data + User: admin + Password: admin + Secure: False +``` +部署paopao-ce实例时,可以按需自定义配置运行时所需的配置项, 多个实例部署可以使用不同配置项组合,运行不同的子服务,再通过一个统一的 Proxy(Nginx或云端proxy) 将请求桥接到具体的paopao-ce部署实例。 + +### 多服务同端口运行 +paopao-ce提供的机制是各个子服务(gRPC/RESTful API服务)可以在一个独立端口提供业务服务,也可以多个同类型的子服务(RESTful API服务 或者 gRPC 服务)共享同一个端口提供服务,比如 Web/Admin/Bot 三个子服务在8010端口提供服务, 只需要配置三个子服务的HttpIp/HttpPort为相同值即可: +```yaml +# file: config.yaml + +Features: + Default: ["Sqlite3", "Zinc", "LocalOSS", "BigCacheIndex", "Web", "Admin", "Bot"] +WebServer: # Web服务 + HttpIp: 0.0.0.0 + HttpPort: 8010 + ReadTimeout: 60 + WriteTimeout: 60 +AdminServer: # Admin后台运维服务 + HttpIp: 0.0.0.0 + HttpPort: 8010 + ReadTimeout: 60 + WriteTimeout: 60 +BotServer: # Bot服务 + HttpIp: 0.0.0.0 + HttpPort: 8010 + ReadTimeout: 60 + WriteTimeout: 60 + +... +``` diff --git a/docs/deploy/local/custom/config.yaml b/docs/deploy/local/custom/config.yaml new file mode 100644 index 00000000..fa9b1b41 --- /dev/null +++ b/docs/deploy/local/custom/config.yaml @@ -0,0 +1,30 @@ +Features: + Default: ["Sqlite3", "Zinc", "LocalOSS", "LoggerFile", "BigCacheIndex", "Friendship", "Frontend:EmbedWeb", "Web"] +BigCacheIndex: # 使用BigCache缓存泡泡广场消息流 + MaxIndexPage: 1024 # 最大缓存页数,必须是2^n, 代表最大同时缓存多少页数据 + HardMaxCacheSize: 256 # 最大缓存大小(MB),0表示无限制 +WebServer: # Web服务 + HttpIp: 0.0.0.0 + HttpPort: 8008 + ReadTimeout: 60 + WriteTimeout: 60 +JWT: # 鉴权加密 + Secret: 18a6413dc4fe394c66345ebe501b2f26 + Issuer: paopao-api + Expire: 86400 +Zinc: # Zinc搜索配置 + Host: 127.0.0.1:4080 + Index: paopao-data + User: admin + Password: admin + Secure: False +LocalOSS: # 本地文件OSS存储配置 + SavePath: custom/data/oss + Secure: True + Bucket: paopao + Domain: api.alimy.me +Sqlite3: # Sqlite3数据库 + Path: custom/data/sqlite3/paopao-ce.db +Redis: + InitAddress: + - 127.0.0.1:6379 diff --git a/docs/discuss/README.md b/docs/discuss/README.md index 3b983ca6..7412cf4a 100644 --- a/docs/discuss/README.md +++ b/docs/discuss/README.md @@ -3,3 +3,6 @@ * [0000-讨论样式模版](./0000-讨论样式模版.md "讨论样式模版") * [0001-FAQs](./0001-FAQs.md "FAQs") + +### paopao.info +关于paopao-ce的交流、反馈,也可以直接在我们官网[paopao.info](https://www.paopao.info)进行,发布动态时记得加上标签`#paopao-ce`或类似主题相关的标签,方便话题查找。欢迎大家在[paopao.info](https://www.paopao.info)畅快愉悦的交流,一起让paopao-ce的用户体验更好、更便捷。 diff --git a/docs/proposal/.proposal.md b/docs/proposal/.proposal.md index 10a33c29..5b372cd4 100644 --- a/docs/proposal/.proposal.md +++ b/docs/proposal/.proposal.md @@ -1,6 +1,6 @@ | 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | | ----- | ----- | ----- | ----- | ----- | ----- | -| 000 | 北野 | 2022-11-04 |2022-11-04 | v1.0| 提议 | +| YYMMDDHH | 北野 | 2022-11-04 |2022-11-04 | v1.0| 提议 | ## <我是标题> ---- 这里写简要介绍 ---- diff --git a/docs/proposal/003-关于Followship功能项的设计.md b/docs/proposal/22110409-关于Followship功能项的设计.md similarity index 97% rename from docs/proposal/003-关于Followship功能项的设计.md rename to docs/proposal/22110409-关于Followship功能项的设计.md index 6ccf15c7..4fb4ef4e 100644 --- a/docs/proposal/003-关于Followship功能项的设计.md +++ b/docs/proposal/22110409-关于Followship功能项的设计.md @@ -1,6 +1,6 @@ | 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | | ----- | ----- | ----- | ----- | ----- | ----- | -| 003| 北野 | 2022-11-04 | 2022-11-21 | v0.1 | 提议 | +| 22110409| 北野 | 2022-11-04 | 2022-11-21 | v0.1 | 提议 | ### 关于Followship功能项的设计 Followship是实现类似Twitter Timeline模式**关注者模型**的时间线信息流,广场推文列表的生成将主要与推文时间、用户的关注者相关。Twitter的推文消息流是非常智能的,用户体验也非常好,这得益于其背后的智能推荐算法以及完善的关注者模型体系,当然还有很多其他机制共同作用下的结果。本提按作为一个总纲为paopao-ce引入类似的机制,这将是一个持续完善的缓慢过程,一切都是为了用户体验,用户就是上帝,用户需要什么,paopao-ce就努力提供什么! diff --git a/docs/proposal/002-关于Friendship功能项的设计.md b/docs/proposal/22110410-关于Friendship功能项的设计.md similarity index 98% rename from docs/proposal/002-关于Friendship功能项的设计.md rename to docs/proposal/22110410-关于Friendship功能项的设计.md index f0c1a35a..c90b6002 100644 --- a/docs/proposal/002-关于Friendship功能项的设计.md +++ b/docs/proposal/22110410-关于Friendship功能项的设计.md @@ -1,6 +1,6 @@ | 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | | ----- | ----- | ----- | ----- | ----- | ----- | -| 002| 北野 | 2022-11-04 | 2023-01-04 | v1.0 | 提议 | +| 22110410 | 北野 | 2022-11-04 | 2023-01-04 | v1.0 | 提议 | ### Friendship功能项的设计概要 Friendship功能提供好友间分享推文信息的机制,更好的帮助用户建立自己的推文分享小圈子。Friendship本质上想优化的是泡泡广场页面推文列表的生成机制,开启功能后,推文列表只能获取 `公开/私密/好友` 的推文,每个用户都有属于自己的个性化推文列表。在提供个性化推文列表生成机制的同时,好友体系的建立也顺便帮助用户建立自己的个性化有限范围内的灵魂社交小圈子,只有相互间拥有个性化认同感的用户才能互为好友。 diff --git a/docs/proposal/001-关于paopao-ce的设计定位.md b/docs/proposal/22110411-关于paopao-ce的设计定位.md similarity index 78% rename from docs/proposal/001-关于paopao-ce的设计定位.md rename to docs/proposal/22110411-关于paopao-ce的设计定位.md index 8d11911f..e98e2e3c 100644 --- a/docs/proposal/001-关于paopao-ce的设计定位.md +++ b/docs/proposal/22110411-关于paopao-ce的设计定位.md @@ -1,6 +1,6 @@ | 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | | ----- | ----- | ----- | ----- | ----- | ----- | -| 001| 北野 | 2022-11-04 | 2022-12-19 | v1.0 | 提议 | +| 22110411 | 北野 | 2022-11-04 | 2023-01-13 | v1.1 | 提议 | ## 概述 paopao-ce是一个清新文艺的微社区,提供类似Twiter/微博的推文分享服务。paopao-ce的运营形态有点类似WordPress,只不过WordPress是使用PHP语言开发的博客平台,提供的是博客服务,而paopao-ce提供的是类似Twitter的推文分享服务。paopao-ce 让 **个人或小组织** 可以快速、方便的部署一个提供**推文分享服务**的小站点,在有限范围内形成一个友善的社交小圈子微社区。 @@ -37,6 +37,10 @@ paopao-ce目前支持Redis作为缓存存储引擎提供缓存服务,请参考 paopao-ce在代码实现上采用 **单体架构模式、分层设计、功能模块化**,架构设计上可能略显保守,但是在使用新技术上却非常积极,比如搜索引擎就采用了近来新星[Zinc](https://github.com/zinclabs/zinc) /[Meilisearch](https://github.com/meilisearch/meilisearch),同时也不排斥各种云端服务,包括阿里云、腾讯云、华为云的对象存储服务、关系数据库服务等。paopao-ce始终秉持着 **包容并蓄、能用就上、去繁就简** 的架构思维,努力打造一个能 **稳定运行、代码清晰、功能可扩展** 的开源项目。 ![](.assets/006-01.png) +## 从技术探索角度思考 +IT世界是非常激动人心的,新技术层出不穷,在各自领域大展身手、大放异彩。作为开发者的我们首要目标当然是以产品为核心,不断的优化服务体验,也不吝啬于新技术的采用以达到更好的产品服务质量。新技术或者某种技术本身,是需要一个环境来支撑其运行、演进,脱离实际环境的技术演进,犹如纸上谈兵,实际效果是存疑的。开发者在研究一项(新)技术时,首先当然是知其然,了解其功能特性、适用场景;再而知其所以然,深入了解其设计原理、知悉其存在的局限等;进而知其不以为然,通过实践,找到技术的最适合场景、知悉其不适合的场景,或与其他技术配合使用,扬长避短,发挥各自的最佳效力以解决具体的事务。这些都是技术探索的通用流程,可以看出,一项技术的探索从陌生到一知半解再到了如指掌,需要一个漫长的过程以及一个技术探索的环境。有些技术的探索,确实需要一个具体的环境,才能更好的研究与实践,比如OBS、Search、Recommended discovery亦或各种云服务的使用、k8s的服务部署等,都需要一个具体的环境来进行技术探索。可以说以需求驱动的技术探索,也更能推进技术本身的不断演进。 +说这么多,这就引出了本节所要说的一个观点了,paopao-ce不仅仅是作为一个提供推文分享服务的产品,也能作为一些(新)技术的探索环境。比如OBS(对象存储服务)、推文搜索服务、推文/用户推荐发现服务、广场推文消息流服务等,都可以作为相应技术领域的技术探索环境,从实践中去检验技术的有效性,更好的推进技术的学习、实践、演进。作为开发者/学习者,也能在理论学习与实际环境中实践(新)技术找到一个平衡,更好、更快的掌握一项(新)技术,这也是paopao-ce的另一价值所在。**路漫漫其修远兮,吾将上下而求索**,用我们开发者的话来说,带着 **上下文(环境/需求)** 去探索(新)技术,或能事半功倍、得心应手。 + ## 从人文角度思考 现在的互联网世界已经非常精彩,各种社交媒体平台琳琅满目,使用体验也非常友好。每个社交平台都有自己的运营方式,都有自己的核心用户群体,也有自己的产品灵魂,都在不断的进行生态演进。比如Twitter、微博都已经从最初的推文分享服务演进到一个成熟的传媒平台,注册用户非常庞大,日均访问PV也是一个惊人的数字,这就注定了平台的运营思维是多维度考量均衡的结果,只能做到让用户群体的大多数人用户体验友好,并不能满足所有人的需求。大平台有大平台的运营模式,小站点有小站点的维系空间。对于类似Twitter这样的推文分享服务,paopao-ce提供一种小站点部署模式,采用类似WordPress的运维模式,让 **个人/小组织** 能快速、便捷的拥有一个提供推文分享服务的小站点,以填补那些在大平台下难以享受到的用户体验,享受小圈子内的自由空间。 @@ -71,3 +75,6 @@ paopao-ce在代码实现上采用 **单体架构模式、分层设计、功能 #### v1.0(2022-12-19) - 北野 * 补充部分内容 + +#### v1.1(2023-01-13) - 北野 +* 补充 从技术探索角度思考 描述 diff --git a/docs/proposal/005-引入go-mir优化后端架构设计.md b/docs/proposal/22112109-引入go-mir优化后端架构设计.md similarity index 97% rename from docs/proposal/005-引入go-mir优化后端架构设计.md rename to docs/proposal/22112109-引入go-mir优化后端架构设计.md index ae696ca3..5e0b903d 100644 --- a/docs/proposal/005-引入go-mir优化后端架构设计.md +++ b/docs/proposal/22112109-引入go-mir优化后端架构设计.md @@ -1,6 +1,6 @@ | 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | | ----- | ----- | ----- | ----- | ----- | ----- | -| 005| 北野 | 2022-11-21 | 2023-01-04 | v1.1 | 提议 | +| 22112109 | 北野 | 2022-11-21 | 2023-01-04 | v1.1 | 提议 | ### 引入go-mir优化后端架构设计 引入[github.com/alimy/mir/v3](https://github.com/alimy/mir)优化后端的架构设计,使得后端代码更具扩展型。 diff --git a/docs/proposal/006-关于paopao-ce的结构设计.md b/docs/proposal/22112309-关于paopao-ce的结构设计.md similarity index 98% rename from docs/proposal/006-关于paopao-ce的结构设计.md rename to docs/proposal/22112309-关于paopao-ce的结构设计.md index 3f3c8ed8..c418fb74 100644 --- a/docs/proposal/006-关于paopao-ce的结构设计.md +++ b/docs/proposal/22112309-关于paopao-ce的结构设计.md @@ -1,6 +1,6 @@ | 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | | ----- | ----- | ----- | ----- | ----- | ----- | -| 006| 北野 | 2022-11-23 | 2022-01-01 | v1.0 | 提议 | +| 22112309 | 北野 | 2022-11-23 | 2022-01-01 | v1.0 | 提议 | ### 关于paopao-ce的结构设计 本文档主要讨论paopao-ce目前的代码结构,简要清晰的描述一个**API请求**从 **接受解析->逻辑处理->结果响应**的大概路径,帮助开发人员快速了解paopao-ce代码基的基本面,更好的融入paopao-ce的开发中做出PR贡献。 @@ -63,7 +63,9 @@ RESTful服务与gRPC服务各自有擅长的场景,在合适的场景使用最 ### 更新记录 #### v0.0(2022-11-23) - 北野 * 初始文档, 先占个位置 + #### v0.1(2022-12-23) - 北野 * 添加部分内容 + #### v1.0(2023-01-01) - 北野 * 添加部分内容 diff --git a/docs/proposal/22121409-关于Lightship功能项的设计.md b/docs/proposal/22121409-关于Lightship功能项的设计.md new file mode 100644 index 00000000..a4063640 --- /dev/null +++ b/docs/proposal/22121409-关于Lightship功能项的设计.md @@ -0,0 +1,47 @@ +| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | +| ----- | ----- | ----- | ----- | ----- | ----- | +| 22121409 | 北野 | 2022-12-14 | 2022-01-09 | v1.1 | 提议 | + +### 关于Lightship功能项的设计 +Lightship(开放模式)功能提供完全公开的推文分享服务,有别于[Friendship](002-关于Friendship功能项的设计.md "关于Friendship功能项的设计")、[Followship](003-关于Followship功能项的设计.md "关于Followship功能项的设计"),使用Lightship用户模式部署paopao-ce,用户发布的所有推文都是公开可访问的,广场推文列表展示的是全站所有公开推文的Timeline Tweets。 + +### 场景 +一般用于非常小的站点,或者推文更新不频繁的站点。 +* 推文更新不频繁站点; +* 个人推文站点; +* 单纯想要所有推文公开访问; + +### 需求 +* 广场推文列表只展示公开可访问推文; +* 推文访问权限只能是 `公开/私密`; + +### 方案 + +#### 实现细节 +* 广场推文列表只展示公开可访问推文 - 前端/后端 +* 推文访问权限只能是 `公开/私密` - 前端/后端 + +#### 参考实现(PR): +[add Lightship feature support #198](https://github.com/rocboss/paopao-ce/pull/198) + +### 疑问 + +1. 公开模式为什么命名为Lightship? +Lightship有灯塔的意思,灯塔是为航行船只指明方向的公共设施,这里取其公有设施的属性指喻 开放模式下paopao-ce不需要授权公开访问推 文的意思。 +1. 如何开启这个功能? +在配置文件config.yaml中的`Features`中添加`Lightship`功能项开启该功能: +```yaml +... +# features中加上 Lightship +Features: + Default: ["Meili", "LoggerMeili", "Base", "Sqlite3", "BigCacheIndex", "MinIO", "Lightship"] + Base: ["Redis", "PhoneBind"] +... +``` + +### 更新记录 +#### v1.0(2022-12-14) - 北野 +* 初始文档 + +#### v1.1(2022-01-09) - 北野 +* 添加参考实现PR信息 diff --git a/docs/proposal/23011309-优化paopao-ce前后端国际化i18n的设计.md b/docs/proposal/23011309-优化paopao-ce前后端国际化i18n的设计.md new file mode 100644 index 00000000..19c57f1b --- /dev/null +++ b/docs/proposal/23011309-优化paopao-ce前后端国际化i18n的设计.md @@ -0,0 +1,21 @@ +| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | +| ----- | ----- | ----- | ----- | ----- | ----- | +| 23011309 | 北野 | 2023-01-13 | 2023-01-13 | v0.0 | 提议 | + +### 概述 +目前paopao-ce前端/后端 都使用中文提供业务服务,暂时还没有提供国际化i18n机制提供国际化的业务服务。本提按提议提过在前端/后端中引入i8n机制,以提供国际化业务服务。 本提按建立在[012-优化前端运行时配置获取机制的设计](012-优化前端运行时配置获取机制的设计.md)基础之上。 + +### 需求 +* 提供i18n机制以实现业务服务的国际化 - 前端/后端 + +### 方案 +TODO; + +### 疑问 + +1. 为什么要提供这种机制? +TODO; + +### 更新记录 +#### v0.0(2023-01-13) - 北野 +* 初始文档, 先占个位置 diff --git a/docs/proposal/23011310-优化前端运行时配置获取机制的设计.md b/docs/proposal/23011310-优化前端运行时配置获取机制的设计.md new file mode 100644 index 00000000..58d308cc --- /dev/null +++ b/docs/proposal/23011310-优化前端运行时配置获取机制的设计.md @@ -0,0 +1,28 @@ +| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | +| ----- | ----- | ----- | ----- | ----- | ----- | +| 23011310 | 北野 | 2023-01-13 | 2023-01-13 | v0.0 | 提议 | + +### 概述 +目前的Web前端运行时配置是通过编译时配置[.env](../../web/.env)进行静态配置,虽然能满足简单的功能需求,但是非常不灵活。本提按提议一种由paopao-ce后端服务控制的前端运行时配置获取机制,让前端更灵活的依据运行时配置提供产品服务。 + +### 场景 +前端依据paopao-ce后端服务提供的运行时配置按需提供产品服务,也可以扩展到按用户喜好自定义的配置提供产品服务,比如用户设置的语言、Theme、功能特性等。 + +### 需求 +* 前端依据运行时配置提供业务服务 - 前端 +* 前端在启动时从paopao-ce后端服务获取运行时配置 - 前端/后端 +* 用户可以自定义前端运行时配置,如语言、Theme、功能特性等 - 前端/后端 +* 用户自定义的前端运行时配置可以 创建/更新 - 前端/后端 +* 后端服务提供默认前端运行时配置 - 后端 + +### 方案 +TODO; + +### 疑问 + +1. 为什么要提供这种机制? +TODO; + +### 更新记录 +#### v0.0(2023-01-13) - 北野 +* 初始文档, 先占个位置 diff --git a/docs/proposal/23020910-关于paopao-ce引入sqlx与sqlc作为数据逻辑层ORM的构想 copy.md b/docs/proposal/23020910-关于paopao-ce引入sqlx与sqlc作为数据逻辑层ORM的构想 copy.md new file mode 100644 index 00000000..45f22cc2 --- /dev/null +++ b/docs/proposal/23020910-关于paopao-ce引入sqlx与sqlc作为数据逻辑层ORM的构想 copy.md @@ -0,0 +1,21 @@ +| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | +| ----- | ----- | ----- | ----- | ----- | ----- | +| 23020910| 北野 | 2023-02-09 | 2023-02-09 | v0.0 | 提议 | + +### 概述 +TODO; + +### 需求 +TODO; + +### 方案 +TODO; + +### 疑问 + +1. 为什么要引入sqlx/sqlc? +TODO; + +### 更新记录 +#### v0.0(2023-02-09) - 北野 +* 初始文档, 先占个位置 diff --git a/docs/proposal/23021310-关于paopao-ce引入bcrypt作为用户密码加密算法的设计.md b/docs/proposal/23021310-关于paopao-ce引入bcrypt作为用户密码加密算法的设计.md new file mode 100644 index 00000000..9e992b54 --- /dev/null +++ b/docs/proposal/23021310-关于paopao-ce引入bcrypt作为用户密码加密算法的设计.md @@ -0,0 +1,25 @@ +| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | +| ----- | ----- | ----- | ----- | ----- | ----- | +| 23021310| 北野 | 2023-02-13 | 2023-02-13 | v0.0 | 提议 | + +### 概述 +TODO; + +### 需求 +TODO; + +### 方案 +TODO; + +### 疑问 + +1. 为什么要引入bcrypt? +TODO; + +### 参考文档 +* [bcrypt](https://github.com/golang/crypto/blob/master/bcrypt/bcrypt.go) +* [bcrypt module](https://pkg.go.dev/golang.org/x/crypto@v0.6.0/bcrypt) + +### 更新记录 +#### v0.0(2023-02-13) - 北野 +* 初始文档, 先占个位置 diff --git a/docs/proposal/23021510-关于使用pyroscope用于性能调试的设计.md b/docs/proposal/23021510-关于使用pyroscope用于性能调试的设计.md new file mode 100644 index 00000000..5b225dd3 --- /dev/null +++ b/docs/proposal/23021510-关于使用pyroscope用于性能调试的设计.md @@ -0,0 +1,53 @@ +| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | +| ----- | ----- | ----- | ----- | ----- | ----- | +| 23021510| 北野 | 2023-02-15 | 2023-02-16 | v1.1 | 提议 | + +### 概述 +Pyroscope 是一个开源的持续性能剖析平台。它能够帮你: +* 找出源代码中的性能问题和瓶颈 +* 解决 CPU 利用率高的问题 +* 理解应用程序的调用树(call tree) +* 追踪随一段时间内变化的情况 + +### 需求 +* 开发环境下启用Pyroscope,但是部署环境下禁用。 + +### 方案 +#### 设计要点 +* 使用//go:build pyroscope 可选编译app集成Pyroscope功能 +* config.yaml中添加`Pyroscope` 功能来启用Pyroscope + +#### 设计细节 +* 参考实现(PR): +[add Pyroscope support #199](https://github.com/rocboss/paopao-ce/pull/199) + +### 疑问 + +1. 为什么要引入Pyroscope? +用于开发环境下对paopao-ce进行性能优化。 + +2. 如何开启这个功能? +* 构建时将 `pyroscope` 添加到TAGS中: + ```sh + make run TAGS='pyroscope' + ``` +* 在配置文件config.yaml中的`Features`中添加`Pyroscope`功能项开启该功能: + ```yaml + ... + # features中加上 Friendship + Features: + Default: ["Meili", "LoggerMeili", "Base", "Sqlite3", "BigCacheIndex", "MinIO", "Pyroscope"] + Base: ["Redis", "PhoneBind"] + ... + ``` + +### 参考文档 +* [pyroscope](https://github.com/pyroscope-io/pyroscope) +* [pyroscope client](https://github.com/pyroscope-io/client) + +### 更新记录 +#### v1.0(2023-02-15) - 北野 +* 初始文档 + +#### v1.1(2023-02-16) - 北野 +* 添加参考实现 diff --git a/docs/proposal/23040412-关于使用sentry用于错误追踪与性能检测的设计.md b/docs/proposal/23040412-关于使用sentry用于错误追踪与性能检测的设计.md new file mode 100644 index 00000000..e687de2f --- /dev/null +++ b/docs/proposal/23040412-关于使用sentry用于错误追踪与性能检测的设计.md @@ -0,0 +1,49 @@ +| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | +| ----- | ----- | ----- | ----- | ----- | ----- | +| 23040412| 北野 | 2023-04-04 | 2023-04-04 | v1.0 | 提议 | + +### 概述 +[Sentry](https://github.com/getsentry/sentry) Sentry is a developer-first error tracking and performance monitoring platform that helps developers see what actually matters, solve quicker, and learn continuously about their applications. + +### 需求 +* 通过配置文件开启Sentry功能 + +### 方案 +#### 设计要点 +* config.yaml中添加`Sentry` 功能来启用Sentry功能 + +#### 设计细节 +* 参考实现(PR): +[add Sentry feature support #258](https://github.com/rocboss/paopao-ce/pull/258) + +### 疑问 + +1. 为什么要引入Sentry? +添加一种对paopao-ce的错误追踪与性能检测机制。 + +2. 如何开启这个功能? +* 在配置文件config.yaml中的`Features`中添加`Sentry`功能项开启该功能: + ```yaml + ... + # features中加上 Sentry + Features: + Default: ["Meili", "LoggerMeili", "Base", "Sqlite3", "BigCacheIndex", "MinIO", "Sentry"] + Base: ["Redis", "PhoneBind"] + Sentry: + Sentry: # Sentry配置 + Dsn: "http://4ea0af5cd88d4512b7e52070506c80ec@localhost:9000/2" + Debug: True + AttachStacktrace: True + TracesSampleRate: 1.0 + AttachLogrus: True # logrus是否附加到Sentry + AttachGin: True # gin是否附加到Sentry + ... + ``` + +### 参考文档 +* [sentry](https://github.com/getsentry/sentry) +* [self-hosted](https://develop.sentry.dev/self-hosted/) + +### 更新记录 +#### v1.0(2023-04-04) - 北野 +* 初始文档 diff --git a/docs/proposal/23062120-关于多媒体资源URI信息存储优化.md b/docs/proposal/23062120-关于多媒体资源URI信息存储优化.md new file mode 100644 index 00000000..31a305f2 --- /dev/null +++ b/docs/proposal/23062120-关于多媒体资源URI信息存储优化.md @@ -0,0 +1,30 @@ +| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | +| ----- | ----- | ----- | ----- | ----- | ----- | +| 23062120| 北野 | 2023-06-21 | 2023-06-21 | v0.1 | 提议 | + +### 概述 +目前图片、视频、附件资源的位置信息是使用完整url的形式存储在sql表中,也就是对外可取的url链接,这就造成这些多媒体资源与一个网站的网址进行了 +绑定,如果网站变更网址后,这些媒体资源将访问不了,除非使用原先的网址。 + +### 需求 +* 变更网址不影响图片、视频、附件资源的获取; +* 图片、视频、附件资源的存储位置应该对外透明,内部如何存储已经具体的存储位置信息不应该暴露到对外url链接中; +* 图片、视频、附件资源的存储位置信息在sql表中应该存储为相对地址; + +### 方案 +#### 设计要点 +* 图片、视频、附件资源的相对位置信息存储在sql表中; +* 图片、视频、附件资源的对外url地址采用动态生成的方式,可以采用服务端生成或者客户端生成的方式或者通过api的参数来自定义; + +#### 设计细节 +TODO; + +### 疑问 + +1. 为什么要优化? +解绑网站地址与图片、视频、附件资源的对应关系。 + + +### 更新记录 +#### v0.1(2023-06-21) - 北野 +* 初始文档 diff --git a/docs/proposal/23062121-关于Migration的优化.md b/docs/proposal/23062121-关于Migration的优化.md new file mode 100644 index 00000000..fed6bb05 --- /dev/null +++ b/docs/proposal/23062121-关于Migration的优化.md @@ -0,0 +1,25 @@ +| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | +| ----- | ----- | ----- | ----- | ----- | ----- | +| 23062121| 北野 | 2023-06-21 | 2023-06-21 | v0.1 | 提议 | + +### 概述 +数据库表的Migration优化。 + +### 需求 +TODO; + +### 方案 +TODO; + +#### 设计细节 +TODO; + +### 疑问 + +1. 为什么要优化? +TODO; + + +### 更新记录 +#### v0.1(2023-06-21) - 北野 +* 初始文档 diff --git a/docs/proposal/23062905-添加Pprof功能特性用于获取Profile.md b/docs/proposal/23062905-添加Pprof功能特性用于获取Profile.md new file mode 100644 index 00000000..5763c5a8 --- /dev/null +++ b/docs/proposal/23062905-添加Pprof功能特性用于获取Profile.md @@ -0,0 +1,67 @@ +| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | +| ----- | ----- | ----- | ----- | ----- | ----- | +| 23062905| 北野 | 2023-06-29 | 2023-06-29 | v1.0 | 提议 | + +### 概述 +使用net/http/pprof获取Profile信息。添加`Pprof`功能特性用于开启PprofServer服务。 + +### 需求 +- 只在开发环境下获取profile信息 +- 可以在配置文件中开启获取profile的服务 + +### 方案 +- 添加`Pprof`功能特性 +- 添加`PprofServer`服务 + +#### 设计细节 +- 配置文件中添加`PprofServer`项用于配制http server +- 添加`Pprof`功能特性 +- 添加`PprofServer`服务 +- 使用`//go:build pprof`按需编译profile功能 +- `PprofServer` 不能和其他服务共用一个端口 + +### 疑问 + +1. 为什么要添加`pprof`功能特性? +使用 net/http/pprof 在线获取CPU profile信息,用于 [PGO](https://go.dev/doc/pgo) 编译优化。 + +2. 如何开启`Pprof`服务? +* 构建时将 `pprof` 添加到TAGS中: + ```sh + make run TAGS='pprof' + ``` +* 在配置文件config.yaml中的`Features`中添加`Pprof`功能项开启该功能: + ```yaml + ... + # features中加上 Friendship + Features: + Default: ["Meili", "LoggerMeili", "Base", "Sqlite3", "BigCacheIndex", "MinIO", "Pprof"] + Base: ["Redis", "PhoneBind"] + ... + ``` + +3. 常见命令 + +#### Merging profiles +The pprof tool can merge multiple profiles like this: +```sh +$ go tool pprof -proto a.pprof b.pprof > merged.pprof +``` +This merge is effectively a straightforward sum of samples in the input, regardless of wall duration of the profile. As a result, when profiling a small time slice of an application (e.g., a server that runs indefinitely), you likely want to ensure that all profiles have the same wall duration (i.e., all profiles are collected for 30s). Otherwise, profiles with longer wall duration will be overrepresented in the merged profile. + +#### look at a 30-second CPU profile: +```sh +go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30 +``` + +### 参考文档 +* [PGO](https://go.dev/doc/pgo) +* [net/http/pprof](https://pkg.go.dev/net/http/pprof) +* [runtime/pprof](https://pkg.go.dev/runtime/pprof) + +### 参考实现 +- [#327](https://github.com/rocboss/paopao-ce/pull/327) + +### 更新记录 +#### v1.0(2023-06-20) - 北野 +* 初始文档 diff --git a/docs/proposal/23062906-关于开启pgo编译优化.md b/docs/proposal/23062906-关于开启pgo编译优化.md new file mode 100644 index 00000000..7622c3f4 --- /dev/null +++ b/docs/proposal/23062906-关于开启pgo编译优化.md @@ -0,0 +1,38 @@ +| 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | +| ----- | ----- | ----- | ----- | ----- | ----- | +| 23062906| 北野 | 2023-06-29 | 2023-06-29 | v1.0 | 提议 | + +### 概述 +Beginning in Go 1.20, the Go compiler supports profile-guided optimization ([PGO](https://go.dev/doc/pgo)) to further optimize builds. + + +### 疑问 + +1. 为什么要添加`pprof`功能特性? +使用 net/http/pprof 在线获取CPU profile信息,用于 [PGO](https://go.dev/doc/pgo) 编译优化。 + +2. 如何开启`pgo`编译优化? +The standard approach is to store a pprof CPU profile with filename default.pgo in the main package directory of the profiled binary, and build with go build -pgo=auto, which will pick up default.pgo files automatically. + +3. 常见命令 + +#### Merging profiles +The pprof tool can merge multiple profiles like this: +```sh +$ go tool pprof -proto a.pprof b.pprof > default.pgo +``` +This merge is effectively a straightforward sum of samples in the input, regardless of wall duration of the profile. As a result, when profiling a small time slice of an application (e.g., a server that runs indefinitely), you likely want to ensure that all profiles have the same wall duration (i.e., all profiles are collected for 30s). Otherwise, profiles with longer wall duration will be overrepresented in the merged profile. + +#### look at a 30-second CPU profile: +```sh +go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30 +``` + +### 参考文档 +* [PGO](https://go.dev/doc/pgo) +* [net/http/pprof](https://pkg.go.dev/net/http/pprof) +* [runtime/pprof](https://pkg.go.dev/runtime/pprof) + +### 更新记录 +#### v1.0(2023-06-20) - 北野 +* 初始文档 diff --git a/docs/proposal/README.md b/docs/proposal/README.md index 12f8096e..2b807a56 100644 --- a/docs/proposal/README.md +++ b/docs/proposal/README.md @@ -1,6 +1,6 @@ ## Draft -* [001-关于paopao-ce的设计定位](001-关于paopao-ce的设计定位.md "关于paopao-ce的设计定位") -* [002-关于Friendship功能项的设计](002-关于Friendship功能项的设计.md "关于Friendship功能项的设计") -* [003-关于Followship功能项的设计](003-关于Followship功能项的设计.md "关于Followship功能项的设计") -* [005-引入go-mir优化后端架构设计](005-引入go-mir优化后端架构设计.md "引入go-mir优化后端架构设计") -* [006-关于paopao-ce的结构设计](006-关于paopao-ce的结构设计.md "关于paopao-ce的结构设计") +* [22110411-关于paopao-ce的设计定位](22110411-关于paopao-ce的设计定位.md "关于paopao-ce的设计定位") +* [22110410-关于Friendship功能项的设计](22110410-关于Friendship功能项的设计.md "关于Friendship功能项的设计") +* [22110409-关于Followship功能项的设计](22110409-关于Followship功能项的设计.md "关于Followship功能项的设计") +* [22112109-引入go-mir优化后端架构设计](22112109-引入go-mir优化后端架构设计.md "引入go-mir优化后端架构设计") +* [22112309-关于paopao-ce的结构设计](22112309-关于paopao-ce的结构设计.md "关于paopao-ce的结构设计") diff --git a/docs/proposal/提案模板.md b/docs/proposal/提案模板.md index 4d44a79d..29fc7474 100644 --- a/docs/proposal/提案模板.md +++ b/docs/proposal/提案模板.md @@ -1,8 +1,8 @@ | 编号 | 作者 | 发表时间 | 变更时间 | 版本 | 状态 | | ----- | ----- | ----- | ----- | ----- | ----- | -| <编号000> | <作者> | <发表时间> | <变更时间> | <版本号v1.0> | <提议/提案/决议/冻结> | +| <编号YYMMDDHH> | <作者> | <发表时间> | <变更时间> | <版本号v1.0> | <提议/提案/决议/冻结> | -* 编号: 填写提案编号,三位数,比如001。 +* 编号: 填写提案编号,六位数,格式为YYMMDDHH,即:年(后两位)+月+日+时。 * 作者: 填写发表者。 * 发表时间: 填写首次发表时间,之后保持不变。 * 变更时间: 填写变更时间,首次发表时,变更时间和发表时间一样。 diff --git a/features-status.md b/features-status.md index 8937a2bc..60f17aff 100644 --- a/features-status.md +++ b/features-status.md @@ -42,7 +42,7 @@ * `Frontend:EmbedWeb` 开启内嵌于后端Web API服务中的前端服务(目前状态: 内测) * [ ] 提按文档 * [x] 服务初始化逻辑 -* `Deprecated:OldWeb` 开启旧的Web服务(目前状态: 内测) +* `Deprecated:OldWeb` 开启旧的Web服务(目前状态: 已弃,不可用) * [ ] 提按文档 * [x] 服务初始化逻辑 @@ -97,7 +97,7 @@ * [ ] 提按文档 * [x] 接口定义 * [x] 业务逻辑实现 -* `SimpleCacheIndex` 提供简单的 广场推文列表 的缓存功能能; +* `SimpleCacheIndex` 提供简单的 广场推文列表 的缓存功能能(目前状态: Deprecated); * [ ] 提按文档 * [x] 接口定义 * [x] 业务逻辑实现 @@ -105,6 +105,10 @@ * [ ] 提按文档 * [x] 接口定义 * [x] 业务逻辑实现 +* `RedisCacheIndex` 使用Redis缓存 广场推文列表,缓存每个用户每一页,简单做到千人千面(目前状态: 内测阶段,推荐使用); + * [ ] 提按文档 + * [x] 接口定义 + * [x] 业务逻辑实现 #### 搜索: * `Zinc` 基于[Zinc](https://github.com/zinclabs/zinc)搜索引擎提供推文搜索服务(目前状态: 稳定,推荐使用); @@ -119,6 +123,7 @@ * [ ] 提按文档 * [ ] 接口定义 * [ ] 业务逻辑实现 + #### 日志: * `LoggerFile` 使用文件写日志(目前状态: 稳定); * [ ] 提按文档 @@ -133,15 +138,25 @@ * [x] 接口定义 * [x] 业务逻辑实现 +#### 监控: +* `Sentry` 使用Sentry进行错误跟踪与性能监控(目前状态: 内测); + * [x] [提按文档](docs/proposal/23040412-关于使用sentry用于错误追踪与性能检测的设计.md) + * [x] 接口定义 + * [x] 业务逻辑实现 + #### 关系模式: -* `Friendship` 弱关系好友模式,类似微信朋友圈(目前状态: 开发阶段); - * [x] 提按文档 +* `Friendship` 弱关系好友模式,类似微信朋友圈(目前状态: 内测); + * [x] [提按文档](docs/proposal/22110410-关于Friendship功能项的设计.md) * [x] 接口定义 * [x] 业务逻辑实现 * `Followship` 关注者模式,类似Twitter的Follow模式(目前状态: WIP); - * [ ] 提按文档 + * [ ] [提按文档](docs/proposal/22110409-关于Followship功能项的设计.md) * [ ] 接口定义 * [ ] 业务逻辑实现 +* `Lightship` 开放模式,所有推文都公开可见(目前状态: 内测、默认); + * [x] [提按文档](docs/proposal/22121409-关于Lightship功能项的设计.md) + * [x] 接口定义 + * [x] 业务逻辑实现 ### 支付: * `Alipay` 开启基于[支付宝开放平台](https://open.alipay.com/)的钱包功能; @@ -160,13 +175,27 @@ * [x] 业务逻辑实现 ### 开发文档: -* `Docs:OpenAPI` 开启openapi文档功能,提供web api文档说明(visit http://127.0.0.1:8008/docs/openapi); +* `Docs:OpenAPI` 开启openapi文档功能,提供web api文档说明(visit http://127.0.0.1:8008/docs/openapi); * [ ] 提按文档 * [x] 接口定义 - * [x] 业务逻辑实现 - + * [x] 业务逻辑实现 + +### 性能优化 +* [`Pyroscope`](docs/proposal/23021510-关于使用pyroscope用于性能调试的设计.md) 开启Pyroscope功能用于性能调试(目前状态: 内测); + * [x] 提按文档 + * [x] 业务逻辑实现 +* [`Pprof`](docs/proposal/23062905-添加Pprof功能特性用于获取Profile.md) 开启Pprof功能收集Profile信息(目前状态: 内测); + * [x] 提按文档 + * [x] 业务逻辑实现 + ### 其他: * `PhoneBind` 手机绑定功能; * [ ] 提按文档 * [x] 接口定义 - * [x] 业务逻辑实现 + * [x] 业务逻辑实现 + +### 功能特性: +* `Web:DisallowUserRegister` 不允许用户注册; + * [ ] 提按文档 + * [x] 接口定义 + * [x] 业务逻辑实现 diff --git a/go.mod b/go.mod index 4be05e53..f73ef15c 100644 --- a/go.mod +++ b/go.mod @@ -1,134 +1,143 @@ module github.com/rocboss/paopao-ce -go 1.18 +go 1.20 require ( - github.com/Masterminds/semver/v3 v3.1.1 + github.com/Masterminds/semver/v3 v3.2.1 github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868 - github.com/alimy/cfg v0.3.0 - github.com/alimy/mir/v3 v3.0.0 - github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible - github.com/allegro/bigcache/v3 v3.0.2 - github.com/bytedance/sonic v1.5.0 + github.com/alimy/cfg v0.4.0 + github.com/alimy/mir/v4 v4.0.0 + github.com/aliyun/aliyun-oss-go-sdk v2.2.8+incompatible + github.com/allegro/bigcache/v3 v3.1.0 + github.com/bufbuild/connect-go v1.10.0 + github.com/bytedance/sonic v1.9.2 + github.com/cockroachdb/errors v1.10.0 github.com/disintegration/imaging v1.6.2 - github.com/ethereum/go-ethereum v1.10.16 - github.com/fatih/color v1.13.0 - github.com/fbsobreira/gotron-sdk v0.0.0-20211102183839-58a64f4da5f4 - github.com/gin-contrib/cors v1.3.1 - github.com/gin-gonic/gin v1.8.1 - github.com/go-redis/redis/v8 v8.11.4 + github.com/fatih/color v1.15.0 + github.com/getsentry/sentry-go v0.23.0 + github.com/gin-contrib/cors v1.4.0 + github.com/gin-gonic/gin v1.9.1 github.com/go-resty/resty/v2 v2.7.0 - github.com/goccy/go-json v0.9.7 - github.com/gofrs/uuid v4.0.0+incompatible - github.com/golang-jwt/jwt/v4 v4.4.2 + github.com/goccy/go-json v0.10.2 + github.com/gofrs/uuid/v5 v5.0.0 + github.com/golang-jwt/jwt/v4 v4.5.0 github.com/golang-migrate/migrate/v4 v4.15.2 - github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible + github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible github.com/json-iterator/go v1.1.12 - github.com/meilisearch/meilisearch-go v0.21.0 - github.com/minio/minio-go/v7 v7.0.45 - github.com/sirupsen/logrus v1.9.0 - github.com/smartwalle/alipay/v3 v3.1.7 - github.com/spf13/viper v1.14.0 - github.com/tencentyun/cos-go-sdk-v5 v0.7.35 + github.com/meilisearch/meilisearch-go v0.25.0 + github.com/minio/minio-go/v7 v7.0.61 + github.com/onsi/ginkgo/v2 v2.11.0 + github.com/onsi/gomega v1.27.10 + github.com/pyroscope-io/client v0.7.1 + github.com/redis/rueidis v1.0.14 + github.com/sirupsen/logrus v1.9.3 + github.com/smartwalle/alipay/v3 v3.2.15 + github.com/sourcegraph/conc v0.3.0 + github.com/spf13/viper v1.16.0 + github.com/tencentyun/cos-go-sdk-v5 v0.7.42 github.com/yinheli/mahonia v0.0.0-20131226213531-0eef680515cc - google.golang.org/grpc v1.50.1 - google.golang.org/protobuf v1.28.1 - gopkg.in/natefinch/lumberjack.v2 v2.0.0 + go.uber.org/automaxprocs v1.5.3 + google.golang.org/grpc v1.57.0 + google.golang.org/protobuf v1.31.0 + gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/resty.v1 v1.12.0 - gorm.io/driver/mysql v1.3.4 - gorm.io/driver/postgres v1.3.7 - gorm.io/driver/sqlite v1.3.4 - gorm.io/gorm v1.23.4 - gorm.io/plugin/dbresolver v1.1.0 - gorm.io/plugin/soft_delete v1.1.0 - modernc.org/sqlite v1.17.3 + gorm.io/driver/mysql v1.5.1 + gorm.io/driver/postgres v1.5.2 + gorm.io/driver/sqlite v1.5.2 + gorm.io/gorm v1.25.2 + gorm.io/plugin/dbresolver v1.4.2 + gorm.io/plugin/soft_delete v1.2.1 + modernc.org/sqlite v1.25.0 ) require ( - github.com/andybalholm/brotli v1.0.4 // indirect - github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect - github.com/btcsuite/btcd v0.22.0-beta // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/clbanning/mxj v1.8.4 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/dustin/go-humanize v1.0.0 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-playground/locales v0.14.0 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-playground/validator/v10 v10.10.1 // indirect - github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/go-logr/logr v1.2.4 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect + github.com/go-sql-driver/mysql v1.7.0 // indirect + github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-querystring v1.1.0 // indirect + github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect github.com/google/uuid v1.3.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/jackc/chunkreader/v2 v2.0.1 // indirect - github.com/jackc/pgconn v1.12.1 // indirect - github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgproto3/v2 v2.3.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect - github.com/jackc/pgtype v1.11.0 // indirect - github.com/jackc/pgx/v4 v4.16.1 // indirect + github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgx/v5 v5.3.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/klauspost/compress v1.15.9 // indirect - github.com/klauspost/cpuid/v2 v2.1.0 // indirect - github.com/leodido/go-urn v1.2.1 // indirect - github.com/lib/pq v1.10.2 // indirect - github.com/magiconair/properties v1.8.6 // indirect + github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/lib/pq v1.10.0 // indirect + github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect - github.com/mattn/go-sqlite3 v1.14.12 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-sqlite3 v1.14.17 // indirect github.com/minio/md5-simd v1.1.2 // indirect - github.com/minio/sha256-simd v1.0.0 // indirect + github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/mozillazg/go-httpheader v0.3.1 // indirect - github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.5 // indirect + github.com/mozillazg/go-httpheader v0.2.1 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect - github.com/rs/xid v1.4.0 // indirect - github.com/smartwalle/crypto4go v1.0.2 // indirect - github.com/spf13/afero v1.9.2 // indirect - github.com/spf13/cast v1.5.0 // indirect + github.com/pyroscope-io/godeltaprof v0.1.0 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect + github.com/rs/xid v1.5.0 // indirect + github.com/smartwalle/ncrypto v1.0.2 // indirect + github.com/smartwalle/ngx v1.0.6 // indirect + github.com/smartwalle/nsign v1.0.8 // indirect + github.com/spf13/afero v1.9.5 // indirect + github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.4.1 // indirect + github.com/subosito/gotenv v1.4.2 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.7 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.37.1-0.20220607072126-8a320890c08d // indirect + github.com/valyala/fasthttp v1.40.0 // indirect go.uber.org/atomic v1.9.0 // indirect - golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect - golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect - golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 // indirect - golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect - golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect - golang.org/x/sys v0.0.0-20220908164124-27713097b956 // indirect - golang.org/x/text v0.4.0 // indirect - golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect - golang.org/x/tools v0.1.12 // indirect - google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e // indirect + golang.org/x/arch v0.3.0 // indirect + golang.org/x/crypto v0.11.0 // indirect + golang.org/x/image v0.0.0-20210216034530-4410531fe030 // indirect + golang.org/x/mod v0.10.0 // indirect + golang.org/x/net v0.12.0 // indirect + golang.org/x/sys v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect + golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.9.3 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - lukechampine.com/uint128 v1.1.1 // indirect - modernc.org/cc/v3 v3.36.0 // indirect - modernc.org/ccgo/v3 v3.16.6 // indirect - modernc.org/libc v1.16.7 // indirect - modernc.org/mathutil v1.4.1 // indirect - modernc.org/memory v1.1.1 // indirect - modernc.org/opt v0.1.1 // indirect - modernc.org/strutil v1.1.1 // indirect - modernc.org/token v1.0.0 // indirect + lukechampine.com/uint128 v1.2.0 // indirect + modernc.org/cc/v3 v3.40.0 // indirect + modernc.org/ccgo/v3 v3.16.13 // indirect + modernc.org/libc v1.24.1 // indirect + modernc.org/mathutil v1.5.0 // indirect + modernc.org/memory v1.6.0 // indirect + modernc.org/opt v0.1.3 // indirect + modernc.org/strutil v1.1.3 // indirect + modernc.org/token v1.0.1 // indirect ) diff --git a/go.sum b/go.sum index f009c99f..3cb171d4 100644 --- a/go.sum +++ b/go.sum @@ -3,14 +3,12 @@ bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= @@ -39,7 +37,6 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= @@ -54,15 +51,11 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= -github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= -github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= @@ -70,35 +63,23 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOEl github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/adal v0.9.16/go.mod h1:tGMin8I49Yij6AQ+rvV+Xa/zwxYQB5hmsd6DkfAx2+A= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ClickHouse/clickhouse-go v1.4.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= -github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= @@ -132,9 +113,6 @@ github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdko github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= -github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868 h1:uFrPOl1VBt/Abfl2z+A/DFc+AwmFLxEHR1+Yq6cXvww= github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868/go.mod h1:srphKZ1i+yGXxl/LpBS7ZIECTjCTPzZzAMtJWoG3sLo= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -145,20 +123,18 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= -github.com/alimy/cfg v0.3.0 h1:9xgA0QWVCPSq9fFNRcYahVCAX22IL9ts2wrTQPfAStY= -github.com/alimy/cfg v0.3.0/go.mod h1:rOxbasTH2srl6StAjNF5Vyi8bfrdkl3fLGmOYtSw81c= -github.com/alimy/mir/v3 v3.0.0 h1:bUcT+SLs/BYHIuHzTCbYnxnEwbYDSCDJULU5a1YZDes= -github.com/alimy/mir/v3 v3.0.0/go.mod h1:ybhT2ijOiDn0lLwWzIY6vXdv+uzZrctS7VFfczcXBWU= -github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible h1:9gWa46nstkJ9miBReJcN8Gq34cBFbzSpQZVVT9N09TM= -github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= -github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/allegro/bigcache/v3 v3.0.2 h1:AKZCw+5eAaVyNTBmI2fgyPVJhHkdWder3O9IrprcQfI= -github.com/allegro/bigcache/v3 v3.0.2/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= +github.com/alimy/cfg v0.4.0 h1:SslKPndmxRViT1ePWLmNsEq7okYP0GVeuowQlRWZPkw= +github.com/alimy/cfg v0.4.0/go.mod h1:rOxbasTH2srl6StAjNF5Vyi8bfrdkl3fLGmOYtSw81c= +github.com/alimy/mir/v4 v4.0.0 h1:MzGfmoLjjvR69jbZEmpKJO3tUuqB0RGRv1UWPbtukBg= +github.com/alimy/mir/v4 v4.0.0/go.mod h1:d58dBvw2KImcVbAUANrciEV/of0arMNsI9c/5UNCMMc= +github.com/aliyun/aliyun-oss-go-sdk v2.2.8+incompatible h1:6JF1bjhT0WN2srEmijfOFtVWwV91KZ6dJY1/JbdtGrI= +github.com/aliyun/aliyun-oss-go-sdk v2.2.8+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= +github.com/allegro/bigcache/v3 v3.1.0 h1:H2Vp8VOvxcrB91o86fUSVJFqeuz8kpyyB02eH3bSzwk= +github.com/allegro/bigcache/v3 v3.1.0/go.mod h1:aPyh7jEvrog9zAwx5N7+JUQX5dZTSGpxF1LAR4dr35I= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= +github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/arrow/go/arrow v0.0.0-20210818145353-234c94e4ce64/go.mod h1:2qMFB56yOP3KzkB3PbYZ4AlUFg3a88F67TIx5lB/WwY= github.com/apache/arrow/go/arrow v0.0.0-20211013220434-5962184e7a30/go.mod h1:Q7yQnSMnLvcXlZ8RV+jwz/6y1rQTqbX6C82SndT52Zs= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -168,16 +144,12 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.17.7/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= github.com/aws/aws-sdk-go-v2 v1.8.0/go.mod h1:xEFuWz+3TYdlPRuo+CqATbeDWIWyaT5uAPwPaWtgse0= github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= github.com/aws/aws-sdk-go-v2/config v1.6.0/go.mod h1:TNtBVmka80lRPk5+S9ZqVfFszOQAGJJ9KbT3EM3CHNU= github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= github.com/aws/aws-sdk-go-v2/credentials v1.3.2/go.mod h1:PACKuTJdt6AlXvEq8rFI4eDmoqDFC5DpVKQbWysaDgM= github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.4.0/go.mod h1:Mj/U8OpDbcVcoctrYwA2bak8k/HFPdcLzI/vaiXMwuM= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.6.0/go.mod h1:gqlclDEZp4aqJOancXK6TN24aKhT0W0Ae9MHk3wzTMM= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.4.0/go.mod h1:eHwXu2+uE/T6gpnYWwBwqoeqRf9IXyCcolyOWDRAErQ= @@ -186,25 +158,18 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.2.0/go.mod h1:Q5jATQc+f1MfZp3PDMhn6 github.com/aws/aws-sdk-go-v2/internal/ini v1.2.4/go.mod h1:ZcBrrI3zBKlhGFNYWvju0I3TR93I7YIgAfy82Fh4lcQ= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.2.2/go.mod h1:EASdTcM1lGhUe1/p4gkojHwlGJkeoRjjr1sRCzup3Is= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.3.0/go.mod h1:v8ygadNyATSm6elwJ/4gzJwcFhri9RqS8skgHKiwXPU= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.2/go.mod h1:NXmNI41bdEsJMrD0v9rUvbGCB5GwdBEpKvUvIY3vTFg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.3.2/go.mod h1:72HRZDLMtmVQiLG2tLfQcaWLCssELvGl+Zf2WVxMmR8= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.5.2/go.mod h1:QuL2Ym8BkrLmN4lUofXYq6000/i5jPjosCNK//t6gak= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.7.2/go.mod h1:np7TMuJNT83O0oDOSF8i4dF3dvGqA6hPYYo6YYkzgRA= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= github.com/aws/aws-sdk-go-v2/service/s3 v1.12.0/go.mod h1:6J++A5xpo7QDsIeSqPK4UHqMSyPOCopa+zKtqAMhqVQ= github.com/aws/aws-sdk-go-v2/service/s3 v1.16.1/go.mod h1:CQe/KvWV1AqRc65KqeJjrLzr5X2ijnFTTVzJW0VBRCI= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= github.com/aws/aws-sdk-go-v2/service/sso v1.3.2/go.mod h1:J21I6kF+d/6XHVk7kp/cx9YVD2TMD2TbLwtRGVcinXo= github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= github.com/aws/aws-sdk-go-v2/service/sts v1.6.1/go.mod h1:hLZ/AnkIKHLuPGjEiyghNEdvJ2PP0MgOxcmv9EBJ4xs= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aws/smithy-go v1.7.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA= -github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -219,47 +184,33 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= -github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/bufbuild/connect-go v1.10.0 h1:QAJ3G9A1OYQW2Jbk3DeoJbkCxuKArrvZgDt47mjdTbg= +github.com/bufbuild/connect-go v1.10.0/go.mod h1:CAIePUgkDR5pAFaylSMtNK45ANQjp9JvpluG20rhpV8= github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/bytedance/sonic v1.5.0 h1:XWdTi8bwPgxIML+eNV1IwNuTROK6EUrQ65ey8yd6fRQ= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= +github.com/bytedance/sonic v1.9.2 h1:GDaNjuWSGu09guE9Oql0MSTNhNCLlWwO8y/xM5BzcbM= +github.com/bytedance/sonic v1.9.2/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06 h1:1sDoSuDPWzhkdzNVxCxtIaKiAe96ESVPv8coGwc1gZ4= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -272,7 +223,6 @@ github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2u github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I= github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -284,15 +234,18 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3Kb23bWV10IRV1TyeSpwM= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= +github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= +github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= -github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= @@ -413,7 +366,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/cznic/mathutil v0.0.0-20180504122225-ca4c9f2c1369/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= @@ -421,28 +373,18 @@ github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1S github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= -github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= -github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dhui/dktest v0.3.10 h1:0frpeeoM9pHouHjhLeZDuDTJ0PqjDTrycaHaMmkJAo8= github.com/dhui/dktest v0.3.10/go.mod h1:h5Enh0nG3Qbo9WjNFRrwmKUaePEBhXMOygbz3Ww7Sz0= github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c= github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= @@ -450,7 +392,6 @@ github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.13+incompatible h1:5s7uxnKZG+b8hYWlPYUi6x1Sjpq2MSt96d15eLZeHyw= github.com/docker/docker v20.10.13+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= @@ -466,14 +407,11 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= @@ -488,24 +426,19 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= -github.com/ethereum/go-ethereum v1.10.16 h1:3oPrumn0bCW/idjcxMn5YYVCdK7VzJYIvwGZUGLEaoc= -github.com/ethereum/go-ethereum v1.10.16/go.mod h1:Anj6cxczl+AHy63o4X9O8yWNHuN5wMpfb8MAnHkWn7Y= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fbsobreira/gotron-sdk v0.0.0-20211102183839-58a64f4da5f4 h1:zlN+of+l+or/Y6CYgpX99wwaTf4zN0myVj6YAXiE3xk= -github.com/fbsobreira/gotron-sdk v0.0.0-20211102183839-58a64f4da5f4/go.mod h1:h93/Km+mJz1q4a+4fjYE+dMxzTRTrJjxaVIc/Tm9uV0= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.5+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -514,23 +447,22 @@ github.com/fsouza/fake-gcs-server v1.17.0/go.mod h1:D1rTE4YCyHFNa99oyJJ5HyclvN/0 github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/gabriel-vasile/mimetype v1.3.1/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8= github.com/gabriel-vasile/mimetype v1.4.0/go.mod h1:fA8fi6KUiG7MgQQ+mEWotXoEOvmxRtOJlERCzSmRvr8= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= +github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= +github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gin-contrib/cors v1.3.1 h1:doAsuITavI4IOcd0Y19U4B+O0dNWihRyX//nn4sEmgA= -github.com/gin-contrib/cors v1.3.1/go.mod h1:jjEJ4268OPZUcU7k9Pm653S7lXUGcqMADzFA61xsmDk= +github.com/gin-contrib/cors v1.4.0 h1:oJ6gwtUl3lqV0WEIwM/LxPF1QZ5qe2lGWdY2+bz7y0g= +github.com/gin-contrib/cors v1.4.0/go.mod h1:bs9pNM0x/UsmHPBWT2xZz9ROh8xYjYkiURUfmBoMlcs= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= -github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= -github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= -github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= @@ -552,9 +484,10 @@ github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTg github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -569,28 +502,28 @@ github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dp github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.10.1 h1:uA0+amWMiglNZKZ9FJRKUAe9U3RX91eVn1JYXMWt7ig= -github.com/go-playground/validator/v10 v10.10.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= -github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= -github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= +github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= @@ -616,8 +549,9 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gocql/gocql v0.0.0-20210515062232-b7ef815b4556/go.mod h1:DL0ekTmBSTdlNF25Orwt/JMzqIq3EJ4MVa/J/uK64OY= github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= @@ -626,9 +560,9 @@ github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M= +github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -640,14 +574,13 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-migrate/migrate/v4 v4.15.2 h1:vU+M05vs6jWHKDdmE1Ecwj0BznygFc4QsdRe2E/L7kc= github.com/golang-migrate/migrate/v4 v4.15.2/go.mod h1:f2toGLkYqD3JH+Todi4aZ2ZdbeUNx4sIwiOK96rE9Lw= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -681,18 +614,16 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -707,6 +638,7 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -714,7 +646,6 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -735,11 +666,12 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20230207041349-798e818bf904 h1:4/hN5RUoecvl+RmJRE2YxKWtnnQls6rQjjW5oV7qg2U= +github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -757,11 +689,9 @@ github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/ github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -777,7 +707,6 @@ github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FK github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= @@ -793,20 +722,15 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible h1:tANYIteuFrosKbRYUk1Yo/OGJjbt4x3OVg211Qc60M0= -github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s= -github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= -github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible h1:XRAk4HBDLCYEdPLWtKf5iZhOi7lfx17aY0oSO9+mcg8= +github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.4+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -816,23 +740,11 @@ github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= -github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= -github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= -github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= -github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= -github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= -github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= -github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= -github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= -github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= @@ -841,17 +753,9 @@ github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5 github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= -github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.12.1 h1:rsDFzIpRk7xT4B8FufgpCCeyjdNpKyghZeSefViE5W8= -github.com/jackc/pgconn v1.12.1/go.mod h1:ZkhRC59Llhrq3oSfrikvwQ5NaxYExr6twkdkMLaKono= github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds= -github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= -github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= -github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= @@ -862,12 +766,10 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1: github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.0.7/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.3.0 h1:brH0pCGBDkBW07HWlN/oSBXrmo3WB0UvZd1pIuDcL8Y= -github.com/jackc/pgproto3/v2 v2.3.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= @@ -875,9 +777,6 @@ github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4 github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po= github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= github.com/jackc/pgtype v1.6.2/go.mod h1:JCULISAZBFGrHaOXIIFiyfzW5VY0GRitRr8NeJsrdig= -github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.11.0 h1:u4uiGPz/1hryuXzyaBhSk6dnIyyG2683olG2OV+UUgs= -github.com/jackc/pgtype v1.11.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= @@ -885,19 +784,13 @@ github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXg github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o= github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= github.com/jackc/pgx/v4 v4.10.1/go.mod h1:QlrWebbs3kqEZPHCTGyxecvzG6tvIsYu+A5b1raylkA= -github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.16.1 h1:JzTglcal01DrghUqt+PmzWsZx/Yh7SC/CTQmSBMTd0Y= -github.com/jackc/pgx/v4 v4.16.1/go.mod h1:SIhx0D5hoADaiXZVyv+3gSm3LCIIINTVO0PficsvWGQ= +github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU= +github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= @@ -918,7 +811,6 @@ github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUB github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -927,16 +819,13 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/k0kubun/pp v2.3.0+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= @@ -946,8 +835,6 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= @@ -956,16 +843,12 @@ github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8 github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.6/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.1.0 h1:eyi1Ad2aNJMW95zcSbmGg7Cg6cq3ADwLpMAP96d8rF0= -github.com/klauspost/cpuid/v2 v2.1.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= -github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= -github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -974,8 +857,9 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= @@ -983,27 +867,22 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/ktrysmt/go-bitbucket v0.6.4/go.mod h1:9u0v3hsd2rqCHRIpbir1oP7F58uo5dq19sBYvuMoyQ4= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E= github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= -github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -1015,18 +894,12 @@ github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsI github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -1035,35 +908,33 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.12 h1:TJ1bhYJPV44phC+IMu1u2K/i5RriLTPe+yc68XDJ1Z0= -github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= +github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= +github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= -github.com/meilisearch/meilisearch-go v0.21.0 h1:SwYMWJVi6vDdSDJdOmbkJ4T26PavjYc4MlZcJZF9+Qs= -github.com/meilisearch/meilisearch-go v0.21.0/go.mod h1:3dvPYZGUWu40qHoTK187fmqF2lrarboPa5m2Yu2Seh4= +github.com/meilisearch/meilisearch-go v0.25.0 h1:xIp+8YWterHuDvpdYlwQ4Qp7im3JlRHmSKiP0NvjyXs= +github.com/meilisearch/meilisearch-go v0.25.0/go.mod h1:SxuSqDcPBIykjWz1PX+KzsYzArNLSCadQodWs8extS0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.45 h1:g4IeM9M9pW/Lo8AGGNOjBZYlvmtlE1N5TQEYWXRWzIs= -github.com/minio/minio-go/v7 v7.0.45/go.mod h1:nCrRzjoSUQh8hgKKtu3Y708OLvRLtuASMg2/nvmbarw= -github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= -github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= +github.com/minio/minio-go/v7 v7.0.61 h1:87c+x8J3jxQ5VUGimV9oHdpjsAvy3fhneEBKuoKEVUI= +github.com/minio/minio-go/v7 v7.0.61/go.mod h1:BTu8FcrEw+HidY0zd/0eny43QnVNkXRPXrLXFuQBHXg= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= +github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -1074,12 +945,10 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= -github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= @@ -1102,11 +971,9 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ= github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= -github.com/mozillazg/go-httpheader v0.3.1 h1:IRP+HFrMX2SlwY9riuio7raffXUpzAosHtZu25BSJok= -github.com/mozillazg/go-httpheader v0.3.1/go.mod h1:PuT8h0pw6efvp8ZeUec1Rs7dwjK08bt6gKSReGMqtdA= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mutecomm/go-sqlcipher/v4 v4.4.0/go.mod h1:PyN04SaWalavxRGH9E8ZftG6Ju7rsPrGmQRjrEaVpiY= @@ -1114,21 +981,16 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8/go.mod h1:86wM1zFnC6/uDBfZGNwB65O+pR2OFi5q/YQaEUid1qA= -github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= -github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/neo4j/neo4j-go-driver v1.8.1-0.20200803113522-b626aa943eba/go.mod h1:ncO5VaFWh0Nrt+4KT4mOZboaczBZcLuHrG+/sUeP8gI= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1137,12 +999,11 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0 github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= +github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -1150,8 +1011,8 @@ github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= -github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1181,27 +1042,21 @@ github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqi github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= -github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= -github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= +github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= -github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.8/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -1212,11 +1067,11 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= @@ -1250,23 +1105,28 @@ github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/pyroscope-io/client v0.7.1 h1:yFRhj3vbgjBxehvxQmedmUWJQ4CAfCHhn+itPsuWsHw= +github.com/pyroscope-io/client v0.7.1/go.mod h1:4h21iOU4pUOq0prKyDlvYRL+SCKsBc5wKiEtV+rJGqU= +github.com/pyroscope-io/godeltaprof v0.1.0 h1:UBqtjt0yZi4jTxqZmLAs34XG6ycS3vUTlhEUSq4NHLE= +github.com/pyroscope-io/godeltaprof v0.1.0/go.mod h1:psMITXp90+8pFenXkKIpNhrfmI9saQnPbba27VIaiQE= +github.com/redis/rueidis v1.0.14 h1:qdFZahk1F/2L+sZeOECx5E2N5J4Qc51b7ezSUpQXJfs= +github.com/redis/rueidis v1.0.14/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo= github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= -github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1274,20 +1134,14 @@ github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfF github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= -github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= @@ -1299,28 +1153,34 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartwalle/alipay/v3 v3.1.7 h1:J4U5slABafKVD/b9gPCZe/3HAPB8Pa2NOYOPcugEJBo= -github.com/smartwalle/alipay/v3 v3.1.7/go.mod h1:cZUMCCnsux9YAxA0/f3PWUR+7wckWtE1BqxbVRtGij0= -github.com/smartwalle/crypto4go v1.0.2 h1:9DUEOOsPhmp00438L4oBdcL8EZG1zumecft5bWj5phI= -github.com/smartwalle/crypto4go v1.0.2/go.mod h1:LQ7vCZIb7BE5+MuMtJBuO8ORkkQ01m4DXDBWPzLbkMY= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/smartwalle/alipay/v3 v3.2.15 h1:3fvFJnINKKAOXHR/Iv20k1Z7KJ+nOh3oK214lELPqG8= +github.com/smartwalle/alipay/v3 v3.2.15/go.mod h1:niTNB609KyUYuAx9Bex/MawEjv2yPx4XOjxSAkqmGjE= +github.com/smartwalle/ncrypto v1.0.2 h1:pTAhCqtPCMhpOwFXX+EcMdR6PNzruBNoGQrN2S1GbGI= +github.com/smartwalle/ncrypto v1.0.2/go.mod h1:Dwlp6sfeNaPMnOxMNayMTacvC5JGEVln3CVdiVDgbBk= +github.com/smartwalle/ngx v1.0.6 h1:JPNqNOIj+2nxxFtrSkJO+vKJfeNUSEQueck/Wworjps= +github.com/smartwalle/ngx v1.0.6/go.mod h1:mx/nz2Pk5j+RBs7t6u6k22MPiBG/8CtOMpCnALIG8Y0= +github.com/smartwalle/nsign v1.0.8 h1:78KWtwKPrdt4Xsn+tNEBVxaTLIJBX9YRX0ZSrMUeuHo= +github.com/smartwalle/nsign v1.0.8/go.mod h1:eY6I4CJlyNdVMP+t6z1H6Jpd4m5/V+8xi44ufSTxXgc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/snowflakedb/gosnowflake v1.6.3/go.mod h1:6hLajn6yxuJ4xUHZegMekpq9rnQbGJ7TMwXjgTmA6lg= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= -github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= @@ -1336,9 +1196,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= -github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -1346,8 +1205,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1356,47 +1215,42 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= -github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= +github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.194/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.194/go.mod h1:yrBKWhChnDqNz1xuXdSbWXG56XawEq0G5j1lg4VwBD4= -github.com/tencentyun/cos-go-sdk-v5 v0.7.35 h1:XVk5GQ4eH1q+DBUJfpaMMdU9TJZWMjwNNwv0PG5nbLQ= -github.com/tencentyun/cos-go-sdk-v5 v0.7.35/go.mod h1:4dCEtLHGh8QPxHEkgq+nFaky7yZxQuYwgSJM87icDaw= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0= +github.com/tencentyun/cos-go-sdk-v5 v0.7.42 h1:Up1704BJjI5orycXKjpVpvuOInt9GC5pqY4knyE9Uds= +github.com/tencentyun/cos-go-sdk-v5 v0.7.42/go.mod h1:LUFnaqRmGk6pEHOaRmdn2dCZR2j0cSsM5xowWFPTPao= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= -github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.37.1-0.20220607072126-8a320890c08d h1:xS9QTPgKl9ewGsAOPc+xW7DeStJDqYPfisDmeSCcbco= github.com/valyala/fasthttp v1.37.1-0.20220607072126-8a320890c08d/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/valyala/fasthttp v1.40.0 h1:CRq/00MfruPGFLTQKY8b+8SfdK60TxNztjRMnH0t1Yc= +github.com/valyala/fasthttp v1.40.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= @@ -1406,7 +1260,6 @@ github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmF github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVThkpGiXrs= @@ -1417,7 +1270,6 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yinheli/mahonia v0.0.0-20131226213531-0eef680515cc h1:7VHQaaNwHymWbj8lAcXMYX1qopebSBHwYC3ceXLWONU= github.com/yinheli/mahonia v0.0.0-20131226213531-0eef680515cc/go.mod h1:Pcc297eVCbkDBBVq8FbnI+qDUeIMrHy4Bo7nveAuCAs= @@ -1476,25 +1328,24 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= +go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1503,37 +1354,28 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1557,9 +1399,8 @@ golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+o golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210216034530-4410531fe030 h1:lP9pYkih3DUSC641giIXa2XqfTIbbbRr0w2EOTA7wHA= golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 h1:LRtI4W37N+KFebI/qV0OFiLUv4GLOWeEW5hn/KEJvxE= -golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1584,10 +1425,9 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1629,7 +1469,6 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1639,7 +1478,6 @@ golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= @@ -1649,7 +1487,6 @@ golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -1658,8 +1495,8 @@ golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b h1:tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180227000427-d7d64896b5ff/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1690,6 +1527,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= golang.org/x/sys v0.0.0-20180224232135-f6cff0780e54/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1734,7 +1572,6 @@ golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1757,9 +1594,7 @@ golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1783,12 +1618,10 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1809,8 +1642,6 @@ golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1819,10 +1650,13 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220317061510-51cd9980dadf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956 h1:XeJjHH1KiLpKGb6lvMiksZ9l0fVUh+AmGcm0nOMEBOY= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1837,20 +1671,19 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1893,8 +1726,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1932,8 +1763,8 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= +golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1941,11 +1772,8 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= -gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= @@ -1997,7 +1825,6 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -2005,7 +1832,6 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= @@ -2065,8 +1891,8 @@ google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220111164026-67b88f271998/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e h1:S9GbmC1iCgvbLyAokVCwiO6tVIrU9Y7c5oMx1V/ki/Y= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -2100,8 +1926,8 @@ google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= -google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= +google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -2116,8 +1942,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2131,25 +1958,20 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= -gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -2159,34 +1981,33 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/driver/mysql v1.0.3/go.mod h1:twGxftLBlFgNVNakL7F+P/x9oYqoymG3YYT8cAfI9oI= -gorm.io/driver/mysql v1.3.4 h1:/KoBMgsUHC3bExsekDcmNYaBnfH2WNeFuXqqrqMc98Q= -gorm.io/driver/mysql v1.3.4/go.mod h1:s4Tq0KmD0yhPGHbZEwg1VPlH0vT/GBHJZorPzhcxBUE= +gorm.io/driver/mysql v1.4.3/go.mod h1:sSIebwZAVPiT+27jK9HIwvsqOGKx3YMPmrA3mBJR10c= +gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw= +gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o= gorm.io/driver/postgres v1.0.8/go.mod h1:4eOzrI1MUfm6ObJU/UcmbXyiHSs8jSwH95G5P5dxcAg= -gorm.io/driver/postgres v1.3.7 h1:FKF6sIMDHDEvvMF/XJvbnCl0nu6KSKUaPXevJ4r+VYQ= -gorm.io/driver/postgres v1.3.7/go.mod h1:f02ympjIcgtHEGFMZvdgTxODZ9snAHDb4hXfigBVuNI= +gorm.io/driver/postgres v1.5.2 h1:ytTDxxEv+MplXOfFe3Lzm7SjG09fcdb3Z/c056DTBx0= +gorm.io/driver/postgres v1.5.2/go.mod h1:fmpX0m2I1PKuR7mKZiEluwrP3hbs+ps7JIGMUBpCgl8= gorm.io/driver/sqlite v1.1.3/go.mod h1:AKDgRWk8lcSQSw+9kxCJnX/yySj8G3rdwYlU57cB45c= -gorm.io/driver/sqlite v1.3.4 h1:NnFOPVfzi4CPsJPH4wXr6rMkPb4ElHEqKMvrsx9c9Fk= -gorm.io/driver/sqlite v1.3.4/go.mod h1:B+8GyC9K7VgzJAcrcXMRPdnMcck+8FgJynEehEPM16U= +gorm.io/driver/sqlite v1.5.2 h1:TpQ+/dqCY4uCigCFyrfnrJnrW9zjpelWVoEVNy5qJkc= +gorm.io/driver/sqlite v1.5.2/go.mod h1:qxAuCol+2r6PannQDpOP1FP6ag3mKi4esLnB/jHed+4= gorm.io/gorm v1.20.1/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.20.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= -gorm.io/gorm v1.20.11/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.20.12/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.21.4/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.23.0/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= -gorm.io/gorm v1.23.4 h1:1BKWM67O6CflSLcwGQR7ccfmC4ebOxQrTfOQGRE9wjg= -gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= -gorm.io/plugin/dbresolver v1.1.0 h1:cegr4DeprR6SkLIQlKhJLYxH8muFbJ4SmnojXvoeb00= -gorm.io/plugin/dbresolver v1.1.0/go.mod h1:tpImigFAEejCALOttyhWqsy4vfa2Uh/vAUVnL5IRF7Y= -gorm.io/plugin/soft_delete v1.1.0 h1:LcE4L+GD29RkkMLxMYHpT4wQCJ/9945FsdU/mHGaDuE= -gorm.io/plugin/soft_delete v1.1.0/go.mod h1:Zv7vQctOJTGOsJ/bWgrN1n3od0GBAZgnLjEx+cApLGk= +gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.2 h1:gs1o6Vsa+oVKG/a9ElL3XgyGfghFfkKA2SInQaCyMho= +gorm.io/gorm v1.25.2/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/plugin/dbresolver v1.4.2 h1:IeLSH20ayxbo4rN6HMIQ0ccdsh/fkLK23pp6ivZrqBI= +gorm.io/plugin/dbresolver v1.4.2/go.mod h1:l4Cn87EHLEYuqUncpEeTC2tTJQkjngPSD+lo8hIvcT0= +gorm.io/plugin/soft_delete v1.2.1 h1:qx9D/c4Xu6w5KT8LviX8DgLcB9hkKl6JC9f44Tj7cGU= +gorm.io/plugin/soft_delete v1.2.1/go.mod h1:Zv7vQctOJTGOsJ/bWgrN1n3od0GBAZgnLjEx+cApLGk= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= @@ -2198,7 +2019,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= @@ -2242,20 +2062,16 @@ k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -lukechampine.com/uint128 v1.1.1 h1:pnxCASz787iMf+02ssImqk6OLt+Z5QHMoZyUXR4z6JU= -lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= +lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= +lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/b v1.0.0/go.mod h1:uZWcZfRj1BpYzfN9JTerzlNUnnPsV9O2ZA8JsRcubNg= modernc.org/cc/v3 v3.32.4/go.mod h1:0R6jl1aZlIl2avnYfbfHBS1QB6/f+16mihBObaBC878= -modernc.org/cc/v3 v3.36.0 h1:0kmRkTmqNidmu3c7BNDSdVHCxXCkWLmWmCIVX4LUboo= -modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= -modernc.org/ccgo/v3 v3.0.0-20220428102840-41399a37e894/go.mod h1:eI31LL8EwEBKPpNpA4bU1/i+sKOwOrQy8D87zWUcRZc= -modernc.org/ccgo/v3 v3.0.0-20220430103911-bc99d88307be/go.mod h1:bwdAnOoaIt8Ax9YdWGjxWsdkPcZyRPHqrOvJxaKAKGw= +modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= +modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0= modernc.org/ccgo/v3 v3.9.2/go.mod h1:gnJpy6NIVqkETT+L5zPsQFj7L2kkhfPMzOghRNv/CFo= -modernc.org/ccgo/v3 v3.16.4/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= -modernc.org/ccgo/v3 v3.16.6 h1:3l18poV+iUemQ98O3X5OMr97LOqlzis+ytivU4NqGhA= -modernc.org/ccgo/v3 v3.16.6/go.mod h1:tGtX0gE9Jn7hdZFeU88slbTh1UtCYKusWOoCJuvkWsQ= +modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= +modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY= modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= -modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/db v1.0.0/go.mod h1:kYD/cO29L/29RM0hXYl4i3+Q5VojL31kTUVpVJDw0s8= modernc.org/file v1.0.0/go.mod h1:uqEokAEn1u6e+J45e54dsEA/pw4o7zLrA2GwyntZzjw= modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8= @@ -2263,41 +2079,38 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= modernc.org/internal v1.0.0/go.mod h1:VUD/+JAkhCpvkUitlEOnhpVxCgsBI90oTzSCRcqQVSM= -modernc.org/libc v0.0.0-20220428101251-2d5f3daf273b/go.mod h1:p7Mg4+koNjc8jkqwcoFBJx7tXkpj00G77X7A72jXPXA= modernc.org/libc v1.7.13-0.20210308123627-12f642a52bb8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= modernc.org/libc v1.9.5/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= -modernc.org/libc v1.16.0/go.mod h1:N4LD6DBE9cf+Dzf9buBlzVJndKr/iJHG97vGLHYnb5A= -modernc.org/libc v1.16.1/go.mod h1:JjJE0eu4yeK7tab2n4S1w8tlWd9MxXLRzheaRnAKymU= -modernc.org/libc v1.16.7 h1:qzQtHhsZNpVPpeCu+aMIQldXeV1P0vRhSqCL0nOIJOA= -modernc.org/libc v1.16.7/go.mod h1:hYIV5VZczAmGZAnG15Vdngn5HSF5cSkbvfz2B7GRuVU= +modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM= +modernc.org/libc v1.24.1/go.mod h1:FmfO1RLrU3MHJfyi9eYYmZBfi/R+tqZ6+hQ3yQQUkak= modernc.org/lldb v1.0.0/go.mod h1:jcRvJGWfCGodDZz8BPwiKMJxGJngQ/5DrRapkQnLob8= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.4.1 h1:ij3fYGe8zBF4Vu+g0oT7mB06r8sqGWKuJu1yXeR4by8= -modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= -modernc.org/memory v1.1.1 h1:bDOL0DIDLQv7bWhP3gMvIrnoFw+Eo6F7a2QK9HPDiFU= -modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= -modernc.org/opt v0.1.1 h1:/0RX92k9vwVeDXj+Xn23DKp2VJubL7k8qNffND6qn3A= +modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o= +modernc.org/memory v1.6.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/ql v1.0.0/go.mod h1:xGVyrLIatPcO2C1JvI/Co8c0sr6y91HKFNy4pt9JXEY= modernc.org/sortutil v1.1.0/go.mod h1:ZyL98OQHJgH9IEfN71VsamvJgrtRX9Dj2gX+vH86L1k= modernc.org/sqlite v1.10.6/go.mod h1:Z9FEjUtZP4qFEg6/SiADg9XCER7aYy9a/j7Pg9P7CPs= -modernc.org/sqlite v1.17.3 h1:iE+coC5g17LtByDYDWKpR6m2Z9022YrSh3bumwOnIrI= -modernc.org/sqlite v1.17.3/go.mod h1:10hPVYar9C0kfXuTWGz8s0XtB8uAGymUy51ZzStYe3k= +modernc.org/sqlite v1.25.0 h1:AFweiwPNd/b3BoKnBOfFm+Y260guGMF+0UFk0savqeA= +modernc.org/sqlite v1.25.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/strutil v1.1.1 h1:xv+J1BXY3Opl2ALrBwyfEikFAj8pmqcpnfmuwUwcozs= -modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= +modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= +modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= modernc.org/tcl v1.5.2/go.mod h1:pmJYOLgpiys3oI4AeAafkcUfE+TKKilminxNyU/+Zlo= -modernc.org/tcl v1.13.1 h1:npxzTwFTZYM8ghWicVIX1cRWzj7Nd8i6AqqX2p+IYao= -modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= -modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk= +modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +modernc.org/token v1.0.1 h1:A3qvTqOwexpfZZeyI0FeGPDlSWX5pjZu9hF4lU+EKWg= +modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.0.1-0.20210308123920-1f282aa71362/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= modernc.org/z v1.0.1/go.mod h1:8/SRk5C/HgiQWCgXdfpb+1RvhORdkz5sw72d3jjtyqA= -modernc.org/z v1.5.1 h1:RTNHdsrOpeoSeOF4FbzTo8gBYByaJ5xT7NgZ9ZqRiJM= -modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= +modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= modernc.org/zappy v1.0.0/go.mod h1:hHe+oGahLVII/aTTyWK/b53VDHMAGCBYYeZ9sn83HC4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/internal/conf/alipay.go b/internal/conf/alipay.go new file mode 100644 index 00000000..4f118d64 --- /dev/null +++ b/internal/conf/alipay.go @@ -0,0 +1,38 @@ +package conf + +import ( + "sync" + + "github.com/sirupsen/logrus" + "github.com/smartwalle/alipay/v3" +) + +var ( + _alipayClient *alipay.Client + _onceAlipay sync.Once +) + +func MustAlipayClient() *alipay.Client { + _onceAlipay.Do(func() { + s := AlipaySetting + // 将 key 的验证调整到初始化阶段 + client, err := alipay.New(s.AppID, s.PrivateKey, s.InProduction) + if err != nil { + logrus.Fatalf("alipay.New err: %s", err) + } + // 加载应用公钥证书 + if err = client.LoadAppPublicCertFromFile(s.AppPublicCertFile); err != nil { + logrus.Fatalf("client.LoadAppPublicCertFromFile err: %s\n", err) + } + // 加载支付宝根证书 + if err = client.LoadAliPayRootCertFromFile(s.RootCertFile); err != nil { + logrus.Fatalf("client.LoadAliPayRootCertFromFile err: %s\n", err) + } + // 加载支付宝公钥证书 + if err = client.LoadAliPayPublicCertFromFile(s.PublicCertFile); err != nil { + logrus.Fatalf("client.LoadAliPayPublicCertFromFile err: %s\n", err) + } + _alipayClient = client + }) + return _alipayClient +} diff --git a/internal/conf/conf.go b/internal/conf/conf.go index 950d2d8a..a0dc88df 100644 --- a/internal/conf/conf.go +++ b/internal/conf/conf.go @@ -6,60 +6,61 @@ package conf import ( "log" - "sync" "time" "github.com/alimy/cfg" ) var ( - loggerSetting *LoggerSettingS - loggerFileSetting *LoggerFileSettingS - loggerZincSetting *LoggerZincSettingS - loggerMeiliSetting *LoggerMeiliSettingS - redisSetting *RedisSettingS + loggerSetting *loggerConf + loggerFileSetting *loggerFileConf + loggerZincSetting *loggerZincConf + loggerMeiliSetting *loggerMeiliConf + sentrySetting *sentryConf + redisSetting *redisConf - DatabaseSetting *DatabaseSetingS - MysqlSetting *MySQLSettingS - PostgresSetting *PostgresSettingS - Sqlite3Setting *Sqlite3SettingS - ServerSetting *HttpServerSettingS - WebServerSetting *HttpServerSettingS - AdminServerSetting *HttpServerSettingS - SpaceXServerSetting *HttpServerSettingS - BotServerSetting *HttpServerSettingS - LocalossServerSetting *HttpServerSettingS - FrontendWebSetting *HttpServerSettingS - DocsServerSetting *HttpServerSettingS - MobileServerSetting *GRPCServerSettingS - AppSetting *AppSettingS - CacheIndexSetting *CacheIndexSettingS - SimpleCacheIndexSetting *SimpleCacheIndexSettingS - BigCacheIndexSetting *BigCacheIndexSettingS - SmsJuheSetting *SmsJuheSettings - AlipaySetting *AlipaySettingS - TweetSearchSetting *TweetSearchS - ZincSetting *ZincSettingS - MeiliSetting *MeiliSettingS - ObjectStorage *ObjectStorageS - AliOSSSetting *AliOSSSettingS - COSSetting *COSSettingS - HuaweiOBSSetting *HuaweiOBSSettingS - MinIOSetting *MinIOSettingS - S3Setting *S3SettingS - LocalOSSSetting *LocalOSSSettingS - JWTSetting *JWTSettingS - Mutex *sync.Mutex + PyroscopeSetting *pyroscopeConf + DatabaseSetting *databaseConf + MysqlSetting *mysqlConf + PostgresSetting *postgresConf + Sqlite3Setting *sqlite3Conf + PprofServerSetting *httpServerConf + WebServerSetting *httpServerConf + AdminServerSetting *httpServerConf + SpaceXServerSetting *httpServerConf + BotServerSetting *httpServerConf + LocalossServerSetting *httpServerConf + FrontendWebSetting *httpServerConf + DocsServerSetting *httpServerConf + MobileServerSetting *grpcServerConf + AppSetting *appConf + CacheIndexSetting *cacheIndexConf + SimpleCacheIndexSetting *simpleCacheIndexConf + BigCacheIndexSetting *bigCacheIndexConf + RedisCacheIndexSetting *redisCacheIndexConf + SmsJuheSetting *smsJuheConf + AlipaySetting *alipayConf + TweetSearchSetting *tweetSearchConf + ZincSetting *zincConf + MeiliSetting *meiliConf + ObjectStorage *objectStorageConf + AliOSSSetting *aliOSSConf + COSSetting *cosConf + HuaweiOBSSetting *huaweiOBSConf + MinIOSetting *minioConf + S3Setting *s3Conf + LocalOSSSetting *localossConf + JWTSetting *jwtConf ) func setupSetting(suite []string, noDefault bool) error { - setting, err := NewSetting() + vp, err := newViper() if err != nil { return err } // initialize features configure - ss, kv := setting.featuresInfoFrom("Features") + ss, kv := featuresInfoFrom(vp, "Features") cfg.Initial(ss, kv) if len(suite) > 0 { cfg.Use(suite, noDefault) @@ -67,7 +68,7 @@ func setupSetting(suite []string, noDefault bool) error { objects := map[string]any{ "App": &AppSetting, - "Server": &ServerSetting, + "PprofServer": &PprofServerSetting, "WebServer": &WebServerSetting, "AdminServer": &AdminServerSetting, "SpaceXServer": &SpaceXServerSetting, @@ -79,8 +80,11 @@ func setupSetting(suite []string, noDefault bool) error { "CacheIndex": &CacheIndexSetting, "SimpleCacheIndex": &SimpleCacheIndexSetting, "BigCacheIndex": &BigCacheIndexSetting, + "RedisCacheIndex": &RedisCacheIndexSetting, "Alipay": &AlipaySetting, "SmsJuhe": &SmsJuheSetting, + "Pyroscope": &PyroscopeSetting, + "Sentry": &sentrySetting, "Logger": &loggerSetting, "LoggerFile": &loggerFileSetting, "LoggerZinc": &loggerZincSetting, @@ -102,27 +106,30 @@ func setupSetting(suite []string, noDefault bool) error { "LocalOSS": &LocalOSSSetting, "S3": &S3Setting, } - if err = setting.Unmarshal(objects); err != nil { - return err + for k, v := range objects { + err := vp.UnmarshalKey(k, v) + if err != nil { + return err + } } JWTSetting.Expire *= time.Second SimpleCacheIndexSetting.CheckTickDuration *= time.Second SimpleCacheIndexSetting.ExpireTickDuration *= time.Second BigCacheIndexSetting.ExpireInSecond *= time.Second + RedisCacheIndexSetting.ExpireInSecond *= time.Second + redisSetting.ConnWriteTimeout *= time.Second - Mutex = &sync.Mutex{} return nil } -func Initialize(suite []string, noDefault bool) { +func Initial(suite []string, noDefault bool) { err := setupSetting(suite, noDefault) if err != nil { log.Fatalf("init.setupSetting err: %v", err) } - setupLogger() - setupDBEngine() + initSentry() } func GetOssDomain() string { @@ -154,8 +161,9 @@ func GetOssDomain() string { } func RunMode() string { - if !cfg.If("Deprecated:OldWeb") { - return ServerSetting.RunMode - } return AppSetting.RunMode } + +func UseSentryGin() bool { + return cfg.If("Sentry") && sentrySetting.AttachGin +} diff --git a/internal/conf/config.yaml b/internal/conf/config.yaml index c86d168a..fc86dfd4 100644 --- a/internal/conf/config.yaml +++ b/internal/conf/config.yaml @@ -1,49 +1,56 @@ App: # APP基础设置项 RunMode: debug AttachmentIncomeRate: 0.8 - MaxCommentCount: 10 + MaxCommentCount: 1000 DefaultContextTimeout: 60 DefaultPageSize: 10 MaxPageSize: 100 -Server: # 服务设置 - RunMode: debug - HttpIp: 0.0.0.0 - HttpPort: 8008 - ReadTimeout: 60 - WriteTimeout: 60 Features: Default: [] WebServer: # Web服务 + RunMode: debug HttpIp: 0.0.0.0 - HttpPort: 8010 + HttpPort: 8008 ReadTimeout: 60 WriteTimeout: 60 AdminServer: # Admin后台运维服务 + RunMode: debug HttpIp: 0.0.0.0 HttpPort: 8014 ReadTimeout: 60 WriteTimeout: 60 SpaceXServer: # SpaceX服务 + RunMode: debug HttpIp: 0.0.0.0 HttpPort: 8012 ReadTimeout: 60 WriteTimeout: 60 BotServer: # Bot服务 + RunMode: debug HttpIp: 0.0.0.0 HttpPort: 8016 ReadTimeout: 60 WriteTimeout: 60 LocalossServer: # Localoss服务 + RunMode: debug HttpIp: 0.0.0.0 HttpPort: 8018 ReadTimeout: 60 WriteTimeout: 60 +PprofServer: # Pprof服务 + RunMode: debug + HttpIp: 0.0.0.0 + HttpPort: 6060 + ReadTimeout: 60 + WriteTimeout: 60 FrontendWebServer: # Web前端静态资源服务 + RunMode: debug HttpIp: 0.0.0.0 HttpPort: 8006 ReadTimeout: 60 WriteTimeout: 60 DocsServer: # 开发文档服务 + RunMode: debug HttpIp: 0.0.0.0 HttpPort: 8011 ReadTimeout: 60 @@ -70,12 +77,28 @@ SimpleCacheIndex: # 缓存泡泡广场消息流 ExpireTickDuration: 300 # 每多少秒后强制过期缓存, 设置为0禁止强制使缓存过期 BigCacheIndex: # 使用BigCache缓存泡泡广场消息流 MaxIndexPage: 1024 # 最大缓存页数,必须是2^n, 代表最大同时缓存多少页数据 + HardMaxCacheSize: 256 # 最大缓存大小(MB),0表示无限制 + Verbose: False # 是否打印cache操作的log + ExpireInSecond: 300 # 多少秒(>0)后强制过期缓存 +RedisCacheIndex: # 使用Redis缓存泡泡广场消息流 Verbose: False # 是否打印cache操作的log ExpireInSecond: 300 # 多少秒(>0)后强制过期缓存 +Pyroscope: # Pyroscope配置 + AppName: "paopao-ce" # application name + Endpoint: "http://localhost:4040" # Pyroscope server address + AuthToken: # Pyroscope authentication token + Logger: none # Pyroscope logger (standard | logrus | none) +Sentry: # Sentry配置 + Dsn: "http://4ea0af5cd88d4512b7e52070506c80ec@localhost:9000/2" + Debug: True + AttachStacktrace: True + TracesSampleRate: 1.0 + AttachLogrus: True # logrus是否附加到Sentry + AttachGin: True # gin是否附加到Sentry Logger: # 日志通用配置 Level: debug # 日志级别 panic|fatal|error|warn|info|debug|trace LoggerFile: # 使用File写日志 - SavePath: data/paopao-ce/logs + SavePath: custom/data/paopao-ce/logs FileName: app FileExt: .log LoggerZinc: # 使用Zinc写日志 @@ -145,7 +168,7 @@ S3: # Amazon S3 存储配置 Bucket: paopao Domain: LocalOSS: # 本地文件OSS存储配置 - SavePath: data/paopao-ce/oss + SavePath: custom/data/paopao-ce/oss Secure: False Bucket: paopao Domain: 127.0.0.1:8008 @@ -165,14 +188,18 @@ Postgres: # PostgreSQL数据库 User: paopao Password: paopao DBName: paopao + Schema: public Host: localhost Port: 5432 SSLMode: disable - TimeZone: Asia/Shanghai + ApplicationName: Sqlite3: # Sqlite3数据库 - Path: data/sqlite3/paopao-ce.db + Path: custom/data/sqlite3/paopao-ce.db Redis: - Host: redis:6379 - Password: - DB: + InitAddress: + - redis:6379 + Username: + Password: + SelectDB: + ConnWriteTimeout: 60 # 连接写超时时间 多少秒 默认 60秒 \ No newline at end of file diff --git a/internal/conf/db.go b/internal/conf/db.go index 62ad7fe3..f04fc3fb 100644 --- a/internal/conf/db.go +++ b/internal/conf/db.go @@ -1,94 +1,68 @@ -// Copyright 2022 ROC. All rights reserved. +// Copyright 2023 ROC. All rights reserved. // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. package conf import ( + "database/sql" "sync" - "time" "github.com/alimy/cfg" - "github.com/go-redis/redis/v8" "github.com/sirupsen/logrus" - "gorm.io/driver/mysql" - "gorm.io/driver/postgres" - "gorm.io/gorm" - "gorm.io/gorm/logger" - "gorm.io/gorm/schema" - "gorm.io/plugin/dbresolver" ) var ( - db *gorm.DB - Redis *redis.Client - once sync.Once + _sqldb *sql.DB + _onceSql sync.Once ) -func MustGormDB() *gorm.DB { - once.Do(func() { +const ( + TableAnouncement = "user" + TableAnouncementContent = "anouncement_content" + TableAttachment = "attachment" + TableCaptcha = "captcha" + TableComment = "comment" + TableCommentContent = "comment_content" + TableCommentReply = "comment_reply" + TableContact = "contact" + TableContactGroup = "contact_group" + TableMessage = "message" + TablePost = "post" + TablePostAttachmentBill = "post_attachment_bill" + TablePostCollection = "post_collection" + TablePostContent = "post_content" + TablePostStar = "post_star" + TableTag = "tag" + TableUser = "user" + TableWalletRecharge = "wallet_recharge" + TableWalletStatement = "wallet_statement" +) + +type TableNameMap map[string]string + +func MustSqlDB() *sql.DB { + _onceSql.Do(func() { var err error - if db, err = newDBEngine(); err != nil { - logrus.Fatalf("new gorm db failed: %s", err) + if _, _sqldb, err = newSqlDB(); err != nil { + logrus.Fatalf("new sql db failed: %s", err) } }) - return db + return _sqldb } -func newDBEngine() (*gorm.DB, error) { - newLogger := logger.New( - logrus.StandardLogger(), // io writer(日志输出的目标,前缀和日志包含的内容) - logger.Config{ - SlowThreshold: time.Second, // 慢 SQL 阈值 - LogLevel: DatabaseSetting.logLevel(), // 日志级别 - IgnoreRecordNotFoundError: true, // 忽略ErrRecordNotFound(记录未找到)错误 - Colorful: false, // 禁用彩色打印 - }, - ) - - config := &gorm.Config{ - Logger: newLogger, - NamingStrategy: schema.NamingStrategy{ - TablePrefix: DatabaseSetting.TablePrefix, - SingularTable: true, - }, - } - - plugin := dbresolver.Register(dbresolver.Config{}). - SetConnMaxIdleTime(time.Hour). - SetConnMaxLifetime(24 * time.Hour). - SetMaxIdleConns(MysqlSetting.MaxIdleConns). - SetMaxOpenConns(MysqlSetting.MaxOpenConns) - - var ( - db *gorm.DB - err error - ) +func newSqlDB() (driver string, db *sql.DB, err error) { if cfg.If("MySQL") { - logrus.Debugln("use MySQL as db") - if db, err = gorm.Open(mysql.Open(MysqlSetting.Dsn()), config); err == nil { - db.Use(plugin) - } - } else if cfg.If("Postgres") { - logrus.Debugln("use PostgreSQL as db") - db, err = gorm.Open(postgres.Open(PostgresSetting.Dsn()), config) + driver = "mysql" + db, err = sql.Open(driver, MysqlSetting.Dsn()) + } else if cfg.If("PostgreSQL") || cfg.If("Postgres") { + driver = "pgx" + db, err = sql.Open(driver, PostgresSetting.Dsn()) } else if cfg.If("Sqlite3") { - logrus.Debugf("use Sqlite3 as db path:%s sqlite3InCgoEnabled:%t", Sqlite3Setting.Path, sqlite3InCgoEnabled) - db, err = gormOpenSqlite3(config) + driver, db, err = OpenSqlite3() } else { - logrus.Debugln("use default of MySQL as db") - if db, err = gorm.Open(mysql.Open(MysqlSetting.Dsn()), config); err == nil { - db.Use(plugin) - } + driver = "mysql" + db, err = sql.Open(driver, MysqlSetting.Dsn()) } - - return db, err -} - -func setupDBEngine() { - Redis = redis.NewClient(&redis.Options{ - Addr: redisSetting.Host, - Password: redisSetting.Password, - DB: redisSetting.DB, - }) + return } diff --git a/internal/conf/db_cgo.go b/internal/conf/db_cgo.go index 218512a5..231dc16b 100644 --- a/internal/conf/db_cgo.go +++ b/internal/conf/db_cgo.go @@ -18,8 +18,9 @@ const ( sqlite3InCgoEnabled = true ) -func OpenSqlite3() (*sql.DB, error) { - return sql.Open("sqlite3", Sqlite3Setting.Dsn("sqlite3")) +func OpenSqlite3() (string, *sql.DB, error) { + db, err := sql.Open("sqlite3", Sqlite3Setting.Dsn("sqlite3")) + return "sqlite3", db, err } func gormOpenSqlite3(opts ...gorm.Option) (*gorm.DB, error) { diff --git a/internal/conf/db_gorm.go b/internal/conf/db_gorm.go new file mode 100644 index 00000000..f667ff61 --- /dev/null +++ b/internal/conf/db_gorm.go @@ -0,0 +1,84 @@ +// Copyright 2022 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package conf + +import ( + "sync" + "time" + + "github.com/alimy/cfg" + "github.com/sirupsen/logrus" + "gorm.io/driver/mysql" + "gorm.io/driver/postgres" + "gorm.io/gorm" + "gorm.io/gorm/logger" + "gorm.io/gorm/schema" + "gorm.io/plugin/dbresolver" +) + +var ( + _gormdb *gorm.DB + _onceGorm sync.Once +) + +func MustGormDB() *gorm.DB { + _onceGorm.Do(func() { + var err error + if _gormdb, err = newGormDB(); err != nil { + logrus.Fatalf("new gorm db failed: %s", err) + } + }) + return _gormdb +} + +func newGormDB() (*gorm.DB, error) { + newLogger := logger.New( + logrus.StandardLogger(), // io writer(日志输出的目标,前缀和日志包含的内容) + logger.Config{ + SlowThreshold: time.Second, // 慢 SQL 阈值 + LogLevel: DatabaseSetting.logLevel(), // 日志级别 + IgnoreRecordNotFoundError: true, // 忽略ErrRecordNotFound(记录未找到)错误 + Colorful: false, // 禁用彩色打印 + }, + ) + + config := &gorm.Config{ + Logger: newLogger, + NamingStrategy: schema.NamingStrategy{ + TablePrefix: DatabaseSetting.TablePrefix, + SingularTable: true, + }, + } + + plugin := dbresolver.Register(dbresolver.Config{}). + SetConnMaxIdleTime(time.Hour). + SetConnMaxLifetime(24 * time.Hour). + SetMaxIdleConns(MysqlSetting.MaxIdleConns). + SetMaxOpenConns(MysqlSetting.MaxOpenConns) + + var ( + db *gorm.DB + err error + ) + if cfg.If("MySQL") { + logrus.Debugln("use MySQL as db") + if db, err = gorm.Open(mysql.Open(MysqlSetting.Dsn()), config); err == nil { + db.Use(plugin) + } + } else if cfg.If("Postgres") { + logrus.Debugln("use PostgreSQL as db") + db, err = gorm.Open(postgres.Open(PostgresSetting.Dsn()), config) + } else if cfg.If("Sqlite3") { + logrus.Debugf("use Sqlite3 as db path:%s sqlite3InCgoEnabled:%t", Sqlite3Setting.Path, sqlite3InCgoEnabled) + db, err = gormOpenSqlite3(config) + } else { + logrus.Debugln("use default of MySQL as db") + if db, err = gorm.Open(mysql.Open(MysqlSetting.Dsn()), config); err == nil { + db.Use(plugin) + } + } + + return db, err +} diff --git a/internal/conf/db_nocgo.go b/internal/conf/db_nocgo.go index 977a6695..bbe79a50 100644 --- a/internal/conf/db_nocgo.go +++ b/internal/conf/db_nocgo.go @@ -19,8 +19,9 @@ const ( sqlite3InCgoEnabled = false ) -func OpenSqlite3() (*sql.DB, error) { - return sql.Open("sqlite", Sqlite3Setting.Dsn("sqlite")) +func OpenSqlite3() (string, *sql.DB, error) { + db, err := sql.Open("sqlite", Sqlite3Setting.Dsn("sqlite")) + return "sqlite", db, err } func gormOpenSqlite3(opts ...gorm.Option) (*gorm.DB, error) { diff --git a/internal/conf/logger.go b/internal/conf/logger.go index cbe3cc1b..f6d08723 100644 --- a/internal/conf/logger.go +++ b/internal/conf/logger.go @@ -6,8 +6,11 @@ package conf import ( "io" + "time" "github.com/alimy/cfg" + "github.com/getsentry/sentry-go" + sentrylogrus "github.com/getsentry/sentry-go/logrus" "github.com/sirupsen/logrus" "gopkg.in/natefinch/lumberjack.v2" ) @@ -42,3 +45,16 @@ func setupLogger() { }, }) } + +func setupSentryLogrus(opts sentry.ClientOptions) { + // Send only ERROR and higher level logs to Sentry + sentryLevels := []logrus.Level{logrus.ErrorLevel, logrus.FatalLevel, logrus.PanicLevel} + sentryHook, err := sentrylogrus.New(sentryLevels, opts) + if err != nil { + panic(err) + } + logrus.AddHook(sentryHook) + // Flushes before calling os.Exit(1) when using logger.Fatal + // (else all defers are not called, and Sentry does not have time to send the event) + logrus.RegisterExitHandler(func() { sentryHook.Flush(5 * time.Second) }) +} diff --git a/internal/conf/redis.go b/internal/conf/redis.go new file mode 100644 index 00000000..93799b82 --- /dev/null +++ b/internal/conf/redis.go @@ -0,0 +1,34 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package conf + +import ( + "log" + "sync" + + "github.com/redis/rueidis" +) + +var ( + _redisClient rueidis.Client + _onceRedis sync.Once +) + +func MustRedisClient() rueidis.Client { + _onceRedis.Do(func() { + client, err := rueidis.NewClient(rueidis.ClientOption{ + InitAddress: redisSetting.InitAddress, + Username: redisSetting.Username, + Password: redisSetting.Password, + SelectDB: redisSetting.SelectDB, + ConnWriteTimeout: redisSetting.ConnWriteTimeout, + }) + if err != nil { + log.Fatalf("create a redis client failed: %s", err) + } + _redisClient = client + }) + return _redisClient +} diff --git a/internal/conf/sentry.go b/internal/conf/sentry.go new file mode 100644 index 00000000..70c534e4 --- /dev/null +++ b/internal/conf/sentry.go @@ -0,0 +1,35 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package conf + +import ( + "time" + + "github.com/alimy/cfg" + "github.com/getsentry/sentry-go" + "github.com/rocboss/paopao-ce/pkg/version" +) + +func initSentry() { + cfg.Be("Sentry", func() { + opts := sentry.ClientOptions{ + Dsn: sentrySetting.Dsn, + Debug: sentrySetting.Debug, + AttachStacktrace: sentrySetting.AttachStacktrace, + TracesSampleRate: sentrySetting.TracesSampleRate, + } + _ = sentry.Init(opts) + if sentrySetting.AttachLogrus { + setupSentryLogrus(opts) + } + sentry.WithScope(func(scope *sentry.Scope) { + scope.SetExtras(map[string]any{ + "version": version.VersionInfo(), + "time": time.Now().Local(), + }) + sentry.CaptureMessage("paopao-ce sentry works!") + }) + }) +} diff --git a/internal/conf/settting.go b/internal/conf/setting.go similarity index 58% rename from internal/conf/settting.go rename to internal/conf/setting.go index 93443f64..d7c7223b 100644 --- a/internal/conf/settting.go +++ b/internal/conf/setting.go @@ -1,38 +1,52 @@ -// Copyright 2022 ROC. All rights reserved. +// Copyright 2023 ROC. All rights reserved. // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. package conf import ( - "embed" + "bytes" + _ "embed" "fmt" "strings" "time" + "github.com/pyroscope-io/client/pyroscope" "github.com/sirupsen/logrus" "github.com/spf13/viper" "gorm.io/gorm/logger" ) //go:embed config.yaml -var files embed.FS +var configBytes []byte -type Setting struct { - vp *viper.Viper +type pyroscopeConf struct { + AppName string + Endpoint string + AuthToken string + Logger string +} + +type sentryConf struct { + Dsn string + Debug bool + AttachStacktrace bool + TracesSampleRate float64 + AttachLogrus bool + AttachGin bool } -type LoggerSettingS struct { +type loggerConf struct { Level string } -type LoggerFileSettingS struct { +type loggerFileConf struct { SavePath string FileName string FileExt string } -type LoggerZincSettingS struct { +type loggerZincConf struct { Host string Index string User string @@ -40,7 +54,7 @@ type LoggerZincSettingS struct { Secure bool } -type LoggerMeiliSettingS struct { +type loggerMeiliConf struct { Host string Index string ApiKey string @@ -49,7 +63,7 @@ type LoggerMeiliSettingS struct { MinWorker int } -type HttpServerSettingS struct { +type httpServerConf struct { RunMode string HttpIp string HttpPort string @@ -57,12 +71,12 @@ type HttpServerSettingS struct { WriteTimeout time.Duration } -type GRPCServerSettingS struct { +type grpcServerConf struct { Host string Port string } -type AppSettingS struct { +type appConf struct { RunMode string MaxCommentCount int64 AttachmentIncomeRate float64 @@ -71,24 +85,30 @@ type AppSettingS struct { MaxPageSize int } -type CacheIndexSettingS struct { +type cacheIndexConf struct { MaxUpdateQPS int MinWorker int } -type SimpleCacheIndexSettingS struct { +type simpleCacheIndexConf struct { MaxIndexSize int CheckTickDuration time.Duration ExpireTickDuration time.Duration } -type BigCacheIndexSettingS struct { - MaxIndexPage int +type bigCacheIndexConf struct { + MaxIndexPage int + HardMaxCacheSize int + ExpireInSecond time.Duration + Verbose bool +} + +type redisCacheIndexConf struct { ExpireInSecond time.Duration Verbose bool } -type AlipaySettingS struct { +type alipayConf struct { AppID string PrivateKey string RootCertFile string @@ -97,19 +117,19 @@ type AlipaySettingS struct { InProduction bool } -type SmsJuheSettings struct { +type smsJuheConf struct { Gateway string Key string TplID string TplVal string } -type TweetSearchS struct { +type tweetSearchConf struct { MaxUpdateQPS int MinWorker int } -type ZincSettingS struct { +type zincConf struct { Host string Index string User string @@ -117,19 +137,19 @@ type ZincSettingS struct { Secure bool } -type MeiliSettingS struct { +type meiliConf struct { Host string Index string ApiKey string Secure bool } -type DatabaseSetingS struct { +type databaseConf struct { TablePrefix string LogLevel string } -type MySQLSettingS struct { +type mysqlConf struct { UserName string Password string Host string @@ -140,18 +160,18 @@ type MySQLSettingS struct { MaxOpenConns int } -type PostgresSettingS map[string]string +type postgresConf map[string]string -type Sqlite3SettingS struct { +type sqlite3Conf struct { Path string } -type ObjectStorageS struct { +type objectStorageConf struct { RetainInDays int TempDir string } -type MinIOSettingS struct { +type minioConf struct { AccessKey string SecretKey string Secure bool @@ -160,7 +180,7 @@ type MinIOSettingS struct { Domain string } -type S3SettingS struct { +type s3Conf struct { AccessKey string SecretKey string Secure bool @@ -169,7 +189,7 @@ type S3SettingS struct { Domain string } -type AliOSSSettingS struct { +type aliOSSConf struct { AccessKeyID string AccessKeySecret string Endpoint string @@ -177,7 +197,7 @@ type AliOSSSettingS struct { Domain string } -type COSSettingS struct { +type cosConf struct { SecretID string SecretKey string Region string @@ -185,7 +205,7 @@ type COSSettingS struct { Domain string } -type HuaweiOBSSettingS struct { +type huaweiOBSConf struct { AccessKey string SecretKey string Endpoint string @@ -193,92 +213,36 @@ type HuaweiOBSSettingS struct { Domain string } -type LocalOSSSettingS struct { +type localossConf struct { SavePath string Secure bool Bucket string Domain string } -type RedisSettingS struct { - Host string - Password string - DB int +type redisConf struct { + InitAddress []string + Username string + Password string + SelectDB int + ConnWriteTimeout time.Duration } -type JWTSettingS struct { +type jwtConf struct { Secret string Issuer string Expire time.Duration } -func NewSetting() (*Setting, error) { - cfgFile, err := files.Open("config.yaml") - if err != nil { - return nil, err - } - defer cfgFile.Close() - - vp := viper.New() - vp.SetConfigName("config") - vp.AddConfigPath(".") - vp.AddConfigPath("custom/") - vp.SetConfigType("yaml") - if err = vp.ReadConfig(cfgFile); err != nil { - return nil, err - } - if err = vp.MergeInConfig(); err != nil { - return nil, err - } - - return &Setting{vp}, nil -} - -func (s *Setting) ReadSection(k string, v any) error { - err := s.vp.UnmarshalKey(k, v) - if err != nil { - return err - } - return nil -} - -func (s *Setting) Unmarshal(objects map[string]any) error { - for k, v := range objects { - err := s.vp.UnmarshalKey(k, v) - if err != nil { - return err - } - } - return nil -} - -func (s *Setting) featuresInfoFrom(k string) (map[string][]string, map[string]string) { - sub := s.vp.Sub(k) - keys := sub.AllKeys() - - suites := make(map[string][]string) - kv := make(map[string]string, len(keys)) - for _, key := range sub.AllKeys() { - val := sub.Get(key) - switch v := val.(type) { - case string: - kv[key] = v - case []any: - suites[key] = sub.GetStringSlice(key) - } - } - return suites, kv -} - -func (s *HttpServerSettingS) GetReadTimeout() time.Duration { +func (s *httpServerConf) GetReadTimeout() time.Duration { return s.ReadTimeout * time.Second } -func (s *HttpServerSettingS) GetWriteTimeout() time.Duration { +func (s *httpServerConf) GetWriteTimeout() time.Duration { return s.WriteTimeout * time.Second } -func (s *MySQLSettingS) Dsn() string { +func (s *mysqlConf) Dsn() string { return fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=%s&parseTime=%t&loc=Local", s.UserName, s.Password, @@ -289,17 +253,27 @@ func (s *MySQLSettingS) Dsn() string { ) } -func (s PostgresSettingS) Dsn() string { +func (s postgresConf) Dsn() string { var params []string for k, v := range s { - if len(v) > 0 { - params = append(params, strings.ToLower(k)+"="+v) + if len(v) == 0 { + continue + } + lk := strings.ToLower(k) + tv := strings.Trim(v, " ") + switch lk { + case "schema": + params = append(params, "search_path="+tv) + case "applicationname": + params = append(params, "application_name="+tv) + default: + params = append(params, lk+"="+tv) } } return strings.Join(params, " ") } -func (s *Sqlite3SettingS) Dsn(driverName string) string { +func (s *sqlite3Conf) Dsn(driverName string) string { pragmas := "_foreign_keys=1&_journal_mode=WAL&_synchronous=NORMAL&_busy_timeout=8000" if driverName == "sqlite" { pragmas = "_pragma=foreign_keys(1)&_pragma=journal_mode(WAL)&_pragma=synchronous(NORMAL)&_pragma=busy_timeout(8000)&_pragma=journal_size_limit(100000000)" @@ -307,7 +281,7 @@ func (s *Sqlite3SettingS) Dsn(driverName string) string { return fmt.Sprintf("file:%s?%s", s.Path, pragmas) } -func (s *DatabaseSetingS) logLevel() logger.LogLevel { +func (s *databaseConf) logLevel() logger.LogLevel { switch strings.ToLower(s.LogLevel) { case "silent": return logger.Silent @@ -322,7 +296,36 @@ func (s *DatabaseSetingS) logLevel() logger.LogLevel { } } -func (s *LoggerSettingS) logLevel() logrus.Level { +func (s *databaseConf) TableNames() (res TableNameMap) { + tableNames := []string{ + TableAnouncement, + TableAnouncementContent, + TableAttachment, + TableCaptcha, + TableComment, + TableCommentContent, + TableCommentReply, + TableContact, + TableContactGroup, + TableMessage, + TablePost, + TablePostAttachmentBill, + TablePostCollection, + TablePostContent, + TablePostStar, + TableTag, + TableUser, + TableWalletRecharge, + TableWalletStatement, + } + res = make(TableNameMap, len(tableNames)) + for _, name := range tableNames { + res[name] = s.TablePrefix + name + } + return +} + +func (s *loggerConf) logLevel() logrus.Level { switch strings.ToLower(s.Level) { case "panic": return logrus.PanicLevel @@ -343,15 +346,15 @@ func (s *LoggerSettingS) logLevel() logrus.Level { } } -func (s *LoggerZincSettingS) Endpoint() string { +func (s *loggerZincConf) Endpoint() string { return endpoint(s.Host, s.Secure) } -func (s *LoggerMeiliSettingS) Endpoint() string { +func (s *loggerMeiliConf) Endpoint() string { return endpoint(s.Host, s.Secure) } -func (s *LoggerMeiliSettingS) minWork() int { +func (s *loggerMeiliConf) minWork() int { if s.MinWorker < 5 { return 5 } else if s.MinWorker > 100 { @@ -360,7 +363,7 @@ func (s *LoggerMeiliSettingS) minWork() int { return s.MinWorker } -func (s *LoggerMeiliSettingS) maxLogBuffer() int { +func (s *loggerMeiliConf) maxLogBuffer() int { if s.MaxLogBuffer < 10 { return 10 } else if s.MaxLogBuffer > 1000 { @@ -369,18 +372,28 @@ func (s *LoggerMeiliSettingS) maxLogBuffer() int { return s.MaxLogBuffer } -func (s *ObjectStorageS) TempDirSlash() string { +func (s *objectStorageConf) TempDirSlash() string { return strings.Trim(s.TempDir, " /") + "/" } -func (s *ZincSettingS) Endpoint() string { +func (s *zincConf) Endpoint() string { return endpoint(s.Host, s.Secure) } -func (s *MeiliSettingS) Endpoint() string { +func (s *meiliConf) Endpoint() string { return endpoint(s.Host, s.Secure) } +func (s *pyroscopeConf) GetLogger() (logger pyroscope.Logger) { + switch strings.ToLower(s.Logger) { + case "standard": + logger = pyroscope.StandardLogger + case "logrus": + logger = logrus.StandardLogger() + } + return +} + func endpoint(host string, secure bool) string { schema := "http" if secure { @@ -388,3 +401,37 @@ func endpoint(host string, secure bool) string { } return schema + "://" + host } + +func newViper() (*viper.Viper, error) { + vp := viper.New() + vp.SetConfigName("config") + vp.AddConfigPath(".") + vp.AddConfigPath("custom/") + vp.SetConfigType("yaml") + err := vp.ReadConfig(bytes.NewReader(configBytes)) + if err != nil { + return nil, err + } + if err = vp.MergeInConfig(); err != nil { + return nil, err + } + return vp, nil +} + +func featuresInfoFrom(vp *viper.Viper, k string) (map[string][]string, map[string]string) { + sub := vp.Sub(k) + keys := sub.AllKeys() + + suites := make(map[string][]string) + kv := make(map[string]string, len(keys)) + for _, key := range sub.AllKeys() { + val := sub.Get(key) + switch v := val.(type) { + case string: + kv[key] = v + case []any: + suites[key] = sub.GetStringSlice(key) + } + } + return suites, kv +} diff --git a/internal/core/authority.go b/internal/core/authority.go index 05e3742a..31a43be4 100644 --- a/internal/core/authority.go +++ b/internal/core/authority.go @@ -5,119 +5,13 @@ package core import ( - "github.com/rocboss/paopao-ce/pkg/types" + "github.com/rocboss/paopao-ce/internal/core/ms" ) -const ( - ActRegisterUser act = iota - ActCreatePublicTweet - ActCreatePublicAttachment - ActCreatePublicPicture - ActCreatePublicVideo - ActCreatePrivateTweet - ActCreatePrivateAttachment - ActCreatePrivatePicture - ActCreatePrivateVideo - ActCreateFriendTweet - ActCreateFriendAttachment - ActCreateFriendPicture - ActCreateFriendVideo - ActCreatePublicComment - ActCreatePublicPicureComment - ActCreateFriendComment - ActCreateFriendPicureComment - ActCreatePrivateComment - ActCreatePrivatePicureComment - ActStickTweet - ActTopTweet - ActLockTweet - ActVisibleTweet - ActDeleteTweet - ActCreateActivationCode -) - -type ( - act uint8 - - FriendFilter map[int64]types.Empty - FriendSet map[string]types.Empty - - Action struct { - Act act - UserId int64 - } -) - -func (f FriendFilter) IsFriend(userId int64) bool { - _, yeah := f[userId] - return yeah -} - -// IsAllow default true if user is admin -func (a act) IsAllow(user *User, userId int64, isFriend bool, isActivation bool) bool { - if user.IsAdmin { - return true - } - if user.ID == userId && isActivation { - switch a { - case ActCreatePublicTweet, - ActCreatePublicAttachment, - ActCreatePublicPicture, - ActCreatePublicVideo, - ActCreatePrivateTweet, - ActCreatePrivateAttachment, - ActCreatePrivatePicture, - ActCreatePrivateVideo, - ActCreateFriendTweet, - ActCreateFriendAttachment, - ActCreateFriendPicture, - ActCreateFriendVideo, - ActCreatePrivateComment, - ActCreatePrivatePicureComment, - ActStickTweet, - ActLockTweet, - ActVisibleTweet, - ActDeleteTweet: - return true - } - } - - if user.ID == userId && !isActivation { - switch a { - case ActCreatePrivateTweet, - ActCreatePrivateComment, - ActStickTweet, - ActLockTweet, - ActDeleteTweet: - return true - } - } - - if isFriend && isActivation { - switch a { - case ActCreatePublicComment, - ActCreatePublicPicureComment, - ActCreateFriendComment, - ActCreateFriendPicureComment: - return true - } - } - - if !isFriend && isActivation { - switch a { - case ActCreatePublicComment, - ActCreatePublicPicureComment: - return true - } - } - - return false -} - // AuthorizationManageService 授权管理服务 type AuthorizationManageService interface { - IsAllow(user *User, action *Action) bool - BeFriendFilter(userId int64) FriendFilter + IsAllow(user *ms.User, action *ms.Action) bool + BeFriendFilter(userId int64) ms.FriendFilter BeFriendIds(userId int64) ([]int64, error) - MyFriendSet(userId int64) FriendSet + MyFriendSet(userId int64) ms.FriendSet } diff --git a/internal/core/cache.go b/internal/core/cache.go index d8b8cd10..8d8c3b42 100644 --- a/internal/core/cache.go +++ b/internal/core/cache.go @@ -5,6 +5,10 @@ package core import ( + "context" + + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" ) @@ -24,6 +28,11 @@ type IndexAction struct { Post *dbr.Post } +type IndexActionA struct { + Act IdxAct + Tweet *cs.TweetInfo +} + func (a IdxAct) String() string { switch a { case IdxActNop: @@ -43,16 +52,48 @@ func (a IdxAct) String() string { } } -func NewIndexAction(act IdxAct, post *dbr.Post) *IndexAction { +func NewIndexAction(act IdxAct, post *ms.Post) *IndexAction { return &IndexAction{ Act: act, Post: post, } } +func NewIndexActionA(act IdxAct, tweet *cs.TweetInfo) *IndexActionA { + return &IndexActionA{ + Act: act, + Tweet: tweet, + } +} + // CacheIndexService cache index service interface type CacheIndexService interface { IndexPostsService SendAction(act IdxAct, post *dbr.Post) } + +// CacheIndexServantA cache index service interface +type CacheIndexServantA interface { + IndexPostsServantA + + SendAction(act IdxAct, tweet *cs.TweetInfo) +} + +// RedisCache memory cache by Redis +type RedisCache interface { + SetPushToSearchJob(ctx context.Context) error + DelPushToSearchJob(ctx context.Context) error + SetImgCaptcha(ctx context.Context, id string, value string) error + GetImgCaptcha(ctx context.Context, id string) (string, error) + DelImgCaptcha(ctx context.Context, id string) error + GetCountSmsCaptcha(ctx context.Context, phone string) (int64, error) + IncrCountSmsCaptcha(ctx context.Context, phone string) error + GetCountLoginErr(ctx context.Context, id int64) (int64, error) + DelCountLoginErr(ctx context.Context, id int64) error + IncrCountLoginErr(ctx context.Context, id int64) error + GetCountWhisper(ctx context.Context, uid int64) (int64, error) + IncrCountWhisper(ctx context.Context, uid int64) error + SetRechargeStatus(ctx context.Context, tradeNo string) error + DelRechargeStatus(ctx context.Context, tradeNo string) error +} diff --git a/internal/core/comments.go b/internal/core/comments.go index c5501b4b..cf917a82 100644 --- a/internal/core/comments.go +++ b/internal/core/comments.go @@ -5,32 +5,30 @@ package core import ( - "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" -) - -type ( - Comment = dbr.Comment - CommentFormated = dbr.CommentFormated - CommentReply = dbr.CommentReply - CommentContent = dbr.CommentContent - CommentReplyFormated = dbr.CommentReplyFormated + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" ) // CommentService 评论检索服务 type CommentService interface { - GetComments(conditions *ConditionsT, offset, limit int) ([]*Comment, error) - GetCommentByID(id int64) (*Comment, error) - GetCommentCount(conditions *ConditionsT) (int64, error) - GetCommentReplyByID(id int64) (*CommentReply, error) - GetCommentContentsByIDs(ids []int64) ([]*CommentContent, error) - GetCommentRepliesByID(ids []int64) ([]*CommentReplyFormated, error) + GetComments(conditions *ms.ConditionsT, offset, limit int) ([]*ms.Comment, error) + GetCommentByID(id int64) (*ms.Comment, error) + GetCommentCount(conditions *ms.ConditionsT) (int64, error) + GetCommentReplyByID(id int64) (*ms.CommentReply, error) + GetCommentContentsByIDs(ids []int64) ([]*ms.CommentContent, error) + GetCommentRepliesByID(ids []int64) ([]*ms.CommentReplyFormated, error) + GetCommentThumbsMap(userId int64, tweetId int64) (cs.CommentThumbsMap, cs.CommentThumbsMap, error) } // CommentManageService 评论管理服务 type CommentManageService interface { - DeleteComment(comment *Comment) error - CreateComment(comment *Comment) (*Comment, error) - CreateCommentReply(reply *CommentReply) (*CommentReply, error) - DeleteCommentReply(reply *CommentReply) error - CreateCommentContent(content *CommentContent) (*CommentContent, error) + DeleteComment(comment *ms.Comment) error + CreateComment(comment *ms.Comment) (*ms.Comment, error) + CreateCommentReply(reply *ms.CommentReply) (*ms.CommentReply, error) + DeleteCommentReply(reply *ms.CommentReply) error + CreateCommentContent(content *ms.CommentContent) (*ms.CommentContent, error) + ThumbsUpComment(userId int64, tweetId, commentId int64) error + ThumbsDownComment(userId int64, tweetId, commentId int64) error + ThumbsUpReply(userId int64, tweetId, commentId, replyId int64) error + ThumbsDownReply(userId int64, tweetId, commentId, replyId int64) error } diff --git a/internal/core/core.go b/internal/core/core.go index 9a8eb26f..ab0ba620 100644 --- a/internal/core/core.go +++ b/internal/core/core.go @@ -35,3 +35,14 @@ type DataService interface { SecurityService AttachmentCheckService } + +// WebDataServantA Web数据服务集成(版本A) +type WebDataServantA interface { + // 话题服务 + TopicServantA + + // 推文服务 + TweetServantA + TweetManageServantA + TweetHelpServantA +} diff --git a/internal/core/cs/comment_thumbs.go b/internal/core/cs/comment_thumbs.go new file mode 100644 index 00000000..cb6f7d0d --- /dev/null +++ b/internal/core/cs/comment_thumbs.go @@ -0,0 +1,19 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cs + +type CommentThumbs struct { + UserID int64 `json:"user_id"` + TweetID int64 `json:"tweet_id"` + CommentID int64 `json:"comment_id"` + ReplyID int64 `json:"reply_id"` + CommentType int8 `json:"comment_type"` + IsThumbsUp int8 `json:"is_thumbs_up"` + IsThumbsDown int8 `json:"is_thumbs_down"` +} + +type CommentThumbsList []*CommentThumbs + +type CommentThumbsMap map[int64]*CommentThumbs diff --git a/internal/core/cs/contact.go b/internal/core/cs/contact.go new file mode 100644 index 00000000..ed774631 --- /dev/null +++ b/internal/core/cs/contact.go @@ -0,0 +1,26 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cs + +const ( + ContactStatusRequesting int8 = iota + 1 + ContactStatusAgree + ContactStatusReject + ContactStatusDeleted +) + +type Contact struct { + ID int64 `db:"id" json:"id"` + UserId int64 `db:"user_id" json:"user_id"` + FriendId int64 `db:"friend_id" json:"friend_id"` + GroupId int64 `json:"group_id"` + Remark string `json:"remark"` + Status int8 `json:"status"` // 1请求好友, 2已同意好友, 3已拒绝好友, 4已删除好友 + IsTop int8 `json:"is_top"` + IsBlack int8 `json:"is_black"` + NoticeEnable int8 `json:"notice_enable"` + IsDel int8 `json:"-"` + DeletedOn int64 `db:"-" json:"-"` +} diff --git a/internal/core/cs/cs.go b/internal/core/cs/cs.go new file mode 100644 index 00000000..4ac8eae9 --- /dev/null +++ b/internal/core/cs/cs.go @@ -0,0 +1,8 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +// Package cs contain core data service interface type +// model define + +package cs diff --git a/internal/core/cs/errors.go b/internal/core/cs/errors.go new file mode 100644 index 00000000..881d694a --- /dev/null +++ b/internal/core/cs/errors.go @@ -0,0 +1,13 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cs + +import "errors" + +// internal core error variable for data logic implement. +var ( + ErrNotImplemented = errors.New("not implemented") + ErrNoPermission = errors.New("no permission") +) diff --git a/internal/core/cs/search.go b/internal/core/cs/search.go new file mode 100644 index 00000000..37c8fa9d --- /dev/null +++ b/internal/core/cs/search.go @@ -0,0 +1,38 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cs + +const ( + // 搜索查询类型 + TsQueryTypeDefault TsQueryType = "search" + TsQueryTypeTag TsQueryType = "tag" +) + +type ( + // TsQueryType 搜索查询类型 + TsQueryType string + + // TsDocList 索引条陈列表 + TsDocList []TsDocItem +) + +// TsQueryReq 搜索查询请求 +type TsQueryReq struct { + Query string + Visibility []TweetVisibleType + Type TsQueryType +} + +// TsQueryResp 搜索查询响应 +type TsQueryResp struct { + Items TweetList + Total int64 +} + +// TsDocItem 索引条陈 +type TsDocItem struct { + Post *TweetInfo + Content string +} diff --git a/internal/core/cs/timeline.go b/internal/core/cs/timeline.go new file mode 100644 index 00000000..118f371c --- /dev/null +++ b/internal/core/cs/timeline.go @@ -0,0 +1,11 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cs + +// TweetBox 推文列表盒子,包含其他一些关于推文列表的信息 +type TweetBox struct { + Tweets TweetList + Total int64 +} diff --git a/internal/core/cs/topics.go b/internal/core/cs/topics.go new file mode 100644 index 00000000..c7819fc6 --- /dev/null +++ b/internal/core/cs/topics.go @@ -0,0 +1,55 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cs + +const ( + // 标签类型 + TagTypeHot TagType = "hot" + TagTypeNew TagType = "new" + TagTypeFollow TagType = "follow" + TagTypeHotExtral TagType = "hot_extral" +) + +type ( + // TagType 标签类型 + TagType string + + // TagInfoList 标签信息列表 + TagInfoList []*TagInfo + + // TagList 标签列表 + TagList []*TagItem +) + +// TagInfo 标签信息 +type TagInfo struct { + ID int64 `json:"id" db:"id"` + UserID int64 `json:"user_id" db:"user_id"` + Tag string `json:"tag"` + QuoteNum int64 `json:"quote_num" db:"quote_num"` +} + +// TagItem 标签信息条陈 +type TagItem struct { + ID int64 `json:"id"` + UserID int64 `json:"user_id"` + User *UserInfo `json:"user" db:"u"` + Tag string `json:"tag"` + QuoteNum int64 `json:"quote_num"` + IsFollowing int8 `json:"is_following"` + IsTop int8 `json:"is_top"` +} + +func (t *TagInfo) Format() *TagItem { + return &TagItem{ + ID: t.ID, + UserID: t.UserID, + User: &UserInfo{}, + Tag: t.Tag, + QuoteNum: t.QuoteNum, + IsFollowing: 0, + IsTop: 0, + } +} diff --git a/internal/core/cs/trading.go b/internal/core/cs/trading.go new file mode 100644 index 00000000..aebeb132 --- /dev/null +++ b/internal/core/cs/trading.go @@ -0,0 +1,12 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cs + +type AttachmentBill struct { + ID int64 `json:"id"` + PostID int64 `json:"post_id"` + UserID int64 `json:"user_id"` + PaidAmount int64 `json:"paid_amount"` +} diff --git a/internal/core/cs/tweets.go b/internal/core/cs/tweets.go new file mode 100644 index 00000000..34060030 --- /dev/null +++ b/internal/core/cs/tweets.go @@ -0,0 +1,141 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cs + +const ( + // 推文内容分快类型 + TweetBlockTitle TweetBlockType = iota + 1 + TweetBlockText + TweetBlockImage + TweetBlockVideo + TweetBlockAudio + TweetBlockLink + TweetBlockAttachment + TweetBlockChargeAttachment + + // 推文可见性 + TweetVisitPublic TweetVisibleType = iota + TweetVisitPrivate + TweetVisitFriend + TweetVisitInvalid + + // 附件类型 + AttachmentTypeImage AttachmentType = iota + 1 + AttachmentTypeVideo + AttachmentTypeOther +) + +type ( + // TweetBlockType 推文内容分块类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源 + // TODO: 优化一下类型为 uint8, 需要底层数据库同步修改 + TweetBlockType int + + // TweetVisibleType 推文可见性,0公开,1私密,2好友 + TweetVisibleType uint8 + + // AttachmentType 附件类型, 1图片, 2视频, 3其他 + // TODO: 优化一下类型为 uint8, 需要底层数据库同步修改 + AttachmentType int + + // TweetList 推文列表 + TweetList []*TweetItem + + // TweetInfoList 推文信息列表 + TweetInfoList []*TweetInfo + + // FavoriteList 收藏列表 + FavoriteList []*FavoriteItem + + // ReactionList 点赞列表 + ReactionList []*ReactionItem + + // TweetBlockList 推文分块列表 + TweetBlockList []*TweetBlock +) + +// TweetBlock 推文分块 +type TweetBlock struct { + ID int64 `json:"id" binding:"-"` + PostID int64 `json:"post_id" binding:"-"` + Content string `json:"content" binding:"required"` + Type TweetBlockType `json:"type" binding:"required"` + Sort int64 `json:"sort" binding:"required"` +} + +// TweetInfo 推文信息 +type TweetInfo struct { + ID int64 `json:"id"` + UserID int64 `json:"user_id"` + CommentCount int64 `json:"comment_count"` + CollectionCount int64 `json:"collection_count"` + UpvoteCount int64 `json:"upvote_count"` + Visibility TweetVisibleType `json:"visibility"` + IsTop int `json:"is_top"` + IsEssence int `json:"is_essence"` + IsLock int `json:"is_lock"` + LatestRepliedOn int64 `json:"latest_replied_on"` + Tags string `json:"tags"` + AttachmentPrice int64 `json:"attachment_price"` + IP string `json:"ip"` + IPLoc string `json:"ip_loc"` + CreatedOn int64 `json:"created_on"` + ModifiedOn int64 `json:"modified_on"` +} + +// TweetItem 一条推文信息 +type TweetItem struct { + ID int64 `json:"id"` + UserID int64 `json:"user_id"` + User *UserInfo `db:"user" json:"user"` + Contents []*TweetBlock `db:"-" json:"contents"` + CommentCount int64 `json:"comment_count"` + CollectionCount int64 `json:"collection_count"` + UpvoteCount int64 `json:"upvote_count"` + Visibility TweetVisibleType `json:"visibility"` + IsTop int `json:"is_top"` + IsEssence int `json:"is_essence"` + IsLock int `json:"is_lock"` + LatestRepliedOn int64 `json:"latest_replied_on"` + CreatedOn int64 `json:"created_on"` + ModifiedOn int64 `json:"modified_on"` + Tags map[string]int8 `json:"tags"` + AttachmentPrice int64 `json:"attachment_price"` + IPLoc string `json:"ip_loc"` +} + +type Attachment struct { + ID int64 `json:"id"` + UserID int64 `json:"user_id"` + FileSize int64 `json:"file_size"` + ImgWidth int `json:"img_width"` + ImgHeight int `json:"img_height"` + Type AttachmentType `json:"type"` + Content string `json:"content"` +} + +// Favorite 收藏 +type FavoriteItem struct { + ID int64 `json:"id"` + Tweet *TweetInfo `json:"-"` + TweetID int64 `json:"post_id"` + UserID int64 `json:"user_id"` +} + +// Reaction 反应、表情符号, 点赞、喜欢等 +type ReactionItem struct { + ID int64 `json:"id"` + Tweet *TweetInfo `json:"-"` + TweetID int64 `json:"post_id"` + UserID int64 `json:"user_id"` +} + +type NewTweetReq struct { + Contents TweetBlockList `json:"contents" binding:"required"` + Tags []string `json:"tags" binding:"required"` + Users []string `json:"users" binding:"required"` + AttachmentPrice int64 `json:"attachment_price"` + Visibility TweetVisibleType `json:"visibility"` + ClientIP string `json:"-" binding:"-"` +} diff --git a/internal/core/cs/user.go b/internal/core/cs/user.go new file mode 100644 index 00000000..ee60df96 --- /dev/null +++ b/internal/core/cs/user.go @@ -0,0 +1,58 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cs + +const ( + RelationUnknow RelationTyp = iota + RelationSelf + RelationFriend + RelationFollower + RelationFollowing + RelationAdmin + RelationGuest +) + +type ( + // UserInfoList 用户信息列表 + UserInfoList []*UserInfo + + // + RelationTyp uint8 + + VistUser struct { + Username string + UserId int64 + RelTyp RelationTyp + } +) + +// UserInfo 用户基本信息 +type UserInfo struct { + ID int64 `json:"id"` + Nickname string `json:"nickname"` + Username string `json:"username"` + Status int `json:"status"` + Avatar string `json:"avatar"` + IsAdmin bool `json:"is_admin"` +} + +func (t RelationTyp) String() string { + switch t { + case RelationSelf: + return "self" + case RelationFriend: + return "friend" + case RelationFollower: + return "follower" + case RelationFollowing: + return "following" + case RelationAdmin: + return "admin" + case RelationUnknow: + fallthrough + default: + return "unknow relation" + } +} diff --git a/internal/core/messages.go b/internal/core/messages.go index 57816480..519e4e49 100644 --- a/internal/core/messages.go +++ b/internal/core/messages.go @@ -5,32 +5,15 @@ package core import ( - "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" -) - -const ( - MsgTypePost = dbr.MsgTypePost - MsgtypeComment = dbr.MsgtypeComment - MsgTypeReply = dbr.MsgTypeReply - MsgTypeWhisper = dbr.MsgTypeWhisper - MsgTypeRequestingFriend = dbr.MsgTypeRequestingFriend - MsgTypeSystem = dbr.MsgTypeSystem - - MsgStatusUnread = dbr.MsgStatusUnread - MsgStatusReaded = dbr.MsgStatusReaded -) - -type ( - Message = dbr.Message - MessageFormated = dbr.MessageFormated + "github.com/rocboss/paopao-ce/internal/core/ms" ) // MessageService 消息服务 type MessageService interface { - CreateMessage(msg *Message) (*Message, error) + CreateMessage(msg *ms.Message) (*ms.Message, error) GetUnreadCount(userID int64) (int64, error) - GetMessageByID(id int64) (*Message, error) - ReadMessage(message *Message) error - GetMessages(conditions *ConditionsT, offset, limit int) ([]*MessageFormated, error) - GetMessageCount(conditions *ConditionsT) (int64, error) + GetMessageByID(id int64) (*ms.Message, error) + ReadMessage(message *ms.Message) error + GetMessages(conditions *ms.ConditionsT, offset, limit int) ([]*ms.MessageFormated, error) + GetMessageCount(conditions *ms.ConditionsT) (int64, error) } diff --git a/internal/core/ms/authority.go b/internal/core/ms/authority.go new file mode 100644 index 00000000..d6378696 --- /dev/null +++ b/internal/core/ms/authority.go @@ -0,0 +1,115 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package ms + +import ( + "github.com/rocboss/paopao-ce/pkg/types" +) + +const ( + ActRegisterUser act = iota + ActCreatePublicTweet + ActCreatePublicAttachment + ActCreatePublicPicture + ActCreatePublicVideo + ActCreatePrivateTweet + ActCreatePrivateAttachment + ActCreatePrivatePicture + ActCreatePrivateVideo + ActCreateFriendTweet + ActCreateFriendAttachment + ActCreateFriendPicture + ActCreateFriendVideo + ActCreatePublicComment + ActCreatePublicPicureComment + ActCreateFriendComment + ActCreateFriendPicureComment + ActCreatePrivateComment + ActCreatePrivatePicureComment + ActStickTweet + ActTopTweet + ActLockTweet + ActVisibleTweet + ActDeleteTweet + ActCreateActivationCode +) + +type ( + act uint8 + + FriendFilter map[int64]types.Empty + FriendSet map[string]types.Empty + + Action struct { + Act act + UserId int64 + } +) + +func (f FriendFilter) IsFriend(userId int64) bool { + _, yeah := f[userId] + return yeah +} + +// IsAllow default true if user is admin +func (a act) IsAllow(user *User, userId int64, isFriend bool, isActivation bool) bool { + if user.IsAdmin { + return true + } + if user.ID == userId && isActivation { + switch a { + case ActCreatePublicTweet, + ActCreatePublicAttachment, + ActCreatePublicPicture, + ActCreatePublicVideo, + ActCreatePrivateTweet, + ActCreatePrivateAttachment, + ActCreatePrivatePicture, + ActCreatePrivateVideo, + ActCreateFriendTweet, + ActCreateFriendAttachment, + ActCreateFriendPicture, + ActCreateFriendVideo, + ActCreatePrivateComment, + ActCreatePrivatePicureComment, + ActStickTweet, + ActLockTweet, + ActVisibleTweet, + ActDeleteTweet: + return true + } + } + + if user.ID == userId && !isActivation { + switch a { + case ActCreatePrivateTweet, + ActCreatePrivateComment, + ActStickTweet, + ActLockTweet, + ActDeleteTweet: + return true + } + } + + if isFriend && isActivation { + switch a { + case ActCreatePublicComment, + ActCreatePublicPicureComment, + ActCreateFriendComment, + ActCreateFriendPicureComment: + return true + } + } + + if !isFriend && isActivation { + switch a { + case ActCreatePublicComment, + ActCreatePublicPicureComment: + return true + } + } + + return false +} diff --git a/internal/core/ms/comments.go b/internal/core/ms/comments.go new file mode 100644 index 00000000..87ef2473 --- /dev/null +++ b/internal/core/ms/comments.go @@ -0,0 +1,17 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package ms + +import ( + "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" +) + +type ( + Comment = dbr.Comment + CommentFormated = dbr.CommentFormated + CommentReply = dbr.CommentReply + CommentContent = dbr.CommentContent + CommentReplyFormated = dbr.CommentReplyFormated +) diff --git a/internal/core/ms/messages.go b/internal/core/ms/messages.go new file mode 100644 index 00000000..adf793f8 --- /dev/null +++ b/internal/core/ms/messages.go @@ -0,0 +1,26 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package ms + +import ( + "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" +) + +const ( + MsgTypePost = dbr.MsgTypePost + MsgtypeComment = dbr.MsgtypeComment + MsgTypeReply = dbr.MsgTypeReply + MsgTypeWhisper = dbr.MsgTypeWhisper + MsgTypeRequestingFriend = dbr.MsgTypeRequestingFriend + MsgTypeSystem = dbr.MsgTypeSystem + + MsgStatusUnread = dbr.MsgStatusUnread + MsgStatusReaded = dbr.MsgStatusReaded +) + +type ( + Message = dbr.Message + MessageFormated = dbr.MessageFormated +) diff --git a/internal/core/types.go b/internal/core/ms/ms.go similarity index 79% rename from internal/core/types.go rename to internal/core/ms/ms.go index 6ca95893..8993251f 100644 --- a/internal/core/types.go +++ b/internal/core/ms/ms.go @@ -1,8 +1,10 @@ -// Copyright 2022 ROC. All rights reserved. +// Copyright 2023 ROC. All rights reserved. // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. -package core +// Package ms contain core data service interface type +// model define for gorm adapter +package ms import ( "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" diff --git a/internal/core/ms/security.go b/internal/core/ms/security.go new file mode 100644 index 00000000..a6610ca1 --- /dev/null +++ b/internal/core/ms/security.go @@ -0,0 +1,13 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package ms + +import ( + "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" +) + +type ( + Captcha = dbr.Captcha +) diff --git a/internal/core/ms/timeline.go b/internal/core/ms/timeline.go new file mode 100644 index 00000000..eb1169f4 --- /dev/null +++ b/internal/core/ms/timeline.go @@ -0,0 +1,10 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package ms + +type IndexTweetList struct { + Tweets []*PostFormated + Total int64 +} diff --git a/internal/core/ms/tweets.go b/internal/core/ms/tweets.go new file mode 100644 index 00000000..eab6d85c --- /dev/null +++ b/internal/core/ms/tweets.go @@ -0,0 +1,43 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package ms + +import ( + "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" +) + +const ( + AttachmentTypeImage = dbr.AttachmentTypeImage + AttachmentTypeVideo = dbr.AttachmentTypeVideo + AttachmentTypeOther = dbr.AttachmentTypeOther + + // 类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源 + ContentTypeTitle = dbr.ContentTypeTitle + ContentTypeText = dbr.ContentTypeText + ContentTypeImage = dbr.ContentTypeImage + ContentTypeVideo = dbr.ContentTypeVideo + ContentTypeAudio = dbr.ContentTypeAudio + ContentTypeLink = dbr.ContentTypeLink + ContentTypeAttachment = dbr.ContentTypeAttachment + ContentTypeChargeAttachment = dbr.ContentTypeChargeAttachment +) + +const ( + PostVisitPublic PostVisibleT = iota + PostVisitPrivate + PostVisitFriend + PostVisitInvalid +) + +type ( + PostStar = dbr.PostStar + PostCollection = dbr.PostCollection + PostAttachmentBill = dbr.PostAttachmentBill + PostContent = dbr.PostContent + Attachment = dbr.Attachment + AttachmentType = dbr.AttachmentType + PostContentT = dbr.PostContentT + PostVisibleT = dbr.PostVisibleT +) diff --git a/internal/core/ms/user.go b/internal/core/ms/user.go new file mode 100644 index 00000000..88cc6e73 --- /dev/null +++ b/internal/core/ms/user.go @@ -0,0 +1,20 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package ms + +type ( + ContactItem struct { + UserId int64 `json:"user_id"` + UserName string `db:"username" json:"username"` + Nickname string `json:"nickname"` + Avatar string `json:"avatar"` + Phone string `json:"phone"` + } + + ContactList struct { + Contacts []ContactItem `json:"contacts"` + Total int64 `json:"total"` + } +) diff --git a/internal/core/ms/wallet.go b/internal/core/ms/wallet.go new file mode 100644 index 00000000..5786fcac --- /dev/null +++ b/internal/core/ms/wallet.go @@ -0,0 +1,14 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package ms + +import ( + "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" +) + +type ( + WalletStatement = dbr.WalletStatement + WalletRecharge = dbr.WalletRecharge +) diff --git a/internal/core/search.go b/internal/core/search.go index 74d6e029..dc08e127 100644 --- a/internal/core/search.go +++ b/internal/core/search.go @@ -5,6 +5,7 @@ package core import ( + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" ) @@ -21,6 +22,7 @@ const ( ) type ( + // PostVisibleT 可访问类型,0公开,1私密,2好友 PostVisibleT = dbr.PostVisibleT SearchType string @@ -32,12 +34,12 @@ type ( } QueryResp struct { - Items []*PostFormated + Items []*ms.PostFormated Total int64 } TsDocItem struct { - Post *Post + Post *ms.Post Content string } ) @@ -47,5 +49,5 @@ type TweetSearchService interface { IndexName() string AddDocuments(data []TsDocItem, primaryKey ...string) (bool, error) DeleteDocuments(identifiers []string) error - Search(user *User, q *QueryReq, offset, limit int) (*QueryResp, error) + Search(user *ms.User, q *QueryReq, offset, limit int) (*QueryResp, error) } diff --git a/internal/core/security.go b/internal/core/security.go index ce313635..0643cc28 100644 --- a/internal/core/security.go +++ b/internal/core/security.go @@ -7,17 +7,13 @@ package core import ( "time" - "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" -) - -type ( - Captcha = dbr.Captcha + "github.com/rocboss/paopao-ce/internal/core/ms" ) // SecurityService 安全相关服务 type SecurityService interface { - GetLatestPhoneCaptcha(phone string) (*Captcha, error) - UsePhoneCaptcha(captcha *Captcha) error + GetLatestPhoneCaptcha(phone string) (*ms.Captcha, error) + UsePhoneCaptcha(captcha *ms.Captcha) error SendPhoneCaptcha(phone string) error } diff --git a/internal/core/timeline.go b/internal/core/timeline.go new file mode 100644 index 00000000..722e79f3 --- /dev/null +++ b/internal/core/timeline.go @@ -0,0 +1,20 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package core + +import ( + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" +) + +// IndexPostsService 广场首页推文列表服务 +type IndexPostsService interface { + IndexPosts(user *ms.User, offset int, limit int) (*ms.IndexTweetList, error) +} + +// IndexPostsServantA 广场首页推文列表服务(版本A) +type IndexPostsServantA interface { + IndexPosts(user *ms.User, limit int, offset int) (*cs.TweetBox, error) +} diff --git a/internal/core/topics.go b/internal/core/topics.go index 138cc151..cc3f12cf 100644 --- a/internal/core/topics.go +++ b/internal/core/topics.go @@ -5,18 +5,27 @@ package core import ( - "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" -) - -type ( - Tag = dbr.Tag - TagFormated = dbr.TagFormated + "github.com/rocboss/paopao-ce/internal/core/cs" ) // TopicService 话题服务 type TopicService interface { - CreateTag(tag *Tag) (*Tag, error) - DeleteTag(tag *Tag) error - GetTags(conditions *ConditionsT, offset, limit int) ([]*Tag, error) - GetTagsByKeyword(keyword string) ([]*Tag, error) + UpsertTags(userId int64, tags []string) (cs.TagInfoList, error) + DecrTagsById(ids []int64) error + ListTags(typ cs.TagType, limit int, offset int) (cs.TagList, error) + TagsByKeyword(keyword string) (cs.TagInfoList, error) + GetHotTags(userId int64, limit int, offset int) (cs.TagList, error) + GetNewestTags(userId int64, limit int, offset int) (cs.TagList, error) + GetFollowTags(userId int64, limit int, offset int) (cs.TagList, error) + FollowTopic(userId int64, topicId int64) error + UnfollowTopic(userId int64, topicId int64) error + StickTopic(userId int64, topicId int64) (int8, error) +} + +// TopicServantA 话题服务(版本A) +type TopicServantA interface { + UpsertTags(userId int64, tags []string) (cs.TagInfoList, error) + DecrTagsById(ids []int64) error + ListTags(typ cs.TagType, limit int, offset int) (cs.TagList, error) + TagsByKeyword(keyword string) (cs.TagInfoList, error) } diff --git a/internal/core/tweets.go b/internal/core/tweets.go index 682cbd65..9cb2e54a 100644 --- a/internal/core/tweets.go +++ b/internal/core/tweets.go @@ -5,79 +5,78 @@ package core import ( - "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" -) - -const ( - AttachmentTypeImage = dbr.AttachmentTypeImage - AttachmentTypeVideo = dbr.AttachmentTypeVideo - AttachmentTypeOther = dbr.AttachmentTypeOther - - // 类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源 - ContentTypeTitle = dbr.ContentTypeTitle - ContentTypeText = dbr.ContentTypeText - ContentTypeImage = dbr.ContentTypeImage - ContentTypeVideo = dbr.ContentTypeVideo - ContentTypeAudio = dbr.ContentTypeAudio - ContentTypeLink = dbr.ContentTypeLink - ContentTypeAttachment = dbr.ContentTypeAttachment - ContentTypeChargeAttachment = dbr.ContentTypeChargeAttachment -) - -type ( - PostStar = dbr.PostStar - PostCollection = dbr.PostCollection - PostAttachmentBill = dbr.PostAttachmentBill - PostContent = dbr.PostContent - Attachment = dbr.Attachment - AttachmentType = dbr.AttachmentType - PostContentT = dbr.PostContentT - - IndexTweetList struct { - Tweets []*PostFormated - Total int64 - } + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" ) // TweetService 推文检索服务 type TweetService interface { - GetPostByID(id int64) (*Post, error) - GetPosts(conditions *ConditionsT, offset, limit int) ([]*Post, error) - GetPostCount(conditions *ConditionsT) (int64, error) - GetUserPostStar(postID, userID int64) (*PostStar, error) - GetUserPostStars(userID int64, offset, limit int) ([]*PostStar, error) + GetPostByID(id int64) (*ms.Post, error) + GetPosts(conditions ms.ConditionsT, offset, limit int) ([]*ms.Post, error) + GetPostCount(conditions ms.ConditionsT) (int64, error) + GetUserPostStar(postID, userID int64) (*ms.PostStar, error) + GetUserPostStars(userID int64, limit int, offset int) ([]*ms.PostStar, error) GetUserPostStarCount(userID int64) (int64, error) - GetUserPostCollection(postID, userID int64) (*PostCollection, error) - GetUserPostCollections(userID int64, offset, limit int) ([]*PostCollection, error) + GetUserPostCollection(postID, userID int64) (*ms.PostCollection, error) + GetUserPostCollections(userID int64, offset, limit int) ([]*ms.PostCollection, error) GetUserPostCollectionCount(userID int64) (int64, error) - GetPostAttatchmentBill(postID, userID int64) (*PostAttachmentBill, error) - GetPostContentsByIDs(ids []int64) ([]*PostContent, error) - GetPostContentByID(id int64) (*PostContent, error) + GetPostAttatchmentBill(postID, userID int64) (*ms.PostAttachmentBill, error) + GetPostContentsByIDs(ids []int64) ([]*ms.PostContent, error) + GetPostContentByID(id int64) (*ms.PostContent, error) + ListUserStarTweets(user *cs.VistUser, limit int, offset int) ([]*ms.PostStar, int64, error) } // TweetManageService 推文管理服务,包括创建/删除/更新推文 type TweetManageService interface { - CreateAttachment(attachment *Attachment) (*Attachment, error) - CreatePost(post *Post) (*Post, error) - DeletePost(post *Post) ([]string, error) - LockPost(post *Post) error - StickPost(post *Post) error - VisiblePost(post *Post, visibility PostVisibleT) error - UpdatePost(post *Post) error - CreatePostStar(postID, userID int64) (*PostStar, error) - DeletePostStar(p *PostStar) error - CreatePostCollection(postID, userID int64) (*PostCollection, error) - DeletePostCollection(p *PostCollection) error - CreatePostContent(content *PostContent) (*PostContent, error) + CreatePost(post *ms.Post) (*ms.Post, error) + DeletePost(post *ms.Post) ([]string, error) + LockPost(post *ms.Post) error + StickPost(post *ms.Post) error + HighlightPost(userId, postId int64) (int, error) + VisiblePost(post *ms.Post, visibility PostVisibleT) error + UpdatePost(post *ms.Post) error + CreatePostStar(postID, userID int64) (*ms.PostStar, error) + DeletePostStar(p *ms.PostStar) error + CreatePostCollection(postID, userID int64) (*ms.PostCollection, error) + DeletePostCollection(p *ms.PostCollection) error + CreatePostContent(content *ms.PostContent) (*ms.PostContent, error) + CreateAttachment(obj *ms.Attachment) (int64, error) } // TweetHelpService 推文辅助服务 type TweetHelpService interface { - RevampPosts(posts []*PostFormated) ([]*PostFormated, error) - MergePosts(posts []*Post) ([]*PostFormated, error) + RevampPosts(posts []*ms.PostFormated) ([]*ms.PostFormated, error) + MergePosts(posts []*ms.Post) ([]*ms.PostFormated, error) +} + +// TweetServantA 推文检索服务(版本A) +type TweetServantA interface { + TweetInfoById(id int64) (*cs.TweetInfo, error) + TweetItemById(id int64) (*cs.TweetItem, error) + UserTweets(visitorId, userId int64) (cs.TweetList, error) + ReactionByTweetId(userId int64, tweetId int64) (*cs.ReactionItem, error) + UserReactions(userId int64, limit int, offset int) (cs.ReactionList, error) + FavoriteByTweetId(userId int64, tweetId int64) (*cs.FavoriteItem, error) + UserFavorites(userId int64, limit int, offset int) (cs.FavoriteList, error) + AttachmentByTweetId(userId int64, tweetId int64) (*cs.AttachmentBill, error) +} + +// TweetManageServantA 推文管理服务,包括创建/删除/更新推文(版本A) +type TweetManageServantA interface { + CreateAttachment(obj *cs.Attachment) (int64, error) + CreateTweet(userId int64, req *cs.NewTweetReq) (*cs.TweetItem, error) + DeleteTweet(userId int64, tweetId int64) ([]string, error) + LockTweet(userId int64, tweetId int64) error + StickTweet(userId int64, tweetId int64) error + VisibleTweet(userId int64, visibility cs.TweetVisibleType) error + CreateReaction(userId int64, tweetId int64) error + DeleteReaction(userId int64, reactionId int64) error + CreateFavorite(userId int64, tweetId int64) error + DeleteFavorite(userId int64, favoriteId int64) error } -// IndexPostsService 广场首页推文列表服务 -type IndexPostsService interface { - IndexPosts(user *User, offset int, limit int) (*IndexTweetList, error) +// TweetHelpServantA 推文辅助服务(版本A) +type TweetHelpServantA interface { + RevampTweets(tweets cs.TweetList) (cs.TweetList, error) + MergeTweets(tweets cs.TweetInfo) (cs.TweetList, error) } diff --git a/internal/core/user.go b/internal/core/user.go index ed132dd3..04d30e23 100644 --- a/internal/core/user.go +++ b/internal/core/user.go @@ -4,30 +4,17 @@ package core -type ( - ContactItem struct { - UserId int64 `json:"user_id"` - UserName string `json:"username"` - Nickname string `json:"nickname"` - Avatar string `json:"avatar"` - Phone string `json:"phone"` - } - - ContactList struct { - Contacts []ContactItem `json:"contacts"` - Total int64 `json:"total"` - } -) +import "github.com/rocboss/paopao-ce/internal/core/ms" // UserManageService 用户管理服务 type UserManageService interface { - GetUserByID(id int64) (*User, error) - GetUserByUsername(username string) (*User, error) - GetUserByPhone(phone string) (*User, error) - GetUsersByIDs(ids []int64) ([]*User, error) - GetUsersByKeyword(keyword string) ([]*User, error) - CreateUser(user *User) (*User, error) - UpdateUser(user *User) error + GetUserByID(id int64) (*ms.User, error) + GetUserByUsername(username string) (*ms.User, error) + GetUserByPhone(phone string) (*ms.User, error) + GetUsersByIDs(ids []int64) ([]*ms.User, error) + GetUsersByKeyword(keyword string) ([]*ms.User, error) + CreateUser(user *ms.User) (*ms.User, error) + UpdateUser(user *ms.User) error } // ContactManageService 联系人管理服务 @@ -36,6 +23,6 @@ type ContactManageService interface { AddFriend(userId int64, friendId int64) error RejectFriend(userId int64, friendId int64) error DeleteFriend(userId int64, friendId int64) error - GetContacts(userId int64, offset int, limit int) (*ContactList, error) + GetContacts(userId int64, offset int, limit int) (*ms.ContactList, error) IsFriend(userID int64, friendID int64) bool } diff --git a/internal/core/wallet.go b/internal/core/wallet.go index c4792d3b..e452a3ad 100644 --- a/internal/core/wallet.go +++ b/internal/core/wallet.go @@ -5,20 +5,15 @@ package core import ( - "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" -) - -type ( - WalletStatement = dbr.WalletStatement - WalletRecharge = dbr.WalletRecharge + "github.com/rocboss/paopao-ce/internal/core/ms" ) // WalletService wallet service interface type WalletService interface { - GetUserWalletBills(userID int64, offset, limit int) ([]*WalletStatement, error) + GetUserWalletBills(userID int64, offset, limit int) ([]*ms.WalletStatement, error) GetUserWalletBillCount(userID int64) (int64, error) - GetRechargeByID(id int64) (*WalletRecharge, error) - CreateRecharge(userId, amount int64) (*WalletRecharge, error) - HandleRechargeSuccess(recharge *WalletRecharge, tradeNo string) error - HandlePostAttachmentBought(post *Post, user *User) error + GetRechargeByID(id int64) (*ms.WalletRecharge, error) + CreateRecharge(userId, amount int64) (*ms.WalletRecharge, error) + HandleRechargeSuccess(recharge *ms.WalletRecharge, tradeNo string) error + HandlePostAttachmentBought(post *ms.Post, user *ms.User) error } diff --git a/internal/dao/cache/base.go b/internal/dao/cache/base.go new file mode 100644 index 00000000..fe314683 --- /dev/null +++ b/internal/dao/cache/base.go @@ -0,0 +1,230 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cache + +import ( + "bytes" + "encoding/gob" + "fmt" + "strconv" + "strings" + "time" + + "github.com/Masterminds/semver/v3" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/pkg/types" + "github.com/sirupsen/logrus" +) + +const ( + _cacheIndexKey = "paopao_index" +) + +var ( + _ core.CacheIndexService = (*cacheIndexSrv)(nil) + _ core.VersionInfo = (*cacheIndexSrv)(nil) +) + +type postsEntry struct { + key string + tweets *ms.IndexTweetList +} + +type tweetsCache interface { + core.VersionInfo + getTweetsBytes(key string) ([]byte, error) + setTweetsBytes(key string, bs []byte) error + delTweets(keys []string) error + allKeys() ([]string, error) +} + +type cacheIndexSrv struct { + ips core.IndexPostsService + ams core.AuthorizationManageService + + name string + version *semver.Version + indexActionCh chan *core.IndexAction + cachePostsCh chan *postsEntry + cache tweetsCache + lastCacheResetTime time.Time + preventDuration time.Duration +} + +func (s *cacheIndexSrv) IndexPosts(user *ms.User, offset int, limit int) (*ms.IndexTweetList, error) { + key := s.keyFrom(user, offset, limit) + posts, err := s.getPosts(key) + if err == nil { + logrus.Debugf("cacheIndexSrv.IndexPosts get index posts from cache by key: %s", key) + return posts, nil + } + + if posts, err = s.ips.IndexPosts(user, offset, limit); err != nil { + return nil, err + } + logrus.Debugf("cacheIndexSrv.IndexPosts get index posts from database by key: %s", key) + s.cachePosts(key, posts) + return posts, nil +} + +func (s *cacheIndexSrv) getPosts(key string) (*ms.IndexTweetList, error) { + data, err := s.cache.getTweetsBytes(key) + if err != nil { + logrus.Debugf("cacheIndexSrv.getPosts get posts by key: %s from cache err: %v", key, err) + return nil, err + } + buf := bytes.NewBuffer(data) + dec := gob.NewDecoder(buf) + var resp ms.IndexTweetList + if err := dec.Decode(&resp); err != nil { + logrus.Debugf("cacheIndexSrv.getPosts get posts from cache in decode err: %v", err) + return nil, err + } + return &resp, nil +} + +func (s *cacheIndexSrv) cachePosts(key string, tweets *ms.IndexTweetList) { + entry := &postsEntry{key: key, tweets: tweets} + select { + case s.cachePostsCh <- entry: + logrus.Debugf("cacheIndexSrv.cachePosts cachePosts by chan of key: %s", key) + default: + go func(ch chan<- *postsEntry, entry *postsEntry) { + logrus.Debugf("cacheIndexSrv.cachePosts cachePosts indexAction by goroutine of key: %s", key) + ch <- entry + }(s.cachePostsCh, entry) + } +} + +func (s *cacheIndexSrv) setPosts(entry *postsEntry) { + var buf bytes.Buffer + enc := gob.NewEncoder(&buf) + if err := enc.Encode(entry.tweets); err != nil { + logrus.Debugf("cacheIndexSrv.setPosts setPosts encode post entry err: %v", err) + return + } + if err := s.cache.setTweetsBytes(entry.key, buf.Bytes()); err != nil { + logrus.Debugf("cacheIndexSrv.setPosts setPosts set cache err: %v", err) + } + logrus.Debugf("cacheIndexSrv.setPosts setPosts set cache by key: %s", entry.key) +} + +func (s *cacheIndexSrv) keyFrom(user *ms.User, offset int, limit int) string { + var userId int64 = -1 + if user != nil { + userId = user.ID + } + return fmt.Sprintf("%s:%d:%d:%d", _cacheIndexKey, userId, offset, limit) +} + +func (s *cacheIndexSrv) SendAction(act core.IdxAct, post *ms.Post) { + action := core.NewIndexAction(act, post) + select { + case s.indexActionCh <- action: + logrus.Debugf("cacheIndexSrv.SendAction send indexAction by chan: %s", act) + default: + go func(ch chan<- *core.IndexAction, act *core.IndexAction) { + logrus.Debugf("cacheIndexSrv.SendAction send indexAction by goroutine: %s", action.Act) + ch <- act + }(s.indexActionCh, action) + } +} + +func (s *cacheIndexSrv) startIndexPosts() { + for { + select { + case entry := <-s.cachePostsCh: + s.setPosts(entry) + case action := <-s.indexActionCh: + s.handleIndexAction(action) + } + } +} + +func (s *cacheIndexSrv) handleIndexAction(action *core.IndexAction) { + act, post := action.Act, action.Post + + // 创建/删除 私密推文特殊处理 + switch act { + case core.IdxActCreatePost, core.IdxActDeletePost: + if post.Visibility == core.PostVisitPrivate { + s.deleteCacheByUserId(post.UserID, true) + return + } + } + + // 如果在s.preventDuration时间内就清除所有缓存,否则只清除自个儿的缓存 + // TODO: 需要优化只清除受影响的缓存,后续完善 + if time.Since(s.lastCacheResetTime) > s.preventDuration { + s.deleteCacheByUserId(post.UserID, false) + } else { + s.deleteCacheByUserId(post.UserID, true) + } +} + +func (s *cacheIndexSrv) deleteCacheByUserId(id int64, oneself bool) { + var keys []string + userId := strconv.FormatInt(id, 10) + friendSet := ms.FriendSet{} + if !oneself { + friendSet = s.ams.MyFriendSet(id) + } + friendSet[userId] = types.Empty{} + + // 获取需要删除缓存的key,目前是仅删除自个儿的缓存 + allKeys, err := s.cache.allKeys() + if err != nil { + logrus.Debugf("cacheIndexSrv.deleteCacheByUserId userId: %s err:%s", userId, err) + } + for _, key := range allKeys { + keyParts := strings.Split(key, ":") + if len(keyParts) > 2 && keyParts[0] == _cacheIndexKey { + if _, ok := friendSet[keyParts[1]]; ok { + keys = append(keys, key) + } + } + } + + // 执行删缓存 + s.cache.delTweets(keys) + s.lastCacheResetTime = time.Now() + logrus.Debugf("cacheIndexSrv.deleteCacheByUserId userId:%s oneself:%t keys:%d", userId, oneself, len(keys)) +} + +func (s *cacheIndexSrv) Name() string { + return s.name +} + +func (s *cacheIndexSrv) Version() *semver.Version { + return s.version +} + +func newCacheIndexSrv(ips core.IndexPostsService, ams core.AuthorizationManageService, tc tweetsCache) *cacheIndexSrv { + cacheIndex := &cacheIndexSrv{ + ips: ips, + ams: ams, + cache: tc, + name: tc.Name(), + version: tc.Version(), + preventDuration: 10 * time.Second, + } + + // indexActionCh capacity custom configure by conf.yaml need in [10, 10000] + // or re-compile source to adjust min/max capacity + capacity := conf.CacheIndexSetting.MaxUpdateQPS + if capacity < 10 { + capacity = 10 + } else if capacity > 10000 { + capacity = 10000 + } + cacheIndex.indexActionCh = make(chan *core.IndexAction, capacity) + cacheIndex.cachePostsCh = make(chan *postsEntry, capacity) + // 启动索引更新器 + go cacheIndex.startIndexPosts() + + return cacheIndex +} diff --git a/internal/dao/cache/bigcache.go b/internal/dao/cache/bigcache.go index 8ec83c38..202627e3 100644 --- a/internal/dao/cache/bigcache.go +++ b/internal/dao/cache/bigcache.go @@ -5,189 +5,51 @@ package cache import ( - "bytes" - "encoding/gob" - "fmt" - "strconv" - "strings" - "time" - "github.com/Masterminds/semver/v3" "github.com/allegro/bigcache/v3" - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/pkg/types" - "github.com/sirupsen/logrus" ) var ( - _ core.CacheIndexService = (*bigCacheIndexServant)(nil) - _ core.VersionInfo = (*bigCacheIndexServant)(nil) + _ tweetsCache = (*bigCacheTweetsCache)(nil) ) -type postsEntry struct { - key string - tweets *core.IndexTweetList +type bigCacheTweetsCache struct { + name string + version *semver.Version + bc *bigcache.BigCache } -type bigCacheIndexServant struct { - ips core.IndexPostsService - ams core.AuthorizationManageService - - indexActionCh chan *core.IndexAction - cachePostsCh chan *postsEntry - cache *bigcache.BigCache - lastCacheResetTime time.Time - preventDuration time.Duration -} - -func (s *bigCacheIndexServant) IndexPosts(user *core.User, offset int, limit int) (*core.IndexTweetList, error) { - key := s.keyFrom(user, offset, limit) - posts, err := s.getPosts(key) - if err == nil { - logrus.Debugf("bigCacheIndexServant.IndexPosts get index posts from cache by key: %s", key) - return posts, nil - } - - if posts, err = s.ips.IndexPosts(user, offset, limit); err != nil { - return nil, err - } - logrus.Debugf("bigCacheIndexServant.IndexPosts get index posts from database by key: %s", key) - s.cachePosts(key, posts) - return posts, nil +func (s *bigCacheTweetsCache) getTweetsBytes(key string) ([]byte, error) { + return s.bc.Get(key) } -func (s *bigCacheIndexServant) getPosts(key string) (*core.IndexTweetList, error) { - data, err := s.cache.Get(key) - if err != nil { - logrus.Debugf("bigCacheIndexServant.getPosts get posts by key: %s from cache err: %v", key, err) - return nil, err - } - buf := bytes.NewBuffer(data) - dec := gob.NewDecoder(buf) - var resp core.IndexTweetList - if err := dec.Decode(&resp); err != nil { - logrus.Debugf("bigCacheIndexServant.getPosts get posts from cache in decode err: %v", err) - return nil, err - } - return &resp, nil -} - -func (s *bigCacheIndexServant) cachePosts(key string, tweets *core.IndexTweetList) { - entry := &postsEntry{key: key, tweets: tweets} - select { - case s.cachePostsCh <- entry: - logrus.Debugf("bigCacheIndexServant.cachePosts cachePosts by chan of key: %s", key) - default: - go func(ch chan<- *postsEntry, entry *postsEntry) { - logrus.Debugf("bigCacheIndexServant.cachePosts cachePosts indexAction by goroutine of key: %s", key) - ch <- entry - }(s.cachePostsCh, entry) - } -} - -func (s *bigCacheIndexServant) setPosts(entry *postsEntry) { - var buf bytes.Buffer - enc := gob.NewEncoder(&buf) - if err := enc.Encode(entry.tweets); err != nil { - logrus.Debugf("bigCacheIndexServant.setPosts setPosts encode post entry err: %v", err) - return - } - if err := s.cache.Set(entry.key, buf.Bytes()); err != nil { - logrus.Debugf("bigCacheIndexServant.setPosts setPosts set cache err: %v", err) - } - logrus.Debugf("bigCacheIndexServant.setPosts setPosts set cache by key: %s", entry.key) -} - -func (s *bigCacheIndexServant) keyFrom(user *core.User, offset int, limit int) string { - var userId int64 = -1 - if user != nil { - userId = user.ID - } - return fmt.Sprintf("index:%d:%d:%d", userId, offset, limit) +func (s *bigCacheTweetsCache) setTweetsBytes(key string, bs []byte) error { + return s.bc.Set(key, bs) } -func (s *bigCacheIndexServant) SendAction(act core.IdxAct, post *core.Post) { - action := core.NewIndexAction(act, post) - select { - case s.indexActionCh <- action: - logrus.Debugf("bigCacheIndexServant.SendAction send indexAction by chan: %s", act) - default: - go func(ch chan<- *core.IndexAction, act *core.IndexAction) { - logrus.Debugf("bigCacheIndexServant.SendAction send indexAction by goroutine: %s", action.Act) - ch <- act - }(s.indexActionCh, action) - } -} - -func (s *bigCacheIndexServant) startIndexPosts() { - for { - select { - case entry := <-s.cachePostsCh: - s.setPosts(entry) - case action := <-s.indexActionCh: - s.handleIndexAction(action) - } - } -} - -func (s *bigCacheIndexServant) handleIndexAction(action *core.IndexAction) { - act, post := action.Act, action.Post - - // 创建/删除 私密推文特殊处理 - switch act { - case core.IdxActCreatePost, core.IdxActDeletePost: - if post.Visibility == core.PostVisitPrivate { - s.deleteCacheByUserId(post.UserID, true) - return - } - } - - // 如果在s.preventDuration时间内就清除所有缓存,否则只清除自个儿的缓存 - // TODO: 需要优化只清除受影响的缓存,后续完善 - if time.Since(s.lastCacheResetTime) > s.preventDuration { - s.deleteCacheByUserId(post.UserID, false) - } else { - s.deleteCacheByUserId(post.UserID, true) +func (s *bigCacheTweetsCache) delTweets(keys []string) error { + for _, k := range keys { + s.bc.Delete(k) } + return nil } -func (s *bigCacheIndexServant) deleteCacheByUserId(id int64, oneself bool) { +func (s *bigCacheTweetsCache) allKeys() ([]string, error) { var keys []string - userId := strconv.FormatInt(id, 10) - friendSet := core.FriendSet{} - if !oneself { - friendSet = s.ams.MyFriendSet(id) - } - friendSet[userId] = types.Empty{} - - // 获取需要删除缓存的key,目前是仅删除自个儿的缓存 - for it := s.cache.Iterator(); it.SetNext(); { + for it := s.bc.Iterator(); it.SetNext(); { entry, err := it.Value() if err != nil { - logrus.Debugf("bigCacheIndexServant.deleteCacheByUserId userId: %s err:%s", userId, err) - return + return nil, err } - key := entry.Key() - keyParts := strings.Split(key, ":") - if len(keyParts) > 2 && keyParts[0] == "index" { - if _, ok := friendSet[keyParts[1]]; ok { - keys = append(keys, key) - } - } - } - - // 执行删缓存 - for _, k := range keys { - s.cache.Delete(k) + keys = append(keys, entry.Key()) } - s.lastCacheResetTime = time.Now() - logrus.Debugf("bigCacheIndexServant.deleteCacheByUserId userId:%s oneself:%t keys:%d", userId, oneself, len(keys)) + return keys, nil } -func (s *bigCacheIndexServant) Name() string { +func (s *bigCacheTweetsCache) Name() string { return "BigCacheIndex" } -func (s *bigCacheIndexServant) Version() *semver.Version { +func (s *bigCacheTweetsCache) Version() *semver.Version { return semver.MustParse("v0.2.0") } diff --git a/internal/dao/cache/cache.go b/internal/dao/cache/cache.go index 773c9a2f..6c97d2ec 100644 --- a/internal/dao/cache/cache.go +++ b/internal/dao/cache/cache.go @@ -13,40 +13,37 @@ import ( "github.com/sirupsen/logrus" ) +func NewRedisCache() core.RedisCache { + return &redisCache{ + c: conf.MustRedisClient(), + } +} + func NewBigCacheIndexService(ips core.IndexPostsService, ams core.AuthorizationManageService) (core.CacheIndexService, core.VersionInfo) { s := conf.BigCacheIndexSetting + c := bigcache.DefaultConfig(s.ExpireInSecond) + c.Shards = s.MaxIndexPage + c.HardMaxCacheSize = s.HardMaxCacheSize + c.Verbose = s.Verbose + c.MaxEntrySize = 10000 + c.Logger = logrus.StandardLogger() - config := bigcache.DefaultConfig(s.ExpireInSecond) - config.Shards = s.MaxIndexPage - config.Verbose = s.Verbose - config.MaxEntrySize = 10000 - config.Logger = logrus.StandardLogger() - cache, err := bigcache.NewBigCache(config) + bc, err := bigcache.NewBigCache(c) if err != nil { logrus.Fatalf("initial bigCahceIndex failure by err: %v", err) } + cacheIndex := newCacheIndexSrv(ips, ams, &bigCacheTweetsCache{ + bc: bc, + }) + return cacheIndex, cacheIndex +} - cacheIndex := &bigCacheIndexServant{ - ips: ips, - ams: ams, - cache: cache, - preventDuration: 10 * time.Second, - } - - // indexActionCh capacity custom configure by conf.yaml need in [10, 10000] - // or re-compile source to adjust min/max capacity - capacity := conf.CacheIndexSetting.MaxUpdateQPS - if capacity < 10 { - capacity = 10 - } else if capacity > 10000 { - capacity = 10000 - } - cacheIndex.indexActionCh = make(chan *core.IndexAction, capacity) - cacheIndex.cachePostsCh = make(chan *postsEntry, capacity) - - // 启动索引更新器 - go cacheIndex.startIndexPosts() - +func NewRedisCacheIndexService(ips core.IndexPostsService, ams core.AuthorizationManageService) (core.CacheIndexService, core.VersionInfo) { + cacheIndex := newCacheIndexSrv(ips, ams, &redisCacheTweetsCache{ + expireDuration: conf.RedisCacheIndexSetting.ExpireInSecond, + expireInSecond: int64(conf.RedisCacheIndexSetting.ExpireInSecond / time.Second), + c: conf.MustRedisClient(), + }) return cacheIndex, cacheIndex } diff --git a/internal/dao/cache/none.go b/internal/dao/cache/none.go index ce6e1caf..079c453b 100644 --- a/internal/dao/cache/none.go +++ b/internal/dao/cache/none.go @@ -7,6 +7,9 @@ package cache import ( "github.com/Masterminds/semver/v3" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/pkg/debug" ) var ( @@ -18,11 +21,16 @@ type noneCacheIndexServant struct { ips core.IndexPostsService } -func (s *noneCacheIndexServant) IndexPosts(user *core.User, offset int, limit int) (*core.IndexTweetList, error) { +func (s *noneCacheIndexServant) IndexPosts(user *ms.User, offset int, limit int) (*ms.IndexTweetList, error) { return s.ips.IndexPosts(user, offset, limit) } -func (s *noneCacheIndexServant) SendAction(_act core.IdxAct, _post *core.Post) { +func (s *noneCacheIndexServant) TweetTimeline(userId int64, offset int, limit int) (*cs.TweetBox, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *noneCacheIndexServant) SendAction(_act core.IdxAct, _post *ms.Post) { // empty } diff --git a/internal/dao/cache/redis.go b/internal/dao/cache/redis.go new file mode 100644 index 00000000..50b581a7 --- /dev/null +++ b/internal/dao/cache/redis.go @@ -0,0 +1,153 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package cache + +import ( + "context" + "fmt" + "time" + "unsafe" + + "github.com/Masterminds/semver/v3" + "github.com/redis/rueidis" + "github.com/rocboss/paopao-ce/internal/core" +) + +var ( + _ core.RedisCache = (*redisCache)(nil) + _ tweetsCache = (*redisCacheTweetsCache)(nil) +) + +const ( + _cacheIndexKeyPattern = _cacheIndexKey + "*" + _pushToSearchJobKey = "paopao_push_to_search_job" + _countLoginErrKey = "paopao_count_login_err" + _imgCaptchaKey = "paopao_img_captcha:" + _smsCaptchaKey = "paopao_sms_captcha" + _countWhisperKey = "paopao_whisper_key" + _rechargeStatusKey = "paopao_recharge_status:" +) + +type redisCache struct { + c rueidis.Client +} + +type redisCacheTweetsCache struct { + expireDuration time.Duration + expireInSecond int64 + c rueidis.Client +} + +func (s *redisCacheTweetsCache) getTweetsBytes(key string) ([]byte, error) { + res, err := rueidis.MGetCache(s.c, context.Background(), s.expireDuration, []string{key}) + if err != nil { + return nil, err + } + message := res[key] + return message.AsBytes() +} + +func (s *redisCacheTweetsCache) setTweetsBytes(key string, bs []byte) error { + cmd := s.c.B().Set().Key(key).Value(rueidis.BinaryString(bs)).ExSeconds(s.expireInSecond).Build() + return s.c.Do(context.Background(), cmd).Error() +} + +func (s *redisCacheTweetsCache) delTweets(keys []string) error { + cmd := s.c.B().Del().Key(keys...).Build() + return s.c.Do(context.Background(), cmd).Error() +} + +func (s *redisCacheTweetsCache) allKeys() ([]string, error) { + cmd := s.c.B().Keys().Pattern(_cacheIndexKeyPattern).Build() + return s.c.Do(context.Background(), cmd).AsStrSlice() +} + +func (s *redisCacheTweetsCache) Name() string { + return "RedisCacheIndex" +} + +func (s *redisCacheTweetsCache) Version() *semver.Version { + return semver.MustParse("v0.1.0") +} + +func (r *redisCache) SetPushToSearchJob(ctx context.Context) error { + return r.c.Do(ctx, r.c.B().Set(). + Key(_pushToSearchJobKey).Value("1"). + Nx().ExSeconds(3600). + Build()).Error() +} + +func (r *redisCache) DelPushToSearchJob(ctx context.Context) error { + return r.c.Do(ctx, r.c.B().Del().Key(_pushToSearchJobKey).Build()).Error() +} + +func (r *redisCache) SetImgCaptcha(ctx context.Context, id string, value string) error { + return r.c.Do(ctx, r.c.B().Set(). + Key(_imgCaptchaKey+id).Value(value). + ExSeconds(300). + Build()).Error() +} + +func (r *redisCache) GetImgCaptcha(ctx context.Context, id string) (string, error) { + res, err := r.c.Do(ctx, r.c.B().Get().Key(_imgCaptchaKey+id).Build()).AsBytes() + return unsafe.String(&res[0], len(res)), err +} + +func (r *redisCache) DelImgCaptcha(ctx context.Context, id string) error { + return r.c.Do(ctx, r.c.B().Del().Key(_imgCaptchaKey+id).Build()).Error() +} + +func (r *redisCache) GetCountSmsCaptcha(ctx context.Context, phone string) (int64, error) { + return r.c.Do(ctx, r.c.B().Get().Key(_smsCaptchaKey+phone).Build()).AsInt64() +} + +func (r *redisCache) IncrCountSmsCaptcha(ctx context.Context, phone string) (err error) { + if err = r.c.Do(ctx, r.c.B().Incr().Key(_smsCaptchaKey+phone).Build()).Error(); err == nil { + currentTime := time.Now() + endTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), 23, 59, 59, 0, currentTime.Location()) + err = r.c.Do(ctx, r.c.B().Expire().Key(_smsCaptchaKey+phone).Seconds(int64(endTime.Sub(currentTime)/time.Second)).Build()).Error() + } + return +} + +func (r *redisCache) GetCountLoginErr(ctx context.Context, id int64) (int64, error) { + return r.c.Do(ctx, r.c.B().Get().Key(fmt.Sprintf("%s:%d", _countLoginErrKey, id)).Build()).AsInt64() +} + +func (r *redisCache) DelCountLoginErr(ctx context.Context, id int64) error { + return r.c.Do(ctx, r.c.B().Del().Key(fmt.Sprintf("%s:%d", _countLoginErrKey, id)).Build()).Error() +} + +func (r *redisCache) IncrCountLoginErr(ctx context.Context, id int64) error { + err := r.c.Do(ctx, r.c.B().Incr().Key(fmt.Sprintf("%s:%d", _countLoginErrKey, id)).Build()).Error() + if err == nil { + err = r.c.Do(ctx, r.c.B().Expire().Key(fmt.Sprintf("%s:%d", _countLoginErrKey, id)).Seconds(3600).Build()).Error() + } + return err +} + +func (r *redisCache) GetCountWhisper(ctx context.Context, uid int64) (int64, error) { + return r.c.Do(ctx, r.c.B().Get().Key(fmt.Sprintf("%s:%d", _countWhisperKey, uid)).Build()).AsInt64() +} + +func (r *redisCache) IncrCountWhisper(ctx context.Context, uid int64) (err error) { + key := fmt.Sprintf("%s:%d", _countWhisperKey, uid) + if err = r.c.Do(ctx, r.c.B().Incr().Key(key).Build()).Error(); err == nil { + currentTime := time.Now() + endTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), 23, 59, 59, 0, currentTime.Location()) + err = r.c.Do(ctx, r.c.B().Expire().Key(key).Seconds(int64(endTime.Sub(currentTime)/time.Second)).Build()).Error() + } + return +} + +func (r *redisCache) SetRechargeStatus(ctx context.Context, tradeNo string) error { + return r.c.Do(ctx, r.c.B().Set(). + Key(_rechargeStatusKey+tradeNo).Value("1"). + Nx().ExSeconds(5).Build()).Error() +} + +func (r *redisCache) DelRechargeStatus(ctx context.Context, tradeNo string) error { + return r.c.Do(ctx, r.c.B().Del().Key(_rechargeStatusKey+tradeNo).Build()).Error() +} diff --git a/internal/dao/cache/simple.go b/internal/dao/cache/simple.go index ba674d1b..a1c230d3 100644 --- a/internal/dao/cache/simple.go +++ b/internal/dao/cache/simple.go @@ -10,6 +10,9 @@ import ( "github.com/Masterminds/semver/v3" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/pkg/debug" "github.com/sirupsen/logrus" ) @@ -22,21 +25,21 @@ type simpleCacheIndexServant struct { ips core.IndexPostsService indexActionCh chan core.IdxAct - indexPosts *core.IndexTweetList + indexPosts *ms.IndexTweetList atomicIndex atomic.Value maxIndexSize int checkTick *time.Ticker expireIndexTick *time.Ticker } -func (s *simpleCacheIndexServant) IndexPosts(user *core.User, offset int, limit int) (*core.IndexTweetList, error) { - cacheResp := s.atomicIndex.Load().(*core.IndexTweetList) +func (s *simpleCacheIndexServant) IndexPosts(user *ms.User, offset int, limit int) (*ms.IndexTweetList, error) { + cacheResp := s.atomicIndex.Load().(*ms.IndexTweetList) end := offset + limit if cacheResp != nil { size := len(cacheResp.Tweets) logrus.Debugf("simpleCacheIndexServant.IndexPosts get index posts from cache posts: %d offset:%d limit:%d start:%d, end:%d", size, offset, limit, offset, end) if size >= end { - return &core.IndexTweetList{ + return &ms.IndexTweetList{ Tweets: cacheResp.Tweets[offset:end], Total: cacheResp.Total, }, nil @@ -47,7 +50,12 @@ func (s *simpleCacheIndexServant) IndexPosts(user *core.User, offset int, limit return s.ips.IndexPosts(user, offset, limit) } -func (s *simpleCacheIndexServant) SendAction(act core.IdxAct, _post *core.Post) { +func (s *simpleCacheIndexServant) TweetTimeline(userId int64, offset int, limit int) (*cs.TweetBox, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *simpleCacheIndexServant) SendAction(act core.IdxAct, _post *ms.Post) { select { case s.indexActionCh <- act: logrus.Debugf("simpleCacheIndexServant.SendAction send indexAction by chan: %s", act) diff --git a/internal/dao/dao.go b/internal/dao/dao.go index d0b05c9c..b1f7d9f2 100644 --- a/internal/dao/dao.go +++ b/internal/dao/dao.go @@ -18,87 +18,114 @@ import ( ) var ( - ts core.TweetSearchService - ds core.DataService - oss core.ObjectStorageService + ts core.TweetSearchService + ds core.DataService + oss core.ObjectStorageService + webDsa core.WebDataServantA - onceTs, onceDs, onceOss sync.Once + _onceInitial sync.Once ) func DataService() core.DataService { - onceDs.Do(func() { - var v core.VersionInfo - if cfg.If("Gorm") { - ds, v = jinzhu.NewDataService() - } else if cfg.If("Sqlx") && cfg.If("MySQL") { - ds, v = sakila.NewDataService() - } else if cfg.If("Sqlx") && (cfg.If("Postgres") || cfg.If("PostgreSQL")) { - ds, v = slonik.NewDataService() - } else { - // default use gorm as orm for sql database - ds, v = jinzhu.NewDataService() - } - logrus.Infof("use %s as data service with version %s", v.Name(), v.Version()) - }) + lazyInitial() return ds } +func WebDataServantA() core.WebDataServantA { + lazyInitial() + return webDsa +} + func ObjectStorageService() core.ObjectStorageService { - onceOss.Do(func() { - var v core.VersionInfo - if cfg.If("AliOSS") { - oss, v = storage.MustAliossService() - } else if cfg.If("COS") { - oss, v = storage.NewCosService() - } else if cfg.If("HuaweiOBS") { - oss, v = storage.MustHuaweiobsService() - } else if cfg.If("MinIO") { - oss, v = storage.MustMinioService() - } else if cfg.If("S3") { - oss, v = storage.MustS3Service() - logrus.Infof("use S3 as object storage by version %s", v.Version()) - return - } else if cfg.If("LocalOSS") { - oss, v = storage.MustLocalossService() - } else { - // default use AliOSS as object storage service - oss, v = storage.MustAliossService() - logrus.Infof("use default AliOSS as object storage by version %s", v.Version()) - return - } - logrus.Infof("use %s as object storage by version %s", v.Name(), v.Version()) - }) + lazyInitial() return oss } func TweetSearchService() core.TweetSearchService { - onceTs.Do(func() { - var v core.VersionInfo - ams := newAuthorizationManageService() - if cfg.If("Zinc") { - ts, v = search.NewZincTweetSearchService(ams) - } else if cfg.If("Meili") { - ts, v = search.NewMeiliTweetSearchService(ams) - } else { - // default use Zinc as tweet search service - ts, v = search.NewZincTweetSearchService(ams) - } - logrus.Infof("use %s as tweet search serice by version %s", v.Name(), v.Version()) - - ts = search.NewBridgeTweetSearchService(ts) - }) + lazyInitial() return ts } -func newAuthorizationManageService() (s core.AuthorizationManageService) { +func newAuthorizationManageService() (ams core.AuthorizationManageService) { if cfg.If("Gorm") { - s = jinzhu.NewAuthorizationManageService() - } else if cfg.If("Sqlx") && cfg.If("MySQL") { - s = sakila.NewAuthorizationManageService() - } else if cfg.If("Sqlx") && (cfg.If("Postgres") || cfg.If("PostgreSQL")) { - s = slonik.NewAuthorizationManageService() + ams = jinzhu.NewAuthorizationManageService() + } else if cfg.If("Sqlx") { + ams = sakila.NewAuthorizationManageService() + } else if cfg.If("Sqlc") && cfg.Any("Postgres", "PostgreSQL") { + ams = slonik.NewAuthorizationManageService() } else { - s = jinzhu.NewAuthorizationManageService() + ams = jinzhu.NewAuthorizationManageService() } return } + +// lazyInitial do some package lazy initialize for performance +func lazyInitial() { + _onceInitial.Do(func() { + initDsX() + initOSS() + initTsX() + }) +} + +func initDsX() { + var dsVer, dsaVer core.VersionInfo + if cfg.If("Gorm") { + ds, dsVer = jinzhu.NewDataService() + webDsa, dsaVer = jinzhu.NewWebDataServantA() + } else if cfg.If("Sqlx") { + ds, dsVer = sakila.NewDataService() + webDsa, dsaVer = sakila.NewWebDataServantA() + } else if cfg.If("Sqlc") && cfg.Any("Postgres", "PostgreSQL") { + ds, dsVer = slonik.NewDataService() + webDsa, dsaVer = slonik.NewWebDataServantA() + } else { + // default use gorm as orm for sql database + ds, dsVer = jinzhu.NewDataService() + webDsa, dsaVer = jinzhu.NewWebDataServantA() + } + logrus.Infof("use %s as core.DataService with version %s", dsVer.Name(), dsVer.Version()) + logrus.Infof("use %s as core.ServantA with version %s", dsaVer.Name(), dsaVer.Version()) +} + +func initOSS() { + var v core.VersionInfo + if cfg.If("AliOSS") { + oss, v = storage.MustAliossService() + } else if cfg.If("COS") { + oss, v = storage.NewCosService() + } else if cfg.If("HuaweiOBS") { + oss, v = storage.MustHuaweiobsService() + } else if cfg.If("MinIO") { + oss, v = storage.MustMinioService() + } else if cfg.If("S3") { + oss, v = storage.MustS3Service() + logrus.Infof("use S3 as object storage by version %s", v.Version()) + return + } else if cfg.If("LocalOSS") { + oss, v = storage.MustLocalossService() + } else { + // default use AliOSS as object storage service + oss, v = storage.MustAliossService() + logrus.Infof("use default AliOSS as object storage by version %s", v.Version()) + return + } + logrus.Infof("use %s as object storage by version %s", v.Name(), v.Version()) +} + +func initTsX() { + var v core.VersionInfo + ams := newAuthorizationManageService() + cfg.On(cfg.Actions{ + "Zinc": func() { + ts, v = search.NewZincTweetSearchService(ams) + }, + "Meili": func() { + ts, v = search.NewMeiliTweetSearchService(ams) + }, + }, func() { + ts, v = search.NewZincTweetSearchService(ams) + }) + logrus.Infof("use %s as tweet search serice by version %s", v.Name(), v.Version()) + ts = search.NewBridgeTweetSearchService(ts) +} diff --git a/internal/dao/jinzhu/authority.go b/internal/dao/jinzhu/authority.go index 5932fa24..9921f214 100644 --- a/internal/dao/jinzhu/authority.go +++ b/internal/dao/jinzhu/authority.go @@ -6,26 +6,27 @@ package jinzhu import ( "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" "github.com/rocboss/paopao-ce/pkg/types" "gorm.io/gorm" ) var ( - _ core.AuthorizationManageService = (*authorizationManageServant)(nil) + _ core.AuthorizationManageService = (*authorizationManageSrv)(nil) ) -type authorizationManageServant struct { +type authorizationManageSrv struct { db *gorm.DB } func newAuthorizationManageService(db *gorm.DB) core.AuthorizationManageService { - return &authorizationManageServant{ + return &authorizationManageSrv{ db: db, } } -func (s *authorizationManageServant) IsAllow(user *core.User, action *core.Action) bool { +func (s *authorizationManageSrv) IsAllow(user *ms.User, action *ms.Action) bool { // user is activation if had bind phone isActivation := (len(user.Phone) != 0) isFriend := s.isFriend(user.ID, action.UserId) @@ -33,37 +34,37 @@ func (s *authorizationManageServant) IsAllow(user *core.User, action *core.Actio return action.Act.IsAllow(user, action.UserId, isFriend, isActivation) } -func (s *authorizationManageServant) MyFriendSet(userId int64) core.FriendSet { +func (s *authorizationManageSrv) MyFriendSet(userId int64) ms.FriendSet { ids, err := (&dbr.Contact{UserId: userId}).MyFriendIds(s.db) if err != nil { - return core.FriendSet{} + return ms.FriendSet{} } - resp := make(core.FriendSet, len(ids)) + resp := make(ms.FriendSet, len(ids)) for _, id := range ids { resp[id] = types.Empty{} } return resp } -func (s *authorizationManageServant) BeFriendFilter(userId int64) core.FriendFilter { +func (s *authorizationManageSrv) BeFriendFilter(userId int64) ms.FriendFilter { ids, err := (&dbr.Contact{FriendId: userId}).BeFriendIds(s.db) if err != nil { - return core.FriendFilter{} + return ms.FriendFilter{} } - resp := make(core.FriendFilter, len(ids)) + resp := make(ms.FriendFilter, len(ids)) for _, id := range ids { resp[id] = types.Empty{} } return resp } -func (s *authorizationManageServant) BeFriendIds(userId int64) ([]int64, error) { +func (s *authorizationManageSrv) BeFriendIds(userId int64) ([]int64, error) { return (&dbr.Contact{FriendId: userId}).BeFriendIds(s.db) } -func (s *authorizationManageServant) isFriend(userId int64, friendId int64) bool { +func (s *authorizationManageSrv) isFriend(userId int64, friendId int64) bool { contact, err := (&dbr.Contact{UserId: friendId, FriendId: userId}).GetByUserFriend(s.db) if err == nil || contact.Status == dbr.ContactStatusAgree { return true diff --git a/internal/dao/jinzhu/comments.go b/internal/dao/jinzhu/comments.go index 1af9e5ce..4ac08e18 100644 --- a/internal/dao/jinzhu/comments.go +++ b/internal/dao/jinzhu/comments.go @@ -5,41 +5,66 @@ package jinzhu import ( + "time" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" + "github.com/rocboss/paopao-ce/pkg/types" "gorm.io/gorm" ) var ( - _ core.CommentService = (*commentServant)(nil) - _ core.CommentManageService = (*commentManageServant)(nil) + _ core.CommentService = (*commentSrv)(nil) + _ core.CommentManageService = (*commentManageSrv)(nil) ) -type commentServant struct { +type commentSrv struct { db *gorm.DB } -type commentManageServant struct { +type commentManageSrv struct { db *gorm.DB } func newCommentService(db *gorm.DB) core.CommentService { - return &commentServant{ + return &commentSrv{ db: db, } } func newCommentManageService(db *gorm.DB) core.CommentManageService { - return &commentManageServant{ + return &commentManageSrv{ db: db, } } -func (s *commentServant) GetComments(conditions *core.ConditionsT, offset, limit int) ([]*core.Comment, error) { +func (s *commentSrv) GetCommentThumbsMap(userId int64, tweetId int64) (cs.CommentThumbsMap, cs.CommentThumbsMap, error) { + if userId < 0 { + return nil, nil, nil + } + commentThumbsList := cs.CommentThumbsList{} + err := s.db.Model(&dbr.TweetCommentThumbs{}).Where("user_id=? AND tweet_id=?", userId, tweetId).Find(&commentThumbsList).Error + if err != nil { + return nil, nil, err + } + commentThumbs, replyThumbs := make(cs.CommentThumbsMap), make(cs.CommentThumbsMap) + for _, thumbs := range commentThumbsList { + if thumbs.CommentType == 0 { + commentThumbs[thumbs.CommentID] = thumbs + } else { + replyThumbs[thumbs.ReplyID] = thumbs + } + } + return commentThumbs, replyThumbs, nil +} + +func (s *commentSrv) GetComments(conditions *ms.ConditionsT, offset, limit int) ([]*ms.Comment, error) { return (&dbr.Comment{}).List(s.db, conditions, offset, limit) } -func (s *commentServant) GetCommentByID(id int64) (*core.Comment, error) { +func (s *commentSrv) GetCommentByID(id int64) (*ms.Comment, error) { comment := &dbr.Comment{ Model: &dbr.Model{ ID: id, @@ -48,7 +73,7 @@ func (s *commentServant) GetCommentByID(id int64) (*core.Comment, error) { return comment.Get(s.db) } -func (s *commentServant) GetCommentReplyByID(id int64) (*core.CommentReply, error) { +func (s *commentSrv) GetCommentReplyByID(id int64) (*ms.CommentReply, error) { reply := &dbr.CommentReply{ Model: &dbr.Model{ ID: id, @@ -57,21 +82,22 @@ func (s *commentServant) GetCommentReplyByID(id int64) (*core.CommentReply, erro return reply.Get(s.db) } -func (s *commentServant) GetCommentCount(conditions *core.ConditionsT) (int64, error) { +func (s *commentSrv) GetCommentCount(conditions *ms.ConditionsT) (int64, error) { return (&dbr.Comment{}).Count(s.db, conditions) } -func (s *commentServant) GetCommentContentsByIDs(ids []int64) ([]*core.CommentContent, error) { +func (s *commentSrv) GetCommentContentsByIDs(ids []int64) ([]*ms.CommentContent, error) { commentContent := &dbr.CommentContent{} return commentContent.List(s.db, &dbr.ConditionsT{ "comment_id IN ?": ids, }, 0, 0) } -func (s *commentServant) GetCommentRepliesByID(ids []int64) ([]*core.CommentReplyFormated, error) { +func (s *commentSrv) GetCommentRepliesByID(ids []int64) ([]*ms.CommentReplyFormated, error) { CommentReply := &dbr.CommentReply{} replies, err := CommentReply.List(s.db, &dbr.ConditionsT{ "comment_id IN ?": ids, + "ORDER": "id ASC", }, 0, 0) if err != nil { @@ -87,7 +113,7 @@ func (s *commentServant) GetCommentRepliesByID(ids []int64) ([]*core.CommentRepl if err != nil { return nil, err } - repliesFormated := []*core.CommentReplyFormated{} + repliesFormated := []*ms.CommentReplyFormated{} for _, reply := range replies { replyFormated := reply.Format() for _, user := range users { @@ -105,22 +131,271 @@ func (s *commentServant) GetCommentRepliesByID(ids []int64) ([]*core.CommentRepl return repliesFormated, nil } -func (s *commentManageServant) DeleteComment(comment *core.Comment) error { - return comment.Delete(s.db) +func (s *commentManageSrv) DeleteComment(comment *ms.Comment) error { + db := s.db.Begin() + defer db.Rollback() + + err := comment.Delete(s.db) + if err != nil { + return err + } + err = db.Model(&dbr.TweetCommentThumbs{}).Where("user_id=? AND tweet_id=? AND comment_id=?", comment.UserID, comment.PostID, comment.ID).Updates(map[string]any{ + "deleted_on": time.Now().Unix(), + "is_del": 1, + }).Error + if err != nil { + return err + } + db.Commit() + return nil } -func (s *commentManageServant) CreateComment(comment *core.Comment) (*core.Comment, error) { +func (s *commentManageSrv) CreateComment(comment *ms.Comment) (*ms.Comment, error) { return comment.Create(s.db) } -func (s *commentManageServant) CreateCommentReply(reply *core.CommentReply) (*core.CommentReply, error) { +func (s *commentManageSrv) CreateCommentReply(reply *ms.CommentReply) (*ms.CommentReply, error) { return reply.Create(s.db) } -func (s *commentManageServant) DeleteCommentReply(reply *core.CommentReply) error { - return reply.Delete(s.db) +func (s *commentManageSrv) DeleteCommentReply(reply *ms.CommentReply) (err error) { + db := s.db.Begin() + defer db.Rollback() + + err = reply.Delete(s.db) + if err != nil { + return + } + err = db.Model(&dbr.TweetCommentThumbs{}). + Where("user_id=? AND comment_id=? AND reply_id=?", reply.UserID, reply.CommentID, reply.ID).Updates(map[string]any{ + "deleted_on": time.Now().Unix(), + "is_del": 1, + }).Error + if err != nil { + return + } + db.Commit() + return } -func (s *commentManageServant) CreateCommentContent(content *core.CommentContent) (*core.CommentContent, error) { +func (s *commentManageSrv) CreateCommentContent(content *ms.CommentContent) (*ms.CommentContent, error) { return content.Create(s.db) } + +func (s *commentManageSrv) ThumbsUpComment(userId int64, tweetId, commentId int64) error { + db := s.db.Begin() + defer db.Rollback() + + var ( + thumbsUpCount int32 = 0 + thumbsDownCount int32 = 0 + ) + commentThumbs := &dbr.TweetCommentThumbs{} + // 检查thumbs状态 + err := s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND comment_type=0", userId, tweetId, commentId).Take(commentThumbs).Error + if err == nil { + switch { + case commentThumbs.IsThumbsUp == types.Yes && commentThumbs.IsThumbsDown == types.No: + thumbsUpCount, thumbsDownCount = -1, 0 + case commentThumbs.IsThumbsUp == types.No && commentThumbs.IsThumbsDown == types.No: + thumbsUpCount, thumbsDownCount = 1, 0 + default: + thumbsUpCount, thumbsDownCount = 1, -1 + commentThumbs.IsThumbsDown = types.No + } + commentThumbs.IsThumbsUp = 1 - commentThumbs.IsThumbsUp + commentThumbs.ModifiedOn = time.Now().Unix() + } else { + commentThumbs = &dbr.TweetCommentThumbs{ + UserID: userId, + TweetID: tweetId, + CommentID: commentId, + IsThumbsUp: types.Yes, + IsThumbsDown: types.No, + CommentType: 0, + Model: &dbr.Model{ + CreatedOn: time.Now().Unix(), + }, + } + thumbsUpCount, thumbsDownCount = 1, 0 + } + // 更新thumbs状态 + if err = s.db.Save(commentThumbs).Error; err != nil { + return err + } + // 更新thumbsUpCount + if err = s.updateCommentThumbsUpCount(&dbr.Comment{}, commentId, thumbsUpCount, thumbsDownCount); err != nil { + return err + } + db.Commit() + return nil +} + +func (s *commentManageSrv) ThumbsDownComment(userId int64, tweetId, commentId int64) error { + db := s.db.Begin() + defer db.Rollback() + + var ( + thumbsUpCount int32 = 0 + thumbsDownCount int32 = 0 + ) + commentThumbs := &dbr.TweetCommentThumbs{} + // 检查thumbs状态 + err := s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND comment_type=0", userId, tweetId, commentId).Take(commentThumbs).Error + if err == nil { + switch { + case commentThumbs.IsThumbsDown == types.Yes: + thumbsUpCount, thumbsDownCount = 0, -1 + case commentThumbs.IsThumbsDown == types.No && commentThumbs.IsThumbsUp == types.No: + thumbsUpCount, thumbsDownCount = 0, 1 + default: + thumbsUpCount, thumbsDownCount = -1, 1 + commentThumbs.IsThumbsUp = types.No + + } + commentThumbs.IsThumbsDown = 1 - commentThumbs.IsThumbsDown + commentThumbs.ModifiedOn = time.Now().Unix() + } else { + commentThumbs = &dbr.TweetCommentThumbs{ + UserID: userId, + TweetID: tweetId, + CommentID: commentId, + IsThumbsUp: types.No, + IsThumbsDown: types.Yes, + CommentType: 0, + Model: &dbr.Model{ + CreatedOn: time.Now().Unix(), + }, + } + thumbsUpCount, thumbsDownCount = 0, 1 + } + // 更新thumbs状态 + if err = s.db.Save(commentThumbs).Error; err != nil { + return err + } + // 更新thumbsUpCount + if err = s.updateCommentThumbsUpCount(&dbr.Comment{}, commentId, thumbsUpCount, thumbsDownCount); err != nil { + return err + } + db.Commit() + return nil +} + +func (s *commentManageSrv) ThumbsUpReply(userId int64, tweetId, commentId, replyId int64) error { + db := s.db.Begin() + defer db.Rollback() + + var ( + thumbsUpCount int32 = 0 + thumbsDownCount int32 = 0 + ) + commentThumbs := &dbr.TweetCommentThumbs{} + // 检查thumbs状态 + err := s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND reply_id=? AND comment_type=1", userId, tweetId, commentId, replyId).Take(commentThumbs).Error + if err == nil { + switch { + case commentThumbs.IsThumbsUp == types.Yes: + thumbsUpCount, thumbsDownCount = -1, 0 + case commentThumbs.IsThumbsUp == types.No && commentThumbs.IsThumbsDown == types.No: + thumbsUpCount, thumbsDownCount = 1, 0 + default: + thumbsUpCount, thumbsDownCount = 1, -1 + commentThumbs.IsThumbsDown = types.No + } + commentThumbs.IsThumbsUp = 1 - commentThumbs.IsThumbsUp + commentThumbs.ModifiedOn = time.Now().Unix() + } else { + commentThumbs = &dbr.TweetCommentThumbs{ + UserID: userId, + TweetID: tweetId, + CommentID: commentId, + ReplyID: replyId, + IsThumbsUp: types.Yes, + IsThumbsDown: types.No, + CommentType: 1, + Model: &dbr.Model{ + CreatedOn: time.Now().Unix(), + }, + } + thumbsUpCount, thumbsDownCount = 1, 0 + } + // 更新thumbs状态 + if err = s.db.Save(commentThumbs).Error; err != nil { + return err + } + // 更新thumbsUpCount + if err = s.updateCommentThumbsUpCount(&dbr.CommentReply{}, replyId, thumbsUpCount, thumbsDownCount); err != nil { + return err + } + db.Commit() + return nil +} + +func (s *commentManageSrv) ThumbsDownReply(userId int64, tweetId, commentId, replyId int64) error { + db := s.db.Begin() + defer db.Rollback() + + var ( + thumbsUpCount int32 = 0 + thumbsDownCount int32 = 0 + ) + commentThumbs := &dbr.TweetCommentThumbs{} + // 检查thumbs状态 + err := s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND reply_id=? AND comment_type=1", userId, tweetId, commentId, replyId).Take(commentThumbs).Error + if err == nil { + switch { + case commentThumbs.IsThumbsDown == types.Yes: + thumbsUpCount, thumbsDownCount = 0, -1 + case commentThumbs.IsThumbsUp == types.No && commentThumbs.IsThumbsDown == types.No: + thumbsUpCount, thumbsDownCount = 0, 1 + default: + thumbsUpCount, thumbsDownCount = -1, 1 + commentThumbs.IsThumbsUp = types.No + } + commentThumbs.IsThumbsDown = 1 - commentThumbs.IsThumbsDown + commentThumbs.ModifiedOn = time.Now().Unix() + } else { + commentThumbs = &dbr.TweetCommentThumbs{ + UserID: userId, + TweetID: tweetId, + CommentID: commentId, + ReplyID: replyId, + IsThumbsUp: types.No, + IsThumbsDown: types.Yes, + CommentType: 1, + Model: &dbr.Model{ + CreatedOn: time.Now().Unix(), + }, + } + thumbsUpCount, thumbsDownCount = 0, 1 + } + // 更新thumbs状态 + if err = s.db.Save(commentThumbs).Error; err != nil { + return err + } + // 更新thumbsUpCount + if err = s.updateCommentThumbsUpCount(&dbr.CommentReply{}, replyId, thumbsUpCount, thumbsDownCount); err != nil { + return err + } + db.Commit() + return nil +} + +func (s *commentManageSrv) updateCommentThumbsUpCount(obj any, id int64, thumbsUpCount, thumbsDownCount int32) error { + updateColumns := make(map[string]any, 2) + if thumbsUpCount == 1 { + updateColumns["thumbs_up_count"] = gorm.Expr("thumbs_up_count + 1") + } else if thumbsUpCount == -1 { + updateColumns["thumbs_up_count"] = gorm.Expr("thumbs_up_count - 1") + } + if thumbsDownCount == 1 { + updateColumns["thumbs_down_count"] = gorm.Expr("thumbs_down_count + 1") + } else if thumbsDownCount == -1 { + updateColumns["thumbs_down_count"] = gorm.Expr("thumbs_down_count - 1") + } + if len(updateColumns) > 0 { + updateColumns["modified_on"] = time.Now().Unix() + return s.db.Model(obj).Where("id=?", id).UpdateColumns(updateColumns).Error + } + return nil +} diff --git a/internal/dao/jinzhu/contacts.go b/internal/dao/jinzhu/contacts.go index c26ae4de..b44307fe 100644 --- a/internal/dao/jinzhu/contacts.go +++ b/internal/dao/jinzhu/contacts.go @@ -8,26 +8,27 @@ import ( "time" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" "github.com/sirupsen/logrus" "gorm.io/gorm" ) var ( - _ core.ContactManageService = (*contactManageServant)(nil) + _ core.ContactManageService = (*contactManageSrv)(nil) ) -type contactManageServant struct { +type contactManageSrv struct { db *gorm.DB } func newContactManageService(db *gorm.DB) core.ContactManageService { - return &contactManageServant{ + return &contactManageSrv{ db: db, } } -func (s *contactManageServant) fetchOrNewContact(db *gorm.DB, userId int64, friendId int64, status int8) (*dbr.Contact, error) { +func (s *contactManageSrv) fetchOrNewContact(db *gorm.DB, userId int64, friendId int64, status int8) (*dbr.Contact, error) { contact := &dbr.Contact{ UserId: userId, FriendId: friendId, @@ -40,14 +41,14 @@ func (s *contactManageServant) fetchOrNewContact(db *gorm.DB, userId int64, frie Status: status, } if contact, err = contact.Create(db); err != nil { - logrus.Errorf("contactManageServant.fetchOrNewContact create new contact err:%s", err) + logrus.Errorf("contactManageSrv.fetchOrNewContact create new contact err:%s", err) return nil, err } } return contact, nil } -func (s *contactManageServant) RequestingFriend(userId int64, friendId int64, greetings string) (err error) { +func (s *contactManageSrv) RequestingFriend(userId int64, friendId int64, greetings string) (err error) { db := s.db.Begin() defer func() { if err == nil { @@ -70,7 +71,7 @@ func (s *contactManageServant) RequestingFriend(userId int64, friendId int64, gr contact.Status = dbr.ContactStatusRequesting contact.IsDel = 0 // remove deleted flag if needed if err = contact.UpdateInUnscoped(db); err != nil { - logrus.Errorf("contactManageServant.RequestingFriend update exsit contact err:%s", err) + logrus.Errorf("contactManageSrv.RequestingFriend update exsit contact err:%s", err) return } } @@ -84,13 +85,13 @@ func (s *contactManageServant) RequestingFriend(userId int64, friendId int64, gr ReplyID: int64(dbr.ContactStatusRequesting), } if _, err = msg.Create(db); err != nil { - logrus.Errorf("contactManageServant.RequestingFriend create message err:%s", err) + logrus.Errorf("contactManageSrv.RequestingFriend create message err:%s", err) return } return nil } -func (s *contactManageServant) AddFriend(userId int64, friendId int64) (err error) { +func (s *contactManageSrv) AddFriend(userId int64, friendId int64) (err error) { db := s.db.Begin() defer func() { if err == nil { @@ -109,7 +110,7 @@ func (s *contactManageServant) AddFriend(userId int64, friendId int64) (err erro } // 如果还不是请求好友,啥也不干 if contact.Status != dbr.ContactStatusRequesting { - logrus.Debugf("contactManageServant.AddFriend not reuesting status now so skip") + logrus.Debugf("contactManageSrv.AddFriend not reuesting status now so skip") return nil } contact.Status = dbr.ContactStatusAgree @@ -127,7 +128,7 @@ func (s *contactManageServant) AddFriend(userId int64, friendId int64) (err erro contact.Status = dbr.ContactStatusAgree contact.IsDel = 0 // remove deleted flag if err = contact.UpdateInUnscoped(db); err != nil { - logrus.Errorf("contactManageServant.AddFriend update contact err:%s", err) + logrus.Errorf("contactManageSrv.AddFriend update contact err:%s", err) return } } @@ -149,7 +150,7 @@ func (s *contactManageServant) AddFriend(userId int64, friendId int64) (err erro return nil } -func (s *contactManageServant) RejectFriend(userId int64, friendId int64) (err error) { +func (s *contactManageSrv) RejectFriend(userId int64, friendId int64) (err error) { db := s.db.Begin() defer func() { if err == nil { @@ -192,7 +193,7 @@ func (s *contactManageServant) RejectFriend(userId int64, friendId int64) (err e return nil } -func (s *contactManageServant) DeleteFriend(userId int64, friendId int64) (err error) { +func (s *contactManageSrv) DeleteFriend(userId int64, friendId int64) (err error) { db := s.db.Begin() defer func() { if err == nil { @@ -226,7 +227,7 @@ func (s *contactManageServant) DeleteFriend(userId int64, friendId int64) (err e return nil } -func (s *contactManageServant) GetContacts(userId int64, offset int, limit int) (*core.ContactList, error) { +func (s *contactManageSrv) GetContacts(userId int64, offset int, limit int) (*ms.ContactList, error) { contact := &dbr.Contact{} condition := dbr.ConditionsT{ "user_id": userId, @@ -240,13 +241,13 @@ func (s *contactManageServant) GetContacts(userId int64, offset int, limit int) if err != nil { return nil, err } - resp := &core.ContactList{ - Contacts: make([]core.ContactItem, 0, len(contacts)), + resp := &ms.ContactList{ + Contacts: make([]ms.ContactItem, 0, len(contacts)), Total: total, } for _, c := range contacts { if c.User != nil { - resp.Contacts = append(resp.Contacts, core.ContactItem{ + resp.Contacts = append(resp.Contacts, ms.ContactItem{ UserId: c.FriendId, UserName: c.User.Username, Nickname: c.User.Nickname, @@ -258,7 +259,7 @@ func (s *contactManageServant) GetContacts(userId int64, offset int, limit int) return resp, nil } -func (s *contactManageServant) IsFriend(userId int64, friendId int64) bool { +func (s *contactManageSrv) IsFriend(userId int64, friendId int64) bool { contact := &dbr.Contact{ UserId: friendId, FriendId: userId, diff --git a/internal/dao/jinzhu/dbr/comment.go b/internal/dao/jinzhu/dbr/comment.go index 80192df7..4f673336 100644 --- a/internal/dao/jinzhu/dbr/comment.go +++ b/internal/dao/jinzhu/dbr/comment.go @@ -7,27 +7,33 @@ package dbr import ( "time" + "github.com/rocboss/paopao-ce/pkg/types" "gorm.io/gorm" ) type Comment struct { *Model - PostID int64 `json:"post_id"` - UserID int64 `json:"user_id"` - IP string `json:"ip"` - IPLoc string `json:"ip_loc"` + PostID int64 `json:"post_id"` + UserID int64 `json:"user_id"` + IP string `json:"ip"` + IPLoc string `json:"ip_loc"` + ThumbsUpCount int32 `json:"thumbs_up_count"` + ThumbsDownCount int32 `json:"-"` } type CommentFormated struct { - ID int64 `json:"id"` - PostID int64 `json:"post_id"` - UserID int64 `json:"user_id"` - User *UserFormated `json:"user"` - Contents []*CommentContent `json:"contents"` - Replies []*CommentReplyFormated `json:"replies"` - IPLoc string `json:"ip_loc"` - CreatedOn int64 `json:"created_on"` - ModifiedOn int64 `json:"modified_on"` + ID int64 `json:"id"` + PostID int64 `json:"post_id"` + UserID int64 `json:"user_id"` + User *UserFormated `json:"user"` + Contents []*CommentContent `json:"contents"` + Replies []*CommentReplyFormated `json:"replies"` + IPLoc string `json:"ip_loc"` + ThumbsUpCount int32 `json:"thumbs_up_count"` + IsThumbsUp int8 `json:"is_thumbs_up"` + IsThumbsDown int8 `json:"is_thumbs_down"` + CreatedOn int64 `json:"created_on"` + ModifiedOn int64 `json:"modified_on"` } func (c *Comment) Format() *CommentFormated { @@ -35,15 +41,18 @@ func (c *Comment) Format() *CommentFormated { return &CommentFormated{} } return &CommentFormated{ - ID: c.Model.ID, - PostID: c.PostID, - UserID: c.UserID, - User: &UserFormated{}, - Contents: []*CommentContent{}, - Replies: []*CommentReplyFormated{}, - IPLoc: c.IPLoc, - CreatedOn: c.CreatedOn, - ModifiedOn: c.ModifiedOn, + ID: c.Model.ID, + PostID: c.PostID, + UserID: c.UserID, + User: &UserFormated{}, + Contents: []*CommentContent{}, + Replies: []*CommentReplyFormated{}, + IPLoc: c.IPLoc, + ThumbsUpCount: c.ThumbsUpCount, + IsThumbsUp: types.No, + IsThumbsDown: types.No, + CreatedOn: c.CreatedOn, + ModifiedOn: c.ModifiedOn, } } @@ -70,7 +79,7 @@ func (c *Comment) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) db = db.Offset(offset).Limit(limit) } if c.PostID > 0 { - db = db.Where("id = ?", c.PostID) + db = db.Where("post_id = ?", c.PostID) } for k, v := range *conditions { diff --git a/internal/dao/jinzhu/dbr/comment_reply.go b/internal/dao/jinzhu/dbr/comment_reply.go index fe527be5..dcdfde21 100644 --- a/internal/dao/jinzhu/dbr/comment_reply.go +++ b/internal/dao/jinzhu/dbr/comment_reply.go @@ -7,30 +7,36 @@ package dbr import ( "time" + "github.com/rocboss/paopao-ce/pkg/types" "gorm.io/gorm" ) type CommentReply struct { *Model - CommentID int64 `json:"comment_id"` - UserID int64 `json:"user_id"` - AtUserID int64 `json:"at_user_id"` - Content string `json:"content"` - IP string `json:"ip"` - IPLoc string `json:"ip_loc"` + CommentID int64 `db:"comment_id" json:"comment_id"` + UserID int64 `db:"user_id" json:"user_id"` + AtUserID int64 `db:"at_user_id" json:"at_user_id"` + Content string `json:"content"` + IP string `json:"ip"` + IPLoc string `json:"ip_loc"` + ThumbsUpCount int32 `json:"thumbs_up_count"` + ThumbsDownCount int32 `json:"-"` } type CommentReplyFormated struct { - ID int64 `json:"id"` - CommentID int64 `json:"comment_id"` - UserID int64 `json:"user_id"` - User *UserFormated `json:"user"` - AtUserID int64 `json:"at_user_id"` - AtUser *UserFormated `json:"at_user"` - Content string `json:"content"` - IPLoc string `json:"ip_loc"` - CreatedOn int64 `json:"created_on"` - ModifiedOn int64 `json:"modified_on"` + ID int64 `json:"id"` + CommentID int64 `db:"comment_id" json:"comment_id"` + UserID int64 `db:"user_id" json:"user_id"` + User *UserFormated `json:"user"` + AtUserID int64 `db:"at_user_id" json:"at_user_id"` + AtUser *UserFormated `json:"at_user"` + Content string `json:"content"` + IPLoc string `json:"ip_loc"` + ThumbsUpCount int32 `json:"thumbs_up_count"` + IsThumbsUp int8 `json:"is_thumbs_up"` + IsThumbsDown int8 `json:"is_thumbs_down"` + CreatedOn int64 `json:"created_on"` + ModifiedOn int64 `json:"modified_on"` } func (c *CommentReply) Format() *CommentReplyFormated { @@ -39,16 +45,19 @@ func (c *CommentReply) Format() *CommentReplyFormated { } return &CommentReplyFormated{ - ID: c.ID, - CommentID: c.CommentID, - UserID: c.UserID, - User: &UserFormated{}, - AtUserID: c.AtUserID, - AtUser: &UserFormated{}, - Content: c.Content, - IPLoc: c.IPLoc, - CreatedOn: c.CreatedOn, - ModifiedOn: c.ModifiedOn, + ID: c.ID, + CommentID: c.CommentID, + UserID: c.UserID, + User: &UserFormated{}, + AtUserID: c.AtUserID, + AtUser: &UserFormated{}, + Content: c.Content, + IPLoc: c.IPLoc, + ThumbsUpCount: c.ThumbsUpCount, + IsThumbsUp: types.No, + IsThumbsDown: types.No, + CreatedOn: c.CreatedOn, + ModifiedOn: c.ModifiedOn, } } diff --git a/internal/dao/jinzhu/dbr/comment_thumbs.go b/internal/dao/jinzhu/dbr/comment_thumbs.go new file mode 100644 index 00000000..7d66ca46 --- /dev/null +++ b/internal/dao/jinzhu/dbr/comment_thumbs.go @@ -0,0 +1,16 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package dbr + +type TweetCommentThumbs struct { + *Model + UserID int64 `json:"user_id"` + TweetID int64 `json:"tweet_id"` + CommentID int64 `json:"comment_id"` + ReplyID int64 `json:"reply_id"` + CommentType int8 `json:"comment_type"` + IsThumbsUp int8 `json:"is_thumbs_up"` + IsThumbsDown int8 `json:"is_thumbs_down"` +} diff --git a/internal/dao/jinzhu/dbr/contact.go b/internal/dao/jinzhu/dbr/contact.go index e8c12bd0..a1777e28 100644 --- a/internal/dao/jinzhu/dbr/contact.go +++ b/internal/dao/jinzhu/dbr/contact.go @@ -7,6 +7,7 @@ package dbr import ( "github.com/sirupsen/logrus" "gorm.io/gorm" + "gorm.io/gorm/clause" ) const ( @@ -73,7 +74,7 @@ func (c *Contact) List(db *gorm.DB, conditions ConditionsT, offset, limit int) ( } } - db.Joins("User").Order("`User`.`nickname` ASC") + db.Joins("User").Order(clause.OrderByColumn{Column: clause.Column{Name: "nickname"}, Desc: false}) if err = db.Find(&contacts).Error; err != nil { return nil, err } diff --git a/internal/dao/jinzhu/dbr/post.go b/internal/dao/jinzhu/dbr/post.go index a47dedfc..be4582c6 100644 --- a/internal/dao/jinzhu/dbr/post.go +++ b/internal/dao/jinzhu/dbr/post.go @@ -26,6 +26,7 @@ type Post struct { UserID int64 `json:"user_id"` CommentCount int64 `json:"comment_count"` CollectionCount int64 `json:"collection_count"` + ShareCount int64 `json:"share_count"` UpvoteCount int64 `json:"upvote_count"` Visibility PostVisibleT `json:"visibility"` IsTop int `json:"is_top"` @@ -45,6 +46,7 @@ type PostFormated struct { Contents []*PostContentFormated `json:"contents"` CommentCount int64 `json:"comment_count"` CollectionCount int64 `json:"collection_count"` + ShareCount int64 `json:"share_count"` UpvoteCount int64 `json:"upvote_count"` Visibility PostVisibleT `json:"visibility"` IsTop int `json:"is_top"` @@ -71,6 +73,7 @@ func (p *Post) Format() *PostFormated { Contents: []*PostContentFormated{}, CommentCount: p.CommentCount, CollectionCount: p.CollectionCount, + ShareCount: p.ShareCount, UpvoteCount: p.UpvoteCount, Visibility: p.Visibility, IsTop: p.IsTop, @@ -117,7 +120,7 @@ func (p *Post) Get(db *gorm.DB) (*Post, error) { return &post, nil } -func (p *Post) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([]*Post, error) { +func (p *Post) List(db *gorm.DB, conditions ConditionsT, offset, limit int) ([]*Post, error) { var posts []*Post var err error if offset >= 0 && limit > 0 { @@ -126,7 +129,7 @@ func (p *Post) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([] if p.UserID > 0 { db = db.Where("user_id = ?", p.UserID) } - for k, v := range *conditions { + for k, v := range conditions { if k == "ORDER" { db = db.Order(v) } else { @@ -175,12 +178,12 @@ func (p *Post) CountBy(db *gorm.DB, predicates Predicates) (count int64, err err return } -func (p *Post) Count(db *gorm.DB, conditions *ConditionsT) (int64, error) { +func (p *Post) Count(db *gorm.DB, conditions ConditionsT) (int64, error) { var count int64 if p.UserID > 0 { db = db.Where("user_id = ?", p.UserID) } - for k, v := range *conditions { + for k, v := range conditions { if k != "ORDER" { db = db.Where(k, v) } diff --git a/internal/dao/jinzhu/dbr/post_collection.go b/internal/dao/jinzhu/dbr/post_collection.go index 04ca2647..23604ff1 100644 --- a/internal/dao/jinzhu/dbr/post_collection.go +++ b/internal/dao/jinzhu/dbr/post_collection.go @@ -8,13 +8,14 @@ import ( "time" "gorm.io/gorm" + "gorm.io/gorm/clause" ) type PostCollection struct { *Model Post *Post `json:"-"` - PostID int64 `json:"post_id"` - UserID int64 `json:"user_id"` + PostID int64 `db:"post_id" json:"post_id"` + UserID int64 `db:"user_id" json:"user_id"` } func (p *PostCollection) Get(db *gorm.DB) (*PostCollection, error) { @@ -31,7 +32,7 @@ func (p *PostCollection) Get(db *gorm.DB) (*PostCollection, error) { db = db.Where(tn+"user_id = ?", p.UserID) } - db = db.Joins("Post").Where("Post.visibility <> ?", PostVisitPrivate).Order("Post.id DESC") + db = db.Joins("Post").Where("visibility <> ? OR (visibility = ? AND ? = ?)", PostVisitPrivate, PostVisitPrivate, clause.Column{Table: "Post", Name: "user_id"}, p.UserID).Order(clause.OrderByColumn{Column: clause.Column{Table: "Post", Name: "id"}, Desc: true}) err := db.First(&star).Error if err != nil { return &star, err @@ -73,7 +74,7 @@ func (p *PostCollection) List(db *gorm.DB, conditions *ConditionsT, offset, limi } } - db = db.Joins("Post").Where("Post.visibility <> ?", PostVisitPrivate).Order("Post.id DESC") + db = db.Joins("Post").Where(`visibility <> ? OR (visibility = ? AND ? = ?)`, PostVisitPrivate, PostVisitPrivate, clause.Column{Table: "Post", Name: "user_id"}, p.UserID).Order(clause.OrderByColumn{Column: clause.Column{Table: "Post", Name: "id"}, Desc: true}) if err = db.Where(tn+"is_del = ?", 0).Find(&collections).Error; err != nil { return nil, err } @@ -97,7 +98,7 @@ func (p *PostCollection) Count(db *gorm.DB, conditions *ConditionsT) (int64, err } } - db = db.Joins("Post").Where("Post.visibility <> ?", PostVisitPrivate) + db = db.Joins("Post").Where(`visibility <> ? OR (visibility = ? AND ? = ?)`, PostVisitPrivate, PostVisitPrivate, clause.Column{Table: "Post", Name: "user_id"}, p.UserID) if err := db.Model(p).Count(&count).Error; err != nil { return 0, err } diff --git a/internal/dao/jinzhu/dbr/post_content.go b/internal/dao/jinzhu/dbr/post_content.go index 672cc57e..5f257630 100644 --- a/internal/dao/jinzhu/dbr/post_content.go +++ b/internal/dao/jinzhu/dbr/post_content.go @@ -44,7 +44,7 @@ type PostContent struct { } type PostContentFormated struct { - ID int64 `json:"id"` + ID int64 `db:"id" json:"id"` PostID int64 `json:"post_id"` Content string `json:"content"` Type PostContentT `json:"type"` diff --git a/internal/dao/jinzhu/dbr/post_star.go b/internal/dao/jinzhu/dbr/post_star.go index 45c48f45..33173e4b 100644 --- a/internal/dao/jinzhu/dbr/post_star.go +++ b/internal/dao/jinzhu/dbr/post_star.go @@ -7,7 +7,9 @@ package dbr import ( "time" + "github.com/rocboss/paopao-ce/internal/core/cs" "gorm.io/gorm" + "gorm.io/gorm/clause" ) type PostStar struct { @@ -31,7 +33,7 @@ func (p *PostStar) Get(db *gorm.DB) (*PostStar, error) { db = db.Where(tn+"user_id = ?", p.UserID) } - db = db.Joins("Post").Where("Post.visibility <> ?", PostVisitPrivate).Order("Post.id DESC") + db = db.Joins("Post").Where("visibility <> ? OR (visibility = ? AND ? = ?)", PostVisitPrivate, PostVisitPrivate, clause.Column{Table: "Post", Name: "user_id"}, p.UserID).Order(clause.OrderByColumn{Column: clause.Column{Table: "Post", Name: "id"}, Desc: true}) if err := db.First(&star).Error; err != nil { return nil, err } @@ -51,18 +53,14 @@ func (p *PostStar) Delete(db *gorm.DB) error { }).Error } -func (p *PostStar) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([]*PostStar, error) { - var stars []*PostStar - var err error +func (p *PostStar) List(db *gorm.DB, conditions *ConditionsT, typ cs.RelationTyp, limit int, offset int) (res []*PostStar, err error) { tn := db.NamingStrategy.TableName("PostStar") + "." - if offset >= 0 && limit > 0 { db = db.Offset(offset).Limit(limit) } if p.UserID > 0 { db = db.Where(tn+"user_id = ?", p.UserID) } - for k, v := range *conditions { if k == "ORDER" { db = db.Order(v) @@ -70,18 +68,24 @@ func (p *PostStar) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) db = db.Where(tn+k, v) } } - - db = db.Joins("Post").Where("Post.visibility <> ?", PostVisitPrivate).Order("Post.id DESC") - if err = db.Find(&stars).Error; err != nil { - return nil, err + db = db.Joins("Post") + switch typ { + case cs.RelationAdmin: + // admin have all permition to visit all type tweets + case cs.RelationFriend: + db = db.Where("visibility = ? OR visibility = ?", PostVisitPublic, PostVisitFriend) + case cs.RelationSelf: + db = db.Where("visibility <> ? OR (visibility = ? AND ? = ?)", PostVisitPrivate, PostVisitPrivate, clause.Column{Table: "Post", Name: "user_id"}, p.UserID) + default: + db = db.Where("visibility=?", PostVisitPublic) } - return stars, nil + db = db.Order(clause.OrderByColumn{Column: clause.Column{Table: "Post", Name: "id"}, Desc: true}) + err = db.Find(&res).Error + return } -func (p *PostStar) Count(db *gorm.DB, conditions *ConditionsT) (int64, error) { - var count int64 +func (p *PostStar) Count(db *gorm.DB, typ cs.RelationTyp, conditions *ConditionsT) (res int64, err error) { tn := db.NamingStrategy.TableName("PostStar") + "." - if p.PostID > 0 { db = db.Where(tn+"post_id = ?", p.PostID) } @@ -93,10 +97,17 @@ func (p *PostStar) Count(db *gorm.DB, conditions *ConditionsT) (int64, error) { db = db.Where(tn+k, v) } } - - db = db.Joins("Post").Where("Post.visibility <> ?", PostVisitPrivate) - if err := db.Model(p).Count(&count).Error; err != nil { - return 0, err + db = db.Joins("Post") + switch typ { + case cs.RelationAdmin: + // admin have all permition to visit all type tweets + case cs.RelationFriend: + db = db.Where("visibility = ? OR visibility = ?", PostVisitPublic, PostVisitFriend) + case cs.RelationSelf: + db = db.Where("visibility <> ? OR (visibility = ? AND ? = ?)", PostVisitPrivate, PostVisitPrivate, clause.Column{Table: "Post", Name: "user_id"}, p.UserID) + default: + db = db.Where("visibility=?", PostVisitPublic) } - return count, nil + err = db.Model(p).Count(&res).Error + return } diff --git a/internal/dao/jinzhu/dbr/tag.go b/internal/dao/jinzhu/dbr/topic.go similarity index 65% rename from internal/dao/jinzhu/dbr/tag.go rename to internal/dao/jinzhu/dbr/topic.go index 8570f574..45cabfef 100644 --- a/internal/dao/jinzhu/dbr/tag.go +++ b/internal/dao/jinzhu/dbr/topic.go @@ -16,12 +16,27 @@ type Tag struct { Tag string `json:"tag"` QuoteNum int64 `json:"quote_num"` } + +type TopicUser struct { + *Model + UserID int64 `json:"user_id"` + TopicID int64 `json:"topic_id"` + AliasName string `json:"-"` + Remark string `json:"-"` + QuoteNum int64 `json:"quote_num"` + IsTop int8 `json:"is_top"` + ReserveA string `json:"-"` + ReserveB string `json:"-"` +} + type TagFormated struct { - ID int64 `json:"id"` - UserID int64 `json:"user_id"` - User *UserFormated `json:"user"` - Tag string `json:"tag"` - QuoteNum int64 `json:"quote_num"` + ID int64 `json:"id"` + UserID int64 `json:"user_id"` + User *UserFormated `json:"user"` + Tag string `json:"tag"` + QuoteNum int64 `json:"quote_num"` + IsFollowing int8 `json:"is_following"` + IsTop int8 `json:"is_top"` } func (t *Tag) Format() *TagFormated { @@ -30,11 +45,13 @@ func (t *Tag) Format() *TagFormated { } return &TagFormated{ - ID: t.ID, - UserID: t.UserID, - User: &UserFormated{}, - Tag: t.Tag, - QuoteNum: t.QuoteNum, + ID: t.ID, + UserID: t.UserID, + User: &UserFormated{}, + Tag: t.Tag, + QuoteNum: t.QuoteNum, + IsFollowing: 0, + IsTop: 0, } } @@ -71,9 +88,7 @@ func (t *Tag) Delete(db *gorm.DB) error { }).Error } -func (t *Tag) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([]*Tag, error) { - var tags []*Tag - var err error +func (t *Tag) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) (tags []*Tag, err error) { if offset >= 0 && limit > 0 { db = db.Offset(offset).Limit(limit) } @@ -87,12 +102,8 @@ func (t *Tag) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([]* db = db.Where(k, v) } } - - if err = db.Where("is_del = 0 and quote_num > 0").Find(&tags).Error; err != nil { - return nil, err - } - - return tags, nil + err = db.Where("is_del = 0 and quote_num > 0").Find(&tags).Error + return } func (t *Tag) TagsFrom(db *gorm.DB, tags []string) (res []*Tag, err error) { diff --git a/internal/dao/jinzhu/dbr/user.go b/internal/dao/jinzhu/dbr/user.go index a10d5432..7297e39f 100644 --- a/internal/dao/jinzhu/dbr/user.go +++ b/internal/dao/jinzhu/dbr/user.go @@ -4,7 +4,10 @@ package dbr -import "gorm.io/gorm" +import ( + "github.com/rocboss/paopao-ce/internal/core/cs" + "gorm.io/gorm" +) const ( UserStatusNormal int = iota + 1 @@ -25,7 +28,7 @@ type User struct { } type UserFormated struct { - ID int64 `json:"id"` + ID int64 `db:"id" json:"id"` Nickname string `json:"nickname"` Username string `json:"username"` Status int `json:"status"` @@ -87,6 +90,11 @@ func (u *User) List(db *gorm.DB, conditions *ConditionsT, offset, limit int) ([] return users, nil } +func (u *User) ListUserInfoById(db *gorm.DB, ids []int64) (res cs.UserInfoList, err error) { + err = db.Model(u).Where("id IN ?", ids).Find(&res).Error + return +} + func (u *User) Create(db *gorm.DB) (*User, error) { err := db.Create(&u).Error diff --git a/internal/dao/jinzhu/gorm.go b/internal/dao/jinzhu/gorm.go new file mode 100644 index 00000000..8cd44639 --- /dev/null +++ b/internal/dao/jinzhu/gorm.go @@ -0,0 +1,55 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package jinzhu + +import ( + "github.com/rocboss/paopao-ce/internal/conf" +) + +// 数据库表名,统一使用 __ 的形式命名, 比如tag表 => _tag_ +var ( + _anouncement_ string + _anouncementContent_ string + _attachment_ string + _captcha_ string + _comment_ string + _commentContent_ string + _commentReply_ string + _contact_ string + _contactGroup_ string + _message_ string + _post_ string + _postAttachmentBill_ string + _postCollection_ string + _postContent_ string + _postStar_ string + _tag_ string + _user_ string + _walletRecharge_ string + _walletStatement_ string +) + +func initTableName() { + m := conf.DatabaseSetting.TableNames() + _anouncement_ = m[conf.TableAnouncement] + _anouncementContent_ = m[conf.TableAnouncementContent] + _attachment_ = m[conf.TableAttachment] + _captcha_ = m[conf.TableCaptcha] + _comment_ = m[conf.TableComment] + _commentContent_ = m[conf.TableCommentContent] + _commentReply_ = m[conf.TableCommentReply] + _contact_ = m[conf.TableContact] + _contactGroup_ = m[conf.TableContactGroup] + _message_ = m[conf.TableMessage] + _post_ = m[conf.TablePost] + _postAttachmentBill_ = m[conf.TablePostAttachmentBill] + _postCollection_ = m[conf.TablePostCollection] + _postContent_ = m[conf.TablePostContent] + _postStar_ = m[conf.TablePostStar] + _tag_ = m[conf.TableTag] + _user_ = m[conf.TableUser] + _walletRecharge_ = m[conf.TableWalletRecharge] + _walletStatement_ = m[conf.TableWalletStatement] +} diff --git a/internal/dao/jinzhu/index.go b/internal/dao/jinzhu/index.go deleted file mode 100644 index 7548de49..00000000 --- a/internal/dao/jinzhu/index.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package jinzhu - -import ( - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" - "github.com/sirupsen/logrus" - "gorm.io/gorm" -) - -var ( - _ core.IndexPostsService = (*indexPostsServant)(nil) - _ core.IndexPostsService = (*simpleIndexPostsServant)(nil) -) - -type indexPostsServant struct { - ams core.AuthorizationManageService - ths core.TweetHelpService - db *gorm.DB -} - -type simpleIndexPostsServant struct { - ths core.TweetHelpService - db *gorm.DB -} - -func newIndexPostsService(db *gorm.DB) core.IndexPostsService { - return &indexPostsServant{ - ams: NewAuthorizationManageService(), - ths: newTweetHelpService(db), - db: db, - } -} - -func newSimpleIndexPostsService(db *gorm.DB) core.IndexPostsService { - return &simpleIndexPostsServant{ - ths: newTweetHelpService(db), - db: db, - } -} - -// IndexPosts 根据userId查询广场推文列表,简单做到不同用户的主页都是不同的; -func (s *indexPostsServant) IndexPosts(user *core.User, offset int, limit int) (*core.IndexTweetList, error) { - predicates := dbr.Predicates{ - "ORDER": []any{"is_top DESC, latest_replied_on DESC"}, - } - if user == nil { - predicates["visibility = ?"] = []any{dbr.PostVisitPublic} - } else if !user.IsAdmin { - friendIds, _ := s.ams.BeFriendIds(user.ID) - friendIds = append(friendIds, user.ID) - args := []any{dbr.PostVisitPublic, dbr.PostVisitPrivate, user.ID, dbr.PostVisitFriend, friendIds} - predicates["visibility = ? OR (visibility = ? AND user_id = ?) OR (visibility = ? AND user_id IN ?)"] = args - } - - posts, err := (&dbr.Post{}).Fetch(s.db, predicates, offset, limit) - if err != nil { - logrus.Debugf("gormIndexPostsServant.IndexPosts err: %v", err) - return nil, err - } - formatPosts, err := s.ths.MergePosts(posts) - if err != nil { - return nil, err - } - - total, err := (&dbr.Post{}).CountBy(s.db, predicates) - if err != nil { - return nil, err - } - - return &core.IndexTweetList{ - Tweets: formatPosts, - Total: total, - }, nil -} - -// simpleCacheIndexGetPosts simpleCacheIndex 专属获取广场推文列表函数 -func (s *simpleIndexPostsServant) IndexPosts(_user *core.User, offset int, limit int) (*core.IndexTweetList, error) { - predicates := dbr.Predicates{ - "visibility = ?": []any{dbr.PostVisitPublic}, - "ORDER": []any{"is_top DESC, latest_replied_on DESC"}, - } - - posts, err := (&dbr.Post{}).Fetch(s.db, predicates, offset, limit) - if err != nil { - logrus.Debugf("gormSimpleIndexPostsServant.IndexPosts err: %v", err) - return nil, err - } - - formatPosts, err := s.ths.MergePosts(posts) - if err != nil { - return nil, err - } - - total, err := (&dbr.Post{}).CountBy(s.db, predicates) - if err != nil { - return nil, err - } - - return &core.IndexTweetList{ - Tweets: formatPosts, - Total: total, - }, nil -} diff --git a/internal/dao/jinzhu/jinzhu.go b/internal/dao/jinzhu/jinzhu.go index f708e064..50c26768 100644 --- a/internal/dao/jinzhu/jinzhu.go +++ b/internal/dao/jinzhu/jinzhu.go @@ -9,6 +9,8 @@ package jinzhu import ( + "sync" + "github.com/Masterminds/semver/v3" "github.com/alimy/cfg" "github.com/rocboss/paopao-ce/internal/conf" @@ -19,11 +21,16 @@ import ( ) var ( - _ core.DataService = (*dataServant)(nil) - _ core.VersionInfo = (*dataServant)(nil) + _ core.DataService = (*dataSrv)(nil) + _ core.VersionInfo = (*dataSrv)(nil) + + _ core.WebDataServantA = (*webDataSrvA)(nil) + _ core.VersionInfo = (*webDataSrvA)(nil) + + _onceInitial sync.Once ) -type dataServant struct { +type dataSrv struct { core.IndexPostsService core.WalletService core.MessageService @@ -39,34 +46,65 @@ type dataServant struct { core.AttachmentCheckService } +type webDataSrvA struct { + core.TopicServantA + core.TweetServantA + core.TweetManageServantA + core.TweetHelpServantA +} + func NewDataService() (core.DataService, core.VersionInfo) { - // initialize CacheIndex if needed + lazyInitial() + var ( - c core.CacheIndexService - v core.VersionInfo + v core.VersionInfo + cis core.CacheIndexService + ips core.IndexPostsService ) db := conf.MustGormDB() pvs := security.NewPhoneVerifyService() + ams := NewAuthorizationManageService() + ths := newTweetHelpService(db) - i := newIndexPostsService(db) - if cfg.If("SimpleCacheIndex") { - i = newSimpleIndexPostsService(db) - c, v = cache.NewSimpleCacheIndexService(i) - } else if cfg.If("BigCacheIndex") { - a := newAuthorizationManageService(db) - c, v = cache.NewBigCacheIndexService(i, a) + // initialize core.IndexPostsService + if cfg.If("Friendship") { + ips = newFriendIndexService(db, ams, ths) + } else if cfg.If("Followship") { + ips = newFollowIndexService(db, ths) + } else if cfg.If("Lightship") { + ips = newLightIndexService(db, ths) } else { - c, v = cache.NewNoneCacheIndexService(i) + // default use lightship post index service + ips = newLightIndexService(db, ths) } + + // initialize core.CacheIndexService + cfg.On(cfg.Actions{ + "SimpleCacheIndex": func() { + // simpleCache use special post index service + ips = newSimpleIndexPostsService(db, ths) + cis, v = cache.NewSimpleCacheIndexService(ips) + }, + "BigCacheIndex": func() { + // TODO: make cache index post in different scence like friendship/followship/lightship + cis, v = cache.NewBigCacheIndexService(ips, ams) + }, + "RedisCacheIndex": func() { + cis, v = cache.NewRedisCacheIndexService(ips, ams) + }, + }, func() { + // defualt no cache + cis, v = cache.NewNoneCacheIndexService(ips) + }) logrus.Infof("use %s as cache index service by version: %s", v.Name(), v.Version()) - ds := &dataServant{ - IndexPostsService: c, + ds := &dataSrv{ + IndexPostsService: cis, WalletService: newWalletService(db), MessageService: newMessageService(db), TopicService: newTopicService(db), TweetService: newTweetService(db), - TweetManageService: newTweetManageService(db, c), + TweetManageService: newTweetManageService(db, cis), TweetHelpService: newTweetHelpService(db), CommentService: newCommentService(db), CommentManageService: newCommentManageService(db), @@ -78,14 +116,41 @@ func NewDataService() (core.DataService, core.VersionInfo) { return ds, ds } +func NewWebDataServantA() (core.WebDataServantA, core.VersionInfo) { + lazyInitial() + db := conf.MustGormDB() + ds := &webDataSrvA{ + TopicServantA: newTopicServantA(db), + TweetServantA: newTweetServantA(db), + TweetManageServantA: newTweetManageServantA(db), + TweetHelpServantA: newTweetHelpServantA(db), + } + return ds, ds +} + func NewAuthorizationManageService() core.AuthorizationManageService { return newAuthorizationManageService(conf.MustGormDB()) } -func (s *dataServant) Name() string { +func (s *dataSrv) Name() string { return "Gorm" } -func (s *dataServant) Version() *semver.Version { +func (s *dataSrv) Version() *semver.Version { return semver.MustParse("v0.2.0") } + +func (s *webDataSrvA) Name() string { + return "Gorm" +} + +func (s *webDataSrvA) Version() *semver.Version { + return semver.MustParse("v0.1.0") +} + +// lazyInitial do some package lazy initialize for performance +func lazyInitial() { + _onceInitial.Do(func() { + initTableName() + }) +} diff --git a/internal/dao/jinzhu/messages.go b/internal/dao/jinzhu/messages.go index 32edaac2..00df949f 100644 --- a/internal/dao/jinzhu/messages.go +++ b/internal/dao/jinzhu/messages.go @@ -6,50 +6,51 @@ package jinzhu import ( "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" "gorm.io/gorm" ) var ( - _ core.MessageService = (*messageServant)(nil) + _ core.MessageService = (*messageSrv)(nil) ) -type messageServant struct { +type messageSrv struct { db *gorm.DB } func newMessageService(db *gorm.DB) core.MessageService { - return &messageServant{ + return &messageSrv{ db: db, } } -func (d *messageServant) CreateMessage(msg *core.Message) (*core.Message, error) { - return msg.Create(d.db) +func (s *messageSrv) CreateMessage(msg *ms.Message) (*ms.Message, error) { + return msg.Create(s.db) } -func (d *messageServant) GetUnreadCount(userID int64) (int64, error) { - return (&dbr.Message{}).Count(d.db, &dbr.ConditionsT{ +func (s *messageSrv) GetUnreadCount(userID int64) (int64, error) { + return (&dbr.Message{}).Count(s.db, &dbr.ConditionsT{ "receiver_user_id": userID, "is_read": dbr.MsgStatusUnread, }) } -func (d *messageServant) GetMessageByID(id int64) (*core.Message, error) { +func (s *messageSrv) GetMessageByID(id int64) (*ms.Message, error) { return (&dbr.Message{ Model: &dbr.Model{ ID: id, }, - }).Get(d.db) + }).Get(s.db) } -func (d *messageServant) ReadMessage(message *core.Message) error { +func (s *messageSrv) ReadMessage(message *ms.Message) error { message.IsRead = 1 - return message.Update(d.db) + return message.Update(s.db) } -func (d *messageServant) GetMessages(conditions *core.ConditionsT, offset, limit int) ([]*core.MessageFormated, error) { - messages, err := (&dbr.Message{}).List(d.db, conditions, offset, limit) +func (s *messageSrv) GetMessages(conditions *ms.ConditionsT, offset, limit int) ([]*ms.MessageFormated, error) { + messages, err := (&dbr.Message{}).List(s.db, conditions, offset, limit) if err != nil { return nil, err } @@ -63,6 +64,6 @@ func (d *messageServant) GetMessages(conditions *core.ConditionsT, offset, limit return mfs, nil } -func (d *messageServant) GetMessageCount(conditions *core.ConditionsT) (int64, error) { - return (&dbr.Message{}).Count(d.db, conditions) +func (s *messageSrv) GetMessageCount(conditions *ms.ConditionsT) (int64, error) { + return (&dbr.Message{}).Count(s.db, conditions) } diff --git a/internal/dao/jinzhu/security.go b/internal/dao/jinzhu/security.go index 69fc57d4..18a8ccae 100644 --- a/internal/dao/jinzhu/security.go +++ b/internal/dao/jinzhu/security.go @@ -10,46 +10,48 @@ import ( "time" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" "gorm.io/gorm" ) var ( - _ core.SecurityService = (*securityServant)(nil) + _ core.SecurityService = (*securitySrv)(nil) ) -type securityServant struct { +type securitySrv struct { db *gorm.DB + rand *rand.Rand phoneVerify core.PhoneVerifyService } func newSecurityService(db *gorm.DB, phoneVerify core.PhoneVerifyService) core.SecurityService { - return &securityServant{ + return &securitySrv{ db: db, + rand: rand.New(rand.NewSource(time.Now().UnixNano())), phoneVerify: phoneVerify, } } // GetLatestPhoneCaptcha 获取最新短信验证码 -func (s *securityServant) GetLatestPhoneCaptcha(phone string) (*core.Captcha, error) { +func (s *securitySrv) GetLatestPhoneCaptcha(phone string) (*ms.Captcha, error) { return (&dbr.Captcha{ Phone: phone, }).Get(s.db) } // UsePhoneCaptcha 更新短信验证码 -func (s *securityServant) UsePhoneCaptcha(captcha *core.Captcha) error { +func (s *securitySrv) UsePhoneCaptcha(captcha *ms.Captcha) error { captcha.UseTimes++ return captcha.Update(s.db) } // SendPhoneCaptcha 发送短信验证码 -func (s *securityServant) SendPhoneCaptcha(phone string) error { +func (s *securitySrv) SendPhoneCaptcha(phone string) error { expire := time.Duration(5) // 发送验证码 - rand.Seed(time.Now().UnixNano()) - captcha := strconv.Itoa(rand.Intn(900000) + 100000) + captcha := strconv.Itoa(s.rand.Intn(900000) + 100000) if err := s.phoneVerify.SendPhoneCaptcha(phone, captcha, expire); err != nil { return err } diff --git a/internal/dao/jinzhu/timeline.go b/internal/dao/jinzhu/timeline.go new file mode 100644 index 00000000..f81e3619 --- /dev/null +++ b/internal/dao/jinzhu/timeline.go @@ -0,0 +1,195 @@ +// Copyright 2022 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package jinzhu + +import ( + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" + "github.com/rocboss/paopao-ce/pkg/debug" + "github.com/sirupsen/logrus" + "gorm.io/gorm" +) + +var ( + _ core.IndexPostsService = (*friendIndexSrv)(nil) + _ core.IndexPostsService = (*followIndexSrv)(nil) + _ core.IndexPostsService = (*lightIndexSrv)(nil) + _ core.IndexPostsService = (*simpleIndexPostsSrv)(nil) +) + +type friendIndexSrv struct { + ams core.AuthorizationManageService + ths core.TweetHelpService + db *gorm.DB +} + +type followIndexSrv struct { + ths core.TweetHelpService + db *gorm.DB +} + +type lightIndexSrv struct { + ths core.TweetHelpService + db *gorm.DB +} + +type simpleIndexPostsSrv struct { + ths core.TweetHelpService + db *gorm.DB +} + +// IndexPosts 根据userId查询广场推文列表,简单做到不同用户的主页都是不同的; +func (s *friendIndexSrv) IndexPosts(user *ms.User, offset int, limit int) (*ms.IndexTweetList, error) { + predicates := dbr.Predicates{ + "ORDER": []any{"is_top DESC, latest_replied_on DESC"}, + } + if user == nil { + predicates["visibility = ?"] = []any{dbr.PostVisitPublic} + } else if !user.IsAdmin { + friendIds, _ := s.ams.BeFriendIds(user.ID) + friendIds = append(friendIds, user.ID) + args := []any{dbr.PostVisitPublic, dbr.PostVisitPrivate, user.ID, dbr.PostVisitFriend, friendIds} + predicates["visibility = ? OR (visibility = ? AND user_id = ?) OR (visibility = ? AND user_id IN ?)"] = args + } + + posts, err := (&dbr.Post{}).Fetch(s.db, predicates, offset, limit) + if err != nil { + logrus.Debugf("gormIndexPostsSrv.IndexPosts err: %v", err) + return nil, err + } + formatPosts, err := s.ths.MergePosts(posts) + if err != nil { + return nil, err + } + + total, err := (&dbr.Post{}).CountBy(s.db, predicates) + if err != nil { + return nil, err + } + + return &ms.IndexTweetList{ + Tweets: formatPosts, + Total: total, + }, nil +} + +func (s *friendIndexSrv) TweetTimeline(userId int64, offset int, limit int) (*cs.TweetBox, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +// IndexPosts 根据userId查询广场推文列表 +func (s *followIndexSrv) IndexPosts(user *ms.User, offset int, limit int) (*ms.IndexTweetList, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *followIndexSrv) TweetTimeline(userId int64, offset int, limit int) (*cs.TweetBox, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +// IndexPosts 根据userId查询广场推文列表,获取公开可见Tweet或者所属用户的私有Tweet +func (s *lightIndexSrv) IndexPosts(user *ms.User, offset int, limit int) (*ms.IndexTweetList, error) { + predicates := dbr.Predicates{ + "ORDER": []any{"is_top DESC, latest_replied_on DESC"}, + } + if user == nil { + predicates["visibility = ?"] = []any{dbr.PostVisitPublic} + } else if !user.IsAdmin { + args := []any{dbr.PostVisitPublic, dbr.PostVisitPrivate, user.ID} + predicates["visibility = ? OR (visibility = ? AND user_id = ?)"] = args + } + + posts, err := (&dbr.Post{}).Fetch(s.db, predicates, offset, limit) + if err != nil { + logrus.Debugf("gormIndexPostsSrv.IndexPosts err: %v", err) + return nil, err + } + formatPosts, err := s.ths.MergePosts(posts) + if err != nil { + return nil, err + } + + total, err := (&dbr.Post{}).CountBy(s.db, predicates) + if err != nil { + return nil, err + } + + return &ms.IndexTweetList{ + Tweets: formatPosts, + Total: total, + }, nil +} + +func (s *lightIndexSrv) TweetTimeline(userId int64, offset int, limit int) (*cs.TweetBox, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +// simpleCacheIndexGetPosts simpleCacheIndex 专属获取广场推文列表函数 +func (s *simpleIndexPostsSrv) IndexPosts(_user *ms.User, offset int, limit int) (*ms.IndexTweetList, error) { + predicates := dbr.Predicates{ + "visibility = ?": []any{dbr.PostVisitPublic}, + "ORDER": []any{"is_top DESC, latest_replied_on DESC"}, + } + + posts, err := (&dbr.Post{}).Fetch(s.db, predicates, offset, limit) + if err != nil { + logrus.Debugf("gormSimpleIndexPostsSrv.IndexPosts err: %v", err) + return nil, err + } + + formatPosts, err := s.ths.MergePosts(posts) + if err != nil { + return nil, err + } + + total, err := (&dbr.Post{}).CountBy(s.db, predicates) + if err != nil { + return nil, err + } + + return &ms.IndexTweetList{ + Tweets: formatPosts, + Total: total, + }, nil +} + +func (s *simpleIndexPostsSrv) TweetTimeline(userId int64, offset int, limit int) (*cs.TweetBox, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func newFriendIndexService(db *gorm.DB, ams core.AuthorizationManageService, ths core.TweetHelpService) core.IndexPostsService { + return &friendIndexSrv{ + ams: ams, + ths: ths, + db: db, + } +} + +func newFollowIndexService(db *gorm.DB, ths core.TweetHelpService) core.IndexPostsService { + return &followIndexSrv{ + ths: ths, + db: db, + } +} + +func newLightIndexService(db *gorm.DB, ths core.TweetHelpService) core.IndexPostsService { + return &lightIndexSrv{ + ths: ths, + db: db, + } +} + +func newSimpleIndexPostsService(db *gorm.DB, ths core.TweetHelpService) core.IndexPostsService { + return &simpleIndexPostsSrv{ + ths: ths, + db: db, + } +} diff --git a/internal/dao/jinzhu/topics.go b/internal/dao/jinzhu/topics.go index d5ce70a9..de317164 100644 --- a/internal/dao/jinzhu/topics.go +++ b/internal/dao/jinzhu/topics.go @@ -5,51 +5,409 @@ package jinzhu import ( + "errors" "strings" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" "gorm.io/gorm" ) var ( - _ core.TopicService = (*topicServant)(nil) + _ core.TopicService = (*topicSrv)(nil) + _ core.TopicServantA = (*topicSrvA)(nil) ) -type topicServant struct { +type topicSrv struct { + db *gorm.DB + tnTopicUser string + tnDotTopicUser string +} + +type topicSrvA struct { db *gorm.DB } +type topicInfo struct { + TopicId int64 + IsTop int8 +} + func newTopicService(db *gorm.DB) core.TopicService { - return &topicServant{ + return &topicSrv{ + db: db, + tnTopicUser: db.NamingStrategy.TableName("TopicUser"), + tnDotTopicUser: db.NamingStrategy.TableName("TopicUser") + ".", + } +} + +func newTopicServantA(db *gorm.DB) core.TopicServantA { + return &topicSrvA{ db: db, } } -func (s *topicServant) CreateTag(tag *core.Tag) (*core.Tag, error) { - return createTag(s.db, tag) +func (s *topicSrv) UpsertTags(userId int64, tags []string) (_ cs.TagInfoList, err error) { + db := s.db.Begin() + defer func() { + if err == nil { + db.Commit() + } else { + db.Rollback() + } + }() + return createTags(db, userId, tags) +} + +func (s *topicSrv) DecrTagsById(ids []int64) (err error) { + db := s.db.Begin() + defer func() { + if err == nil { + db.Commit() + } else { + db.Rollback() + } + }() + return decrTagsByIds(db, ids) } -func (s *topicServant) DeleteTag(tag *core.Tag) error { - return deleteTag(s.db, tag) +func (s *topicSrv) ListTags(typ cs.TagType, offset, limit int) (res cs.TagList, err error) { + conditions := &ms.ConditionsT{} + switch typ { + case cs.TagTypeHot: + // 热门标签 + conditions = &ms.ConditionsT{ + "ORDER": "quote_num DESC", + } + case cs.TagTypeNew: + // 最新标签 + conditions = &ms.ConditionsT{ + "ORDER": "id DESC", + } + } + return s.listTags(conditions, limit, offset) } -func (s *topicServant) GetTags(conditions *core.ConditionsT, offset, limit int) ([]*core.Tag, error) { - return (&dbr.Tag{}).List(s.db, conditions, offset, limit) +func (s *topicSrv) GetHotTags(userId int64, limit int, offset int) (cs.TagList, error) { + tags, err := s.listTags(&ms.ConditionsT{ + "ORDER": "quote_num DESC", + }, limit, offset) + if err != nil { + return nil, err + } + return s.tagsFormatA(userId, tags) } -func (s *topicServant) GetTagsByKeyword(keyword string) ([]*core.Tag, error) { +func (s *topicSrv) GetNewestTags(userId int64, limit int, offset int) (cs.TagList, error) { + tags, err := s.listTags(&ms.ConditionsT{ + "ORDER": "id DESC", + }, limit, offset) + if err != nil { + return nil, err + } + return s.tagsFormatA(userId, tags) +} + +func (s *topicSrv) GetFollowTags(userId int64, limit int, offset int) (cs.TagList, error) { + if userId < 0 { + return nil, nil + } + userTopics := []*topicInfo{} + err := s.db.Model(&dbr.TopicUser{}). + Where("user_id=?", userId). + Order("is_top DESC"). + Limit(limit). + Offset(offset). + Find(&userTopics).Error + if err != nil { + return nil, err + } + userTopicsMap := make(map[int64]*topicInfo, len(userTopics)) + topicIds := make([]int64, 0, len(userTopics)) + topicIdsMap := make(map[int64]int, len(userTopics)) + for idx, info := range userTopics { + userTopicsMap[info.TopicId] = info + topicIds = append(topicIds, info.TopicId) + topicIdsMap[info.TopicId] = idx + } + var tags cs.TagInfoList + err = s.db.Model(&dbr.Tag{}).Where("quote_num > 0 and id in ?", topicIds).Order("quote_num DESC").Find(&tags).Error + if err != nil { + return nil, err + } + formtedTags, err := s.tagsFormatB(userTopicsMap, tags) + if err != nil { + return nil, err + } + // 置顶排序后处理 + // TODO: 垃圾办法,最好是topic_user join tag 一次查询,但是gorm的join真他喵的别扭,F*K + res := make(cs.TagList, len(topicIds), len(topicIds)) + for _, tag := range formtedTags { + res[topicIdsMap[tag.ID]] = tag + } + return res, nil +} + +func (s *topicSrv) listTags(conditions *ms.ConditionsT, limit int, offset int) (res cs.TagList, err error) { + // TODO: 优化查询方式,直接返回[]*core.Tag, 目前保持先转换一下 + var ( + tags []*dbr.Tag + item *cs.TagItem + ) + if tags, err = (&dbr.Tag{}).List(s.db, conditions, offset, limit); err == nil { + if len(tags) == 0 { + return + } + tagMap := make(map[int64][]*cs.TagItem, len(tags)) + for _, tag := range tags { + item = &cs.TagItem{ + ID: tag.ID, + UserID: tag.UserID, + Tag: tag.Tag, + QuoteNum: tag.QuoteNum, + } + tagMap[item.UserID] = append(tagMap[item.UserID], item) + res = append(res, item) + } + ids := make([]int64, len(tagMap)) + for userId := range tagMap { + ids = append(ids, userId) + } + userInfos, err := (&dbr.User{}).ListUserInfoById(s.db, ids) + if err != nil { + return nil, err + } + for _, userInfo := range userInfos { + for _, item = range tagMap[userInfo.ID] { + item.User = userInfo + } + } + } + return +} + +func (s *topicSrv) tagsFormatA(userId int64, tags cs.TagList) (cs.TagList, error) { + // 获取创建者User IDs + tagIds := []int64{} + for _, tag := range tags { + tagIds = append(tagIds, tag.ID) + } + // 填充话题follow信息 + if userId > -1 { + userTopics := []*topicInfo{} + err := s.db.Model(&dbr.TopicUser{}).Where("is_del=0 and user_id=? and topic_id in ?", userId, tagIds).Find(&userTopics).Error + if err != nil { + return nil, err + } + userTopicsMap := make(map[int64]*topicInfo, len(userTopics)) + for _, info := range userTopics { + userTopicsMap[info.TopicId] = info + } + for _, tag := range tags { + if info, exist := userTopicsMap[tag.ID]; exist { + tag.IsFollowing, tag.IsTop = 1, info.IsTop + } + } + } + return tags, nil +} + +func (s *topicSrv) tagsFormatB(userTopicsMap map[int64]*topicInfo, tags cs.TagInfoList) (cs.TagList, error) { + // 获取创建者User IDs + userIds := []int64{} + tagIds := []int64{} + for _, tag := range tags { + userIds = append(userIds, tag.UserID) + tagIds = append(tagIds, tag.ID) + } + users, err := (&dbr.User{}).ListUserInfoById(s.db, userIds) + if err != nil { + return nil, err + } + tagList := cs.TagList{} + for _, tag := range tags { + tagFormated := tag.Format() + for _, user := range users { + if user.ID == tagFormated.UserID { + tagFormated.User = user + } + } + tagList = append(tagList, tagFormated) + } + // 填充话题follow信息 + if len(userTopicsMap) > 0 { + for _, tag := range tagList { + if info, exist := userTopicsMap[tag.ID]; exist { + tag.IsFollowing, tag.IsTop = 1, info.IsTop + } + } + } + return tagList, nil +} + +func (s *topicSrv) TagsByKeyword(keyword string) (res cs.TagInfoList, err error) { + keyword = "%" + strings.Trim(keyword, " ") + "%" tag := &dbr.Tag{} + var tags []*dbr.Tag + if keyword == "%%" { + tags, err = tag.List(s.db, &dbr.ConditionsT{ + "ORDER": "quote_num DESC", + }, 0, 6) + } else { + tags, err = tag.List(s.db, &dbr.ConditionsT{ + "tag LIKE ?": keyword, + "ORDER": "quote_num DESC", + }, 0, 6) + } + if err == nil { + for _, tag := range tags { + res = append(res, &cs.TagInfo{ + ID: tag.ID, + UserID: tag.UserID, + Tag: tag.Tag, + QuoteNum: tag.QuoteNum, + }) + } + } + return +} + +func (s *topicSrvA) UpsertTags(userId int64, tags []string) (_ cs.TagInfoList, err error) { + db := s.db.Begin() + defer func() { + if err == nil { + db.Commit() + } else { + db.Rollback() + } + }() + return createTags(db, userId, tags) +} + +func (s *topicSrvA) DecrTagsById(ids []int64) (err error) { + db := s.db.Begin() + defer func() { + if err == nil { + db.Commit() + } else { + db.Rollback() + } + }() + return decrTagsByIds(db, ids) +} + +func (s *topicSrvA) ListTags(typ cs.TagType, offset, limit int) (res cs.TagList, err error) { + conditions := &ms.ConditionsT{} + switch typ { + case cs.TagTypeHot: + // 热门标签 + conditions = &ms.ConditionsT{ + "ORDER": "quote_num DESC", + } + case cs.TagTypeNew: + // 最新标签 + conditions = &ms.ConditionsT{ + "ORDER": "id DESC", + } + } + // TODO: 优化查询方式,直接返回[]*core.Tag, 目前保持先转换一下 + var ( + tags []*dbr.Tag + item *cs.TagItem + ) + if tags, err = (&dbr.Tag{}).List(s.db, conditions, offset, limit); err == nil { + if len(tags) == 0 { + return + } + tagMap := make(map[int64][]*cs.TagItem, len(tags)) + for _, tag := range tags { + item = &cs.TagItem{ + ID: tag.ID, + UserID: tag.UserID, + Tag: tag.Tag, + QuoteNum: tag.QuoteNum, + } + tagMap[item.UserID] = append(tagMap[item.UserID], item) + res = append(res, item) + } + ids := make([]int64, len(tagMap)) + for userId := range tagMap { + ids = append(ids, userId) + } + userInfos, err := (&dbr.User{}).ListUserInfoById(s.db, ids) + if err != nil { + return nil, err + } + for _, userInfo := range userInfos { + for _, item = range tagMap[userInfo.ID] { + item.User = userInfo + } + } + } + return +} +func (s *topicSrvA) TagsByKeyword(keyword string) (res cs.TagInfoList, err error) { keyword = "%" + strings.Trim(keyword, " ") + "%" + tag := &dbr.Tag{} + var tags []*dbr.Tag if keyword == "%%" { - return tag.List(s.db, &dbr.ConditionsT{ + tags, err = tag.List(s.db, &dbr.ConditionsT{ "ORDER": "quote_num DESC", }, 0, 6) } else { - return tag.List(s.db, &dbr.ConditionsT{ + tags, err = tag.List(s.db, &dbr.ConditionsT{ "tag LIKE ?": keyword, "ORDER": "quote_num DESC", }, 0, 6) } + if err == nil { + for _, tag := range tags { + res = append(res, &cs.TagInfo{ + ID: tag.ID, + UserID: tag.UserID, + Tag: tag.Tag, + QuoteNum: tag.QuoteNum, + }) + } + } + return +} + +func (s *topicSrv) FollowTopic(userId int64, topicId int64) (err error) { + return s.db.Create(&dbr.TopicUser{ + UserID: userId, + TopicID: topicId, + IsTop: 0, + }).Error +} + +func (s *topicSrv) UnfollowTopic(userId int64, topicId int64) error { + return s.db.Exec("DELETE FROM "+s.tnTopicUser+" WHERE user_id=? AND topic_id=?", userId, topicId).Error +} + +func (s *topicSrv) StickTopic(userId int64, topicId int64) (status int8, err error) { + db := s.db.Begin() + defer db.Rollback() + + m := &dbr.TopicUser{} + err = db.Model(m). + Where("user_id=? and topic_id=?", userId, topicId). + UpdateColumn("is_top", gorm.Expr("1-is_top")).Error + if err != nil { + return + } + status = -1 + err = db.Model(m).Where("user_id=? and topic_id=?", userId, topicId).Select("is_top").Scan(&status).Error + if err != nil { + return + } + if status < 0 { + return -1, errors.New("topic not exist") + } + + db.Commit() + return } diff --git a/internal/dao/jinzhu/tweets.go b/internal/dao/jinzhu/tweets.go index 186b7280..0e517b16 100644 --- a/internal/dao/jinzhu/tweets.go +++ b/internal/dao/jinzhu/tweets.go @@ -9,50 +9,87 @@ import ( "time" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" + "github.com/rocboss/paopao-ce/pkg/debug" "gorm.io/gorm" ) var ( - _ core.TweetService = (*tweetServant)(nil) - _ core.TweetManageService = (*tweetManageServant)(nil) - _ core.TweetHelpService = (*tweetHelpServant)(nil) + _ core.TweetService = (*tweetSrv)(nil) + _ core.TweetManageService = (*tweetManageSrv)(nil) + _ core.TweetHelpService = (*tweetHelpSrv)(nil) + + _ core.TweetServantA = (*tweetSrvA)(nil) + _ core.TweetManageServantA = (*tweetManageSrvA)(nil) + _ core.TweetHelpServantA = (*tweetHelpSrvA)(nil) ) -type tweetServant struct { +type tweetSrv struct { db *gorm.DB } -type tweetManageServant struct { +type tweetManageSrv struct { cacheIndex core.CacheIndexService db *gorm.DB } -type tweetHelpServant struct { +type tweetHelpSrv struct { + db *gorm.DB +} + +type tweetSrvA struct { + db *gorm.DB +} + +type tweetManageSrvA struct { + db *gorm.DB +} + +type tweetHelpSrvA struct { db *gorm.DB } func newTweetService(db *gorm.DB) core.TweetService { - return &tweetServant{ + return &tweetSrv{ db: db, } } func newTweetManageService(db *gorm.DB, cacheIndex core.CacheIndexService) core.TweetManageService { - return &tweetManageServant{ + return &tweetManageSrv{ cacheIndex: cacheIndex, db: db, } } func newTweetHelpService(db *gorm.DB) core.TweetHelpService { - return &tweetHelpServant{ + return &tweetHelpSrv{ + db: db, + } +} + +func newTweetServantA(db *gorm.DB) core.TweetServantA { + return &tweetSrvA{ + db: db, + } +} + +func newTweetManageServantA(db *gorm.DB) core.TweetManageServantA { + return &tweetManageSrvA{ + db: db, + } +} + +func newTweetHelpServantA(db *gorm.DB) core.TweetHelpServantA { + return &tweetHelpSrvA{ db: db, } } // MergePosts post数据整合 -func (s *tweetHelpServant) MergePosts(posts []*core.Post) ([]*core.PostFormated, error) { +func (s *tweetHelpSrv) MergePosts(posts []*ms.Post) ([]*ms.PostFormated, error) { postIds := make([]int64, 0, len(posts)) userIds := make([]int64, 0, len(posts)) for _, post := range posts { @@ -92,7 +129,7 @@ func (s *tweetHelpServant) MergePosts(posts []*core.Post) ([]*core.PostFormated, } // RevampPosts post数据整形修复 -func (s *tweetHelpServant) RevampPosts(posts []*core.PostFormated) ([]*core.PostFormated, error) { +func (s *tweetHelpSrv) RevampPosts(posts []*ms.PostFormated) ([]*ms.PostFormated, error) { postIds := make([]int64, 0, len(posts)) userIds := make([]int64, 0, len(posts)) for _, post := range posts { @@ -128,14 +165,14 @@ func (s *tweetHelpServant) RevampPosts(posts []*core.PostFormated) ([]*core.Post return posts, nil } -func (s *tweetHelpServant) getPostContentsByIDs(ids []int64) ([]*dbr.PostContent, error) { +func (s *tweetHelpSrv) getPostContentsByIDs(ids []int64) ([]*dbr.PostContent, error) { return (&dbr.PostContent{}).List(s.db, &dbr.ConditionsT{ "post_id IN ?": ids, "ORDER": "sort ASC", }, 0, 0) } -func (s *tweetHelpServant) getUsersByIDs(ids []int64) ([]*dbr.User, error) { +func (s *tweetHelpSrv) getUsersByIDs(ids []int64) ([]*dbr.User, error) { user := &dbr.User{} return user.List(s.db, &dbr.ConditionsT{ @@ -143,7 +180,7 @@ func (s *tweetHelpServant) getUsersByIDs(ids []int64) ([]*dbr.User, error) { }, 0, 0) } -func (s *tweetManageServant) CreatePostCollection(postID, userID int64) (*core.PostCollection, error) { +func (s *tweetManageSrv) CreatePostCollection(postID, userID int64) (*ms.PostCollection, error) { collection := &dbr.PostCollection{ PostID: postID, UserID: userID, @@ -152,19 +189,20 @@ func (s *tweetManageServant) CreatePostCollection(postID, userID int64) (*core.P return collection.Create(s.db) } -func (s *tweetManageServant) DeletePostCollection(p *core.PostCollection) error { +func (s *tweetManageSrv) DeletePostCollection(p *ms.PostCollection) error { return p.Delete(s.db) } -func (s *tweetManageServant) CreatePostContent(content *core.PostContent) (*core.PostContent, error) { +func (s *tweetManageSrv) CreatePostContent(content *ms.PostContent) (*ms.PostContent, error) { return content.Create(s.db) } -func (s *tweetManageServant) CreateAttachment(attachment *core.Attachment) (*core.Attachment, error) { - return attachment.Create(s.db) +func (s *tweetManageSrv) CreateAttachment(obj *ms.Attachment) (int64, error) { + attachment, err := obj.Create(s.db) + return attachment.ID, err } -func (s *tweetManageServant) CreatePost(post *core.Post) (*core.Post, error) { +func (s *tweetManageSrv) CreatePost(post *ms.Post) (*ms.Post, error) { post.LatestRepliedOn = time.Now().Unix() p, err := post.Create(s.db) if err != nil { @@ -174,7 +212,7 @@ func (s *tweetManageServant) CreatePost(post *core.Post) (*core.Post, error) { return p, nil } -func (s *tweetManageServant) DeletePost(post *core.Post) ([]string, error) { +func (s *tweetManageSrv) DeletePost(post *ms.Post) ([]string, error) { var mediaContents []string postId := post.ID @@ -221,7 +259,7 @@ func (s *tweetManageServant) DeletePost(post *core.Post) ([]string, error) { return mediaContents, nil } -func (s *tweetManageServant) deleteCommentByPostId(db *gorm.DB, postId int64) ([]string, error) { +func (s *tweetManageSrv) deleteCommentByPostId(db *gorm.DB, postId int64) ([]string, error) { comment := &dbr.Comment{} commentContent := &dbr.CommentContent{} @@ -255,12 +293,12 @@ func (s *tweetManageServant) deleteCommentByPostId(db *gorm.DB, postId int64) ([ return mediaContents, nil } -func (s *tweetManageServant) LockPost(post *core.Post) error { +func (s *tweetManageSrv) LockPost(post *ms.Post) error { post.IsLock = 1 - post.IsLock return post.Update(s.db) } -func (s *tweetManageServant) StickPost(post *core.Post) error { +func (s *tweetManageSrv) StickPost(post *ms.Post) error { post.IsTop = 1 - post.IsTop if err := post.Update(s.db); err != nil { return err @@ -269,7 +307,26 @@ func (s *tweetManageServant) StickPost(post *core.Post) error { return nil } -func (s *tweetManageServant) VisiblePost(post *core.Post, visibility core.PostVisibleT) error { +func (s *tweetManageSrv) HighlightPost(userId int64, postId int64) (res int, err error) { + var post dbr.Post + tx := s.db.Begin() + defer tx.Rollback() + post.Get(tx) + if err = tx.Where("id = ? AND is_del = 0", postId).First(&post).Error; err != nil { + return + } + if post.UserID != userId { + return 0, cs.ErrNoPermission + } + post.IsEssence = 1 - post.IsEssence + if err = post.Update(tx); err != nil { + return + } + tx.Commit() + return post.IsEssence, nil +} + +func (s *tweetManageSrv) VisiblePost(post *ms.Post, visibility core.PostVisibleT) (err error) { oldVisibility := post.Visibility post.Visibility = visibility // TODO: 这个判断是否可以不要呢 @@ -282,42 +339,35 @@ func (s *tweetManageServant) VisiblePost(post *core.Post, visibility core.PostVi // TODO: 置顶推文用户是否有权设置成私密? 后续完善 post.IsTop = 0 } - db := s.db.Begin() - err := post.Update(db) - if err != nil { - db.Rollback() - return err + tx := s.db.Begin() + defer tx.Rollback() + if err = post.Update(tx); err != nil { + return } - // tag处理 tags := strings.Split(post.Tags, ",") - for _, t := range tags { - tag := &dbr.Tag{ - Tag: t, - } - // TODO: 暂时宽松不处理错误,这里或许可以有优化,后续完善 - if oldVisibility == dbr.PostVisitPrivate { - // 从私密转为非私密才需要重新创建tag - createTag(db, tag) - } else if visibility == dbr.PostVisitPrivate { - // 从非私密转为私密才需要删除tag - deleteTag(db, tag) - } - } - db.Commit() + // TODO: 暂时宽松不处理错误,这里或许可以有优化,后续完善 + if oldVisibility == dbr.PostVisitPrivate { + // 从私密转为非私密才需要重新创建tag + createTags(tx, post.UserID, tags) + } else if visibility == dbr.PostVisitPrivate { + // 从非私密转为私密才需要删除tag + deleteTags(tx, tags) + } + tx.Commit() s.cacheIndex.SendAction(core.IdxActVisiblePost, post) - return nil + return } -func (s *tweetManageServant) UpdatePost(post *core.Post) error { - if err := post.Update(s.db); err != nil { - return err +func (s *tweetManageSrv) UpdatePost(post *ms.Post) (err error) { + if err = post.Update(s.db); err != nil { + return } s.cacheIndex.SendAction(core.IdxActUpdatePost, post) - return nil + return } -func (s *tweetManageServant) CreatePostStar(postID, userID int64) (*core.PostStar, error) { +func (s *tweetManageSrv) CreatePostStar(postID, userID int64) (*ms.PostStar, error) { star := &dbr.PostStar{ PostID: postID, UserID: userID, @@ -325,11 +375,11 @@ func (s *tweetManageServant) CreatePostStar(postID, userID int64) (*core.PostSta return star.Create(s.db) } -func (s *tweetManageServant) DeletePostStar(p *core.PostStar) error { +func (s *tweetManageSrv) DeletePostStar(p *ms.PostStar) error { return p.Delete(s.db) } -func (s *tweetServant) GetPostByID(id int64) (*core.Post, error) { +func (s *tweetSrv) GetPostByID(id int64) (*ms.Post, error) { post := &dbr.Post{ Model: &dbr.Model{ ID: id, @@ -338,15 +388,15 @@ func (s *tweetServant) GetPostByID(id int64) (*core.Post, error) { return post.Get(s.db) } -func (s *tweetServant) GetPosts(conditions *core.ConditionsT, offset, limit int) ([]*core.Post, error) { +func (s *tweetSrv) GetPosts(conditions ms.ConditionsT, offset, limit int) ([]*ms.Post, error) { return (&dbr.Post{}).List(s.db, conditions, offset, limit) } -func (s *tweetServant) GetPostCount(conditions *core.ConditionsT) (int64, error) { +func (s *tweetSrv) GetPostCount(conditions ms.ConditionsT) (int64, error) { return (&dbr.Post{}).Count(s.db, conditions) } -func (s *tweetServant) GetUserPostStar(postID, userID int64) (*core.PostStar, error) { +func (s *tweetSrv) GetUserPostStar(postID, userID int64) (*ms.PostStar, error) { star := &dbr.PostStar{ PostID: postID, UserID: userID, @@ -354,24 +404,36 @@ func (s *tweetServant) GetUserPostStar(postID, userID int64) (*core.PostStar, er return star.Get(s.db) } -func (s *tweetServant) GetUserPostStars(userID int64, offset, limit int) ([]*core.PostStar, error) { +func (s *tweetSrv) GetUserPostStars(userID int64, limit int, offset int) ([]*ms.PostStar, error) { star := &dbr.PostStar{ UserID: userID, } - return star.List(s.db, &dbr.ConditionsT{ "ORDER": s.db.NamingStrategy.TableName("PostStar") + ".id DESC", - }, offset, limit) + }, cs.RelationSelf, limit, offset) +} + +func (s *tweetSrv) ListUserStarTweets(user *cs.VistUser, limit int, offset int) (res []*ms.PostStar, total int64, err error) { + star := &dbr.PostStar{ + UserID: user.UserId, + } + if total, err = star.Count(s.db, user.RelTyp, &dbr.ConditionsT{}); err != nil { + return + } + res, err = star.List(s.db, &dbr.ConditionsT{ + "ORDER": s.db.NamingStrategy.TableName("PostStar") + ".id DESC", + }, user.RelTyp, limit, offset) + return } -func (s *tweetServant) GetUserPostStarCount(userID int64) (int64, error) { +func (s *tweetSrv) GetUserPostStarCount(userID int64) (int64, error) { star := &dbr.PostStar{ UserID: userID, } - return star.Count(s.db, &dbr.ConditionsT{}) + return star.Count(s.db, cs.RelationSelf, &dbr.ConditionsT{}) } -func (s *tweetServant) GetUserPostCollection(postID, userID int64) (*core.PostCollection, error) { +func (s *tweetSrv) GetUserPostCollection(postID, userID int64) (*ms.PostCollection, error) { star := &dbr.PostCollection{ PostID: postID, UserID: userID, @@ -379,7 +441,7 @@ func (s *tweetServant) GetUserPostCollection(postID, userID int64) (*core.PostCo return star.Get(s.db) } -func (s *tweetServant) GetUserPostCollections(userID int64, offset, limit int) ([]*core.PostCollection, error) { +func (s *tweetSrv) GetUserPostCollections(userID int64, offset, limit int) ([]*ms.PostCollection, error) { collection := &dbr.PostCollection{ UserID: userID, } @@ -389,14 +451,14 @@ func (s *tweetServant) GetUserPostCollections(userID int64, offset, limit int) ( }, offset, limit) } -func (s *tweetServant) GetUserPostCollectionCount(userID int64) (int64, error) { +func (s *tweetSrv) GetUserPostCollectionCount(userID int64) (int64, error) { collection := &dbr.PostCollection{ UserID: userID, } return collection.Count(s.db, &dbr.ConditionsT{}) } -func (s *tweetServant) GetUserWalletBills(userID int64, offset, limit int) ([]*core.WalletStatement, error) { +func (s *tweetSrv) GetUserWalletBills(userID int64, offset, limit int) ([]*ms.WalletStatement, error) { statement := &dbr.WalletStatement{ UserID: userID, } @@ -406,14 +468,14 @@ func (s *tweetServant) GetUserWalletBills(userID int64, offset, limit int) ([]*c }, offset, limit) } -func (s *tweetServant) GetUserWalletBillCount(userID int64) (int64, error) { +func (s *tweetSrv) GetUserWalletBillCount(userID int64) (int64, error) { statement := &dbr.WalletStatement{ UserID: userID, } return statement.Count(s.db, &dbr.ConditionsT{}) } -func (s *tweetServant) GetPostAttatchmentBill(postID, userID int64) (*core.PostAttachmentBill, error) { +func (s *tweetSrv) GetPostAttatchmentBill(postID, userID int64) (*ms.PostAttachmentBill, error) { bill := &dbr.PostAttachmentBill{ PostID: postID, UserID: userID, @@ -422,17 +484,117 @@ func (s *tweetServant) GetPostAttatchmentBill(postID, userID int64) (*core.PostA return bill.Get(s.db) } -func (s *tweetServant) GetPostContentsByIDs(ids []int64) ([]*core.PostContent, error) { +func (s *tweetSrv) GetPostContentsByIDs(ids []int64) ([]*ms.PostContent, error) { return (&dbr.PostContent{}).List(s.db, &dbr.ConditionsT{ "post_id IN ?": ids, "ORDER": "sort ASC", }, 0, 0) } -func (s *tweetServant) GetPostContentByID(id int64) (*core.PostContent, error) { +func (s *tweetSrv) GetPostContentByID(id int64) (*ms.PostContent, error) { return (&dbr.PostContent{ Model: &dbr.Model{ ID: id, }, }).Get(s.db) } + +func (s *tweetSrvA) TweetInfoById(id int64) (*cs.TweetInfo, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *tweetSrvA) TweetItemById(id int64) (*cs.TweetItem, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *tweetSrvA) UserTweets(visitorId, userId int64) (cs.TweetList, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *tweetSrvA) ReactionByTweetId(userId int64, tweetId int64) (*cs.ReactionItem, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *tweetSrvA) UserReactions(userId int64, offset int, limit int) (cs.ReactionList, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *tweetSrvA) FavoriteByTweetId(userId int64, tweetId int64) (*cs.FavoriteItem, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *tweetSrvA) UserFavorites(userId int64, offset int, limit int) (cs.FavoriteList, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *tweetSrvA) AttachmentByTweetId(userId int64, tweetId int64) (*cs.AttachmentBill, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *tweetManageSrvA) CreateAttachment(obj *cs.Attachment) (int64, error) { + // TODO + return 0, debug.ErrNotImplemented +} + +func (s *tweetManageSrvA) CreateTweet(userId int64, req *cs.NewTweetReq) (*cs.TweetItem, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *tweetManageSrvA) DeleteTweet(userId int64, tweetId int64) ([]string, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *tweetManageSrvA) LockTweet(userId int64, tweetId int64) error { + // TODO + return debug.ErrNotImplemented +} + +func (s *tweetManageSrvA) StickTweet(userId int64, tweetId int64) error { + // TODO + return debug.ErrNotImplemented +} + +func (s *tweetManageSrvA) VisibleTweet(userId int64, visibility cs.TweetVisibleType) error { + // TODO + return debug.ErrNotImplemented +} + +func (s *tweetManageSrvA) CreateReaction(userId int64, tweetId int64) error { + // TODO + return debug.ErrNotImplemented +} + +func (s *tweetManageSrvA) DeleteReaction(userId int64, reactionId int64) error { + // TODO + return debug.ErrNotImplemented +} + +func (s *tweetManageSrvA) CreateFavorite(userId int64, tweetId int64) error { + // TODO + return debug.ErrNotImplemented +} + +func (s *tweetManageSrvA) DeleteFavorite(userId int64, favoriteId int64) error { + // TODO + return debug.ErrNotImplemented +} + +func (s *tweetHelpSrvA) RevampTweets(tweets cs.TweetList) (cs.TweetList, error) { + // TODO + return nil, debug.ErrNotImplemented +} + +func (s *tweetHelpSrvA) MergeTweets(tweets cs.TweetInfo) (cs.TweetList, error) { + // TODO + return nil, debug.ErrNotImplemented +} diff --git a/internal/dao/jinzhu/user.go b/internal/dao/jinzhu/user.go index 96d09fc1..6bc18de3 100644 --- a/internal/dao/jinzhu/user.go +++ b/internal/dao/jinzhu/user.go @@ -8,25 +8,26 @@ import ( "strings" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" "gorm.io/gorm" ) var ( - _ core.UserManageService = (*userManageServant)(nil) + _ core.UserManageService = (*userManageSrv)(nil) ) -type userManageServant struct { +type userManageSrv struct { db *gorm.DB } func newUserManageService(db *gorm.DB) core.UserManageService { - return &userManageServant{ + return &userManageSrv{ db: db, } } -func (s *userManageServant) GetUserByID(id int64) (*core.User, error) { +func (s *userManageSrv) GetUserByID(id int64) (*ms.User, error) { user := &dbr.User{ Model: &dbr.Model{ ID: id, @@ -35,28 +36,28 @@ func (s *userManageServant) GetUserByID(id int64) (*core.User, error) { return user.Get(s.db) } -func (s *userManageServant) GetUserByUsername(username string) (*core.User, error) { +func (s *userManageSrv) GetUserByUsername(username string) (*ms.User, error) { user := &dbr.User{ Username: username, } return user.Get(s.db) } -func (s *userManageServant) GetUserByPhone(phone string) (*core.User, error) { +func (s *userManageSrv) GetUserByPhone(phone string) (*ms.User, error) { user := &dbr.User{ Phone: phone, } return user.Get(s.db) } -func (s *userManageServant) GetUsersByIDs(ids []int64) ([]*core.User, error) { +func (s *userManageSrv) GetUsersByIDs(ids []int64) ([]*ms.User, error) { user := &dbr.User{} return user.List(s.db, &dbr.ConditionsT{ "id IN ?": ids, }, 0, 0) } -func (s *userManageServant) GetUsersByKeyword(keyword string) ([]*core.User, error) { +func (s *userManageSrv) GetUsersByKeyword(keyword string) ([]*ms.User, error) { user := &dbr.User{} keyword = strings.Trim(keyword, " ") + "%" if keyword == "%" { @@ -70,25 +71,10 @@ func (s *userManageServant) GetUsersByKeyword(keyword string) ([]*core.User, err } } -func (s *userManageServant) GetTagsByKeyword(keyword string) ([]*core.Tag, error) { - tag := &dbr.Tag{} - keyword = "%" + strings.Trim(keyword, " ") + "%" - if keyword == "%%" { - return tag.List(s.db, &dbr.ConditionsT{ - "ORDER": "quote_num DESC", - }, 0, 6) - } else { - return tag.List(s.db, &dbr.ConditionsT{ - "tag LIKE ?": keyword, - "ORDER": "quote_num DESC", - }, 0, 6) - } -} - -func (s *userManageServant) CreateUser(user *dbr.User) (*core.User, error) { +func (s *userManageSrv) CreateUser(user *dbr.User) (*ms.User, error) { return user.Create(s.db) } -func (s *userManageServant) UpdateUser(user *core.User) error { +func (s *userManageSrv) UpdateUser(user *ms.User) error { return user.Update(s.db) } diff --git a/internal/dao/jinzhu/utils.go b/internal/dao/jinzhu/utils.go index 27766397..9d97b4b8 100644 --- a/internal/dao/jinzhu/utils.go +++ b/internal/dao/jinzhu/utils.go @@ -5,35 +5,52 @@ package jinzhu import ( + "github.com/rocboss/paopao-ce/internal/core/cs" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" "gorm.io/gorm" ) -func createTag(db *gorm.DB, tag *dbr.Tag) (*dbr.Tag, error) { - t, err := tag.Get(db) - if err != nil { - tag.QuoteNum = 1 - return tag.Create(db) - } - - // 更新 - t.QuoteNum++ - err = t.Update(db) - - if err != nil { - return nil, err +func createTags(db *gorm.DB, userId int64, tags []string) (res cs.TagInfoList, err error) { + for _, name := range tags { + tag := &dbr.Tag{Tag: name} + if tag, err = tag.Get(db); err == nil { + // 更新 + tag.QuoteNum++ + if err = tag.Update(db); err != nil { + return + } + } else { + if tag, err = (&dbr.Tag{ + UserID: userId, + QuoteNum: 1, + Tag: name, + }).Create(db); err != nil { + return + } + } + res = append(res, &cs.TagInfo{ + ID: tag.ID, + UserID: tag.UserID, + Tag: tag.Tag, + QuoteNum: tag.QuoteNum, + }) } - - return t, nil + return } -func deleteTag(db *gorm.DB, tag *dbr.Tag) error { - tag, err := tag.Get(db) - if err != nil { - return err +func decrTagsByIds(db *gorm.DB, ids []int64) (err error) { + for _, id := range ids { + tag := &dbr.Tag{Model: &dbr.Model{ID: id}} + if tag, err = tag.Get(db); err == nil { + tag.QuoteNum-- + if err = tag.Update(db); err != nil { + return + } + } else { + continue + } } - tag.QuoteNum-- - return tag.Update(db) + return nil } func deleteTags(db *gorm.DB, tags []string) error { diff --git a/internal/dao/jinzhu/wallet.go b/internal/dao/jinzhu/wallet.go index 7b2023d7..e657deca 100644 --- a/internal/dao/jinzhu/wallet.go +++ b/internal/dao/jinzhu/wallet.go @@ -7,67 +7,68 @@ package jinzhu import ( "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" "gorm.io/gorm" ) var ( - _ core.WalletService = (*walletServant)(nil) + _ core.WalletService = (*walletSrv)(nil) ) -type walletServant struct { +type walletSrv struct { db *gorm.DB } func newWalletService(db *gorm.DB) core.WalletService { - return &walletServant{ + return &walletSrv{ db: db, } } -func (d *walletServant) GetRechargeByID(id int64) (*core.WalletRecharge, error) { +func (s *walletSrv) GetRechargeByID(id int64) (*ms.WalletRecharge, error) { recharge := &dbr.WalletRecharge{ Model: &dbr.Model{ ID: id, }, } - return recharge.Get(d.db) + return recharge.Get(s.db) } -func (d *walletServant) CreateRecharge(userId, amount int64) (*core.WalletRecharge, error) { +func (s *walletSrv) CreateRecharge(userId, amount int64) (*ms.WalletRecharge, error) { recharge := &dbr.WalletRecharge{ UserID: userId, Amount: amount, } - return recharge.Create(d.db) + return recharge.Create(s.db) } -func (d *walletServant) GetUserWalletBills(userID int64, offset, limit int) ([]*core.WalletStatement, error) { +func (s *walletSrv) GetUserWalletBills(userID int64, offset, limit int) ([]*ms.WalletStatement, error) { statement := &dbr.WalletStatement{ UserID: userID, } - return statement.List(d.db, &dbr.ConditionsT{ + return statement.List(s.db, &dbr.ConditionsT{ "ORDER": "id DESC", }, offset, limit) } -func (d *walletServant) GetUserWalletBillCount(userID int64) (int64, error) { +func (s *walletSrv) GetUserWalletBillCount(userID int64) (int64, error) { statement := &dbr.WalletStatement{ UserID: userID, } - return statement.Count(d.db, &dbr.ConditionsT{}) + return statement.Count(s.db, &dbr.ConditionsT{}) } -func (d *walletServant) HandleRechargeSuccess(recharge *core.WalletRecharge, tradeNo string) error { +func (s *walletSrv) HandleRechargeSuccess(recharge *ms.WalletRecharge, tradeNo string) error { user, _ := (&dbr.User{ Model: &dbr.Model{ ID: recharge.UserID, }, - }).Get(d.db) + }).Get(s.db) - return d.db.Transaction(func(tx *gorm.DB) error { + return s.db.Transaction(func(tx *gorm.DB) error { // 扣除金额 if err := tx.Model(user).Update("balance", gorm.Expr("balance + ?", recharge.Amount)).Error; err != nil { // 返回任何错误都会回滚事务 @@ -97,8 +98,8 @@ func (d *walletServant) HandleRechargeSuccess(recharge *core.WalletRecharge, tra }) } -func (d *walletServant) HandlePostAttachmentBought(post *core.Post, user *core.User) error { - return d.db.Transaction(func(tx *gorm.DB) error { +func (s *walletSrv) HandlePostAttachmentBought(post *ms.Post, user *ms.User) error { + return s.db.Transaction(func(tx *gorm.DB) error { // 扣除金额 if err := tx.Model(user).Update("balance", gorm.Expr("balance - ?", post.AttachmentPrice)).Error; err != nil { // 返回任何错误都会回滚事务 @@ -133,7 +134,7 @@ func (d *walletServant) HandlePostAttachmentBought(post *core.Post, user *core.U ID: post.UserID, }, } - master, _ = master.Get(d.db) + master, _ = master.Get(s.db) if err := tx.Model(master).Update("balance", gorm.Expr("balance + ?", income)).Error; err != nil { // 返回任何错误都会回滚事务 diff --git a/internal/dao/sakila/sakila.go b/internal/dao/sakila/sakila.go index d82a0d23..0a605bf8 100644 --- a/internal/dao/sakila/sakila.go +++ b/internal/dao/sakila/sakila.go @@ -17,6 +17,11 @@ func NewDataService() (core.DataService, core.VersionInfo) { return nil, nil } +func NewWebDataServantA() (core.WebDataServantA, core.VersionInfo) { + logrus.Fatal("not support now") + return nil, nil +} + func NewAuthorizationManageService() core.AuthorizationManageService { logrus.Fatal("not support now") return nil diff --git a/internal/dao/search/bridge.go b/internal/dao/search/bridge.go index f23aaa25..bc4eb039 100644 --- a/internal/dao/search/bridge.go +++ b/internal/dao/search/bridge.go @@ -8,6 +8,7 @@ import ( "time" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/sirupsen/logrus" ) @@ -46,7 +47,7 @@ func (s *bridgeTweetSearchServant) DeleteDocuments(identifiers []string) error { return nil } -func (s *bridgeTweetSearchServant) Search(user *core.User, q *core.QueryReq, offset, limit int) (*core.QueryResp, error) { +func (s *bridgeTweetSearchServant) Search(user *ms.User, q *core.QueryReq, offset, limit int) (*core.QueryResp, error) { return s.ts.Search(user, q, offset, limit) } diff --git a/internal/dao/search/filter.go b/internal/dao/search/filter.go index 5840e189..a601c46f 100644 --- a/internal/dao/search/filter.go +++ b/internal/dao/search/filter.go @@ -6,6 +6,7 @@ package search import ( "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/pkg/types" ) @@ -13,13 +14,13 @@ type tweetSearchFilter struct { ams core.AuthorizationManageService } -func (s *tweetSearchFilter) filterResp(user *core.User, resp *core.QueryResp) { +func (s *tweetSearchFilter) filterResp(user *ms.User, resp *core.QueryResp) { // 管理员不过滤 if user != nil && user.IsAdmin { return } - var item *core.PostFormated + var item *ms.PostFormated items := resp.Items latestIndex := len(items) - 1 if user == nil { diff --git a/internal/dao/search/meili.go b/internal/dao/search/meili.go index b2ee4d16..74391ef3 100644 --- a/internal/dao/search/meili.go +++ b/internal/dao/search/meili.go @@ -11,6 +11,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/meilisearch/meilisearch-go" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/pkg/json" "github.com/sirupsen/logrus" ) @@ -52,20 +53,20 @@ func (s *meiliTweetSearchServant) Name() string { } func (s *meiliTweetSearchServant) Version() *semver.Version { - return semver.MustParse("v0.2.1") + return semver.MustParse("v0.2.2") } func (s *meiliTweetSearchServant) IndexName() string { return s.index.UID } -func (s *meiliTweetSearchServant) AddDocuments(data []core.TsDocItem, primaryKey ...string) (bool, error) { +func (s *meiliTweetSearchServant) AddDocuments(data []core.TsDocItem, _primaryKey ...string) (bool, error) { docs := s.toDocs(data) if len(docs) == 0 { return true, nil } - if _, err := s.index.AddDocuments(docs, primaryKey...); err != nil { - logrus.Errorf("meiliTweetSearchServant.AddDocuments error: %v", err) + if _, err := s.index.AddDocuments(docs); err != nil { + logrus.Errorf("meiliTweetSearchServant.AddDocuments error: %s", err) return false, err } return true, nil @@ -77,11 +78,11 @@ func (s *meiliTweetSearchServant) DeleteDocuments(identifiers []string) error { logrus.Errorf("meiliTweetSearchServant.DeleteDocuments error: %v", err) return err } - logrus.Debugf("meiliTweetSearchServant.DeleteDocuments task: %+v", task.Details) + logrus.Debugf("meiliTweetSearchServant.DeleteDocuments task: (taskUID:%d, indexUID:%s, status:%s)", task.TaskUID, task.IndexUID, task.Status) return nil } -func (s *meiliTweetSearchServant) Search(user *core.User, q *core.QueryReq, offset, limit int) (resp *core.QueryResp, err error) { +func (s *meiliTweetSearchServant) Search(user *ms.User, q *core.QueryReq, offset, limit int) (resp *core.QueryResp, err error) { if q.Type == core.SearchTypeDefault && q.Query != "" { resp, err = s.queryByContent(user, q, offset, limit) } else if q.Type == core.SearchTypeTag && q.Query != "" { @@ -99,7 +100,7 @@ func (s *meiliTweetSearchServant) Search(user *core.User, q *core.QueryReq, offs return } -func (s *meiliTweetSearchServant) queryByContent(user *core.User, q *core.QueryReq, offset, limit int) (*core.QueryResp, error) { +func (s *meiliTweetSearchServant) queryByContent(user *ms.User, q *core.QueryReq, offset, limit int) (*core.QueryResp, error) { request := &meilisearch.SearchRequest{ Offset: int64(offset), Limit: int64(limit), @@ -120,7 +121,7 @@ func (s *meiliTweetSearchServant) queryByContent(user *core.User, q *core.QueryR return s.postsFrom(resp) } -func (s *meiliTweetSearchServant) queryByTag(user *core.User, q *core.QueryReq, offset, limit int) (*core.QueryResp, error) { +func (s *meiliTweetSearchServant) queryByTag(user *ms.User, q *core.QueryReq, offset, limit int) (*core.QueryResp, error) { request := &meilisearch.SearchRequest{ Offset: int64(offset), Limit: int64(limit), @@ -144,7 +145,7 @@ func (s *meiliTweetSearchServant) queryByTag(user *core.User, q *core.QueryReq, return s.postsFrom(resp) } -func (s *meiliTweetSearchServant) queryAny(user *core.User, offset, limit int) (*core.QueryResp, error) { +func (s *meiliTweetSearchServant) queryAny(user *ms.User, offset, limit int) (*core.QueryResp, error) { request := &meilisearch.SearchRequest{ Offset: int64(offset), Limit: int64(limit), @@ -164,7 +165,7 @@ func (s *meiliTweetSearchServant) queryAny(user *core.User, offset, limit int) ( return s.postsFrom(resp) } -func (s *meiliTweetSearchServant) filterList(user *core.User) string { +func (s *meiliTweetSearchServant) filterList(user *ms.User) string { if user == nil { return s.publicFilter } @@ -177,7 +178,7 @@ func (s *meiliTweetSearchServant) filterList(user *core.User) string { } func (s *meiliTweetSearchServant) postsFrom(resp *meilisearch.SearchResponse) (*core.QueryResp, error) { - posts := make([]*core.PostFormated, 0, len(resp.Hits)) + posts := make([]*ms.PostFormated, 0, len(resp.Hits)) for _, hit := range resp.Hits { raw, err := json.Marshal(hit) if err != nil { @@ -187,7 +188,7 @@ func (s *meiliTweetSearchServant) postsFrom(resp *meilisearch.SearchResponse) (* if err = json.Unmarshal(raw, p); err != nil { return nil, err } - posts = append(posts, &core.PostFormated{ + posts = append(posts, &ms.PostFormated{ ID: p.ID, UserID: p.UserID, CommentCount: p.CommentCount, diff --git a/internal/dao/search/search.go b/internal/dao/search/search.go index baf0923b..d8a058f8 100644 --- a/internal/dao/search/search.go +++ b/internal/dao/search/search.go @@ -22,19 +22,22 @@ func NewMeiliTweetSearchService(ams core.AuthorizationManageService) (core.Tweet }) if _, err := client.Index(s.Index).FetchInfo(); err != nil { - logrus.Debugf("create index because fetch index info error: %v", err) - client.CreateIndex(&meilisearch.IndexConfig{ + logrus.Debugf("create meili index because fetch index info error: %v", err) + if _, err := client.CreateIndex(&meilisearch.IndexConfig{ Uid: s.Index, PrimaryKey: "id", - }) - searchableAttributes := []string{"content", "tags"} - sortableAttributes := []string{"is_top", "latest_replied_on"} - filterableAttributes := []string{"tags", "visibility", "user_id"} - - index := client.Index(s.Index) - index.UpdateSearchableAttributes(&searchableAttributes) - index.UpdateSortableAttributes(&sortableAttributes) - index.UpdateFilterableAttributes(&filterableAttributes) + }); err == nil { + settings := meilisearch.Settings{ + SearchableAttributes: []string{"content", "tags"}, + SortableAttributes: []string{"is_top", "latest_replied_on"}, + FilterableAttributes: []string{"tags", "visibility", "user_id"}, + } + if _, err = client.Index(s.Index).UpdateSettings(&settings); err != nil { + logrus.Errorf("update meili settings error: %s", err) + } + } else { + logrus.Errorf("create meili index error: %s", err) + } } mts := &meiliTweetSearchServant{ @@ -57,7 +60,7 @@ func NewZincTweetSearchService(ams core.AuthorizationManageService) (core.TweetS ams: ams, }, indexName: s.Index, - client: zinc.NewClient(s), + client: zinc.NewClient(s.Endpoint(), s.User, s.Password), publicFilter: fmt.Sprintf("visibility:%d", core.PostVisitPublic), privateFilter: fmt.Sprintf("visibility:%d AND user_id:%%d", core.PostVisitPrivate), friendFilter: fmt.Sprintf("visibility:%d", core.PostVisitFriend), diff --git a/internal/dao/search/zinc.go b/internal/dao/search/zinc.go index ea9a7fa5..91f74b42 100644 --- a/internal/dao/search/zinc.go +++ b/internal/dao/search/zinc.go @@ -9,6 +9,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/pkg/json" "github.com/rocboss/paopao-ce/pkg/zinc" "github.com/sirupsen/logrus" @@ -76,7 +77,7 @@ func (s *zincTweetSearchServant) DeleteDocuments(identifiers []string) error { return nil } -func (s *zincTweetSearchServant) Search(user *core.User, q *core.QueryReq, offset, limit int) (resp *core.QueryResp, err error) { +func (s *zincTweetSearchServant) Search(user *ms.User, q *core.QueryReq, offset, limit int) (resp *core.QueryResp, err error) { if q.Type == core.SearchTypeDefault && q.Query != "" { resp, err = s.queryByContent(user, q, offset, limit) } else if q.Type == core.SearchTypeTag && q.Query != "" { @@ -94,7 +95,7 @@ func (s *zincTweetSearchServant) Search(user *core.User, q *core.QueryReq, offse return } -func (s *zincTweetSearchServant) queryByContent(user *core.User, q *core.QueryReq, offset, limit int) (*core.QueryResp, error) { +func (s *zincTweetSearchServant) queryByContent(user *ms.User, q *core.QueryReq, offset, limit int) (*core.QueryResp, error) { resp, err := s.client.EsQuery(s.indexName, map[string]any{ "query": map[string]any{ "match_phrase": map[string]any{ @@ -111,7 +112,7 @@ func (s *zincTweetSearchServant) queryByContent(user *core.User, q *core.QueryRe return s.postsFrom(resp) } -func (s *zincTweetSearchServant) queryByTag(user *core.User, q *core.QueryReq, offset, limit int) (*core.QueryResp, error) { +func (s *zincTweetSearchServant) queryByTag(user *ms.User, q *core.QueryReq, offset, limit int) (*core.QueryResp, error) { resp, err := s.client.ApiQuery(s.indexName, map[string]any{ "search_type": "querystring", "query": map[string]any{ @@ -127,7 +128,7 @@ func (s *zincTweetSearchServant) queryByTag(user *core.User, q *core.QueryReq, o return s.postsFrom(resp) } -func (s *zincTweetSearchServant) queryAny(user *core.User, offset, limit int) (*core.QueryResp, error) { +func (s *zincTweetSearchServant) queryAny(user *ms.User, offset, limit int) (*core.QueryResp, error) { queryMap := map[string]any{ "query": map[string]any{ "match_all": map[string]string{}, @@ -144,9 +145,9 @@ func (s *zincTweetSearchServant) queryAny(user *core.User, offset, limit int) (* } func (s *zincTweetSearchServant) postsFrom(resp *zinc.QueryResultT) (*core.QueryResp, error) { - posts := make([]*core.PostFormated, 0, len(resp.Hits.Hits)) + posts := make([]*ms.PostFormated, 0, len(resp.Hits.Hits)) for _, hit := range resp.Hits.Hits { - item := &core.PostFormated{} + item := &ms.PostFormated{} raw, err := json.Marshal(hit.Source) if err != nil { return nil, err diff --git a/internal/dao/security/phone_verify_juhe.go b/internal/dao/security/phone_verify_juhe.go index 5981c6c3..c213d380 100644 --- a/internal/dao/security/phone_verify_juhe.go +++ b/internal/dao/security/phone_verify_juhe.go @@ -1,11 +1,11 @@ package security import ( - "errors" "fmt" "net/http" "time" + "github.com/cockroachdb/errors" "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/pkg/json" diff --git a/internal/dao/slonik/slonik.go b/internal/dao/slonik/slonik.go index bb8f82ad..705c5bbf 100644 --- a/internal/dao/slonik/slonik.go +++ b/internal/dao/slonik/slonik.go @@ -17,6 +17,11 @@ func NewDataService() (core.DataService, core.VersionInfo) { return nil, nil } +func NewWebDataServantA() (core.WebDataServantA, core.VersionInfo) { + logrus.Fatal("not support now") + return nil, nil +} + func NewAuthorizationManageService() core.AuthorizationManageService { logrus.Fatal("not support now") return nil diff --git a/internal/dao/storage/localoss.go b/internal/dao/storage/localoss.go index 584fea91..10131d29 100644 --- a/internal/dao/storage/localoss.go +++ b/internal/dao/storage/localoss.go @@ -5,7 +5,6 @@ package storage import ( - "errors" "fmt" "io" "os" @@ -14,6 +13,7 @@ import ( "time" "github.com/Masterminds/semver/v3" + "github.com/cockroachdb/errors" "github.com/rocboss/paopao-ce/internal/core" "github.com/sirupsen/logrus" ) diff --git a/internal/ims/README.md b/internal/ims/README.md deleted file mode 100644 index d095421b..00000000 --- a/internal/ims/README.md +++ /dev/null @@ -1,2 +0,0 @@ -### IMS(Instant Message Push System) -消息推送模块,用于优化@、私信、系统通知等消息服务,目前还没实现,先占个位置~ diff --git a/internal/ims/ims.go b/internal/ims/ims.go deleted file mode 100644 index 1042e45d..00000000 --- a/internal/ims/ims.go +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package ims diff --git a/internal/internal.go b/internal/internal.go index a8c0934f..926c9f75 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -6,15 +6,9 @@ package internal import ( "github.com/rocboss/paopao-ce/internal/migration" - "github.com/rocboss/paopao-ce/internal/servants/web/broker" - "github.com/rocboss/paopao-ce/internal/servants/web/routers/api" ) -func Initialize() { +func Initial() { // migrate database if needed migration.Run() - - // initialize service - broker.Initialize() - api.Initialize() } diff --git a/internal/migration/migration_embed.go b/internal/migration/migration_embed.go index 02ede293..c2232d29 100644 --- a/internal/migration/migration_embed.go +++ b/internal/migration/migration_embed.go @@ -42,9 +42,9 @@ func Run() { db, err = sql.Open("mysql", conf.MysqlSetting.Dsn()+"&multiStatements=true") } else if cfg.If("PostgreSQL") || cfg.If("Postgres") { dbName = (*conf.PostgresSetting)["DBName"] - db, err = sql.Open("postgres", conf.PostgresSetting.Dsn()) + db, err = sql.Open("pgx", conf.PostgresSetting.Dsn()) } else if cfg.If("Sqlite3") { - db, err = conf.OpenSqlite3() + _, db, err = conf.OpenSqlite3() } else { dbName = conf.MysqlSetting.DBName db, err = sql.Open("mysql", conf.MysqlSetting.Dsn()) diff --git a/internal/model/web/alipay.go b/internal/model/web/alipay.go index 84746309..6bfa674f 100644 --- a/internal/model/web/alipay.go +++ b/internal/model/web/alipay.go @@ -7,7 +7,14 @@ package web import ( "context" + "github.com/alimy/mir/v4" + "github.com/gin-gonic/gin" + "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/servants/base" + "github.com/rocboss/paopao-ce/pkg/app" + "github.com/rocboss/paopao-ce/pkg/convert" + "github.com/rocboss/paopao-ce/pkg/xerror" + "github.com/sirupsen/logrus" "github.com/smartwalle/alipay/v3" ) @@ -46,3 +53,44 @@ type AlipayNotifyReq struct { TradeNo string TradeStatus alipay.TradeStatus } + +func (r *AlipayNotifyReq) Bind(c *gin.Context) mir.Error { + if err := c.Request.ParseForm(); err != nil { + logrus.Errorf("parse form err: %s", err) + return ErrRechargeNotifyError + } + noti, err := conf.MustAlipayClient().GetTradeNotification(c.Request) + if err != nil { + logrus.Errorf("alipayClient.GetTradeNotification err: %s form: %v", err, c.Request.Form) + return ErrRechargeNotifyError + } + r.Ctx = c.Request.Context() + r.ID = convert.StrTo(noti.OutTradeNo).MustInt64() + r.TradeNo, r.TradeStatus = noti.TradeNo, noti.TradeStatus + + return nil +} + +func (r *UserWalletBillsReq) Bind(c *gin.Context) mir.Error { + uid, ok := base.UserIdFrom(c) + if !ok { + return xerror.UnauthorizedTokenError + } + r.UserId = uid + r.Page, r.PageSize = app.GetPageInfo(c) + return nil +} + +func (r *UserRechargeLinkReq) Bind(c *gin.Context) mir.Error { + r.Host = c.Request.Host + return bindAny(c, r) +} + +func (r *UserRechargeResultReq) Bind(c *gin.Context) mir.Error { + uid, exist := base.UserIdFrom(c) + if !exist { + return xerror.UnauthorizedTokenError + } + r.UserId, r.Id = uid, convert.StrTo(c.Query("id")).MustInt64() + return nil +} diff --git a/internal/model/web/core.go b/internal/model/web/core.go index b5fa497b..a697fec7 100644 --- a/internal/model/web/core.go +++ b/internal/model/web/core.go @@ -5,7 +5,11 @@ package web import ( + "github.com/alimy/mir/v4" + "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/servants/base" + "github.com/rocboss/paopao-ce/pkg/convert" + "github.com/rocboss/paopao-ce/pkg/xerror" ) type ChangeAvatarReq struct { @@ -111,3 +115,58 @@ type TweetCollectionStatusReq struct { type TweetCollectionStatusResp struct { Status bool `json:"status"` } + +func (r *UserInfoReq) Bind(c *gin.Context) mir.Error { + username, exist := base.UserNameFrom(c) + if !exist { + return xerror.UnauthorizedAuthNotExist + } + r.Username = username + return nil +} + +func (r *GetMessagesReq) Bind(c *gin.Context) mir.Error { + return (*BasePageReq)(r).Bind(c) +} + +func (r *GetCollectionsReq) Bind(c *gin.Context) mir.Error { + return (*BasePageReq)(r).Bind(c) +} + +func (r *GetStarsReq) Bind(c *gin.Context) mir.Error { + return (*BasePageReq)(r).Bind(c) +} + +func (r *SuggestTagsReq) Bind(c *gin.Context) mir.Error { + r.Keyword = c.Query("k") + return nil +} + +func (r *SuggestUsersReq) Bind(c *gin.Context) mir.Error { + r.Keyword = c.Query("k") + return nil +} + +func (r *TweetCollectionStatusReq) Bind(c *gin.Context) mir.Error { + userId, exist := base.UserIdFrom(c) + if !exist { + return xerror.UnauthorizedAuthNotExist + } + r.SimpleInfo = SimpleInfo{ + Uid: userId, + } + r.TweetId = convert.StrTo(c.Query("id")).MustInt64() + return nil +} + +func (r *TweetStarStatusReq) Bind(c *gin.Context) mir.Error { + UserId, exist := base.UserIdFrom(c) + if !exist { + return xerror.UnauthorizedAuthNotExist + } + r.SimpleInfo = SimpleInfo{ + Uid: UserId, + } + r.TweetId = convert.StrTo(c.Query("id")).MustInt64() + return nil +} diff --git a/internal/model/web/loose.go b/internal/model/web/loose.go index e505e35b..0f6f863e 100644 --- a/internal/model/web/loose.go +++ b/internal/model/web/loose.go @@ -5,10 +5,41 @@ package web import ( + "github.com/alimy/mir/v4" + "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" "github.com/rocboss/paopao-ce/internal/servants/base" + "github.com/rocboss/paopao-ce/pkg/app" ) +const ( + TagTypeHot = cs.TagTypeHot + TagTypeNew = cs.TagTypeNew + TagTypeFollow = cs.TagTypeFollow + TagTypeHotExtral = cs.TagTypeHotExtral +) + +const ( + UserPostsStylePost = "post" + UserPostsStyleComment = "comment" + UserPostsStyleHighlight = "highlight" + UserPostsStyleMedia = "media" + UserPostsStyleStar = "star" +) + +type TagType = cs.TagType + +type TweetCommentsReq struct { + SimpleInfo `form:"-" binding:"-"` + TweetId int64 `form:"id" binding:"required"` + SortStrategy string `form:"sort_strategy"` + Page int `form:"-" binding:"-"` + PageSize int `form:"-" binding:"-"` +} + +type TweetCommentsResp base.PageResp + type TimelineReq struct { BaseInfo `form:"-" binding:"-"` Query string `form:"query"` @@ -23,6 +54,7 @@ type TimelineResp base.PageResp type GetUserTweetsReq struct { BaseInfo `form:"-" binding:"-"` Username string `form:"username" binding:"required"` + Style string `form:"style"` Page int `form:"-" binding:"-"` PageSize int `form:"-" binding:"-"` } @@ -44,6 +76,34 @@ type GetUserProfileResp struct { IsFriend bool `json:"is_friend"` } +type TopicListReq struct { + SimpleInfo `form:"-" binding:"-"` + Type TagType `json:"type" form:"type" binding:"required"` + Num int `json:"num" form:"num" binding:"required"` + ExtralNum int `json:"extral_num" form:"extral_num"` +} + +// TopicListResp 主题返回值 +// TODO: 优化内容定义 +type TopicListResp struct { + Topics cs.TagList `json:"topics"` + ExtralTopics cs.TagList `json:"extral_topics,omitempty"` +} + func (r *GetUserTweetsReq) SetPageInfo(page int, pageSize int) { r.Page, r.PageSize = page, pageSize } + +func (r *TweetCommentsReq) SetPageInfo(page int, pageSize int) { + r.Page, r.PageSize = page, pageSize +} + +func (r *TimelineReq) Bind(c *gin.Context) mir.Error { + user, _ := base.UserFrom(c) + r.BaseInfo = BaseInfo{ + User: user, + } + r.Page, r.PageSize = app.GetPageInfo(c) + r.Query, r.Type = c.Query("query"), "search" + return nil +} diff --git a/internal/model/web/priv.go b/internal/model/web/priv.go index 8a568bd8..7ce1aba0 100644 --- a/internal/model/web/priv.go +++ b/internal/model/web/priv.go @@ -9,13 +9,32 @@ import ( "mime/multipart" "strings" + "github.com/alimy/mir/v4" + "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/internal/servants/base" + "github.com/rocboss/paopao-ce/pkg/convert" + "github.com/rocboss/paopao-ce/pkg/xerror" ) +type TweetCommentThumbsReq struct { + SimpleInfo `json:"-" binding:"-"` + TweetId int64 `json:"tweet_id" binding:"required"` + CommentId int64 `json:"comment_id" binding:"required"` +} + +type TweetReplyThumbsReq struct { + SimpleInfo `json:"-" binding:"-"` + TweetId int64 `json:"tweet_id" binding:"required"` + CommentId int64 `json:"comment_id" binding:"required"` + ReplyId int64 `json:"reply_id" binding:"required"` +} + type PostContentItem struct { - Content string `json:"content" binding:"required"` - Type core.PostContentT `json:"type" binding:"required"` - Sort int64 `json:"sort" binding:"required"` + Content string `json:"content" binding:"required"` + Type ms.PostContentT `json:"type" binding:"required"` + Sort int64 `json:"sort" binding:"required"` } type CreateTweetReq struct { @@ -28,7 +47,7 @@ type CreateTweetReq struct { ClientIP string `json:"-" binding:"-"` } -type CreateTweetResp core.PostFormated +type CreateTweetResp ms.PostFormated type DeleteTweetReq struct { BaseInfo `json:"-" binding:"-"` @@ -67,10 +86,19 @@ type StickTweetReq struct { ID int64 `json:"id" binding:"required"` } +type HighlightTweetReq struct { + BaseInfo `json:"-" binding:"-"` + ID int64 `json:"id" binding:"required"` +} + type StickTweetResp struct { StickStatus int `json:"top_status"` } +type HighlightTweetResp struct { + HighlightStatus int `json:"highlight_status"` +} + type VisibleTweetReq struct { BaseInfo `json:"-" binding:"-"` ID int64 `json:"id"` @@ -89,7 +117,7 @@ type CreateCommentReq struct { ClientIP string `json:"-" binding:"-"` } -type CreateCommentResp core.Comment +type CreateCommentResp ms.Comment type CreateCommentReplyReq struct { SimpleInfo `json:"-" binding:"-"` @@ -99,7 +127,7 @@ type CreateCommentReplyReq struct { ClientIP string `json:"-" binding:"-"` } -type CreateCommentReplyResp core.CommentReply +type CreateCommentReplyResp ms.CommentReply type DeleteCommentReq struct { BaseInfo `json:"-" binding:"-"` @@ -120,12 +148,12 @@ type UploadAttachmentReq struct { } type UploadAttachmentResp struct { - UserID int64 `json:"user_id"` - FileSize int64 `json:"file_size"` - ImgWidth int `json:"img_width"` - ImgHeight int `json:"img_height"` - Type core.AttachmentType `json:"type"` - Content string `json:"content"` + UserID int64 `json:"user_id"` + FileSize int64 `json:"file_size"` + ImgWidth int `json:"img_width"` + ImgHeight int `json:"img_height"` + Type ms.AttachmentType `json:"type"` + Content string `json:"content"` } type DownloadAttachmentPrecheckReq struct { @@ -146,19 +174,110 @@ type DownloadAttachmentResp struct { SignedURL string `json:"signed_url"` } +type StickTopicReq struct { + SimpleInfo `json:"-" binding:"-"` + TopicId int64 `json:"topic_id" binding:"required"` +} + +type StickTopicResp struct { + StickStatus int8 `json:"top_status"` +} + +type FollowTopicReq struct { + SimpleInfo `json:"-" binding:"-"` + TopicId int64 `json:"topic_id" binding:"required"` +} + +type UnfollowTopicReq struct { + SimpleInfo `json:"-" binding:"-"` + TopicId int64 `json:"topic_id" binding:"required"` +} + // Check 检查PostContentItem属性 func (p *PostContentItem) Check(acs core.AttachmentCheckService) error { // 检查附件是否是本站资源 - if p.Type == core.ContentTypeImage || p.Type == core.ContentTypeVideo || p.Type == core.ContentTypeAttachment { + if p.Type == ms.ContentTypeImage || p.Type == ms.ContentTypeVideo || p.Type == ms.ContentTypeAttachment { if err := acs.CheckAttachment(p.Content); err != nil { return err } } // 检查链接是否合法 - if p.Type == core.ContentTypeLink { + if p.Type == ms.ContentTypeLink { if strings.Index(p.Content, "http://") != 0 && strings.Index(p.Content, "https://") != 0 { return fmt.Errorf("链接不合法") } } return nil } + +func (r *UploadAttachmentReq) Bind(c *gin.Context) (xerr mir.Error) { + userId, exist := base.UserIdFrom(c) + if !exist { + return xerror.UnauthorizedAuthNotExist + } + + uploadType := c.Request.FormValue("type") + file, fileHeader, err := c.Request.FormFile("file") + if err != nil { + return ErrFileUploadFailed + } + defer func() { + if xerr != nil { + file.Close() + } + }() + + if err := fileCheck(uploadType, fileHeader.Size); err != nil { + return err + } + contentType := fileHeader.Header.Get("Content-Type") + fileExt, xerr := getFileExt(contentType) + if xerr != nil { + return xerr + } + r.SimpleInfo = SimpleInfo{ + Uid: userId, + } + r.UploadType, r.ContentType = uploadType, contentType + r.File, r.FileSize, r.FileExt = file, fileHeader.Size, fileExt + return nil +} + +func (r *DownloadAttachmentPrecheckReq) Bind(c *gin.Context) mir.Error { + user, exist := base.UserFrom(c) + if !exist { + return xerror.UnauthorizedAuthNotExist + } + r.BaseInfo = BaseInfo{ + User: user, + } + r.ContentID = convert.StrTo(c.Query("id")).MustInt64() + return nil +} + +func (r *DownloadAttachmentReq) Bind(c *gin.Context) mir.Error { + user, exist := base.UserFrom(c) + if !exist { + return xerror.UnauthorizedAuthNotExist + } + r.BaseInfo = BaseInfo{ + User: user, + } + r.ContentID = convert.StrTo(c.Query("id")).MustInt64() + return nil +} + +func (r *CreateTweetReq) Bind(c *gin.Context) mir.Error { + r.ClientIP = c.ClientIP() + return bindAny(c, r) +} + +func (r *CreateCommentReplyReq) Bind(c *gin.Context) mir.Error { + r.ClientIP = c.ClientIP() + return bindAny(c, r) +} + +func (r *CreateCommentReq) Bind(c *gin.Context) mir.Error { + r.ClientIP = c.ClientIP() + return bindAny(c, r) +} diff --git a/internal/model/web/pub.go b/internal/model/web/pub.go index a951b33a..058288e8 100644 --- a/internal/model/web/pub.go +++ b/internal/model/web/pub.go @@ -5,42 +5,15 @@ package web import ( - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/internal/servants/base" - "github.com/rocboss/paopao-ce/pkg/debug" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/pkg/version" ) -const ( - TagTypeHot TagType = "hot" - TagTypeNew TagType = "new" -) - -type TagType string - type TweetDetailReq struct { TweetId int64 `form:"id"` } -type TweetDetailResp core.PostFormated - -type TweetCommentsReq struct { - TweetId int64 `form:"id"` - Page int `form:"-"` - PageSize int `form:"-"` -} - -type TweetCommentsResp base.PageResp - -type TopicListReq struct { - Type TagType `json:"type" form:"type" binding:"required"` - Num int `json:"num" form:"num" binding:"required"` -} - -// TopicListResp 主题返回值 -// TODO: 优化内容定义 -type TopicListResp struct { - Topics []*core.TagFormated `json:"topics"` -} +type TweetDetailResp ms.PostFormated type GetCaptchaResp struct { Id string `json:"id"` @@ -54,7 +27,7 @@ type SendCaptchaReq struct { } type VersionResp struct { - BuildInfo *debug.BuildInfo `json:"build_info"` + BuildInfo *version.BuildInfo `json:"build_info"` } type LoginReq struct { diff --git a/internal/model/web/utils.go b/internal/model/web/utils.go new file mode 100644 index 00000000..06436d72 --- /dev/null +++ b/internal/model/web/utils.go @@ -0,0 +1,47 @@ +// Copyright 2022 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +import ( + "github.com/alimy/mir/v4" + "github.com/rocboss/paopao-ce/pkg/xerror" +) + +func fileCheck(uploadType string, size int64) mir.Error { + if uploadType != "public/video" && + uploadType != "public/image" && + uploadType != "public/avatar" && + uploadType != "attachment" { + return xerror.InvalidParams + } + if size > 1024*1024*100 { + return ErrFileInvalidSize.WithDetails("最大允许100MB") + } + return nil +} + +func getFileExt(s string) (string, mir.Error) { + switch s { + case "image/png": + return ".png", nil + case "image/jpg": + return ".jpg", nil + case "image/jpeg": + return ".jpeg", nil + case "image/gif": + return ".gif", nil + case "video/mp4": + return ".mp4", nil + case "video/quicktime": + return ".mov", nil + case "application/zip", + "application/x-zip", + "application/octet-stream", + "application/x-zip-compressed": + return ".zip", nil + default: + return "", ErrFileInvalidExt.WithDetails("仅允许 png/jpg/gif/mp4/mov/zip 类型") + } +} diff --git a/internal/model/web/web.go b/internal/model/web/web.go index bec917fa..d197bb19 100644 --- a/internal/model/web/web.go +++ b/internal/model/web/web.go @@ -5,16 +5,20 @@ package web import ( - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/pkg/app" "github.com/rocboss/paopao-ce/pkg/xerror" ) +var ( + bindAny = base.NewBindAnyFn() +) + type BaseInfo struct { - User *core.User + User *ms.User } type SimpleInfo struct { @@ -27,7 +31,7 @@ type BasePageReq struct { PageSize int } -func (b *BaseInfo) SetUser(user *core.User) { +func (b *BaseInfo) SetUser(user *ms.User) { b.User = user } @@ -47,3 +51,13 @@ func BasePageReqFrom(c *gin.Context) (*BasePageReq, mir.Error) { PageSize: pageSize, }, nil } + +func (r *BasePageReq) Bind(c *gin.Context) mir.Error { + uid, ok := base.UserIdFrom(c) + if !ok { + return xerror.UnauthorizedTokenError + } + r.UserId = uid + r.Page, r.PageSize = app.GetPageInfo(c) + return nil +} diff --git a/internal/model/web/xerror.go b/internal/model/web/xerror.go new file mode 100644 index 00000000..471196f6 --- /dev/null +++ b/internal/model/web/xerror.go @@ -0,0 +1,96 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package web + +import ( + "github.com/rocboss/paopao-ce/pkg/xerror" +) + +// nolint +var ( + ErrUsernameHasExisted = xerror.NewError(20001, "用户名已存在") + ErrUsernameLengthLimit = xerror.NewError(20002, "用户名长度3~12") + ErrUsernameCharLimit = xerror.NewError(20003, "用户名只能包含字母、数字") + ErrPasswordLengthLimit = xerror.NewError(20004, "密码长度6~16") + ErrUserRegisterFailed = xerror.NewError(20005, "用户注册失败") + ErrUserHasBeenBanned = xerror.NewError(20006, "该账户已被封停") + ErrNoPermission = xerror.NewError(20007, "无权限执行该请求") + ErrUserHasBindOTP = xerror.NewError(20008, "当前用户已绑定二次验证") + ErrUserOTPInvalid = xerror.NewError(20009, "二次验证码验证失败") + ErrUserNoBindOTP = xerror.NewError(20010, "当前用户未绑定二次验证") + ErrErrorOldPassword = xerror.NewError(20011, "当前用户密码验证失败") + ErrErrorCaptchaPassword = xerror.NewError(20012, "图形验证码验证失败") + ErrAccountNoPhoneBind = xerror.NewError(20013, "拒绝操作: 账户未绑定手机号") + ErrTooManyLoginError = xerror.NewError(20014, "登录失败次数过多,请稍后再试") + ErrGetPhoneCaptchaError = xerror.NewError(20015, "短信验证码获取失败") + ErrTooManyPhoneCaptchaSend = xerror.NewError(20016, "短信验证码获取次数已达今日上限") + ErrExistedUserPhone = xerror.NewError(20017, "该手机号已被绑定") + ErrErrorPhoneCaptcha = xerror.NewError(20018, "手机验证码不正确") + ErrMaxPhoneCaptchaUseTimes = xerror.NewError(20019, "手机验证码已达最大使用次数") + ErrNicknameLengthLimit = xerror.NewError(20020, "昵称长度2~12") + ErrNoExistUsername = xerror.NewError(20021, "用户不存在") + ErrNoAdminPermission = xerror.NewError(20022, "无管理权限") + ErrDisallowUserRegister = xerror.NewError(20023, "系统不允许注册用户") + + ErrGetPostsFailed = xerror.NewError(30001, "获取动态列表失败") + ErrCreatePostFailed = xerror.NewError(30002, "动态发布失败") + ErrGetPostFailed = xerror.NewError(30003, "获取动态详情失败") + ErrDeletePostFailed = xerror.NewError(30004, "动态删除失败") + ErrLockPostFailed = xerror.NewError(30005, "动态锁定失败") + ErrGetPostTagsFailed = xerror.NewError(30006, "获取话题列表失败") + ErrInvalidDownloadReq = xerror.NewError(30007, "附件下载请求不合法") + ErrDownloadReqError = xerror.NewError(30008, "附件下载请求失败") + ErrInsuffientDownloadMoney = xerror.NewError(30009, "附件下载失败:账户资金不足") + ErrDownloadExecFail = xerror.NewError(30010, "附件下载失败:扣费失败") + ErrStickPostFailed = xerror.NewError(30011, "动态置顶失败") + ErrVisblePostFailed = xerror.NewError(30012, "更新可见性失败") + ErrHighlightPostFailed = xerror.NewError(30013, "动态设为亮点失败") + + ErrGetCommentsFailed = xerror.NewError(40001, "获取评论列表失败") + ErrCreateCommentFailed = xerror.NewError(40002, "评论发布失败") + ErrGetCommentFailed = xerror.NewError(40003, "获取评论详情失败") + ErrDeleteCommentFailed = xerror.NewError(40004, "评论删除失败") + ErrCreateReplyFailed = xerror.NewError(40005, "评论回复失败") + ErrGetReplyFailed = xerror.NewError(40006, "获取评论详情失败") + ErrMaxCommentCount = xerror.NewError(40007, "评论数已达最大限制") + ErrGetCommentThumbs = xerror.NewError(40008, "获取评论点赞信息失败") + + ErrGetMessagesFailed = xerror.NewError(50001, "获取消息列表失败") + ErrReadMessageFailed = xerror.NewError(50002, "标记消息已读失败") + ErrSendWhisperFailed = xerror.NewError(50003, "私信发送失败") + ErrNoWhisperToSelf = xerror.NewError(50004, "不允许给自己发送私信") + ErrTooManyWhisperNum = xerror.NewError(50005, "今日私信次数已达上限") + + ErrGetCollectionsFailed = xerror.NewError(60001, "获取收藏列表失败") + ErrGetStarsFailed = xerror.NewError(60002, "获取点赞列表失败") + + ErrRechargeReqFail = xerror.NewError(70001, "充值请求失败") + ErrRechargeNotifyError = xerror.NewError(70002, "充值回调失败") + ErrGetRechargeFailed = xerror.NewError(70003, "充值详情获取失败") + ErrUserWalletBillsFailed = xerror.NewError(70004, "用户钱包账单获取失败") + + ErrNoRequestingFriendToSelf = xerror.NewError(80001, "不允许添加自己为好友") + ErrNotExistFriendId = xerror.NewError(80002, "好友id不存在") + ErrSendRequestingFriendFailed = xerror.NewError(80003, "申请添加朋友请求发送失败") + ErrAddFriendFailed = xerror.NewError(80004, "添加好友失败") + ErrRejectFriendFailed = xerror.NewError(80005, "拒绝好友失败") + ErrDeleteFriendFailed = xerror.NewError(80006, "删除好友失败") + ErrGetContactsFailed = xerror.NewError(80007, "获取联系人列表失败") + ErrNoActionToSelf = xerror.NewError(80008, "不允许对自己操作") + + ErrFollowTopicFailed = xerror.NewError(90001, "关注话题失败") + ErrUnfollowTopicFailed = xerror.NewError(90002, "取消关注话题失败") + ErrStickTopicFailed = xerror.NewError(90003, "更行话题置顶状态失败") + ErrThumbsUpTweetComment = xerror.NewError(90101, "评论点赞失败") + ErrThumbsDownTweetComment = xerror.NewError(90102, "评论点踩失败") + ErrThumbsUpTweetReply = xerror.NewError(90103, "评论回复点赞失败") + ErrThumbsDownTweetReply = xerror.NewError(90104, "评论回复点踩失败") + + ErrFileUploadFailed = xerror.NewError(10200, "文件上传失败") + ErrFileInvalidExt = xerror.NewError(10201, "文件类型不合法") + ErrFileInvalidSize = xerror.NewError(10202, "文件大小超限") + + ErrNotImplemented = xerror.NewError(10501, "功能未实现") +) diff --git a/internal/obs/README.md b/internal/obs/README.md deleted file mode 100644 index f56a1ef9..00000000 --- a/internal/obs/README.md +++ /dev/null @@ -1,2 +0,0 @@ -### OBS(Object Blob Storage System) -简单对象存储模块,目前还没实现,先占个位置~ diff --git a/internal/obs/obs.go b/internal/obs/obs.go deleted file mode 100644 index 13923b07..00000000 --- a/internal/obs/obs.go +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package obs diff --git a/internal/servants/admin/admin.go b/internal/servants/admin/admin.go index 409bdd78..26806940 100644 --- a/internal/servants/admin/admin.go +++ b/internal/servants/admin/admin.go @@ -11,5 +11,5 @@ import ( // RouteWeb register Manager route func RouteManager(e *gin.Engine) { - api.RegisterUserServant(e, newUserSrv(), newUserBinding(), newUserRender()) + api.RegisterUserServant(e, newUserSrv()) } diff --git a/internal/servants/admin/user.go b/internal/servants/admin/user.go index fef348cf..5713a205 100644 --- a/internal/servants/admin/user.go +++ b/internal/servants/admin/user.go @@ -10,42 +10,16 @@ import ( ) var ( - _ api.User = (*userSrv)(nil) - _ api.UserBinding = (*userBinding)(nil) - _ api.UserRender = (*userRender)(nil) + _ api.User = (*userSrv)(nil) ) type userSrv struct { - base.BaseServant + *base.BaseServant api.UnimplementedUserServant } -type userBinding struct { - base.BaseBinding - *api.UnimplementedUserBinding -} - -type userRender struct { - base.BaseRender - *api.UnimplementedUserRender -} - func newUserSrv() api.User { - return &userSrv{} -} - -func newUserBinding() api.UserBinding { - return &userBinding{ - UnimplementedUserBinding: &api.UnimplementedUserBinding{ - BindAny: base.BindAny, - }, - } -} - -func newUserRender() api.UserRender { - return &userRender{ - UnimplementedUserRender: &api.UnimplementedUserRender{ - RenderAny: base.RenderAny, - }, + return &userSrv{ + BaseServant: base.NewBaseServant(), } } diff --git a/internal/servants/base/base.go b/internal/servants/base/base.go index 16599ac8..e94e75af 100644 --- a/internal/servants/base/base.go +++ b/internal/servants/base/base.go @@ -9,37 +9,48 @@ import ( "fmt" "math" "net/http" - "time" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" + "github.com/cockroachdb/errors" + "github.com/getsentry/sentry-go" + sentrygin "github.com/getsentry/sentry-go/gin" "github.com/gin-gonic/gin" - "github.com/go-redis/redis/v8" + "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/internal/dao" + "github.com/rocboss/paopao-ce/internal/dao/cache" "github.com/rocboss/paopao-ce/pkg/app" - "github.com/rocboss/paopao-ce/pkg/types" "github.com/rocboss/paopao-ce/pkg/xerror" + "github.com/sirupsen/logrus" ) -type BaseServant types.Empty +type BaseServant struct { + bindAny func(c *gin.Context, obj any) mir.Error +} type DaoServant struct { - Redis *redis.Client + *BaseServant + + Dsa core.WebDataServantA Ds core.DataService Ts core.TweetSearchService + Redis core.RedisCache } -type BaseBinding types.Empty - -type BaseRender types.Empty - type JsonResp struct { Code int `json:"code"` Msg string `json:"msg,omitempty"` Data any `json:"data,omitempty"` } +type SentryHubSetter interface { + SetSentryHub(hub *sentry.Hub) +} + type UserSetter interface { - SetUser(*core.User) + SetUser(*ms.User) } type UserIdSetter interface { @@ -50,9 +61,9 @@ type PageInfoSetter interface { SetPageInfo(page, pageSize int) } -func UserFrom(c *gin.Context) (*core.User, bool) { +func UserFrom(c *gin.Context) (*ms.User, bool) { if u, exists := c.Get("USER"); exists { - user, ok := u.(*core.User) + user, ok := u.(*ms.User) return user, ok } return nil, false @@ -74,7 +85,7 @@ func UserNameFrom(c *gin.Context) (string, bool) { return "", false } -func BindAny(c *gin.Context, obj any) mir.Error { +func bindAny(c *gin.Context, obj any) mir.Error { var errs xerror.ValidErrors err := c.ShouldBind(obj) if err != nil { @@ -98,6 +109,40 @@ func BindAny(c *gin.Context, obj any) mir.Error { return nil } +func bindAnySentry(c *gin.Context, obj any) mir.Error { + hub := sentrygin.GetHubFromContext(c) + var errs xerror.ValidErrors + err := c.ShouldBind(obj) + if err != nil { + xerr := mir.NewError(xerror.InvalidParams.StatusCode(), xerror.InvalidParams.WithDetails(errs.Error())) + if hub != nil { + hub.CaptureException(errors.Wrap(xerr, "bind object")) + } + return xerr + } + // setup sentry hub if needed + if setter, ok := obj.(SentryHubSetter); ok && hub != nil { + setter.SetSentryHub(hub) + } + // setup *core.User if needed + if setter, ok := obj.(UserSetter); ok { + user, _ := UserFrom(c) + setter.SetUser(user) + } + // setup UserId if needed + if setter, ok := obj.(UserIdSetter); ok { + uid, _ := UserIdFrom(c) + setter.SetUserId(uid) + } + // setup PageInfo if needed + if setter, ok := obj.(PageInfoSetter); ok { + page, pageSize := app.GetPageInfo(c) + setter.SetPageInfo(page, pageSize) + } + return nil + +} + func RenderAny(c *gin.Context, data any, err mir.Error) { if err == nil { c.JSON(http.StatusOK, &JsonResp{ @@ -113,7 +158,26 @@ func RenderAny(c *gin.Context, data any, err mir.Error) { } } -func (s *DaoServant) GetTweetBy(id int64) (*core.PostFormated, error) { +func (s *BaseServant) Bind(c *gin.Context, obj any) mir.Error { + return s.bindAny(c, obj) +} + +func (s *BaseServant) Render(c *gin.Context, data any, err mir.Error) { + if err == nil { + c.JSON(http.StatusOK, &JsonResp{ + Code: 0, + Msg: "success", + Data: data, + }) + } else { + c.JSON(xerror.HttpStatusCode(err), &JsonResp{ + Code: err.StatusCode(), + Msg: err.Error(), + }) + } +} + +func (s *DaoServant) GetTweetBy(id int64) (*ms.PostFormated, error) { post, err := s.Ds.GetPostByID(id) if err != nil { return nil, err @@ -140,24 +204,25 @@ func (s *DaoServant) GetTweetBy(id int64) (*core.PostFormated, error) { } func (s *DaoServant) PushPostsToSearch(c context.Context) { - if ok, _ := s.Redis.SetNX(c, "JOB_PUSH_TO_SEARCH", 1, time.Hour).Result(); ok { - defer s.Redis.Del(c, "JOB_PUSH_TO_SEARCH") + if err := s.Redis.SetPushToSearchJob(c); err == nil { + defer s.Redis.DelPushToSearchJob(c) splitNum := 1000 - totalRows, _ := s.Ds.GetPostCount(&core.ConditionsT{ + conditions := ms.ConditionsT{ "visibility IN ?": []core.PostVisibleT{core.PostVisitPublic, core.PostVisitFriend}, - }) + } + totalRows, _ := s.Ds.GetPostCount(conditions) pages := math.Ceil(float64(totalRows) / float64(splitNum)) nums := int(pages) for i := 0; i < nums; i++ { - posts, postsFormated, err := s.GetTweetList(&core.ConditionsT{}, i*splitNum, splitNum) + posts, postsFormated, err := s.GetTweetList(conditions, i*splitNum, splitNum) if err != nil || len(posts) != len(postsFormated) { continue } for i, pf := range postsFormated { contentFormated := "" for _, content := range pf.Contents { - if content.Type == core.ContentTypeText || content.Type == core.ContentTypeTitle { + if content.Type == ms.ContentTypeText || content.Type == ms.ContentTypeTitle { contentFormated = contentFormated + content.Content + "\n" } } @@ -168,12 +233,14 @@ func (s *DaoServant) PushPostsToSearch(c context.Context) { s.Ts.AddDocuments(docs, fmt.Sprintf("%d", posts[i].ID)) } } + } else { + logrus.Errorf("redis: set JOB_PUSH_TO_SEARCH error: %s", err) } } -func (s *DaoServant) PushPostToSearch(post *core.Post) { +func (s *DaoServant) PushPostToSearch(post *ms.Post) { postFormated := post.Format() - postFormated.User = &core.UserFormated{ + postFormated.User = &ms.UserFormated{ ID: post.UserID, } contents, _ := s.Ds.GetPostContentsByIDs([]int64{post.ID}) @@ -183,7 +250,7 @@ func (s *DaoServant) PushPostToSearch(post *core.Post) { contentFormated := "" for _, content := range postFormated.Contents { - if content.Type == core.ContentTypeText || content.Type == core.ContentTypeTitle { + if content.Type == ms.ContentTypeText || content.Type == ms.ContentTypeTitle { contentFormated = contentFormated + content.Content + "\n" } } @@ -195,11 +262,11 @@ func (s *DaoServant) PushPostToSearch(post *core.Post) { s.Ts.AddDocuments(docs, fmt.Sprintf("%d", post.ID)) } -func (s *DaoServant) DeleteSearchPost(post *core.Post) error { +func (s *DaoServant) DeleteSearchPost(post *ms.Post) error { return s.Ts.DeleteDocuments([]string{fmt.Sprintf("%d", post.ID)}) } -func (s *DaoServant) GetTweetList(conditions *core.ConditionsT, offset, limit int) ([]*core.Post, []*core.PostFormated, error) { +func (s *DaoServant) GetTweetList(conditions ms.ConditionsT, offset, limit int) ([]*ms.Post, []*ms.PostFormated, error) { posts, err := s.Ds.GetPosts(conditions, offset, limit) if err != nil { return nil, nil, err @@ -207,3 +274,57 @@ func (s *DaoServant) GetTweetList(conditions *core.ConditionsT, offset, limit in postFormated, err := s.Ds.MergePosts(posts) return posts, postFormated, err } + +func (s *DaoServant) RelationTypFrom(me *ms.User, username string) (res *cs.VistUser, err error) { + res = &cs.VistUser{ + RelTyp: cs.RelationSelf, + Username: username, + } + // visit by self + if me != nil && me.Username == username { + res.UserId = me.ID + return + } + he, xerr := s.Ds.GetUserByUsername(username) + if xerr != nil || (he.Model != nil && he.ID <= 0) { + return nil, errors.New("get user failed with username: " + username) + } + res.UserId = he.ID + // visit by guest + if me == nil { + res.RelTyp = cs.RelationGuest + return + } + // visit by admin/friend/other + if me.IsAdmin { + res.RelTyp = cs.RelationAdmin + } else if s.Ds.IsFriend(me.ID, he.ID) { + res.RelTyp = cs.RelationFriend + } else { + res.RelTyp = cs.RelationGuest + } + return +} + +func NewBindAnyFn() func(c *gin.Context, obj any) mir.Error { + if conf.UseSentryGin() { + return bindAnySentry + } + return bindAny +} + +func NewBaseServant() *BaseServant { + return &BaseServant{ + bindAny: NewBindAnyFn(), + } +} + +func NewDaoServant() *DaoServant { + return &DaoServant{ + BaseServant: NewBaseServant(), + Redis: cache.NewRedisCache(), + Dsa: dao.WebDataServantA(), + Ds: dao.DataService(), + Ts: dao.TweetSearchService(), + } +} diff --git a/internal/servants/bot/bot.go b/internal/servants/bot/bot.go index a2e0e699..8bfaeecf 100644 --- a/internal/servants/bot/bot.go +++ b/internal/servants/bot/bot.go @@ -11,5 +11,5 @@ import ( // RouteBot register Bot route func RouteBot(e *gin.Engine) { - api.RegisterUserServant(e, newUserSrv(), newUserBinding(), newUserRender()) + api.RegisterUserServant(e, newUserSrv()) } diff --git a/internal/servants/bot/user.go b/internal/servants/bot/user.go index aae9048c..5ea239bd 100644 --- a/internal/servants/bot/user.go +++ b/internal/servants/bot/user.go @@ -10,42 +10,16 @@ import ( ) var ( - _ api.User = (*userSrv)(nil) - _ api.UserBinding = (*userBinding)(nil) - _ api.UserRender = (*userRender)(nil) + _ api.User = (*userSrv)(nil) ) type userSrv struct { - base.BaseServant + *base.BaseServant api.UnimplementedUserServant } -type userBinding struct { - base.BaseBinding - *api.UnimplementedUserBinding -} - -type userRender struct { - base.BaseRender - *api.UnimplementedUserRender -} - func newUserSrv() api.User { - return &userSrv{} -} - -func newUserBinding() api.UserBinding { - return &userBinding{ - UnimplementedUserBinding: &api.UnimplementedUserBinding{ - BindAny: base.BindAny, - }, - } -} - -func newUserRender() api.UserRender { - return &userRender{ - UnimplementedUserRender: &api.UnimplementedUserRender{ - RenderAny: base.RenderAny, - }, + return &userSrv{ + BaseServant: base.NewBaseServant(), } } diff --git a/internal/servants/chain/admin.go b/internal/servants/chain/admin.go index 35a0fbc3..37a6e4c7 100644 --- a/internal/servants/chain/admin.go +++ b/internal/servants/chain/admin.go @@ -6,16 +6,15 @@ package chain import ( "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/pkg/app" - "github.com/rocboss/paopao-ce/pkg/errcode" ) func Admin() gin.HandlerFunc { return func(c *gin.Context) { if user, exist := c.Get("USER"); exist { - if userModel, ok := user.(*core.User); ok { - if userModel.Status == core.UserStatusNormal && userModel.IsAdmin { + if userModel, ok := user.(*ms.User); ok { + if userModel.Status == ms.UserStatusNormal && userModel.IsAdmin { c.Next() return } @@ -23,7 +22,7 @@ func Admin() gin.HandlerFunc { } response := app.NewResponse(c) - response.ToErrorResponse(errcode.NoAdminPermission) + response.ToErrorResponse(_errNoAdminPermission) c.Abort() } } diff --git a/internal/servants/chain/chain.go b/internal/servants/chain/chain.go new file mode 100644 index 00000000..84faeca5 --- /dev/null +++ b/internal/servants/chain/chain.go @@ -0,0 +1,24 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package chain + +import ( + "sync" + + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/dao" +) + +var ( + _ums core.UserManageService + _onceUms sync.Once +) + +func userManageService() core.UserManageService { + _onceUms.Do(func() { + _ums = dao.DataService() + }) + return _ums +} diff --git a/internal/servants/chain/jwt.go b/internal/servants/chain/jwt.go index a0396630..efdf2231 100644 --- a/internal/servants/chain/jwt.go +++ b/internal/servants/chain/jwt.go @@ -10,18 +10,16 @@ import ( "github.com/gin-gonic/gin" "github.com/golang-jwt/jwt/v4" "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/pkg/app" - "github.com/rocboss/paopao-ce/pkg/errcode" + "github.com/rocboss/paopao-ce/pkg/xerror" ) func JWT() gin.HandlerFunc { - // TODO: optimize get user from a simple service that provide fetch a user info interface. - db := conf.MustGormDB() + ums := userManageService() return func(c *gin.Context) { var ( token string - ecode = errcode.Success + ecode = xerror.Success ) if s, exist := c.GetQuery("token"); exist { token = s @@ -31,7 +29,7 @@ func JWT() gin.HandlerFunc { // 验证前端传过来的token格式,不为空,开头为Bearer if token == "" || !strings.HasPrefix(token, "Bearer ") { response := app.NewResponse(c) - response.ToErrorResponse(errcode.UnauthorizedTokenError) + response.ToErrorResponse(xerror.UnauthorizedTokenError) c.Abort() return } @@ -40,37 +38,36 @@ func JWT() gin.HandlerFunc { token = token[7:] } if token == "" { - ecode = errcode.InvalidParams + ecode = xerror.InvalidParams } else { claims, err := app.ParseToken(token) if err != nil { switch err.(*jwt.ValidationError).Errors { case jwt.ValidationErrorExpired: - ecode = errcode.UnauthorizedTokenTimeout + ecode = xerror.UnauthorizedTokenTimeout default: - ecode = errcode.UnauthorizedTokenError + ecode = xerror.UnauthorizedTokenError } } else { c.Set("UID", claims.UID) c.Set("USERNAME", claims.Username) // 加载用户信息 - user := &core.User{ - Model: &core.Model{ - ID: claims.UID, - }, + user, err := ums.GetUserByID(claims.UID) + if err == nil { + c.Set("USER", user) + } else { + ecode = xerror.UnauthorizedAuthNotExist } - user, _ = user.Get(db) - c.Set("USER", user) // 强制下线机制 if (conf.JWTSetting.Issuer + ":" + user.Salt) != claims.Issuer { - ecode = errcode.UnauthorizedTokenTimeout + ecode = xerror.UnauthorizedTokenTimeout } } } - if ecode != errcode.Success { + if ecode != xerror.Success { response := app.NewResponse(c) response.ToErrorResponse(ecode) c.Abort() @@ -82,8 +79,7 @@ func JWT() gin.HandlerFunc { } func JwtLoose() gin.HandlerFunc { - // TODO: optimize get user from a simple service that provide fetch a user info interface. - db := conf.MustGormDB() + ums := userManageService() return func(c *gin.Context) { token, exist := c.GetQuery("token") if !exist { @@ -101,12 +97,7 @@ func JwtLoose() gin.HandlerFunc { c.Set("UID", claims.UID) c.Set("USERNAME", claims.Username) // 加载用户信息 - user := &core.User{ - Model: &core.Model{ - ID: claims.UID, - }, - } - user, err := user.Get(db) + user, err := ums.GetUserByID(claims.UID) if err == nil && (conf.JWTSetting.Issuer+":"+user.Salt) == claims.Issuer { c.Set("USER", user) } diff --git a/internal/servants/chain/priv.go b/internal/servants/chain/priv.go index 6c09d0a8..420c3a9c 100644 --- a/internal/servants/chain/priv.go +++ b/internal/servants/chain/priv.go @@ -7,20 +7,19 @@ package chain import ( "github.com/alimy/cfg" "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/pkg/app" - "github.com/rocboss/paopao-ce/pkg/errcode" ) func Priv() gin.HandlerFunc { if cfg.If("PhoneBind") { return func(c *gin.Context) { if u, exist := c.Get("USER"); exist { - if user, ok := u.(*core.User); ok { - if user.Status == core.UserStatusNormal { + if user, ok := u.(*ms.User); ok { + if user.Status == ms.UserStatusNormal { if user.Phone == "" { response := app.NewResponse(c) - response.ToErrorResponse(errcode.AccountNoPhoneBind) + response.ToErrorResponse(_errAccountNoPhoneBind) c.Abort() return } @@ -30,19 +29,19 @@ func Priv() gin.HandlerFunc { } } response := app.NewResponse(c) - response.ToErrorResponse(errcode.UserHasBeenBanned) + response.ToErrorResponse(_errUserHasBeenBanned) c.Abort() } } else { return func(c *gin.Context) { if u, exist := c.Get("USER"); exist { - if user, ok := u.(*core.User); ok && user.Status == core.UserStatusNormal { + if user, ok := u.(*ms.User); ok && user.Status == ms.UserStatusNormal { c.Next() return } } response := app.NewResponse(c) - response.ToErrorResponse(errcode.UserHasBeenBanned) + response.ToErrorResponse(_errUserHasBeenBanned) c.Abort() } } diff --git a/internal/servants/chain/xerror.go b/internal/servants/chain/xerror.go new file mode 100644 index 00000000..6bebbd98 --- /dev/null +++ b/internal/servants/chain/xerror.go @@ -0,0 +1,16 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package chain + +import ( + "github.com/rocboss/paopao-ce/pkg/xerror" +) + +// nolint +var ( + _errUserHasBeenBanned = xerror.NewError(20006, "该账户已被封停") + _errAccountNoPhoneBind = xerror.NewError(20013, "拒绝操作: 账户未绑定手机号") + _errNoAdminPermission = xerror.NewError(20022, "无管理权限") +) diff --git a/internal/servants/localoss/localoss.go b/internal/servants/localoss/localoss.go index 97fdafbe..021c662e 100644 --- a/internal/servants/localoss/localoss.go +++ b/internal/servants/localoss/localoss.go @@ -26,5 +26,5 @@ func RouteLocalOSS(e *gin.Engine) { // RouteLocaloss register LocalOSS route if needed func RouteLocaloss(e *gin.Engine) { - api.RegisterUserServant(e, newUserSrv(), newUserBinding(), newUserRender()) + api.RegisterUserServant(e, newUserSrv()) } diff --git a/internal/servants/localoss/user.go b/internal/servants/localoss/user.go index 37fc715e..2d45f5b9 100644 --- a/internal/servants/localoss/user.go +++ b/internal/servants/localoss/user.go @@ -10,42 +10,16 @@ import ( ) var ( - _ api.User = (*userSrv)(nil) - _ api.UserBinding = (*userBinding)(nil) - _ api.UserRender = (*userRender)(nil) + _ api.User = (*userSrv)(nil) ) type userSrv struct { - base.BaseServant + *base.BaseServant api.UnimplementedUserServant } -type userBinding struct { - base.BaseBinding - *api.UnimplementedUserBinding -} - -type userRender struct { - base.BaseRender - *api.UnimplementedUserRender -} - func newUserSrv() api.User { - return &userSrv{} -} - -func newUserBinding() api.UserBinding { - return &userBinding{ - UnimplementedUserBinding: &api.UnimplementedUserBinding{ - BindAny: base.BindAny, - }, - } -} - -func newUserRender() api.UserRender { - return &userRender{ - UnimplementedUserRender: &api.UnimplementedUserRender{ - RenderAny: base.RenderAny, - }, + return &userSrv{ + BaseServant: base.NewBaseServant(), } } diff --git a/internal/servants/mobile/auth.go b/internal/servants/mobile/auth.go deleted file mode 100644 index 7b66794c..00000000 --- a/internal/servants/mobile/auth.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package mobile - -import ( - api "github.com/rocboss/paopao-ce/auto/rpc/v1" -) - -var ( - _ api.AuthenticateServer = (*authenticateServant)(nil) -) - -type authenticateServant struct { - api.UnimplementedAuthenticateServer -} - -func newAuthenticateServer() *authenticateServant { - return &authenticateServant{} -} diff --git a/internal/servants/mobile/greet.go b/internal/servants/mobile/greet.go new file mode 100644 index 00000000..1d714a9d --- /dev/null +++ b/internal/servants/mobile/greet.go @@ -0,0 +1,21 @@ +// Copyright 2022 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package mobile + +import ( + api "github.com/rocboss/paopao-ce/auto/rpc/greet/v1" +) + +var ( + _ api.GreetServiceServer = (*greetServiceSrv)(nil) +) + +type greetServiceSrv struct { + api.UnimplementedGreetServiceServer +} + +func newGreetServiceServer() *greetServiceSrv { + return &greetServiceSrv{} +} diff --git a/internal/servants/mobile/mobile.go b/internal/servants/mobile/mobile.go index 5f9ed52c..22b0c9d8 100644 --- a/internal/servants/mobile/mobile.go +++ b/internal/servants/mobile/mobile.go @@ -5,10 +5,10 @@ package mobile import ( - api "github.com/rocboss/paopao-ce/auto/rpc/v1" + api "github.com/rocboss/paopao-ce/auto/rpc/greet/v1" "google.golang.org/grpc" ) func RegisterServants(s *grpc.Server) { - api.RegisterAuthenticateServer(s, newAuthenticateServer()) + api.RegisterGreetServiceServer(s, newGreetServiceServer()) } diff --git a/internal/servants/servants.go b/internal/servants/servants.go index e206ad08..35af4bdc 100644 --- a/internal/servants/servants.go +++ b/internal/servants/servants.go @@ -5,7 +5,10 @@ package servants import ( + "net/http" + "github.com/alimy/cfg" + "github.com/bufbuild/connect-go" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/servants/admin" "github.com/rocboss/paopao-ce/internal/servants/bot" @@ -14,6 +17,7 @@ import ( "github.com/rocboss/paopao-ce/internal/servants/mobile" "github.com/rocboss/paopao-ce/internal/servants/space" "github.com/rocboss/paopao-ce/internal/servants/statick" + "github.com/rocboss/paopao-ce/internal/servants/triplet" "github.com/rocboss/paopao-ce/internal/servants/web" "google.golang.org/grpc" ) @@ -63,3 +67,8 @@ func RegisterFrontendWebServants(e *gin.Engine) { func RegisterMobileServants(s *grpc.Server) { mobile.RegisterServants(s) } + +// RegisterTripletServants register all the servants to Connect +func RegisterTripletServants(h func(string, http.Handler), opts ...connect.HandlerOption) { + triplet.RegisterAuthenticateHandler(h, opts...) +} diff --git a/internal/servants/space/space.go b/internal/servants/space/space.go index c9952035..b80b8c93 100644 --- a/internal/servants/space/space.go +++ b/internal/servants/space/space.go @@ -11,5 +11,5 @@ import ( // RouteWeb register SpaceX route func RouteSpaceX(e *gin.Engine) { - api.RegisterUserServant(e, newUserSrv(), newUserBinding(), newUserRender()) + api.RegisterUserServant(e, newUserSrv()) } diff --git a/internal/servants/space/user.go b/internal/servants/space/user.go index d0e5c632..505b6f30 100644 --- a/internal/servants/space/user.go +++ b/internal/servants/space/user.go @@ -10,42 +10,16 @@ import ( ) var ( - _ api.User = (*userSrv)(nil) - _ api.UserBinding = (*userBinding)(nil) - _ api.UserRender = (*userRender)(nil) + _ api.User = (*userSrv)(nil) ) type userSrv struct { - base.BaseServant + *base.BaseServant api.UnimplementedUserServant } -type userBinding struct { - base.BaseBinding - *api.UnimplementedUserBinding -} - -type userRender struct { - base.BaseRender - *api.UnimplementedUserRender -} - func newUserSrv() api.User { - return &userSrv{} -} - -func newUserBinding() api.UserBinding { - return &userBinding{ - UnimplementedUserBinding: &api.UnimplementedUserBinding{ - BindAny: base.BindAny, - }, - } -} - -func newUserRender() api.UserRender { - return &userRender{ - UnimplementedUserRender: &api.UnimplementedUserRender{ - RenderAny: base.RenderAny, - }, + return &userSrv{ + BaseServant: base.NewBaseServant(), } } diff --git a/internal/servants/statick/statick_embed.go b/internal/servants/statick/statick_embed.go index 33392531..96c37f95 100644 --- a/internal/servants/statick/statick_embed.go +++ b/internal/servants/statick/statick_embed.go @@ -16,7 +16,7 @@ import ( // RegisterWebStatick register web static assets route func RegisterWebStatick(e *gin.Engine) { - routeWebStatic(e, "/", "/index.html", "/favicon.ico", "/assets/*filepath") + routeWebStatic(e, "/", "/index.html", "/favicon.ico", "/logo.png", "/sw.js", "/manifest.json", "/assets/*filepath") } func routeWebStatic(e *gin.Engine, paths ...string) { diff --git a/internal/servants/triplet/auth.go b/internal/servants/triplet/auth.go new file mode 100644 index 00000000..17f71671 --- /dev/null +++ b/internal/servants/triplet/auth.go @@ -0,0 +1,17 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package triplet + +import ( + api "github.com/rocboss/paopao-ce/auto/connect/core/v1/corev1connect" +) + +var ( + _ api.AuthenticateServiceHandler = (*authenticateSrv)(nil) +) + +type authenticateSrv struct { + api.UnimplementedAuthenticateServiceHandler +} diff --git a/internal/servants/triplet/triplet.go b/internal/servants/triplet/triplet.go new file mode 100644 index 00000000..bfc77475 --- /dev/null +++ b/internal/servants/triplet/triplet.go @@ -0,0 +1,16 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package triplet + +import ( + "net/http" + + "github.com/bufbuild/connect-go" + api "github.com/rocboss/paopao-ce/auto/connect/core/v1/corev1connect" +) + +func RegisterAuthenticateHandler(h func(string, http.Handler), opts ...connect.HandlerOption) { + h(api.NewAuthenticateServiceHandler(&authenticateSrv{}, opts...)) +} diff --git a/internal/servants/web/admin.go b/internal/servants/web/admin.go index 6a6dc2ec..1d8241e6 100644 --- a/internal/servants/web/admin.go +++ b/internal/servants/web/admin.go @@ -5,7 +5,7 @@ package web import ( - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/model/web" @@ -15,9 +15,7 @@ import ( ) var ( - _ api.Admin = (*adminSrv)(nil) - _ api.AdminBinding = (*adminBinding)(nil) - _ api.AdminRender = (*adminRender)(nil) + _ api.Admin = (*adminSrv)(nil) ) type adminSrv struct { @@ -25,14 +23,6 @@ type adminSrv struct { *base.DaoServant } -type adminBinding struct { - *api.UnimplementedAdminBinding -} - -type adminRender struct { - *api.UnimplementedAdminRender -} - func (s *adminSrv) Chain() gin.HandlersChain { return gin.HandlersChain{chain.JWT(), chain.Admin()} } @@ -40,7 +30,7 @@ func (s *adminSrv) Chain() gin.HandlersChain { func (s *adminSrv) ChangeUserStatus(req *web.ChangeUserStatusReq) mir.Error { user, err := s.Ds.GetUserByID(req.ID) if err != nil || user.Model == nil || user.ID <= 0 { - return _errNoExistUsername + return web.ErrNoExistUsername } // 执行更新 user.Status = req.Status @@ -55,19 +45,3 @@ func newAdminSrv(s *base.DaoServant) api.Admin { DaoServant: s, } } - -func newAdminBinding() api.AdminBinding { - return &adminBinding{ - UnimplementedAdminBinding: &api.UnimplementedAdminBinding{ - BindAny: base.BindAny, - }, - } -} - -func newAdminRender() api.AdminRender { - return &adminRender{ - UnimplementedAdminRender: &api.UnimplementedAdminRender{ - RenderAny: base.RenderAny, - }, - } -} diff --git a/internal/servants/web/alipay.go b/internal/servants/web/alipay.go index c5ce3264..a84a9bd9 100644 --- a/internal/servants/web/alipay.go +++ b/internal/servants/web/alipay.go @@ -6,28 +6,20 @@ package web import ( "fmt" - "time" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/model/web" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/internal/servants/chain" - "github.com/rocboss/paopao-ce/pkg/app" - "github.com/rocboss/paopao-ce/pkg/convert" - "github.com/rocboss/paopao-ce/pkg/xerror" "github.com/sirupsen/logrus" "github.com/smartwalle/alipay/v3" ) var ( - _ api.AlipayPub = (*alipayPubSrv)(nil) - _ api.AlipayPubBinding = (*alipayPubBinding)(nil) - _ api.AlipayPubRender = (*alipayPubRender)(nil) - _ api.AlipayPriv = (*alipayPrivSrv)(nil) - _ api.AlipayPrivBinding = (*alipayPrivBinding)(nil) - _ api.AlipayPrivRender = (*alipayPrivRender)(nil) + _ api.AlipayPub = (*alipayPubSrv)(nil) + _ api.AlipayPriv = (*alipayPrivSrv)(nil) ) type alipayPubSrv struct { @@ -35,16 +27,6 @@ type alipayPubSrv struct { *base.DaoServant } -type alipayPubBinding struct { - *api.UnimplementedAlipayPubBinding - - alipayClient *alipay.Client -} - -type alipayPubRender struct { - *api.UnimplementedAlipayPubRender -} - type alipayPrivSrv struct { api.UnimplementedAlipayPrivServant *base.DaoServant @@ -52,47 +34,21 @@ type alipayPrivSrv struct { alipayClient *alipay.Client } -type alipayPrivBinding struct { - *api.UnimplementedAlipayPrivBinding -} - -type alipayPrivRender struct { - *api.UnimplementedAlipayPrivRender -} - -func (b *alipayPubBinding) BindAlipayNotify(c *gin.Context) (*web.AlipayNotifyReq, mir.Error) { - if err := c.Request.ParseForm(); err != nil { - logrus.Errorf("parse form err: %s", err) - return nil, _errRechargeNotifyError - } - noti, err := b.alipayClient.GetTradeNotification(c.Request) - if err != nil { - logrus.Errorf("alipayClient.GetTradeNotification err: %s form: %v", err, c.Request.Form) - return nil, _errRechargeNotifyError - } - return &web.AlipayNotifyReq{ - Ctx: c.Request.Context(), - ID: convert.StrTo(noti.OutTradeNo).MustInt64(), - TradeNo: noti.TradeNo, - TradeStatus: noti.TradeStatus, - }, nil -} - func (s *alipayPubSrv) AlipayNotify(req *web.AlipayNotifyReq) mir.Error { if req.TradeStatus == alipay.TradeStatusSuccess { - if ok, _ := s.Redis.SetNX(req.Ctx, "PaoPaoRecharge:"+req.TradeNo, 1, time.Second*5).Result(); ok { + if err := s.Redis.SetRechargeStatus(req.Ctx, req.TradeNo); err == nil { recharge, err := s.Ds.GetRechargeByID(req.ID) if err != nil { logrus.Errorf("GetRechargeByID id:%d err: %s", req.ID, err) - return _errRechargeNotifyError + return web.ErrRechargeNotifyError } if recharge.TradeStatus != "TRADE_SUCCESS" { // 标记为已付款 err := s.Ds.HandleRechargeSuccess(recharge, req.TradeNo) - defer s.Redis.Del(req.Ctx, "PaoPaoRecharge:"+req.TradeNo) + defer s.Redis.DelRechargeStatus(req.Ctx, req.TradeNo) if err != nil { logrus.Errorf("HandleRechargeSuccess id:%d err: %s", req.ID, err) - return _errRechargeNotifyError + return web.ErrRechargeNotifyError } } } @@ -100,38 +56,6 @@ func (s *alipayPubSrv) AlipayNotify(req *web.AlipayNotifyReq) mir.Error { return nil } -func (b *alipayPrivBinding) BindUserWalletBills(c *gin.Context) (*web.UserWalletBillsReq, mir.Error) { - uid, ok := base.UserIdFrom(c) - if !ok { - return nil, xerror.UnauthorizedTokenError - } - page, pageSize := app.GetPageInfo(c) - return &web.UserWalletBillsReq{ - UserId: uid, - Page: page, - PageSize: pageSize, - }, nil -} - -func (b *alipayPrivBinding) BindUserRechargeLink(c *gin.Context) (*web.UserRechargeLinkReq, mir.Error) { - v := &web.UserRechargeLinkReq{ - Host: c.Request.Host, - } - err := b.BindAny(c, v) - return v, err -} - -func (b *alipayPrivBinding) BindUserRechargeResult(c *gin.Context) (*web.UserRechargeResultReq, mir.Error) { - uid, exist := base.UserIdFrom(c) - if !exist { - return nil, xerror.UnauthorizedTokenError - } - return &web.UserRechargeResultReq{ - UserId: uid, - Id: convert.StrTo(c.Query("id")).MustInt64(), - }, nil -} - func (s *alipayPrivSrv) Chain() gin.HandlersChain { return gin.HandlersChain{chain.JWT()} } @@ -140,12 +64,12 @@ func (s *alipayPrivSrv) UserWalletBills(req *web.UserWalletBillsReq) (*web.UserW bills, err := s.Ds.GetUserWalletBills(req.UserId, (req.Page-1)*req.PageSize, req.PageSize) if err != nil { logrus.Errorf("GetUserWalletBills err: %s", err) - return nil, _errUserWalletBillsFailed + return nil, web.ErrUserWalletBillsFailed } totalRows, err := s.Ds.GetUserWalletBillCount(req.UserId) if err != nil { logrus.Errorf("GetUserWalletBillCount err: %s", err) - return nil, _errUserWalletBillsFailed + return nil, web.ErrUserWalletBillsFailed } resp := base.PageRespFrom(bills, req.Page, req.PageSize, totalRows) return (*web.UserWalletBillsResp)(resp), nil @@ -155,7 +79,7 @@ func (s *alipayPrivSrv) UserRechargeLink(req *web.UserRechargeLinkReq) (*web.Use recharge, err := s.Ds.CreateRecharge(req.User.ID, req.Amount) if err != nil { logrus.Errorf("Ds.CreateRecharge err: %v", err) - return nil, _errRechargeReqFail + return nil, web.ErrRechargeReqFail } p := alipay.TradePreCreate{} p.OutTradeNo = fmt.Sprintf("%d", recharge.ID) @@ -165,14 +89,14 @@ func (s *alipayPrivSrv) UserRechargeLink(req *web.UserRechargeLinkReq) (*web.Use rsp, err := s.alipayClient.TradePreCreate(p) if err != nil { logrus.Errorf("client.TradePreCreate err: %v\n", err) - return nil, _errRechargeReqFail + return nil, web.ErrRechargeReqFail } - if rsp.Content.Code != alipay.CodeSuccess { - return nil, _errRechargeReqFail + if rsp.Code != alipay.CodeSuccess { + return nil, web.ErrRechargeReqFail } return &web.UserRechargeLinkResp{ Id: recharge.ID, - Pay: rsp.Content.QRCode, + Pay: rsp.QRCode, }, nil } @@ -180,11 +104,11 @@ func (s *alipayPrivSrv) UserRechargeResult(req *web.UserRechargeResultReq) (*web recharge, err := s.Ds.GetRechargeByID(req.Id) if err != nil { logrus.Errorf("Ds.GetRechargeByID err: %v", err) - return nil, _errGetRechargeFailed + return nil, web.ErrGetRechargeFailed } if recharge.UserID != req.UserId { logrus.Errorf("Ds.GetRechargeByID userId not equel recharge.UserID: %d req.UserId %d", recharge.UserID, req.UserId) - return nil, _errGetRechargeFailed + return nil, web.ErrGetRechargeFailed } return &web.UserRechargeResultResp{ Id: recharge.ID, @@ -198,42 +122,9 @@ func newAlipayPubSrv(s *base.DaoServant) api.AlipayPub { } } -func newAlipayPubBinding(alipayClient *alipay.Client) api.AlipayPubBinding { - return &alipayPubBinding{ - UnimplementedAlipayPubBinding: &api.UnimplementedAlipayPubBinding{ - BindAny: base.BindAny, - }, - alipayClient: alipayClient, - } -} - -func newAlipayPubRender() api.AlipayPubRender { - return &alipayPubRender{ - UnimplementedAlipayPubRender: &api.UnimplementedAlipayPubRender{ - RenderAny: base.RenderAny, - }, - } -} - func newAlipayPrivSrv(s *base.DaoServant, client *alipay.Client) api.AlipayPriv { return &alipayPrivSrv{ DaoServant: s, alipayClient: client, } } - -func newAlipayPrivBinding() api.AlipayPrivBinding { - return &alipayPrivBinding{ - UnimplementedAlipayPrivBinding: &api.UnimplementedAlipayPrivBinding{ - BindAny: base.BindAny, - }, - } -} - -func newAlipayPrivRender() api.AlipayPrivRender { - return &alipayPrivRender{ - UnimplementedAlipayPrivRender: &api.UnimplementedAlipayPrivRender{ - RenderAny: base.RenderAny, - }, - } -} diff --git a/internal/servants/web/broker/attachment.go b/internal/servants/web/broker/attachment.go deleted file mode 100644 index e8c69447..00000000 --- a/internal/servants/web/broker/attachment.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package broker - -import ( - "github.com/rocboss/paopao-ce/internal/core" -) - -func CreateAttachment(attachment *core.Attachment) (*core.Attachment, error) { - return ds.CreateAttachment(attachment) -} diff --git a/internal/servants/web/broker/avatar.go b/internal/servants/web/broker/avatar.go deleted file mode 100644 index 04e183f4..00000000 --- a/internal/servants/web/broker/avatar.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package broker - -import ( - "math/rand" - "time" -) - -var defaultAvatars = []string{ - "https://assets.paopao.info/public/avatar/default/zoe.png", - "https://assets.paopao.info/public/avatar/default/william.png", - "https://assets.paopao.info/public/avatar/default/walter.png", - "https://assets.paopao.info/public/avatar/default/thomas.png", - "https://assets.paopao.info/public/avatar/default/taylor.png", - "https://assets.paopao.info/public/avatar/default/sophia.png", - "https://assets.paopao.info/public/avatar/default/sam.png", - "https://assets.paopao.info/public/avatar/default/ryan.png", - "https://assets.paopao.info/public/avatar/default/ruby.png", - "https://assets.paopao.info/public/avatar/default/quinn.png", - "https://assets.paopao.info/public/avatar/default/paul.png", - "https://assets.paopao.info/public/avatar/default/owen.png", - "https://assets.paopao.info/public/avatar/default/olivia.png", - "https://assets.paopao.info/public/avatar/default/norman.png", - "https://assets.paopao.info/public/avatar/default/nora.png", - "https://assets.paopao.info/public/avatar/default/natalie.png", - "https://assets.paopao.info/public/avatar/default/naomi.png", - "https://assets.paopao.info/public/avatar/default/miley.png", - "https://assets.paopao.info/public/avatar/default/mike.png", - "https://assets.paopao.info/public/avatar/default/lucas.png", - "https://assets.paopao.info/public/avatar/default/kylie.png", - "https://assets.paopao.info/public/avatar/default/julia.png", - "https://assets.paopao.info/public/avatar/default/joshua.png", - "https://assets.paopao.info/public/avatar/default/john.png", - "https://assets.paopao.info/public/avatar/default/jane.png", - "https://assets.paopao.info/public/avatar/default/jackson.png", - "https://assets.paopao.info/public/avatar/default/ivy.png", - "https://assets.paopao.info/public/avatar/default/isaac.png", - "https://assets.paopao.info/public/avatar/default/henry.png", - "https://assets.paopao.info/public/avatar/default/harry.png", - "https://assets.paopao.info/public/avatar/default/harold.png", - "https://assets.paopao.info/public/avatar/default/hanna.png", - "https://assets.paopao.info/public/avatar/default/grace.png", - "https://assets.paopao.info/public/avatar/default/george.png", - "https://assets.paopao.info/public/avatar/default/freddy.png", - "https://assets.paopao.info/public/avatar/default/frank.png", - "https://assets.paopao.info/public/avatar/default/finn.png", - "https://assets.paopao.info/public/avatar/default/emma.png", - "https://assets.paopao.info/public/avatar/default/emily.png", - "https://assets.paopao.info/public/avatar/default/edward.png", - "https://assets.paopao.info/public/avatar/default/clara.png", - "https://assets.paopao.info/public/avatar/default/claire.png", - "https://assets.paopao.info/public/avatar/default/chloe.png", - "https://assets.paopao.info/public/avatar/default/audrey.png", - "https://assets.paopao.info/public/avatar/default/arthur.png", - "https://assets.paopao.info/public/avatar/default/anna.png", - "https://assets.paopao.info/public/avatar/default/andy.png", - "https://assets.paopao.info/public/avatar/default/alfred.png", - "https://assets.paopao.info/public/avatar/default/alexa.png", - "https://assets.paopao.info/public/avatar/default/abigail.png", -} - -func GetRandomAvatar() string { - rand.Seed(time.Now().UnixMicro()) - return defaultAvatars[rand.Intn(len(defaultAvatars))] -} diff --git a/internal/servants/web/broker/broker.go b/internal/servants/web/broker/broker.go deleted file mode 100644 index fcc5846d..00000000 --- a/internal/servants/web/broker/broker.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package broker - -import ( - "github.com/alimy/cfg" - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/internal/dao" - "github.com/sirupsen/logrus" -) - -var ( - ds core.DataService - ts core.TweetSearchService - oss core.ObjectStorageService - DisablePhoneVerify bool -) - -func Initialize() { - ds = dao.DataService() - ts = dao.TweetSearchService() - oss = dao.ObjectStorageService() - DisablePhoneVerify = !cfg.If("Sms") -} - -// persistMediaContents 获取媒体内容并持久化 -func persistMediaContents(contents []*PostContentItem) (items []string, err error) { - items = make([]string, 0, len(contents)) - for _, item := range contents { - switch item.Type { - case core.ContentTypeImage, - core.ContentTypeVideo, - core.ContentTypeAudio, - core.ContentTypeAttachment, - core.ContentTypeChargeAttachment: - items = append(items, item.Content) - if err != nil { - continue - } - if err = oss.PersistObject(oss.ObjectKey(item.Content)); err != nil { - logrus.Errorf("service.persistMediaContents failed: %s", err) - } - } - } - return -} diff --git a/internal/servants/web/broker/comment.go b/internal/servants/web/broker/comment.go deleted file mode 100644 index 7f9389dc..00000000 --- a/internal/servants/web/broker/comment.go +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package broker - -import ( - "github.com/rocboss/paopao-ce/internal/core" - "time" - - "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/pkg/errcode" - "github.com/rocboss/paopao-ce/pkg/util" -) - -type CommentCreationReq struct { - PostID int64 `json:"post_id" binding:"required"` - Contents []*PostContentItem `json:"contents" binding:"required"` - Users []string `json:"users" binding:"required"` -} -type CommentReplyCreationReq struct { - CommentID int64 `json:"comment_id" binding:"required"` - Content string `json:"content" binding:"required"` - AtUserID int64 `json:"at_user_id"` -} - -type CommentDelReq struct { - ID int64 `json:"id" binding:"required"` -} -type ReplyDelReq struct { - ID int64 `json:"id" binding:"required"` -} - -func GetPostComments(postID int64, sort string, offset, limit int) ([]*core.CommentFormated, int64, error) { - conditions := &core.ConditionsT{ - "post_id": postID, - "ORDER": sort, - } - comments, err := ds.GetComments(conditions, offset, limit) - - if err != nil { - return nil, 0, err - } - - userIDs := []int64{} - commentIDs := []int64{} - for _, comment := range comments { - userIDs = append(userIDs, comment.UserID) - commentIDs = append(commentIDs, comment.ID) - } - - users, err := ds.GetUsersByIDs(userIDs) - if err != nil { - return nil, 0, err - } - - contents, err := ds.GetCommentContentsByIDs(commentIDs) - if err != nil { - return nil, 0, err - } - - replies, err := ds.GetCommentRepliesByID(commentIDs) - if err != nil { - return nil, 0, err - } - - commentsFormated := []*core.CommentFormated{} - for _, comment := range comments { - commentFormated := comment.Format() - for _, content := range contents { - if content.CommentID == comment.ID { - commentFormated.Contents = append(commentFormated.Contents, content) - } - } - for _, reply := range replies { - if reply.CommentID == commentFormated.ID { - commentFormated.Replies = append(commentFormated.Replies, reply) - } - } - for _, user := range users { - if user.ID == comment.UserID { - commentFormated.User = user.Format() - } - } - - commentsFormated = append(commentsFormated, commentFormated) - } - - // 获取总量 - totalRows, _ := ds.GetCommentCount(conditions) - - return commentsFormated, totalRows, nil -} - -func CreatePostComment(ctx *gin.Context, userID int64, param CommentCreationReq) (comment *core.Comment, err error) { - var mediaContents []string - - defer func() { - if err != nil { - deleteOssObjects(mediaContents) - } - }() - - if mediaContents, err = persistMediaContents(param.Contents); err != nil { - return - } - - // 加载Post - post, err := ds.GetPostByID(param.PostID) - - if err != nil { - return nil, err - } - - if post.CommentCount >= conf.AppSetting.MaxCommentCount { - return nil, errcode.MaxCommentCount - } - ip := ctx.ClientIP() - comment = &core.Comment{ - PostID: post.ID, - UserID: userID, - IP: ip, - IPLoc: util.GetIPLoc(ip), - } - comment, err = ds.CreateComment(comment) - if err != nil { - return nil, err - } - - for _, item := range param.Contents { - // 检查附件是否是本站资源 - if item.Type == core.ContentTypeImage || item.Type == core.ContentTypeVideo || item.Type == core.ContentTypeAttachment { - if err := ds.CheckAttachment(item.Content); err != nil { - continue - } - } - - postContent := &core.CommentContent{ - CommentID: comment.ID, - UserID: userID, - Content: item.Content, - Type: item.Type, - Sort: item.Sort, - } - ds.CreateCommentContent(postContent) - } - - // 更新Post回复数 - post.CommentCount++ - post.LatestRepliedOn = time.Now().Unix() - ds.UpdatePost(post) - - // 更新索引 - PushPostToSearch(post) - - // 创建用户消息提醒 - postMaster, err := ds.GetUserByID(post.UserID) - if err == nil && postMaster.ID != userID { - go ds.CreateMessage(&core.Message{ - SenderUserID: userID, - ReceiverUserID: postMaster.ID, - Type: core.MsgtypeComment, - Brief: "在泡泡中评论了你", - PostID: post.ID, - CommentID: comment.ID, - }) - } - for _, u := range param.Users { - user, err := ds.GetUserByUsername(u) - if err != nil || user.ID == userID || user.ID == postMaster.ID { - continue - } - - // 创建消息提醒 - go ds.CreateMessage(&core.Message{ - SenderUserID: userID, - ReceiverUserID: user.ID, - Type: core.MsgtypeComment, - Brief: "在泡泡评论中@了你", - PostID: post.ID, - CommentID: comment.ID, - }) - } - - return comment, nil -} - -func GetPostComment(id int64) (*core.Comment, error) { - return ds.GetCommentByID(id) -} - -func DeletePostComment(comment *core.Comment) error { - // 加载post - post, err := ds.GetPostByID(comment.PostID) - if err == nil { - // 更新post回复数 - post.CommentCount-- - ds.UpdatePost(post) - } - - return ds.DeleteComment(comment) -} - -func createPostPreHandler(commentID int64, userID, atUserID int64) (*core.Post, *core.Comment, int64, - error) { - // 加载Comment - comment, err := ds.GetCommentByID(commentID) - if err != nil { - return nil, nil, atUserID, err - } - - // 加载comment的post - post, err := ds.GetPostByID(comment.PostID) - if err != nil { - return nil, nil, atUserID, err - } - - if post.CommentCount >= conf.AppSetting.MaxCommentCount { - return nil, nil, atUserID, errcode.MaxCommentCount - } - - if userID == atUserID { - atUserID = 0 - } - - if atUserID > 0 { - // 检测目前用户是否存在 - users, _ := ds.GetUsersByIDs([]int64{atUserID}) - if len(users) == 0 { - atUserID = 0 - } - } - - return post, comment, atUserID, nil -} - -func CreatePostCommentReply(ctx *gin.Context, commentID int64, content string, userID, atUserID int64) (*core.CommentReply, error) { - var ( - post *core.Post - comment *core.Comment - err error - ) - if post, comment, atUserID, err = createPostPreHandler(commentID, userID, atUserID); err != nil { - return nil, err - } - - // 创建评论 - ip := ctx.ClientIP() - reply := &core.CommentReply{ - CommentID: commentID, - UserID: userID, - Content: content, - AtUserID: atUserID, - IP: ip, - IPLoc: util.GetIPLoc(ip), - } - - reply, err = ds.CreateCommentReply(reply) - if err != nil { - return nil, err - } - - // 更新Post回复数 - post.CommentCount++ - post.LatestRepliedOn = time.Now().Unix() - ds.UpdatePost(post) - - // 更新索引 - PushPostToSearch(post) - - // 创建用户消息提醒 - commentMaster, err := ds.GetUserByID(comment.UserID) - if err == nil && commentMaster.ID != userID { - go ds.CreateMessage(&core.Message{ - SenderUserID: userID, - ReceiverUserID: commentMaster.ID, - Type: core.MsgTypeReply, - Brief: "在泡泡评论下回复了你", - PostID: post.ID, - CommentID: comment.ID, - ReplyID: reply.ID, - }) - } - postMaster, err := ds.GetUserByID(post.UserID) - if err == nil && postMaster.ID != userID && commentMaster.ID != postMaster.ID { - go ds.CreateMessage(&core.Message{ - SenderUserID: userID, - ReceiverUserID: postMaster.ID, - Type: core.MsgTypeReply, - Brief: "在泡泡评论下发布了新回复", - PostID: post.ID, - CommentID: comment.ID, - ReplyID: reply.ID, - }) - } - if atUserID > 0 { - user, err := ds.GetUserByID(atUserID) - if err == nil && user.ID != userID && commentMaster.ID != user.ID && postMaster.ID != user.ID { - // 创建消息提醒 - go ds.CreateMessage(&core.Message{ - SenderUserID: userID, - ReceiverUserID: user.ID, - Type: core.MsgTypeReply, - Brief: "在泡泡评论的回复中@了你", - PostID: post.ID, - CommentID: comment.ID, - ReplyID: reply.ID, - }) - } - } - - return reply, nil -} - -func GetPostCommentReply(id int64) (*core.CommentReply, error) { - return ds.GetCommentReplyByID(id) -} - -func DeletePostCommentReply(reply *core.CommentReply) error { - err := ds.DeleteCommentReply(reply) - if err != nil { - return err - } - - // 加载Comment - comment, err := ds.GetCommentByID(reply.CommentID) - if err != nil { - return err - } - - // 加载comment的post - post, err := ds.GetPostByID(comment.PostID) - if err != nil { - return err - } - - // 更新Post回复数 - post.CommentCount-- - post.LatestRepliedOn = time.Now().Unix() - ds.UpdatePost(post) - - // 更新索引 - PushPostToSearch(post) - - return nil -} diff --git a/internal/servants/web/broker/message.go b/internal/servants/web/broker/message.go deleted file mode 100644 index 6e5dd1a1..00000000 --- a/internal/servants/web/broker/message.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package broker - -import ( - "fmt" - "time" - - "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/pkg/convert" - "github.com/rocboss/paopao-ce/pkg/errcode" -) - -// MAX_WHISPER_NUM_DAILY 当日单用户私信总数限制(TODO 配置化、积分兑换等) -const MAX_WHISPER_NUM_DAILY = 20 - -type ReadMessageReq struct { - ID int64 `json:"id" binding:"required"` -} -type WhisperReq struct { - UserID int64 `json:"user_id" binding:"required"` - Content string `json:"content" binding:"required"` -} - -// CreateWhisper 创建私信 -func CreateWhisper(c *gin.Context, msg *core.Message) (*core.Message, error) { - whisperKey := fmt.Sprintf("WhisperTimes:%d", msg.SenderUserID) - - // 今日频次限制 - if res, _ := conf.Redis.Get(c, whisperKey).Result(); convert.StrTo(res).MustInt() >= MAX_WHISPER_NUM_DAILY { - return nil, errcode.TooManyWhisperNum - } - - // 创建私信 - msg, err := ds.CreateMessage(msg) - if err != nil { - return nil, err - } - - // 写入当日(自然日)计数缓存 - conf.Redis.Incr(c, whisperKey).Result() - - currentTime := time.Now() - endTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), 23, 59, 59, 0, currentTime.Location()) - conf.Redis.Expire(c, whisperKey, endTime.Sub(currentTime)) - - return msg, err -} - -func GetUnreadCount(userID int64) (int64, error) { - return ds.GetUnreadCount(userID) -} -func ReadMessage(id, userID int64) error { - // 获取message - message, err := ds.GetMessageByID(id) - if err != nil { - return err - } - - if message.ReceiverUserID != userID { - return errcode.NoPermission - } - - // 已读消息 - return ds.ReadMessage(message) -} - -func GetMessages(userID int64, offset, limit int) ([]*core.MessageFormated, int64, error) { - conditions := &core.ConditionsT{ - "receiver_user_id": userID, - "ORDER": "id DESC", - } - messages, err := ds.GetMessages(conditions, offset, limit) - - for _, mf := range messages { - - if mf.SenderUserID > 0 { - user, err := ds.GetUserByID(mf.SenderUserID) - if err == nil { - mf.SenderUser = user.Format() - } - - } - - // 好友申请消息不需要获取其他信息 - if mf.Type == core.MsgTypeRequestingFriend { - continue - } - - if mf.PostID > 0 { - post, err := GetPost(mf.PostID) - if err == nil { - mf.Post = post - if mf.CommentID > 0 { - comment, err := GetPostComment(mf.CommentID) - - if err == nil { - mf.Comment = comment - - if mf.ReplyID > 0 { - reply, err := GetPostCommentReply(mf.ReplyID) - if err == nil { - mf.Reply = reply - } - } - } - } - } - } - } - - if err != nil { - return nil, 0, err - } - - // 获取总量 - totalRows, _ := ds.GetMessageCount(conditions) - - return messages, totalRows, nil -} diff --git a/internal/servants/web/broker/post.go b/internal/servants/web/broker/post.go deleted file mode 100644 index 9a73528b..00000000 --- a/internal/servants/web/broker/post.go +++ /dev/null @@ -1,592 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package broker - -import ( - "errors" - "fmt" - "math" - "strings" - "time" - - "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/pkg/errcode" - "github.com/rocboss/paopao-ce/pkg/util" - "github.com/sirupsen/logrus" -) - -type TagType string - -const TagTypeHot TagType = "hot" -const TagTypeNew TagType = "new" - -type PostListReq struct { - Conditions *core.ConditionsT - Offset int - Limit int -} -type PostTagsReq struct { - Type TagType `json:"type" form:"type" binding:"required"` - Num int `json:"num" form:"num" binding:"required"` -} - -type PostCreationReq struct { - Contents []*PostContentItem `json:"contents" binding:"required"` - Tags []string `json:"tags" binding:"required"` - Users []string `json:"users" binding:"required"` - AttachmentPrice int64 `json:"attachment_price"` - Visibility core.PostVisibleT `json:"visibility"` -} - -type PostDelReq struct { - ID int64 `json:"id" binding:"required"` -} - -type PostLockReq struct { - ID int64 `json:"id" binding:"required"` -} - -type PostStickReq struct { - ID int64 `json:"id" binding:"required"` -} - -type PostVisibilityReq struct { - ID int64 `json:"id" binding:"required"` - Visibility core.PostVisibleT `json:"visibility"` -} - -type PostStarReq struct { - ID int64 `json:"id" binding:"required"` -} - -type PostCollectionReq struct { - ID int64 `json:"id" binding:"required"` -} - -type PostContentItem struct { - Content string `json:"content" binding:"required"` - Type core.PostContentT `json:"type" binding:"required"` - Sort int64 `json:"sort" binding:"required"` -} - -// Check 检查PostContentItem属性 -func (p *PostContentItem) Check() error { - // 检查附件是否是本站资源 - if p.Type == core.ContentTypeImage || p.Type == core.ContentTypeVideo || p.Type == core.ContentTypeAttachment { - if err := ds.CheckAttachment(p.Content); err != nil { - return err - } - } - // 检查链接是否合法 - if p.Type == core.ContentTypeLink { - if strings.Index(p.Content, "http://") != 0 && strings.Index(p.Content, "https://") != 0 { - return fmt.Errorf("链接不合法") - } - } - return nil -} - -func tagsFrom(originTags []string) []string { - tags := make([]string, 0, len(originTags)) - for _, tag := range originTags { - // TODO: 优化tag有效性检测 - if tag = strings.TrimSpace(tag); len(tag) > 0 { - tags = append(tags, tag) - } - } - return tags -} - -// CreatePost 创建文章 -// TODO: 推文+推文内容需要在一个事务中添加,后续优化 -func CreatePost(c *gin.Context, userID int64, param PostCreationReq) (_ *core.PostFormated, err error) { - var mediaContents []string - - defer func() { - if err != nil { - deleteOssObjects(mediaContents) - } - }() - - if mediaContents, err = persistMediaContents(param.Contents); err != nil { - return - } - - ip := c.ClientIP() - tags := tagsFrom(param.Tags) - post := &core.Post{ - UserID: userID, - Tags: strings.Join(tags, ","), - IP: ip, - IPLoc: util.GetIPLoc(ip), - AttachmentPrice: param.AttachmentPrice, - Visibility: param.Visibility, - } - post, err = ds.CreatePost(post) - if err != nil { - return nil, err - } - - for _, item := range param.Contents { - if err := item.Check(); err != nil { - // 属性非法 - logrus.Infof("contents check err: %v", err) - continue - } - - if item.Type == core.ContentTypeAttachment && param.AttachmentPrice > 0 { - item.Type = core.ContentTypeChargeAttachment - } - - postContent := &core.PostContent{ - PostID: post.ID, - UserID: userID, - Content: item.Content, - Type: item.Type, - Sort: item.Sort, - } - if _, err = ds.CreatePostContent(postContent); err != nil { - return nil, err - } - } - - // 私密推文不创建标签与用户提醒 - if post.Visibility != core.PostVisitPrivate { - // 创建标签 - for _, t := range tags { - tag := &core.Tag{ - UserID: userID, - Tag: t, - } - ds.CreateTag(tag) - } - - // 创建用户消息提醒 - for _, u := range param.Users { - user, err := ds.GetUserByUsername(u) - if err != nil || user.ID == userID { - continue - } - - // 创建消息提醒 - // TODO: 优化消息提醒处理机制 - go ds.CreateMessage(&core.Message{ - SenderUserID: userID, - ReceiverUserID: user.ID, - Type: core.MsgTypePost, - Brief: "在新发布的泡泡动态中@了你", - PostID: post.ID, - }) - } - } - - // 推送Search - PushPostToSearch(post) - - formatedPosts, err := ds.RevampPosts([]*core.PostFormated{post.Format()}) - if err != nil { - return nil, err - } - return formatedPosts[0], nil -} - -func DeletePost(user *core.User, id int64) *errcode.Error { - if user == nil { - return errcode.NoPermission - } - - post, err := ds.GetPostByID(id) - if err != nil { - return errcode.GetPostFailed - } - if post.UserID != user.ID && !user.IsAdmin { - return errcode.NoPermission - } - - mediaContents, err := ds.DeletePost(post) - if err != nil { - logrus.Errorf("service.DeletePost delete post failed: %s", err) - return errcode.DeletePostFailed - } - - // 删除推文的媒体内容 - deleteOssObjects(mediaContents) - - // 删除索引 - DeleteSearchPost(post) - - return nil -} - -// deleteOssObjects 删除推文的媒体内容, 宽松处理错误(就是不处理), 后续完善 -func deleteOssObjects(mediaContents []string) { - mediaContentsSize := len(mediaContents) - if mediaContentsSize > 1 { - objectKeys := make([]string, 0, mediaContentsSize) - for _, cUrl := range mediaContents { - objectKeys = append(objectKeys, oss.ObjectKey(cUrl)) - } - // TODO: 优化处理尽量使用channel传递objectKeys使用可控数量的Goroutine集中处理object删除动作,后续完善 - go oss.DeleteObjects(objectKeys) - } else if mediaContentsSize == 1 { - oss.DeleteObject(oss.ObjectKey(mediaContents[0])) - } -} - -func LockPost(id int64) error { - post, _ := ds.GetPostByID(id) - - err := ds.LockPost(post) - - if err != nil { - return err - } - - return nil -} - -func StickPost(id int64) error { - post, _ := ds.GetPostByID(id) - - err := ds.StickPost(post) - - if err != nil { - return err - } - - return nil -} - -func VisiblePost(user *core.User, postId int64, visibility core.PostVisibleT) *errcode.Error { - if visibility >= core.PostVisitInvalid { - return errcode.InvalidParams - } - - post, err := ds.GetPostByID(postId) - if err != nil { - return errcode.GetPostFailed - } - - if err := checkPermision(user, post.UserID); err != nil { - return err - } - - if err = ds.VisiblePost(post, visibility); err != nil { - logrus.Warnf("update post failure: %v", err) - return errcode.VisblePostFailed - } - - // 推送Search - post.Visibility = visibility - PushPostToSearch(post) - - return nil -} - -func GetPostStar(postID, userID int64) (*core.PostStar, error) { - return ds.GetUserPostStar(postID, userID) -} - -func CreatePostStar(postID, userID int64) (*core.PostStar, error) { - // 加载Post - post, err := ds.GetPostByID(postID) - if err != nil { - return nil, err - } - - // 私密post不可操作 - if post.Visibility == core.PostVisitPrivate { - return nil, errors.New("no permision") - } - - star, err := ds.CreatePostStar(postID, userID) - if err != nil { - return nil, err - } - - // 更新Post点赞数 - post.UpvoteCount++ - ds.UpdatePost(post) - - // 更新索引 - PushPostToSearch(post) - - return star, nil -} - -func DeletePostStar(star *core.PostStar) error { - err := ds.DeletePostStar(star) - if err != nil { - return err - } - // 加载Post - post, err := ds.GetPostByID(star.PostID) - if err != nil { - return err - } - - // 私密post不可操作 - if post.Visibility == core.PostVisitPrivate { - return errors.New("no permision") - } - - // 更新Post点赞数 - post.UpvoteCount-- - ds.UpdatePost(post) - - // 更新索引 - PushPostToSearch(post) - - return nil -} - -func GetPostCollection(postID, userID int64) (*core.PostCollection, error) { - return ds.GetUserPostCollection(postID, userID) -} - -func CreatePostCollection(postID, userID int64) (*core.PostCollection, error) { - // 加载Post - post, err := ds.GetPostByID(postID) - if err != nil { - return nil, err - } - - // 私密post不可操作 - if post.Visibility == core.PostVisitPrivate { - return nil, errors.New("no permision") - } - - collection, err := ds.CreatePostCollection(postID, userID) - if err != nil { - return nil, err - } - - // 更新Post点赞数 - post.CollectionCount++ - ds.UpdatePost(post) - - // 更新索引 - PushPostToSearch(post) - - return collection, nil -} - -func DeletePostCollection(collection *core.PostCollection) error { - err := ds.DeletePostCollection(collection) - if err != nil { - return err - } - // 加载Post - post, err := ds.GetPostByID(collection.PostID) - if err != nil { - return err - } - - // 私密post不可操作 - if post.Visibility == core.PostVisitPrivate { - return errors.New("no permision") - } - - // 更新Post点赞数 - post.CollectionCount-- - ds.UpdatePost(post) - - // 更新索引 - PushPostToSearch(post) - - return nil -} - -func GetPost(id int64) (*core.PostFormated, error) { - post, err := ds.GetPostByID(id) - - if err != nil { - return nil, err - } - - postContents, err := ds.GetPostContentsByIDs([]int64{post.ID}) - if err != nil { - return nil, err - } - - users, err := ds.GetUsersByIDs([]int64{post.UserID}) - if err != nil { - return nil, err - } - - // 数据整合 - postFormated := post.Format() - for _, user := range users { - postFormated.User = user.Format() - } - for _, content := range postContents { - if content.PostID == post.ID { - postFormated.Contents = append(postFormated.Contents, content.Format()) - } - } - return postFormated, nil -} - -func GetPostContentByID(id int64) (*core.PostContent, error) { - return ds.GetPostContentByID(id) -} - -func GetIndexPosts(user *core.User, offset int, limit int) (*core.IndexTweetList, error) { - return ds.IndexPosts(user, offset, limit) -} - -func GetPostList(req *PostListReq) ([]*core.Post, []*core.PostFormated, error) { - posts, err := ds.GetPosts(req.Conditions, req.Offset, req.Limit) - if err != nil { - return nil, nil, err - } - postFormated, err := ds.MergePosts(posts) - return posts, postFormated, err -} - -func GetPostCount(conditions *core.ConditionsT) (int64, error) { - return ds.GetPostCount(conditions) -} - -func GetPostListFromSearch(user *core.User, q *core.QueryReq, offset, limit int) ([]*core.PostFormated, int64, error) { - resp, err := ts.Search(user, q, offset, limit) - if err != nil { - return nil, 0, err - } - posts, err := ds.RevampPosts(resp.Items) - if err != nil { - return nil, 0, err - } - return posts, resp.Total, nil -} - -func GetPostListFromSearchByQuery(user *core.User, query string, offset, limit int) ([]*core.PostFormated, int64, error) { - q := &core.QueryReq{ - Query: query, - Type: "search", - } - return GetPostListFromSearch(user, q, offset, limit) -} - -func PushPostToSearch(post *core.Post) { - postFormated := post.Format() - postFormated.User = &core.UserFormated{ - ID: post.UserID, - } - contents, _ := ds.GetPostContentsByIDs([]int64{post.ID}) - for _, content := range contents { - postFormated.Contents = append(postFormated.Contents, content.Format()) - } - - contentFormated := "" - for _, content := range postFormated.Contents { - if content.Type == core.ContentTypeText || content.Type == core.ContentTypeTitle { - contentFormated = contentFormated + content.Content + "\n" - } - } - - docs := []core.TsDocItem{{ - Post: post, - Content: contentFormated, - }} - ts.AddDocuments(docs, fmt.Sprintf("%d", post.ID)) -} - -func DeleteSearchPost(post *core.Post) error { - return ts.DeleteDocuments([]string{fmt.Sprintf("%d", post.ID)}) -} - -func PushPostsToSearch(c *gin.Context) { - if ok, _ := conf.Redis.SetNX(c, "JOB_PUSH_TO_SEARCH", 1, time.Hour).Result(); ok { - defer conf.Redis.Del(c, "JOB_PUSH_TO_SEARCH") - - splitNum := 1000 - totalRows, _ := GetPostCount(&core.ConditionsT{ - "visibility IN ?": []core.PostVisibleT{core.PostVisitPublic, core.PostVisitFriend}, - }) - - pages := math.Ceil(float64(totalRows) / float64(splitNum)) - nums := int(pages) - - for i := 0; i < nums; i++ { - posts, postsFormated, err := GetPostList(&PostListReq{ - Conditions: &core.ConditionsT{}, - Offset: i * splitNum, - Limit: splitNum, - }) - if err != nil || len(posts) != len(postsFormated) { - continue - } - for i, pf := range postsFormated { - contentFormated := "" - for _, content := range pf.Contents { - if content.Type == core.ContentTypeText || content.Type == core.ContentTypeTitle { - contentFormated = contentFormated + content.Content + "\n" - } - } - docs := []core.TsDocItem{{ - Post: posts[i], - Content: contentFormated, - }} - ts.AddDocuments(docs, fmt.Sprintf("%d", posts[i].ID)) - } - } - } -} - -func GetPostTags(param *PostTagsReq) ([]*core.TagFormated, error) { - num := param.Num - if num > conf.AppSetting.MaxPageSize { - num = conf.AppSetting.MaxPageSize - } - - conditions := &core.ConditionsT{} - if param.Type == TagTypeHot { - // 热门标签 - conditions = &core.ConditionsT{ - "ORDER": "quote_num DESC", - } - } - if param.Type == TagTypeNew { - // 热门标签 - conditions = &core.ConditionsT{ - "ORDER": "id DESC", - } - } - - tags, err := ds.GetTags(conditions, 0, num) - if err != nil { - return nil, err - } - - // 获取创建者User IDs - userIds := []int64{} - for _, tag := range tags { - userIds = append(userIds, tag.UserID) - } - - users, _ := ds.GetUsersByIDs(userIds) - - tagsFormated := []*core.TagFormated{} - for _, tag := range tags { - tagFormated := tag.Format() - for _, user := range users { - if user.ID == tagFormated.UserID { - tagFormated.User = user.Format() - } - } - tagsFormated = append(tagsFormated, tagFormated) - } - - return tagsFormated, nil -} - -func CheckPostAttachmentIsPaid(postID, userID int64) bool { - bill, err := ds.GetPostAttatchmentBill(postID, userID) - - return err == nil && bill.Model != nil && bill.ID > 0 -} diff --git a/internal/servants/web/broker/sign.go b/internal/servants/web/broker/sign.go deleted file mode 100644 index c8883638..00000000 --- a/internal/servants/web/broker/sign.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package broker - -import ( - "fmt" - "sort" - - "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/pkg/util" - "github.com/sirupsen/logrus" -) - -func GetParamSign(param map[string]any, secretKey string) string { - signRaw := "" - - rawStrs := []string{} - for k, v := range param { - if k != "sign" { - rawStrs = append(rawStrs, k+"="+fmt.Sprintf("%v", v)) - } - } - - sort.Strings(rawStrs) - for _, v := range rawStrs { - signRaw += v - } - - if conf.ServerSetting.RunMode == "debug" { - logrus.Info(map[string]string{ - "signRaw": signRaw, - "sysSign": util.EncodeMD5(signRaw + secretKey), - }) - } - - return util.EncodeMD5(signRaw + secretKey) -} diff --git a/internal/servants/web/broker/user.go b/internal/servants/web/broker/user.go deleted file mode 100644 index 66919a99..00000000 --- a/internal/servants/web/broker/user.go +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package broker - -import ( - "fmt" - "regexp" - "strings" - "time" - "unicode/utf8" - - "github.com/gin-gonic/gin" - "github.com/gofrs/uuid" - "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/pkg/convert" - "github.com/rocboss/paopao-ce/pkg/errcode" - "github.com/rocboss/paopao-ce/pkg/util" - "github.com/sirupsen/logrus" -) - -const _MaxCaptchaTimes = 2 - -type PhoneCaptchaReq struct { - Phone string `json:"phone" form:"phone" binding:"required"` - ImgCaptcha string `json:"img_captcha" form:"img_captcha" binding:"required"` - ImgCaptchaID string `json:"img_captcha_id" form:"img_captcha_id" binding:"required"` -} - -type UserPhoneBindReq struct { - Phone string `json:"phone" form:"phone" binding:"required"` - Captcha string `json:"captcha" form:"captcha" binding:"required"` -} - -type AuthRequest struct { - Username string `json:"username" form:"username" binding:"required"` - Password string `json:"password" form:"password" binding:"required"` -} - -type RegisterRequest struct { - Username string `json:"username" form:"username" binding:"required"` - Password string `json:"password" form:"password" binding:"required"` -} - -type ChangePasswordReq struct { - Password string `json:"password" form:"password" binding:"required"` - OldPassword string `json:"old_password" form:"old_password" binding:"required"` -} - -type ChangeNicknameReq struct { - Nickname string `json:"nickname" form:"nickname" binding:"required"` -} - -type ChangeAvatarReq struct { - Avatar string `json:"avatar" form:"avatar" binding:"required"` -} - -type ChangeUserStatusReq struct { - ID int64 `json:"id" form:"id" binding:"required"` - Status int `json:"status" form:"status" binding:"required"` -} - -type RequestingFriendReq struct { - UserId int64 `json:"user_id" binding:"required"` - Greetings string `json:"greetings" binding:"required"` -} - -type AddFriendReq struct { - UserId int64 `json:"user_id" binding:"required"` -} - -type RejectFriendReq struct { - UserId int64 `json:"user_id" binding:"required"` -} - -type DeleteFriendReq struct { - UserId int64 `json:"user_id"` -} - -type UserProfileResp struct { - ID int64 `json:"id"` - Nickname string `json:"nickname"` - Username string `json:"username"` - Status int `json:"status"` - Avatar string `json:"avatar"` - IsAdmin bool `json:"is_admin"` - IsFriend bool `json:"is_friend"` -} - -const ( - _LoginErrKey = "PaoPaoUserLoginErr" - _MaxLoginErrTimes = 10 -) - -// DoLogin 用户认证 -func DoLogin(ctx *gin.Context, param *AuthRequest) (*core.User, error) { - user, err := ds.GetUserByUsername(param.Username) - if err != nil { - return nil, errcode.UnauthorizedAuthNotExist - } - - if user.Model != nil && user.ID > 0 { - if errTimes, err := conf.Redis.Get(ctx, fmt.Sprintf("%s:%d", _LoginErrKey, user.ID)).Result(); err == nil { - if convert.StrTo(errTimes).MustInt() >= _MaxLoginErrTimes { - return nil, errcode.TooManyLoginError - } - } - - // 对比密码是否正确 - if ValidPassword(user.Password, param.Password, user.Salt) { - - if user.Status == core.UserStatusClosed { - return nil, errcode.UserHasBeenBanned - } - - // 清空登录计数 - conf.Redis.Del(ctx, fmt.Sprintf("%s:%d", _LoginErrKey, user.ID)) - return user, nil - } - - // 登录错误计数 - _, err = conf.Redis.Incr(ctx, fmt.Sprintf("%s:%d", _LoginErrKey, user.ID)).Result() - if err == nil { - conf.Redis.Expire(ctx, fmt.Sprintf("%s:%d", _LoginErrKey, user.ID), time.Hour).Result() - } - - return nil, errcode.UnauthorizedAuthFailed - } - - return nil, errcode.UnauthorizedAuthNotExist -} - -// ValidPassword 检查密码是否一致 -func ValidPassword(dbPassword, password, salt string) bool { - return strings.Compare(dbPassword, util.EncodeMD5(util.EncodeMD5(password)+salt)) == 0 -} - -// CheckStatus 检测用户权限 -func CheckStatus(user *core.User) bool { - return user.Status == core.UserStatusNormal -} - -// ValidUsername 验证用户 -func ValidUsername(username string) error { - // 检测用户是否合规 - if utf8.RuneCountInString(username) < 3 || utf8.RuneCountInString(username) > 12 { - return errcode.UsernameLengthLimit - } - - if !regexp.MustCompile(`^[a-zA-Z0-9]+$`).MatchString(username) { - return errcode.UsernameCharLimit - } - - // 重复检查 - user, _ := ds.GetUserByUsername(username) - - if user.Model != nil && user.ID > 0 { - return errcode.UsernameHasExisted - } - - return nil -} - -// CheckPassword 密码检查 -func CheckPassword(password string) error { - // 检测用户是否合规 - if utf8.RuneCountInString(password) < 6 || utf8.RuneCountInString(password) > 16 { - return errcode.PasswordLengthLimit - } - - return nil -} - -// CheckPhoneCaptcha 验证手机验证码 -func CheckPhoneCaptcha(phone, captcha string) *errcode.Error { - // 如果禁止phone verify 则允许通过任意验证码 - if DisablePhoneVerify { - return nil - } - - c, err := ds.GetLatestPhoneCaptcha(phone) - if err != nil { - return errcode.ErrorPhoneCaptcha - } - - if c.Captcha != captcha { - return errcode.ErrorPhoneCaptcha - } - - if c.ExpiredOn < time.Now().Unix() { - return errcode.ErrorPhoneCaptcha - } - - if c.UseTimes >= _MaxCaptchaTimes { - return errcode.MaxPhoneCaptchaUseTimes - } - - // 更新检测次数 - ds.UsePhoneCaptcha(c) - - return nil -} - -// CheckPhoneExist 检测手机号是否存在 -func CheckPhoneExist(uid int64, phone string) bool { - u, err := ds.GetUserByPhone(phone) - if err != nil { - return false - } - - if u.Model == nil || u.ID == 0 { - return false - } - - if u.ID == uid { - return false - } - - return true -} - -// EncryptPasswordAndSalt 密码加密&生成salt -func EncryptPasswordAndSalt(password string) (string, string) { - salt := uuid.Must(uuid.NewV4()).String()[:8] - password = util.EncodeMD5(util.EncodeMD5(password) + salt) - - return password, salt -} - -// Register 用户注册 -func Register(username, password string) (*core.User, error) { - password, salt := EncryptPasswordAndSalt(password) - - user := &core.User{ - Nickname: username, - Username: username, - Password: password, - Avatar: GetRandomAvatar(), - Salt: salt, - Status: core.UserStatusNormal, - } - - user, err := ds.CreateUser(user) - if err != nil { - return nil, err - } - - return user, nil -} - -func RequestingFriend(user *core.User, param *RequestingFriendReq) error { - if _, err := ds.GetUserByID(param.UserId); err != nil { - return errcode.NotExistFriendId - } - return ds.RequestingFriend(user.ID, param.UserId, param.Greetings) -} - -func AddFriend(user *core.User, param *AddFriendReq) error { - if _, err := ds.GetUserByID(param.UserId); err != nil { - return errcode.NotExistFriendId - } - return ds.AddFriend(user.ID, param.UserId) -} - -func RejectFriend(user *core.User, param *RejectFriendReq) error { - if _, err := ds.GetUserByID(param.UserId); err != nil { - return errcode.NotExistFriendId - } - return ds.RejectFriend(user.ID, param.UserId) -} - -func DeleteFriend(user *core.User, param *DeleteFriendReq) error { - if _, err := ds.GetUserByID(param.UserId); err != nil { - return errcode.NotExistFriendId - } - return ds.DeleteFriend(user.ID, param.UserId) -} - -func GetContacts(user *core.User, offset int, limit int) (*core.ContactList, error) { - return ds.GetContacts(user.ID, offset, limit) -} - -// GetUserInfo 获取用户信息 -func GetUserInfo(param *AuthRequest) (*core.User, error) { - user, err := ds.GetUserByUsername(param.Username) - - if err != nil { - return nil, err - } - - if user.Model != nil && user.ID > 0 { - return user, nil - } - - return nil, errcode.UnauthorizedAuthNotExist -} - -func GetUserByID(id int64) (*core.User, error) { - user, err := ds.GetUserByID(id) - - if err != nil { - return nil, err - } - - if user.Model != nil && user.ID > 0 { - return user, nil - } - - return nil, errcode.NoExistUsername -} - -func GetUserByUsername(user *core.User, username string) (*UserProfileResp, error) { - other, err := ds.GetUserByUsername(username) - if err != nil { - return nil, err - } - - var resp *UserProfileResp - if other.Model != nil && other.ID > 0 { - resp = &UserProfileResp{ - ID: other.ID, - Nickname: other.Nickname, - Username: other.Username, - Status: other.Status, - Avatar: other.Avatar, - IsAdmin: other.IsAdmin, - IsFriend: !(user == nil || user.ID == other.ID), - } - } else { - return nil, errcode.NoExistUsername - } - - if user != nil && user.ID != other.ID { - resp.IsFriend = ds.IsFriend(user.ID, other.ID) - } - return resp, nil -} - -// UpdateUserInfo 更新用户信息 -func UpdateUserInfo(user *core.User) *errcode.Error { - if err := ds.UpdateUser(user); err != nil { - return errcode.ServerError - } - return nil -} - -func ChangeUserAvatar(user *core.User, avatar string) (err *errcode.Error) { - defer func() { - if err != nil { - deleteOssObjects([]string{avatar}) - } - }() - - if err := ds.CheckAttachment(avatar); err != nil { - return errcode.InvalidParams - } - - if err := oss.PersistObject(oss.ObjectKey(avatar)); err != nil { - logrus.Errorf("service.ChangeUserAvatar persist object failed: %s", err) - return errcode.ServerError - } - - user.Avatar = avatar - err = UpdateUserInfo(user) - return -} - -// GetUserCollections 获取用户收藏列表 -func GetUserCollections(userID int64, offset, limit int) ([]*core.PostFormated, int64, error) { - collections, err := ds.GetUserPostCollections(userID, offset, limit) - if err != nil { - return nil, 0, err - } - totalRows, err := ds.GetUserPostCollectionCount(userID) - if err != nil { - return nil, 0, err - } - var posts []*core.Post - for _, collection := range collections { - posts = append(posts, collection.Post) - } - postsFormated, err := ds.MergePosts(posts) - if err != nil { - return nil, 0, err - } - - return postsFormated, totalRows, nil -} - -// GetUserStars 获取用户点赞列表 -func GetUserStars(userID int64, offset, limit int) ([]*core.PostFormated, int64, error) { - stars, err := ds.GetUserPostStars(userID, offset, limit) - if err != nil { - return nil, 0, err - } - totalRows, err := ds.GetUserPostStarCount(userID) - if err != nil { - return nil, 0, err - } - - var posts []*core.Post - for _, star := range stars { - posts = append(posts, star.Post) - } - postsFormated, err := ds.MergePosts(posts) - if err != nil { - return nil, 0, err - } - - return postsFormated, totalRows, nil -} - -// GetUserWalletBills 获取用户账单列表 -func GetUserWalletBills(userID int64, offset, limit int) ([]*core.WalletStatement, int64, error) { - bills, err := ds.GetUserWalletBills(userID, offset, limit) - if err != nil { - return nil, 0, err - } - totalRows, err := ds.GetUserWalletBillCount(userID) - if err != nil { - return nil, 0, err - } - - return bills, totalRows, nil -} - -// SendPhoneCaptcha 发送短信验证码 -func SendPhoneCaptcha(ctx *gin.Context, phone string) error { - - err := ds.SendPhoneCaptcha(phone) - if err != nil { - return err - } - - // 写入计数缓存 - conf.Redis.Incr(ctx, "PaoPaoSmsCaptcha:"+phone).Result() - - currentTime := time.Now() - endTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), 23, 59, 59, 0, currentTime.Location()) - - conf.Redis.Expire(ctx, "PaoPaoSmsCaptcha:"+phone, endTime.Sub(currentTime)) - - return nil -} - -// GetSuggestUsers 根据关键词获取用户推荐 -func GetSuggestUsers(keyword string) ([]string, error) { - users, err := ds.GetUsersByKeyword(keyword) - if err != nil { - return nil, err - } - - usernames := []string{} - for _, user := range users { - usernames = append(usernames, user.Username) - } - - return usernames, nil -} - -// GetSuggestTags 根据关键词获取标签推荐 -func GetSuggestTags(keyword string) ([]string, error) { - tags, err := ds.GetTagsByKeyword(keyword) - if err != nil { - return nil, err - } - - ts := []string{} - for _, t := range tags { - ts = append(ts, t.Tag) - } - - return ts, nil -} - -func IsFriend(userId, friendId int64) bool { - return ds.IsFriend(userId, friendId) -} - -// checkPermision 检查是否拥有者或管理员 -func checkPermision(user *core.User, targetUserId int64) *errcode.Error { - if user == nil || (user.ID != targetUserId && !user.IsAdmin) { - return errcode.NoPermission - } - return nil -} diff --git a/internal/servants/web/broker/wallet.go b/internal/servants/web/broker/wallet.go deleted file mode 100644 index 6f89edf8..00000000 --- a/internal/servants/web/broker/wallet.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package broker - -import ( - "github.com/rocboss/paopao-ce/internal/core" - "time" - - "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/pkg/errcode" -) - -type RechargeReq struct { - Amount int64 `json:"amount" form:"amount" binding:"required"` -} - -func GetRechargeByID(id int64) (*core.WalletRecharge, error) { - return ds.GetRechargeByID(id) -} - -func CreateRecharge(userID, amount int64) (*core.WalletRecharge, error) { - return ds.CreateRecharge(userID, amount) -} - -func FinishRecharge(ctx *gin.Context, id int64, tradeNo string) error { - if ok, _ := conf.Redis.SetNX(ctx, "PaoPaoRecharge:"+tradeNo, 1, time.Second*5).Result(); ok { - recharge, err := ds.GetRechargeByID(id) - if err != nil { - return err - } - - if recharge.TradeStatus != "TRADE_SUCCESS" { - - // 标记为已付款 - err := ds.HandleRechargeSuccess(recharge, tradeNo) - defer conf.Redis.Del(ctx, "PaoPaoRecharge:"+tradeNo) - - if err != nil { - return err - } - } - - } - - return nil -} - -func BuyPostAttachment(post *core.Post, user *core.User) error { - if user.Balance < post.AttachmentPrice { - return errcode.InsuffientDownloadMoney - } - - // 执行购买 - return ds.HandlePostAttachmentBought(post, user) -} diff --git a/internal/servants/web/core.go b/internal/servants/web/core.go index 92dcfbaa..c1337fe9 100644 --- a/internal/servants/web/core.go +++ b/internal/servants/web/core.go @@ -6,20 +6,18 @@ package web import ( "context" - "fmt" "time" "unicode/utf8" - "github.com/alimy/cfg" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/model/web" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/internal/servants/chain" - "github.com/rocboss/paopao-ce/pkg/convert" "github.com/rocboss/paopao-ce/pkg/xerror" "github.com/sirupsen/logrus" ) @@ -31,11 +29,7 @@ const ( ) var ( - _ api.Core = (*coreSrv)(nil) - _ api.CoreBinding = (*coreBinding)(nil) - _ api.CoreRender = (*coreRender)(nil) - - _EnablePhoneVerify = cfg.If("Sms") + _ api.Core = (*coreSrv)(nil) ) type coreSrv struct { @@ -45,77 +39,6 @@ type coreSrv struct { oss core.ObjectStorageService } -type coreBinding struct { - *api.UnimplementedCoreBinding -} - -type coreRender struct { - *api.UnimplementedCoreRender -} - -func (b *coreBinding) BindGetUserInfo(c *gin.Context) (*web.UserInfoReq, mir.Error) { - username, exist := base.UserNameFrom(c) - if !exist { - return nil, xerror.UnauthorizedAuthNotExist - } - return &web.UserInfoReq{ - Username: username, - }, nil -} - -func (b *coreBinding) BindGetMessages(c *gin.Context) (*web.GetMessagesReq, mir.Error) { - v, err := web.BasePageReqFrom(c) - return (*web.GetMessagesReq)(v), err -} - -func (b *coreBinding) BindGetCollections(c *gin.Context) (*web.GetCollectionsReq, mir.Error) { - v, err := web.BasePageReqFrom(c) - return (*web.GetCollectionsReq)(v), err -} - -func (b *coreBinding) BindGetStars(c *gin.Context) (*web.GetStarsReq, mir.Error) { - v, err := web.BasePageReqFrom(c) - return (*web.GetStarsReq)(v), err -} - -func (b *coreBinding) BindSuggestTags(c *gin.Context) (*web.SuggestTagsReq, mir.Error) { - return &web.SuggestTagsReq{ - Keyword: c.Query("k"), - }, nil -} - -func (b *coreBinding) BindSuggestUsers(c *gin.Context) (*web.SuggestUsersReq, mir.Error) { - return &web.SuggestUsersReq{ - Keyword: c.Query("k"), - }, nil -} - -func (b *coreBinding) BindTweetCollectionStatus(c *gin.Context) (*web.TweetCollectionStatusReq, mir.Error) { - UserId, exist := base.UserIdFrom(c) - if !exist { - return nil, xerror.UnauthorizedAuthNotExist - } - return &web.TweetCollectionStatusReq{ - SimpleInfo: web.SimpleInfo{ - Uid: UserId, - }, - TweetId: convert.StrTo(c.Query("id")).MustInt64(), - }, nil -} - -func (b *coreBinding) BindTweetStarStatus(c *gin.Context) (*web.TweetStarStatusReq, mir.Error) { - UserId, exist := base.UserIdFrom(c) - if !exist { - return nil, xerror.UnauthorizedAuthNotExist - } - return &web.TweetStarStatusReq{ - SimpleInfo: web.SimpleInfo{ - Uid: UserId, - }, - TweetId: convert.StrTo(c.Query("id")).MustInt64(), - }, nil -} - func (s *coreSrv) Chain() gin.HandlersChain { return gin.HandlersChain{chain.JWT()} } @@ -123,6 +46,8 @@ func (s *coreSrv) Chain() gin.HandlersChain { func (s *coreSrv) SyncSearchIndex(req *web.SyncSearchIndexReq) mir.Error { if req.User != nil && req.User.IsAdmin { go s.PushPostsToSearch(context.Background()) + } else { + logrus.Warnf("sync search index need admin permision user: %#v", req.User) } return nil } @@ -161,7 +86,7 @@ func (s *coreSrv) GetUnreadMsgCount(req *web.GetUnreadMsgCountReq) (*web.GetUnre } func (s *coreSrv) GetMessages(req *web.GetMessagesReq) (*web.GetMessagesResp, mir.Error) { - conditions := &core.ConditionsT{ + conditions := &ms.ConditionsT{ "receiver_user_id": req.UserId, "ORDER": "id DESC", } @@ -174,7 +99,7 @@ func (s *coreSrv) GetMessages(req *web.GetMessagesReq) (*web.GetMessagesResp, mi } } // 好友申请消息不需要获取其他信息 - if mf.Type == core.MsgTypeRequestingFriend { + if mf.Type == ms.MsgTypeRequestingFriend { continue } if mf.PostID > 0 { @@ -198,7 +123,7 @@ func (s *coreSrv) GetMessages(req *web.GetMessagesReq) (*web.GetMessagesResp, mi } if err != nil { logrus.Errorf("Ds.GetMessages err: %v\n", err) - return nil, _errGetMessagesFailed + return nil, web.ErrGetMessagesFailed } totalRows, _ := s.Ds.GetMessageCount(conditions) resp := base.PageRespFrom(messages, req.Page, req.PageSize, totalRows) @@ -208,14 +133,14 @@ func (s *coreSrv) GetMessages(req *web.GetMessagesReq) (*web.GetMessagesResp, mi func (s *coreSrv) ReadMessage(req *web.ReadMessageReq) mir.Error { message, err := s.Ds.GetMessageByID(req.ID) if err != nil { - return _errReadMessageFailed + return web.ErrReadMessageFailed } if message.ReceiverUserID != req.Uid { - return _errNoPermission + return web.ErrNoPermission } if err = s.Ds.ReadMessage(message); err != nil { logrus.Errorf("Ds.ReadMessage err: %s", err) - return _errReadMessageFailed + return web.ErrReadMessageFailed } return nil } @@ -223,34 +148,30 @@ func (s *coreSrv) ReadMessage(req *web.ReadMessageReq) mir.Error { func (s *coreSrv) SendUserWhisper(req *web.SendWhisperReq) mir.Error { // 不允许发送私信给自己 if req.Uid == req.UserID { - return _errNoWhisperToSelf + return web.ErrNoWhisperToSelf } // 今日频次限制 ctx := context.Background() - whisperKey := fmt.Sprintf("WhisperTimes:%d", req.Uid) - if res, _ := s.Redis.Get(ctx, whisperKey).Result(); convert.StrTo(res).MustInt() >= _MaxWhisperNumDaily { - return _errTooManyWhisperNum + if count, _ := s.Redis.GetCountWhisper(ctx, req.Uid); count >= _MaxWhisperNumDaily { + return web.ErrTooManyWhisperNum } // 创建私信 - _, err := s.Ds.CreateMessage(&core.Message{ + _, err := s.Ds.CreateMessage(&ms.Message{ SenderUserID: req.Uid, ReceiverUserID: req.UserID, - Type: core.MsgTypeWhisper, + Type: ms.MsgTypeWhisper, Brief: "给你发送新私信了", Content: req.Content, }) if err != nil { logrus.Errorf("Ds.CreateWhisper err: %s", err) - return _errSendWhisperFailed + return web.ErrSendWhisperFailed } // 写入当日(自然日)计数缓存 - s.Redis.Incr(ctx, whisperKey).Result() - currentTime := time.Now() - endTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), 23, 59, 59, 0, currentTime.Location()) - s.Redis.Expire(ctx, whisperKey, endTime.Sub(currentTime)) + s.Redis.IncrCountWhisper(ctx, req.Uid) return nil } @@ -259,22 +180,22 @@ func (s *coreSrv) GetCollections(req *web.GetCollectionsReq) (*web.GetCollection collections, err := s.Ds.GetUserPostCollections(req.UserId, (req.Page-1)*req.PageSize, req.PageSize) if err != nil { logrus.Errorf("Ds.GetUserPostCollections err: %s", err) - return nil, _errGetCollectionsFailed + return nil, web.ErrGetCollectionsFailed } totalRows, err := s.Ds.GetUserPostCollectionCount(req.UserId) if err != nil { logrus.Errorf("Ds.GetUserPostCollectionCount err: %s", err) - return nil, _errGetCollectionsFailed + return nil, web.ErrGetCollectionsFailed } - var posts []*core.Post + var posts []*ms.Post for _, collection := range collections { posts = append(posts, collection.Post) } postsFormated, err := s.Ds.MergePosts(posts) if err != nil { logrus.Errorf("Ds.MergePosts err: %s", err) - return nil, _errGetCollectionsFailed + return nil, web.ErrGetCollectionsFailed } resp := base.PageRespFrom(postsFormated, req.Page, req.PageSize, totalRows) @@ -284,31 +205,24 @@ func (s *coreSrv) GetCollections(req *web.GetCollectionsReq) (*web.GetCollection func (s *coreSrv) UserPhoneBind(req *web.UserPhoneBindReq) mir.Error { // 手机重复性检查 u, err := s.Ds.GetUserByPhone(req.Phone) - if err != nil { - logrus.Errorf("Ds.GetUserByPhone err: %v", err) - return _errExistedUserPhone - } - if u.Model == nil || u.ID == 0 { - return _errExistedUserPhone - } - if u.ID == req.User.ID { - return _errExistedUserPhone + if err == nil && u.Model != nil && u.ID != 0 && u.ID != req.User.ID { + return web.ErrExistedUserPhone } // 如果禁止phone verify 则允许通过任意验证码 - if !_EnablePhoneVerify { + if _enablePhoneVerify { c, err := s.Ds.GetLatestPhoneCaptcha(req.Phone) if err != nil { - return _errErrorPhoneCaptcha + return web.ErrErrorPhoneCaptcha } if c.Captcha != req.Captcha { - return _errErrorPhoneCaptcha + return web.ErrErrorPhoneCaptcha } if c.ExpiredOn < time.Now().Unix() { - return _errErrorPhoneCaptcha + return web.ErrErrorPhoneCaptcha } if c.UseTimes >= _MaxCaptchaTimes { - return _errMaxPhoneCaptchaUseTimes + return web.ErrMaxPhoneCaptchaUseTimes } // 更新检测次数 s.Ds.UsePhoneCaptcha(c) @@ -326,28 +240,26 @@ func (s *coreSrv) UserPhoneBind(req *web.UserPhoneBindReq) mir.Error { } func (s *coreSrv) GetStars(req *web.GetStarsReq) (*web.GetStarsResp, mir.Error) { - stars, err := s.Ds.GetUserPostStars(req.UserId, (req.Page-1)*req.PageSize, req.PageSize) + stars, err := s.Ds.GetUserPostStars(req.UserId, req.PageSize, (req.Page-1)*req.PageSize) if err != nil { logrus.Errorf("Ds.GetUserPostStars err: %s", err) - return nil, _errGetStarsFailed + return nil, web.ErrGetStarsFailed } totalRows, err := s.Ds.GetUserPostStarCount(req.UserId) if err != nil { logrus.Errorf("Ds.GetUserPostStars err: %s", err) - return nil, _errGetStarsFailed + return nil, web.ErrGetStarsFailed } - - var posts []*core.Post + var posts []*ms.Post for _, star := range stars { posts = append(posts, star.Post) } postsFormated, err := s.Ds.MergePosts(posts) if err != nil { logrus.Errorf("Ds.MergePosts err: %s", err) - return nil, _errGetStarsFailed + return nil, web.ErrGetStarsFailed } resp := base.PageRespFrom(postsFormated, req.Page, req.PageSize, totalRows) - return (*web.GetStarsResp)(resp), nil } @@ -359,7 +271,7 @@ func (s *coreSrv) ChangePassword(req *web.ChangePasswordReq) mir.Error { // 旧密码校验 user := req.User if !validPassword(user.Password, req.OldPassword, req.User.Salt) { - return _errErrorOldPassword + return web.ErrErrorOldPassword } // 更新入库 user.Password, user.Salt = encryptPasswordAndSalt(req.Password) @@ -371,7 +283,7 @@ func (s *coreSrv) ChangePassword(req *web.ChangePasswordReq) mir.Error { } func (s *coreSrv) SuggestTags(req *web.SuggestTagsReq) (*web.SuggestTagsResp, mir.Error) { - tags, err := s.Ds.GetTagsByKeyword(req.Keyword) + tags, err := s.Ds.TagsByKeyword(req.Keyword) if err != nil { logrus.Errorf("Ds.GetTagsByKeyword err: %s", err) return nil, xerror.ServerError @@ -398,7 +310,7 @@ func (s *coreSrv) SuggestUsers(req *web.SuggestUsersReq) (*web.SuggestUsersResp, func (s *coreSrv) ChangeNickname(req *web.ChangeNicknameReq) mir.Error { if utf8.RuneCountInString(req.Nickname) < 2 || utf8.RuneCountInString(req.Nickname) > 12 { - return _errNicknameLengthLimit + return web.ErrNicknameLengthLimit } user := req.User user.Nickname = req.Nickname @@ -461,19 +373,3 @@ func newCoreSrv(s *base.DaoServant, oss core.ObjectStorageService) api.Core { oss: oss, } } - -func newCoreBinding() api.CoreBinding { - return &coreBinding{ - UnimplementedCoreBinding: &api.UnimplementedCoreBinding{ - BindAny: base.BindAny, - }, - } -} - -func newCoreRender() api.CoreRender { - return &coreRender{ - UnimplementedCoreRender: &api.UnimplementedCoreRender{ - RenderAny: base.RenderAny, - }, - } -} diff --git a/internal/servants/web/followship.go b/internal/servants/web/followship.go index 95d19ec3..eb9cc14f 100644 --- a/internal/servants/web/followship.go +++ b/internal/servants/web/followship.go @@ -12,9 +12,7 @@ import ( ) var ( - _ api.Followship = (*followshipSrv)(nil) - _ api.FollowshipBinding = (*followshipBinding)(nil) - _ api.FollowshipRender = (*followshipRender)(nil) + _ api.Followship = (*followshipSrv)(nil) ) type followshipSrv struct { @@ -22,14 +20,6 @@ type followshipSrv struct { *base.DaoServant } -type followshipBinding struct { - *api.UnimplementedFollowshipBinding -} - -type followshipRender struct { - *api.UnimplementedFollowshipRender -} - func (s *followshipSrv) Chain() gin.HandlersChain { return gin.HandlersChain{chain.JWT()} } @@ -37,19 +27,3 @@ func (s *followshipSrv) Chain() gin.HandlersChain { func newFollowshipSrv(s *base.DaoServant) api.Followship { return &followshipSrv{} } - -func newFollowshipBinding() api.FollowshipBinding { - return &followshipBinding{ - UnimplementedFollowshipBinding: &api.UnimplementedFollowshipBinding{ - BindAny: base.BindAny, - }, - } -} - -func newFollowshipRender() api.FollowshipRender { - return &followshipRender{ - UnimplementedFollowshipRender: &api.UnimplementedFollowshipRender{ - RenderAny: base.RenderAny, - }, - } -} diff --git a/internal/servants/web/friendship.go b/internal/servants/web/friendship.go index 54c239ba..4a419666 100644 --- a/internal/servants/web/friendship.go +++ b/internal/servants/web/friendship.go @@ -5,7 +5,7 @@ package web import ( - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/model/web" @@ -16,9 +16,7 @@ import ( ) var ( - _ api.Friendship = (*friendshipSrv)(nil) - _ api.FriendshipBinding = (*friendshipBinding)(nil) - _ api.FriendshipRender = (*friendshipRender)(nil) + _ api.Friendship = (*friendshipSrv)(nil) ) type friendshipSrv struct { @@ -26,14 +24,6 @@ type friendshipSrv struct { *base.DaoServant } -type friendshipBinding struct { - *api.UnimplementedFriendshipBinding -} - -type friendshipRender struct { - *api.UnimplementedFriendshipRender -} - func (s *friendshipSrv) Chain() gin.HandlersChain { return gin.HandlersChain{chain.JWT()} } @@ -45,7 +35,7 @@ func (s *friendshipSrv) GetContacts(req *web.GetContactsReq) (*web.GetContactsRe res, err := s.Ds.GetContacts(req.User.ID, (req.Page-1)*req.PageSize, req.PageSize) if err != nil { logrus.Errorf("service.GetContacts err: %s", err) - return nil, _errGetContactsFailed + return nil, web.ErrGetContactsFailed } resp := base.PageRespFrom(res.Contacts, req.Page, req.PageSize, res.Total) return (*web.GetContactsResp)(resp), nil @@ -56,14 +46,14 @@ func (s *friendshipSrv) DeleteFriend(req *web.DeleteFriendReq) mir.Error { return xerror.ServerError } if req.User != nil && req.User.ID == req.UserId { - return _errNoActionToSelf + return web.ErrNoActionToSelf } if _, err := s.Ds.GetUserByID(req.UserId); err != nil { - return _errNotExistFriendId + return web.ErrNotExistFriendId } if err := s.Ds.DeleteFriend(req.User.ID, req.UserId); err != nil { logrus.Errorf("Ds.DeleteFriend err: %s", err) - return _errDeleteFriendFailed + return web.ErrDeleteFriendFailed } return nil } @@ -73,14 +63,14 @@ func (s *friendshipSrv) RejectFriend(req *web.RejectFriendReq) mir.Error { return xerror.ServerError } if req.User.ID == req.UserId { - return _errNoActionToSelf + return web.ErrNoActionToSelf } if _, err := s.Ds.GetUserByID(req.UserId); err != nil { - return _errNotExistFriendId + return web.ErrNotExistFriendId } if err := s.Ds.RejectFriend(req.User.ID, req.UserId); err != nil { logrus.Errorf("Ds.RejectFriend err: %s", err) - return _errRejectFriendFailed + return web.ErrRejectFriendFailed } return nil } @@ -90,14 +80,14 @@ func (s *friendshipSrv) AddFriend(req *web.AddFriendReq) mir.Error { return xerror.ServerError } if req.User.ID == req.UserId { - return _errNoActionToSelf + return web.ErrNoActionToSelf } if _, err := s.Ds.GetUserByID(req.UserId); err != nil { - return _errNotExistFriendId + return web.ErrNotExistFriendId } if err := s.Ds.AddFriend(req.User.ID, req.UserId); err != nil { logrus.Errorf("Ds.AddFriend err: %s", err) - return _errAddFriendFailed + return web.ErrAddFriendFailed } return nil } @@ -107,14 +97,14 @@ func (s *friendshipSrv) RequestingFriend(req *web.RequestingFriendReq) mir.Error return xerror.ServerError } if req.User.ID == req.UserId { - return _errNoRequestingFriendToSelf + return web.ErrNoRequestingFriendToSelf } if _, err := s.Ds.GetUserByID(req.UserId); err != nil { - return _errNotExistFriendId + return web.ErrNotExistFriendId } if err := s.Ds.RequestingFriend(req.User.ID, req.UserId, req.Greetings); err != nil { logrus.Errorf("Ds.RequestingFriend err: %s", err) - return _errSendRequestingFriendFailed + return web.ErrSendRequestingFriendFailed } return nil } @@ -124,19 +114,3 @@ func newFriendshipSrv(s *base.DaoServant) api.Friendship { DaoServant: s, } } - -func newFriendshipBinding() api.FriendshipBinding { - return &friendshipBinding{ - UnimplementedFriendshipBinding: &api.UnimplementedFriendshipBinding{ - BindAny: base.BindAny, - }, - } -} - -func newFriendshipRender() api.FriendshipRender { - return &friendshipRender{ - UnimplementedFriendshipRender: &api.UnimplementedFriendshipRender{ - RenderAny: base.RenderAny, - }, - } -} diff --git a/internal/servants/web/loose.go b/internal/servants/web/loose.go index 9e9b1bff..9c2877e7 100644 --- a/internal/servants/web/loose.go +++ b/internal/servants/web/loose.go @@ -5,21 +5,21 @@ package web import ( - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" + "github.com/rocboss/paopao-ce/internal/dao/jinzhu/dbr" "github.com/rocboss/paopao-ce/internal/model/web" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/internal/servants/chain" - "github.com/rocboss/paopao-ce/pkg/app" "github.com/sirupsen/logrus" ) var ( - _ api.Loose = (*looseSrv)(nil) - _ api.LooseBinding = (*looseBinding)(nil) - _ api.LooseRender = (*looseRender)(nil) + _ api.Loose = (*looseSrv)(nil) ) type looseSrv struct { @@ -27,32 +27,6 @@ type looseSrv struct { *base.DaoServant } -type looseBinding struct { - *api.UnimplementedLooseBinding -} - -type looseRender struct { - *api.UnimplementedLooseRender -} - -func (s *looseBinding) BindTimeline(c *gin.Context) (*web.TimelineReq, mir.Error) { - user, _ := base.UserFrom(c) - page, pageSize := app.GetPageInfo(c) - v := &web.TimelineReq{ - BaseInfo: web.BaseInfo{ - User: user, - }, - Query: c.Query("query"), - Type: "search", - Page: page, - PageSize: pageSize, - } - if c.Query("type") == "tag" { - v.Type = "tag" - } - return v, nil -} - func (s *looseSrv) Chain() gin.HandlersChain { return gin.HandlersChain{chain.JwtLoose()} } @@ -64,7 +38,7 @@ func (s *looseSrv) Timeline(req *web.TimelineReq) (*web.TimelineResp, mir.Error) res, err := s.Ds.IndexPosts(req.User, offset, limit) if err != nil { logrus.Errorf("Ds.IndexPosts err: %s", err) - return nil, _errGetPostsFailed + return nil, web.ErrGetPostsFailed } resp = base.PageRespFrom(res.Tweets, req.Page, req.PageSize, res.Total) } else { @@ -75,51 +49,116 @@ func (s *looseSrv) Timeline(req *web.TimelineReq) (*web.TimelineResp, mir.Error) res, err := s.Ts.Search(req.User, q, offset, limit) if err != nil { logrus.Errorf("Ts.Search err: %s", err) - return nil, _errGetPostsFailed + return nil, web.ErrGetPostsFailed } posts, err := s.Ds.RevampPosts(res.Items) if err != nil { logrus.Errorf("Ds.RevampPosts err: %s", err) - return nil, _errGetPostsFailed + return nil, web.ErrGetPostsFailed } resp = base.PageRespFrom(posts, req.Page, req.PageSize, res.Total) } return (*web.TimelineResp)(resp), nil } -func (s *looseSrv) GetUserTweets(req *web.GetUserTweetsReq) (*web.GetUserTweetsResp, mir.Error) { - other, xerr := s.GetUserProfile(&web.GetUserProfileReq{ - BaseInfo: req.BaseInfo, - Username: req.Username, - }) +func (s *looseSrv) GetUserTweets(req *web.GetUserTweetsReq) (res *web.GetUserTweetsResp, err mir.Error) { + user, xerr := s.RelationTypFrom(req.User, req.Username) if xerr != nil { - return nil, xerr + return nil, err } - visibilities := []core.PostVisibleT{core.PostVisitPublic} - if req.User != nil { - if req.User.ID == other.ID || req.User.IsAdmin { - visibilities = append(visibilities, core.PostVisitPrivate, core.PostVisitFriend) - } else if other.IsFriend { - visibilities = append(visibilities, core.PostVisitFriend) + switch req.Style { + case web.UserPostsStyleComment: + res, err = s.getUserCommentTweets(req, user) + case web.UserPostsStyleHighlight: + res, err = s.getUserPostTweets(req, user, true) + case web.UserPostsStyleMedia: + res, err = s.getUserMediaTweets(req, user) + case web.UserPostsStyleStar: + res, err = s.getUserStarTweets(req, user) + case web.UserPostsStylePost: + fallthrough + default: + res, err = s.getUserPostTweets(req, user, false) + } + return +} + +func (s *looseSrv) getUserCommentTweets(req *web.GetUserTweetsReq, user *cs.VistUser) (*web.GetUserTweetsResp, mir.Error) { + // TODO: add implement logic + resp := base.PageRespFrom(nil, req.Page, req.PageSize, 0) + return (*web.GetUserTweetsResp)(resp), nil +} + +func (s *looseSrv) getUserHighlightTweets(req *web.GetUserTweetsReq, user *cs.VistUser) (*web.GetUserTweetsResp, mir.Error) { + // TODO: add implement logic + resp := base.PageRespFrom(nil, req.Page, req.PageSize, 0) + return (*web.GetUserTweetsResp)(resp), nil +} + +func (s *looseSrv) getUserMediaTweets(req *web.GetUserTweetsReq, user *cs.VistUser) (*web.GetUserTweetsResp, mir.Error) { + // TODO: add implement logic + resp := base.PageRespFrom(nil, req.Page, req.PageSize, 0) + return (*web.GetUserTweetsResp)(resp), nil +} + +func (s *looseSrv) getSelfMediaTweets(req *web.GetUserTweetsReq) (*web.GetUserTweetsResp, mir.Error) { + // TODO: add implement logic + resp := base.PageRespFrom(nil, req.Page, req.PageSize, 0) + return (*web.GetUserTweetsResp)(resp), nil +} + +func (s *looseSrv) getUserStarTweets(req *web.GetUserTweetsReq, user *cs.VistUser) (*web.GetUserTweetsResp, mir.Error) { + stars, totalRows, err := s.Ds.ListUserStarTweets(user, req.PageSize, (req.Page-1)*req.PageSize) + if err != nil { + logrus.Errorf("Ds.GetUserPostStars err: %s", err) + return nil, web.ErrGetStarsFailed + } + var posts []*ms.Post + for _, star := range stars { + if star.Post != nil { + posts = append(posts, star.Post) } } - conditions := &core.ConditionsT{ - "user_id": other.ID, + postsFormated, err := s.Ds.MergePosts(posts) + if err != nil { + logrus.Errorf("Ds.MergePosts err: %s", err) + return nil, web.ErrGetStarsFailed + } + resp := base.PageRespFrom(postsFormated, req.Page, req.PageSize, totalRows) + return (*web.GetUserTweetsResp)(resp), nil +} + +func (s *looseSrv) getUserPostTweets(req *web.GetUserTweetsReq, user *cs.VistUser, isHighlight bool) (*web.GetUserTweetsResp, mir.Error) { + visibilities := []core.PostVisibleT{core.PostVisitPublic} + switch user.RelTyp { + case cs.RelationAdmin, cs.RelationSelf: + visibilities = append(visibilities, core.PostVisitPrivate, core.PostVisitFriend) + case cs.RelationFriend: + visibilities = append(visibilities, core.PostVisitFriend) + case cs.RelationGuest: + fallthrough + default: + // nothing + } + conditions := ms.ConditionsT{ + "user_id": user.UserId, "visibility IN ?": visibilities, "ORDER": "latest_replied_on DESC", } + if isHighlight { + conditions["is_essence"] = 1 + } _, posts, err := s.GetTweetList(conditions, (req.Page-1)*req.PageSize, req.PageSize) if err != nil { logrus.Errorf("s.GetTweetList err: %s", err) - return nil, _errGetPostsFailed + return nil, web.ErrGetPostsFailed } totalRows, err := s.Ds.GetPostCount(conditions) if err != nil { logrus.Errorf("s.GetPostCount err: %s", err) - return nil, _errGetPostsFailed + return nil, web.ErrGetPostsFailed } - resp := base.PageRespFrom(posts, req.Page, req.PageSize, totalRows) return (*web.GetUserTweetsResp)(resp), nil } @@ -128,10 +167,10 @@ func (s *looseSrv) GetUserProfile(req *web.GetUserProfileReq) (*web.GetUserProfi he, err := s.Ds.GetUserByUsername(req.Username) if err != nil { logrus.Errorf("Ds.GetUserByUsername err: %s", err) - return nil, _errNoExistUsername + return nil, web.ErrNoExistUsername } if he.Model == nil && he.ID <= 0 { - return nil, _errNoExistUsername + return nil, web.ErrNoExistUsername } // 设定自己不是自己的朋友 isFriend := !(req.User == nil || req.User.ID == he.ID) @@ -149,24 +188,130 @@ func (s *looseSrv) GetUserProfile(req *web.GetUserProfileReq) (*web.GetUserProfi }, nil } -func newLooseSrv(s *base.DaoServant) api.Loose { - return &looseSrv{ - DaoServant: s, +func (s *looseSrv) TopicList(req *web.TopicListReq) (*web.TopicListResp, mir.Error) { + var ( + tags, extralTags cs.TagList + err error + ) + num := req.Num + switch req.Type { + case web.TagTypeHot: + tags, err = s.Ds.GetHotTags(req.Uid, num, 0) + case web.TagTypeNew: + tags, err = s.Ds.GetNewestTags(req.Uid, num, 0) + case web.TagTypeFollow: + tags, err = s.Ds.GetFollowTags(req.Uid, num, 0) + case web.TagTypeHotExtral: + extralNum := req.ExtralNum + if extralNum <= 0 { + extralNum = num + } + tags, err = s.Ds.GetHotTags(req.Uid, num, 0) + if err == nil { + extralTags, err = s.Ds.GetFollowTags(req.Uid, extralNum, 0) + } + default: + // TODO: return good error + err = web.ErrGetPostTagsFailed } + if err != nil { + return nil, web.ErrGetPostTagsFailed + } + return &web.TopicListResp{ + Topics: tags, + ExtralTopics: extralTags, + }, nil } -func newLooseBinding() api.LooseBinding { - return &looseBinding{ - UnimplementedLooseBinding: &api.UnimplementedLooseBinding{ - BindAny: base.BindAny, - }, +func (s *looseSrv) TweetComments(req *web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error) { + sort := "id ASC" + if req.SortStrategy == "newest" { + sort = "id DESC" + } + conditions := &ms.ConditionsT{ + "post_id": req.TweetId, + "ORDER": sort, + } + + comments, err := s.Ds.GetComments(conditions, (req.Page-1)*req.PageSize, req.PageSize) + if err != nil { + return nil, web.ErrGetCommentsFailed } + + userIDs := []int64{} + commentIDs := []int64{} + for _, comment := range comments { + userIDs = append(userIDs, comment.UserID) + commentIDs = append(commentIDs, comment.ID) + } + + users, err := s.Ds.GetUsersByIDs(userIDs) + if err != nil { + return nil, web.ErrGetCommentsFailed + } + + contents, err := s.Ds.GetCommentContentsByIDs(commentIDs) + if err != nil { + return nil, web.ErrGetCommentsFailed + } + + replies, err := s.Ds.GetCommentRepliesByID(commentIDs) + if err != nil { + return nil, web.ErrGetCommentsFailed + } + + var commentThumbs, replyThumbs cs.CommentThumbsMap + if req.Uid > 0 { + commentThumbs, replyThumbs, err = s.Ds.GetCommentThumbsMap(req.Uid, req.TweetId) + if err != nil { + return nil, web.ErrGetCommentsFailed + } + } + + replyMap := make(map[int64][]*dbr.CommentReplyFormated) + if len(replyThumbs) > 0 { + for _, reply := range replies { + if thumbs, exist := replyThumbs[reply.ID]; exist { + reply.IsThumbsUp, reply.IsThumbsDown = thumbs.IsThumbsUp, thumbs.IsThumbsDown + } + replyMap[reply.CommentID] = append(replyMap[reply.CommentID], reply) + } + } else { + for _, reply := range replies { + replyMap[reply.CommentID] = append(replyMap[reply.CommentID], reply) + } + } + + commentsFormated := []*ms.CommentFormated{} + for _, comment := range comments { + commentFormated := comment.Format() + if thumbs, exist := commentThumbs[comment.ID]; exist { + commentFormated.IsThumbsUp, commentFormated.IsThumbsDown = thumbs.IsThumbsUp, thumbs.IsThumbsDown + } + for _, content := range contents { + if content.CommentID == comment.ID { + commentFormated.Contents = append(commentFormated.Contents, content) + } + } + if replySlice, exist := replyMap[commentFormated.ID]; exist { + commentFormated.Replies = replySlice + } + for _, user := range users { + if user.ID == comment.UserID { + commentFormated.User = user.Format() + } + } + commentsFormated = append(commentsFormated, commentFormated) + } + + // 获取总量 + totalRows, _ := s.Ds.GetCommentCount(conditions) + resp := base.PageRespFrom(commentsFormated, req.Page, req.PageSize, totalRows) + return (*web.TweetCommentsResp)(resp), nil } -func newLooseRender() api.LooseRender { - return &looseRender{ - UnimplementedLooseRender: &api.UnimplementedLooseRender{ - RenderAny: base.RenderAny, - }, +func newLooseSrv(s *base.DaoServant) api.Loose { + return &looseSrv{ + DaoServant: s, } } diff --git a/internal/servants/web/priv.go b/internal/servants/web/priv.go index 6efdf93c..f3654415 100644 --- a/internal/servants/web/priv.go +++ b/internal/servants/web/priv.go @@ -9,32 +9,37 @@ import ( "strings" "time" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" "github.com/disintegration/imaging" "github.com/gin-gonic/gin" - "github.com/gofrs/uuid" + "github.com/gofrs/uuid/v5" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/model/web" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/internal/servants/chain" - "github.com/rocboss/paopao-ce/pkg/convert" - "github.com/rocboss/paopao-ce/pkg/util" + "github.com/rocboss/paopao-ce/pkg/utils" "github.com/rocboss/paopao-ce/pkg/xerror" "github.com/sirupsen/logrus" ) var ( - _ api.Priv = (*privSrv)(nil) - _ api.PrivBinding = (*privBinding)(nil) - _ api.PrivRender = (*privRender)(nil) + _ api.Priv = (*privSrv)(nil) - _uploadAttachmentTypeMap = map[string]core.AttachmentType{ - "public/image": core.AttachmentTypeImage, - "public/avatar": core.AttachmentTypeImage, - "public/video": core.AttachmentTypeVideo, - "attachment": core.AttachmentTypeOther, + _uploadAttachmentTypeMap = map[string]ms.AttachmentType{ + "public/image": ms.AttachmentTypeImage, + "public/avatar": ms.AttachmentTypeImage, + "public/video": ms.AttachmentTypeVideo, + "attachment": ms.AttachmentTypeOther, + } + _uploadAttachmentTypes = map[string]cs.AttachmentType{ + "public/image": cs.AttachmentTypeImage, + "public/avatar": cs.AttachmentTypeImage, + "public/video": cs.AttachmentTypeVideo, + "attachment": cs.AttachmentTypeOther, } ) @@ -45,104 +50,69 @@ type privSrv struct { oss core.ObjectStorageService } -type privBinding struct { - *api.UnimplementedPrivBinding +func (s *privSrv) Chain() gin.HandlersChain { + return gin.HandlersChain{chain.JWT(), chain.Priv()} } -type privRender struct { - *api.UnimplementedPrivRender +func (s *privSrv) ThumbsDownTweetReply(req *web.TweetReplyThumbsReq) mir.Error { + if err := s.Ds.ThumbsDownReply(req.Uid, req.TweetId, req.CommentId, req.ReplyId); err != nil { + logrus.Errorf("thumbs down tweet reply error: %s req:%v", err, req) + return web.ErrThumbsDownTweetReply + } + return nil } -func (b *privBinding) BindUploadAttachment(c *gin.Context) (_ *web.UploadAttachmentReq, xerr mir.Error) { - UserId, exist := base.UserIdFrom(c) - if !exist { - return nil, xerror.UnauthorizedAuthNotExist +func (s *privSrv) ThumbsUpTweetReply(req *web.TweetReplyThumbsReq) mir.Error { + if err := s.Ds.ThumbsUpReply(req.Uid, req.TweetId, req.CommentId, req.ReplyId); err != nil { + logrus.Errorf("thumbs up tweet reply error: %s req:%v", err, req) + return web.ErrThumbsUpTweetReply } + return nil +} - uploadType := c.Request.FormValue("type") - file, fileHeader, err := c.Request.FormFile("file") - if err != nil { - return nil, _errFileUploadFailed +func (s *privSrv) ThumbsDownTweetComment(req *web.TweetCommentThumbsReq) mir.Error { + if err := s.Ds.ThumbsDownComment(req.Uid, req.TweetId, req.CommentId); err != nil { + logrus.Errorf("thumbs down tweet comment error: %s req:%v", err, req) + return web.ErrThumbsDownTweetComment } - defer func() { - if xerr != nil { - file.Close() - } - }() + return nil +} - if err := fileCheck(uploadType, fileHeader.Size); err != nil { - return nil, err +func (s *privSrv) ThumbsUpTweetComment(req *web.TweetCommentThumbsReq) mir.Error { + if err := s.Ds.ThumbsUpComment(req.Uid, req.TweetId, req.CommentId); err != nil { + logrus.Errorf("thumbs up tweet comment error: %s req:%v", err, req) + return web.ErrThumbsUpTweetComment } + return nil +} - contentType := fileHeader.Header.Get("Content-Type") - fileExt, xerr := getFileExt(contentType) - if xerr != nil { - return nil, xerr +func (s *privSrv) UnfollowTopic(req *web.UnfollowTopicReq) mir.Error { + if err := s.Ds.UnfollowTopic(req.Uid, req.TopicId); err != nil { + logrus.Errorf("user(%d) unfollow topic(%d) failed: %s", req.Uid, req.TopicId, err) + return web.ErrUnfollowTopicFailed } - - return &web.UploadAttachmentReq{ - SimpleInfo: web.SimpleInfo{ - Uid: UserId, - }, - UploadType: uploadType, - ContentType: contentType, - File: file, - FileSize: fileHeader.Size, - FileExt: fileExt, - }, nil + return nil } -func (b *privBinding) BindDownloadAttachmentPrecheck(c *gin.Context) (*web.DownloadAttachmentPrecheckReq, mir.Error) { - user, exist := base.UserFrom(c) - if !exist { - return nil, xerror.UnauthorizedAuthNotExist +func (s *privSrv) FollowTopic(req *web.FollowTopicReq) mir.Error { + if err := s.Ds.FollowTopic(req.Uid, req.TopicId); err != nil { + logrus.Errorf("user(%d) follow topic(%d) failed: %s", req.Uid, req.TopicId, err) + return web.ErrFollowTopicFailed } - return &web.DownloadAttachmentPrecheckReq{ - BaseInfo: web.BaseInfo{ - User: user, - }, - ContentID: convert.StrTo(c.Query("id")).MustInt64(), - }, nil + return nil } -func (b *privBinding) BindDownloadAttachment(c *gin.Context) (*web.DownloadAttachmentReq, mir.Error) { - user, exist := base.UserFrom(c) - if !exist { - return nil, xerror.UnauthorizedAuthNotExist +func (s *privSrv) StickTopic(req *web.StickTopicReq) (*web.StickTopicResp, mir.Error) { + status, err := s.Ds.StickTopic(req.Uid, req.TopicId) + if err != nil { + logrus.Errorf("user(%d) stick topic(%d) failed: %s", req.Uid, req.TopicId, err) + return nil, web.ErrStickTopicFailed } - return &web.DownloadAttachmentReq{ - BaseInfo: web.BaseInfo{ - User: user, - }, - ContentID: convert.StrTo(c.Query("id")).MustInt64(), + return &web.StickTopicResp{ + StickStatus: status, }, nil } -func (s *privBinding) BindCreateTweet(c *gin.Context) (*web.CreateTweetReq, mir.Error) { - v := &web.CreateTweetReq{} - err := s.BindAny(c, v) - v.ClientIP = c.ClientIP() - return v, err -} - -func (s *privBinding) BindCreateCommentReply(c *gin.Context) (*web.CreateCommentReplyReq, mir.Error) { - v := &web.CreateCommentReplyReq{} - err := s.BindAny(c, v) - v.ClientIP = c.ClientIP() - return v, err -} - -func (s *privBinding) BindCreateComment(c *gin.Context) (*web.CreateCommentReq, mir.Error) { - v := &web.CreateCommentReq{} - err := s.BindAny(c, v) - v.ClientIP = c.ClientIP() - return v, err -} - -func (s *privSrv) Chain() gin.HandlersChain { - return gin.HandlersChain{chain.JWT(), chain.Priv()} -} - func (s *privSrv) UploadAttachment(req *web.UploadAttachmentReq) (*web.UploadAttachmentResp, mir.Error) { defer req.File.Close() @@ -152,27 +122,27 @@ func (s *privSrv) UploadAttachment(req *web.UploadAttachmentReq) (*web.UploadAtt objectUrl, err := s.oss.PutObject(ossSavePath, req.File, req.FileSize, req.ContentType, false) if err != nil { logrus.Errorf("oss.putObject err: %s", err) - return nil, _errFileUploadFailed + return nil, web.ErrFileUploadFailed } // 构造附件Model - attachment := &core.Attachment{ + attachment := &ms.Attachment{ UserID: req.Uid, FileSize: req.FileSize, Content: objectUrl, Type: _uploadAttachmentTypeMap[req.UploadType], } - if attachment.Type == core.AttachmentTypeImage { + if attachment.Type == ms.AttachmentTypeImage { var src image.Image src, err = imaging.Decode(req.File) if err == nil { attachment.ImgWidth, attachment.ImgHeight = getImageSize(src.Bounds()) } } - attachment, err = s.Ds.CreateAttachment(attachment) + attachment.ID, err = s.Ds.CreateAttachment(attachment) if err != nil { logrus.Errorf("Ds.CreateAttachment err: %s", err) - return nil, _errFileUploadFailed + return nil, web.ErrFileUploadFailed } return &web.UploadAttachmentResp{ @@ -189,14 +159,14 @@ func (s *privSrv) DownloadAttachmentPrecheck(req *web.DownloadAttachmentPrecheck content, err := s.Ds.GetPostContentByID(req.ContentID) if err != nil { logrus.Errorf("Ds.GetPostContentByID err: %s", err) - return nil, _errInvalidDownloadReq + return nil, web.ErrInvalidDownloadReq } resp := &web.DownloadAttachmentPrecheckResp{Paid: true} - if content.Type == core.ContentTypeChargeAttachment { + if content.Type == ms.ContentTypeChargeAttachment { tweet, err := s.GetTweetBy(content.PostID) if err != nil { logrus.Errorf("get tweet err: %v", err) - return nil, _errInvalidDownloadReq + return nil, web.ErrInvalidDownloadReq } // 发布者或管理员免费下载 if tweet.UserID == req.User.ID || req.User.IsAdmin { @@ -212,10 +182,10 @@ func (s *privSrv) DownloadAttachment(req *web.DownloadAttachmentReq) (*web.Downl content, err := s.Ds.GetPostContentByID(req.ContentID) if err != nil { logrus.Errorf("s.GetPostContentByID err: %v", err) - return nil, _errInvalidDownloadReq + return nil, web.ErrInvalidDownloadReq } // 收费附件 - if content.Type == core.ContentTypeChargeAttachment { + if content.Type == ms.ContentTypeChargeAttachment { post, err := s.GetTweetBy(content.PostID) if err != nil { logrus.Errorf("s.GetTweetBy err: %v", err) @@ -228,8 +198,8 @@ func (s *privSrv) DownloadAttachment(req *web.DownloadAttachmentReq) (*web.Downl } // 未购买,则尝试购买 if !paidFlag { - err := s.buyPostAttachment(&core.Post{ - Model: &core.Model{ + err := s.buyPostAttachment(&ms.Post{ + Model: &ms.Model{ ID: post.ID, }, UserID: post.UserID, @@ -245,7 +215,7 @@ func (s *privSrv) DownloadAttachment(req *web.DownloadAttachmentReq) (*web.Downl signedURL, err := s.oss.SignURL(objectKey, 60) if err != nil { logrus.Errorf("client.SignURL err: %v", err) - return nil, _errDownloadReqError + return nil, web.ErrDownloadReqError } return &web.DownloadAttachmentResp{ SignedURL: signedURL, @@ -262,22 +232,22 @@ func (s *privSrv) CreateTweet(req *web.CreateTweetReq) (_ *web.CreateTweetResp, contents, err := persistMediaContents(s.oss, req.Contents) if err != nil { - return nil, _errCreatePostFailed + return nil, web.ErrCreatePostFailed } mediaContents = contents tags := tagsFrom(req.Tags) - post := &core.Post{ + post := &ms.Post{ UserID: req.User.ID, Tags: strings.Join(tags, ","), IP: req.ClientIP, - IPLoc: util.GetIPLoc(req.ClientIP), + IPLoc: utils.GetIPLoc(req.ClientIP), AttachmentPrice: req.AttachmentPrice, Visibility: req.Visibility, } post, err = s.Ds.CreatePost(post) if err != nil { logrus.Errorf("Ds.CreatePost err: %s", err) - return nil, _errCreatePostFailed + return nil, web.ErrCreatePostFailed } // 创建推文内容 @@ -287,10 +257,10 @@ func (s *privSrv) CreateTweet(req *web.CreateTweetReq) (_ *web.CreateTweetResp, logrus.Infof("contents check err: %s", err) continue } - if item.Type == core.ContentTypeAttachment && req.AttachmentPrice > 0 { - item.Type = core.ContentTypeChargeAttachment + if item.Type == ms.ContentTypeAttachment && req.AttachmentPrice > 0 { + item.Type = ms.ContentTypeChargeAttachment } - postContent := &core.PostContent{ + postContent := &ms.PostContent{ PostID: post.ID, UserID: req.User.ID, Content: item.Content, @@ -299,20 +269,14 @@ func (s *privSrv) CreateTweet(req *web.CreateTweetReq) (_ *web.CreateTweetResp, } if _, err = s.Ds.CreatePostContent(postContent); err != nil { logrus.Infof("Ds.CreatePostContent err: %s", err) - return nil, _errCreateCommentFailed + return nil, web.ErrCreateCommentFailed } } // 私密推文不创建标签与用户提醒 if post.Visibility != core.PostVisitPrivate { // 创建标签 - for _, t := range tags { - tag := &core.Tag{ - UserID: req.User.ID, - Tag: t, - } - s.Ds.CreateTag(tag) - } + s.Ds.UpsertTags(req.User.ID, tags) // 创建用户消息提醒 for _, u := range req.Users { @@ -323,10 +287,10 @@ func (s *privSrv) CreateTweet(req *web.CreateTweetReq) (_ *web.CreateTweetResp, // 创建消息提醒 // TODO: 优化消息提醒处理机制 - go s.Ds.CreateMessage(&core.Message{ + go s.Ds.CreateMessage(&ms.Message{ SenderUserID: req.User.ID, ReceiverUserID: user.ID, - Type: core.MsgTypePost, + Type: ms.MsgTypePost, Brief: "在新发布的泡泡动态中@了你", PostID: post.ID, }) @@ -334,30 +298,30 @@ func (s *privSrv) CreateTweet(req *web.CreateTweetReq) (_ *web.CreateTweetResp, } // 推送Search s.PushPostToSearch(post) - formatedPosts, err := s.Ds.RevampPosts([]*core.PostFormated{post.Format()}) + formatedPosts, err := s.Ds.RevampPosts([]*ms.PostFormated{post.Format()}) if err != nil { logrus.Infof("Ds.RevampPosts err: %s", err) - return nil, _errCreatePostFailed + return nil, web.ErrCreatePostFailed } return (*web.CreateTweetResp)(formatedPosts[0]), nil } func (s *privSrv) DeleteTweet(req *web.DeleteTweetReq) mir.Error { if req.User == nil { - return _errNoPermission + return web.ErrNoPermission } post, err := s.Ds.GetPostByID(req.ID) if err != nil { logrus.Errorf("Ds.GetPostByID err: %s", err) - return _errGetPostFailed + return web.ErrGetPostFailed } if post.UserID != req.User.ID && !req.User.IsAdmin { - return _errNoPermission + return web.ErrNoPermission } mediaContents, err := s.Ds.DeletePost(post) if err != nil { logrus.Errorf("Ds.DeletePost delete post failed: %s", err) - return _errDeletePostFailed + return web.ErrDeletePostFailed } // 删除推文的媒体内容 deleteOssObjects(s.oss, mediaContents) @@ -365,7 +329,7 @@ func (s *privSrv) DeleteTweet(req *web.DeleteTweetReq) mir.Error { s.DeleteSearchPost(post) if err != nil { logrus.Errorf("s.DeleteSearchPost failed: %s", err) - return _errDeletePostFailed + return web.ErrDeletePostFailed } return nil } @@ -374,45 +338,45 @@ func (s *privSrv) DeleteCommentReply(req *web.DeleteCommentReplyReq) mir.Error { reply, err := s.Ds.GetCommentReplyByID(req.ID) if err != nil { logrus.Errorf("Ds.GetCommentReplyByID err: %s", err) - return _errGetReplyFailed + return web.ErrGetReplyFailed } if req.User.ID != reply.UserID && !req.User.IsAdmin { - return _errNoPermission + return web.ErrNoPermission } // 执行删除 err = s.deletePostCommentReply(reply) if err != nil { logrus.Errorf("s.deletePostCommentReply err: %s", err) - return _errDeleteCommentFailed + return web.ErrDeleteCommentFailed } return nil } func (s *privSrv) CreateCommentReply(req *web.CreateCommentReplyReq) (*web.CreateCommentReplyResp, mir.Error) { var ( - post *core.Post - comment *core.Comment + post *ms.Post + comment *ms.Comment atUserID int64 err error ) if post, comment, atUserID, err = s.createPostPreHandler(req.CommentID, req.Uid, req.AtUserID); err != nil { - return nil, _errCreateReplyFailed + return nil, web.ErrCreateReplyFailed } // 创建评论 - reply := &core.CommentReply{ + reply := &ms.CommentReply{ CommentID: req.CommentID, UserID: req.Uid, Content: req.Content, AtUserID: atUserID, IP: req.ClientIP, - IPLoc: util.GetIPLoc(req.ClientIP), + IPLoc: utils.GetIPLoc(req.ClientIP), } reply, err = s.Ds.CreateCommentReply(reply) if err != nil { - return nil, _errCreateReplyFailed + return nil, web.ErrCreateReplyFailed } // 更新Post回复数 @@ -426,10 +390,10 @@ func (s *privSrv) CreateCommentReply(req *web.CreateCommentReplyReq) (*web.Creat // 创建用户消息提醒 commentMaster, err := s.Ds.GetUserByID(comment.UserID) if err == nil && commentMaster.ID != req.Uid { - go s.Ds.CreateMessage(&core.Message{ + go s.Ds.CreateMessage(&ms.Message{ SenderUserID: req.Uid, ReceiverUserID: commentMaster.ID, - Type: core.MsgTypeReply, + Type: ms.MsgTypeReply, Brief: "在泡泡评论下回复了你", PostID: post.ID, CommentID: comment.ID, @@ -438,10 +402,10 @@ func (s *privSrv) CreateCommentReply(req *web.CreateCommentReplyReq) (*web.Creat } postMaster, err := s.Ds.GetUserByID(post.UserID) if err == nil && postMaster.ID != req.Uid && commentMaster.ID != postMaster.ID { - go s.Ds.CreateMessage(&core.Message{ + go s.Ds.CreateMessage(&ms.Message{ SenderUserID: req.Uid, ReceiverUserID: postMaster.ID, - Type: core.MsgTypeReply, + Type: ms.MsgTypeReply, Brief: "在泡泡评论下发布了新回复", PostID: post.ID, CommentID: comment.ID, @@ -452,10 +416,10 @@ func (s *privSrv) CreateCommentReply(req *web.CreateCommentReplyReq) (*web.Creat user, err := s.Ds.GetUserByID(atUserID) if err == nil && user.ID != req.Uid && commentMaster.ID != user.ID && postMaster.ID != user.ID { // 创建消息提醒 - go s.Ds.CreateMessage(&core.Message{ + go s.Ds.CreateMessage(&ms.Message{ SenderUserID: req.Uid, ReceiverUserID: user.ID, - Type: core.MsgTypeReply, + Type: ms.MsgTypeReply, Brief: "在泡泡评论的回复中@了你", PostID: post.ID, CommentID: comment.ID, @@ -470,26 +434,26 @@ func (s *privSrv) DeleteComment(req *web.DeleteCommentReq) mir.Error { comment, err := s.Ds.GetCommentByID(req.ID) if err != nil { logrus.Errorf("Ds.GetCommentByID err: %v\n", err) - return _errGetCommentFailed + return web.ErrGetCommentFailed } if req.User.ID != comment.UserID && !req.User.IsAdmin { - return _errNoPermission + return web.ErrNoPermission } // 加载post post, err := s.Ds.GetPostByID(comment.PostID) if err != nil { - return _errDeleteCommentFailed + return web.ErrDeleteCommentFailed } // 更新post回复数 post.CommentCount-- if err := s.Ds.UpdatePost(post); err != nil { logrus.Errorf("Ds.UpdatePost err: %s", err) - return _errDeleteCommentFailed + return web.ErrDeleteCommentFailed } // TODO: 优化删除逻辑,事务化删除comment if err := s.Ds.DeleteComment(comment); err != nil { logrus.Errorf("Ds.DeleteComment err: %s", err) - return _errDeleteCommentFailed + return web.ErrDeleteCommentFailed } return nil } @@ -516,28 +480,28 @@ func (s *privSrv) CreateComment(req *web.CreateCommentReq) (_ *web.CreateComment return nil, xerror.ServerError } if post.CommentCount >= conf.AppSetting.MaxCommentCount { - return nil, _errMaxCommentCount + return nil, web.ErrMaxCommentCount } - comment := &core.Comment{ + comment := &ms.Comment{ PostID: post.ID, UserID: req.Uid, IP: req.ClientIP, - IPLoc: util.GetIPLoc(req.ClientIP), + IPLoc: utils.GetIPLoc(req.ClientIP), } comment, err = s.Ds.CreateComment(comment) if err != nil { logrus.Errorf("Ds.CreateComment err:%s", err) - return nil, _errCreateCommentFailed + return nil, web.ErrCreateCommentFailed } for _, item := range req.Contents { // 检查附件是否是本站资源 - if item.Type == core.ContentTypeImage || item.Type == core.ContentTypeVideo || item.Type == core.ContentTypeAttachment { + if item.Type == ms.ContentTypeImage || item.Type == ms.ContentTypeVideo || item.Type == ms.ContentTypeAttachment { if err := s.Ds.CheckAttachment(item.Content); err != nil { continue } } - postContent := &core.CommentContent{ + postContent := &ms.CommentContent{ CommentID: comment.ID, UserID: req.Uid, Content: item.Content, @@ -558,10 +522,10 @@ func (s *privSrv) CreateComment(req *web.CreateCommentReq) (_ *web.CreateComment // 创建用户消息提醒 postMaster, err := s.Ds.GetUserByID(post.UserID) if err == nil && postMaster.ID != req.Uid { - go s.Ds.CreateMessage(&core.Message{ + go s.Ds.CreateMessage(&ms.Message{ SenderUserID: req.Uid, ReceiverUserID: postMaster.ID, - Type: core.MsgtypeComment, + Type: ms.MsgtypeComment, Brief: "在泡泡中评论了你", PostID: post.ID, CommentID: comment.ID, @@ -574,10 +538,10 @@ func (s *privSrv) CreateComment(req *web.CreateCommentReq) (_ *web.CreateComment } // 创建消息提醒 - go s.Ds.CreateMessage(&core.Message{ + go s.Ds.CreateMessage(&ms.Message{ SenderUserID: req.Uid, ReceiverUserID: user.ID, - Type: core.MsgtypeComment, + Type: ms.MsgtypeComment, Brief: "在泡泡评论中@了你", PostID: post.ID, CommentID: comment.ID, @@ -633,14 +597,14 @@ func (s *privSrv) VisibleTweet(req *web.VisibleTweetReq) (*web.VisibleTweetResp, } post, err := s.Ds.GetPostByID(req.ID) if err != nil { - return nil, _errVisblePostFailed + return nil, web.ErrVisblePostFailed } if xerr := checkPermision(req.User, post.UserID); xerr != nil { return nil, xerr } if err = s.Ds.VisiblePost(post, req.Visibility); err != nil { logrus.Warnf("s.Ds.VisiblePost: %s", err) - return nil, _errVisblePostFailed + return nil, web.ErrVisblePostFailed } // 推送Search @@ -656,38 +620,53 @@ func (s *privSrv) StickTweet(req *web.StickTweetReq) (*web.StickTweetResp, mir.E post, err := s.Ds.GetPostByID(req.ID) if err != nil { logrus.Errorf("Ds.GetPostByID err: %v\n", err) - return nil, _errStickPostFailed + return nil, web.ErrStickPostFailed } if !req.User.IsAdmin { - return nil, _errNoPermission + return nil, web.ErrNoPermission } newStatus := 1 - post.IsTop if err = s.Ds.StickPost(post); err != nil { - return nil, _errStickPostFailed + return nil, web.ErrStickPostFailed } return &web.StickTweetResp{ StickStatus: newStatus, }, nil } +func (s *privSrv) HighlightTweet(req *web.HighlightTweetReq) (res *web.HighlightTweetResp, err mir.Error) { + if status, xerr := s.Ds.HighlightPost(req.User.ID, req.ID); xerr == nil { + res = &web.HighlightTweetResp{ + HighlightStatus: status, + } + } else if xerr == cs.ErrNoPermission { + err = web.ErrNoPermission + logrus.Warnf("highlight tweet occurs no permision error with userId=%d postId=%d", req.User.ID, req.ID) + } else { + err = web.ErrHighlightPostFailed + logrus.Warnf("highlight tweet err: %s with userId=%d postId=%d", xerr, req.User.ID, req.ID) + } + return +} + func (s *privSrv) LockTweet(req *web.LockTweetReq) (*web.LockTweetResp, mir.Error) { post, err := s.Ds.GetPostByID(req.ID) if err != nil { - return nil, _errLockPostFailed + return nil, web.ErrLockPostFailed } if post.UserID != req.User.ID && !req.User.IsAdmin { - return nil, _errNoPermission + return nil, web.ErrNoPermission } newStatus := 1 - post.IsLock if err := s.Ds.LockPost(post); err != nil { - return nil, _errLockPostFailed + return nil, web.ErrLockPostFailed } return &web.LockTweetResp{ LockStatus: newStatus, }, nil } -func (s *privSrv) deletePostCommentReply(reply *core.CommentReply) error { +func (s *privSrv) deletePostCommentReply(reply *ms.CommentReply) error { err := s.Ds.DeleteCommentReply(reply) if err != nil { return err @@ -711,7 +690,7 @@ func (s *privSrv) deletePostCommentReply(reply *core.CommentReply) error { return nil } -func (s *privSrv) createPostPreHandler(commentID int64, userID, atUserID int64) (*core.Post, *core.Comment, int64, +func (s *privSrv) createPostPreHandler(commentID int64, userID, atUserID int64) (*ms.Post, *ms.Comment, int64, error) { // 加载Comment comment, err := s.Ds.GetCommentByID(commentID) @@ -726,7 +705,7 @@ func (s *privSrv) createPostPreHandler(commentID int64, userID, atUserID int64) } if post.CommentCount >= conf.AppSetting.MaxCommentCount { - return nil, nil, atUserID, _errMaxCommentCount + return nil, nil, atUserID, web.ErrMaxCommentCount } if userID == atUserID { @@ -744,16 +723,16 @@ func (s *privSrv) createPostPreHandler(commentID int64, userID, atUserID int64) return post, comment, atUserID, nil } -func (s *privSrv) createPostStar(postID, userID int64) (*core.PostStar, mir.Error) { - // 加载Post +func (s *privSrv) createPostStar(postID, userID int64) (*ms.PostStar, mir.Error) { post, err := s.Ds.GetPostByID(postID) if err != nil { return nil, xerror.ServerError } // 私密post不可操作 - if post.Visibility == core.PostVisitPrivate { - return nil, _errNoPermission + // TODO: 使用统一的permission checker来检查权限问题,这里好友可见post就没处理,是bug + if post.Visibility == core.PostVisitPrivate && post.UserID != userID { + return nil, web.ErrNoPermission } star, err := s.Ds.CreatePostStar(postID, userID) @@ -767,24 +746,23 @@ func (s *privSrv) createPostStar(postID, userID int64) (*core.PostStar, mir.Erro // 更新索引 s.PushPostToSearch(post) - return star, nil } -func (s *privSrv) deletePostStar(star *core.PostStar) mir.Error { - err := s.Ds.DeletePostStar(star) - if err != nil { - return xerror.ServerError - } - // 加载Post +func (s *privSrv) deletePostStar(star *ms.PostStar) mir.Error { post, err := s.Ds.GetPostByID(star.PostID) if err != nil { return xerror.ServerError } - // 私密post不可操作 - if post.Visibility == core.PostVisitPrivate { - return _errNoPermission + // 私密post特殊处理 + // TODO: 使用统一的permission checker来检查权限问题,这里好友可见post就没处理,是bug + if post.Visibility == core.PostVisitPrivate && post.UserID != star.UserID { + return web.ErrNoPermission + } + + if err = s.Ds.DeletePostStar(star); err != nil { + return xerror.ServerError } // 更新Post点赞数 @@ -793,20 +771,19 @@ func (s *privSrv) deletePostStar(star *core.PostStar) mir.Error { // 更新索引 s.PushPostToSearch(post) - return nil } -func (s *privSrv) createPostCollection(postID, userID int64) (*core.PostCollection, mir.Error) { - // 加载Post +func (s *privSrv) createPostCollection(postID, userID int64) (*ms.PostCollection, mir.Error) { post, err := s.Ds.GetPostByID(postID) if err != nil { return nil, xerror.ServerError } - // 私密post不可操作 - if post.Visibility == core.PostVisitPrivate { - return nil, _errNoPermission + // 私密post特殊处理 + // TODO: 使用统一的permission checker来检查权限问题,这里好友可见post就没处理,是bug + if post.Visibility == core.PostVisitPrivate && post.UserID != userID { + return nil, web.ErrNoPermission } collection, err := s.Ds.CreatePostCollection(postID, userID) @@ -820,24 +797,22 @@ func (s *privSrv) createPostCollection(postID, userID int64) (*core.PostCollecti // 更新索引 s.PushPostToSearch(post) - return collection, nil } -func (s *privSrv) deletePostCollection(collection *core.PostCollection) mir.Error { - err := s.Ds.DeletePostCollection(collection) - if err != nil { - return xerror.ServerError - } - // 加载Post +func (s *privSrv) deletePostCollection(collection *ms.PostCollection) mir.Error { post, err := s.Ds.GetPostByID(collection.PostID) if err != nil { return xerror.ServerError } - // 私密post不可操作 - if post.Visibility == core.PostVisitPrivate { - return _errNoPermission + // 私密post特殊处理 + // TODO: 使用统一的permission checker来检查权限问题,这里好友可见post就没处理,是bug + if post.Visibility == core.PostVisitPrivate && post.UserID != collection.UserID { + return web.ErrNoPermission + } + if err = s.Ds.DeletePostCollection(collection); err != nil { + return xerror.ServerError } // 更新Post点赞数 @@ -846,7 +821,6 @@ func (s *privSrv) deletePostCollection(collection *core.PostCollection) mir.Erro // 更新索引 s.PushPostToSearch(post) - return nil } @@ -855,9 +829,9 @@ func (s *privSrv) checkPostAttachmentIsPaid(postID, userID int64) bool { return err == nil && bill.Model != nil && bill.ID > 0 } -func (s *privSrv) buyPostAttachment(post *core.Post, user *core.User) mir.Error { +func (s *privSrv) buyPostAttachment(post *ms.Post, user *ms.User) mir.Error { if user.Balance < post.AttachmentPrice { - return _errInsuffientDownloadMoney + return web.ErrInsuffientDownloadMoney } // 执行购买 if err := s.Ds.HandlePostAttachmentBought(post, user); err != nil { @@ -873,19 +847,3 @@ func newPrivSrv(s *base.DaoServant, oss core.ObjectStorageService) api.Priv { oss: oss, } } - -func newPrivBinding() api.PrivBinding { - return &privBinding{ - UnimplementedPrivBinding: &api.UnimplementedPrivBinding{ - BindAny: base.BindAny, - }, - } -} - -func newPrivRender() api.PrivRender { - return &privRender{ - UnimplementedPrivRender: &api.UnimplementedPrivRender{ - RenderAny: base.RenderAny, - }, - } -} diff --git a/internal/servants/web/pub.go b/internal/servants/web/pub.go index 51718dee..f12f74ee 100644 --- a/internal/servants/web/pub.go +++ b/internal/servants/web/pub.go @@ -8,39 +8,31 @@ import ( "bytes" "context" "encoding/base64" - "fmt" "image/color" "image/png" "regexp" - "time" "unicode/utf8" "github.com/afocus/captcha" - "github.com/alimy/mir/v3" - "github.com/gin-gonic/gin" - "github.com/gofrs/uuid" + "github.com/alimy/mir/v4" + "github.com/gofrs/uuid/v5" api "github.com/rocboss/paopao-ce/auto/api/v1" - "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/model/web" "github.com/rocboss/paopao-ce/internal/servants/base" "github.com/rocboss/paopao-ce/internal/servants/web/assets" "github.com/rocboss/paopao-ce/pkg/app" - "github.com/rocboss/paopao-ce/pkg/convert" - "github.com/rocboss/paopao-ce/pkg/debug" - "github.com/rocboss/paopao-ce/pkg/util" + "github.com/rocboss/paopao-ce/pkg/utils" + "github.com/rocboss/paopao-ce/pkg/version" "github.com/rocboss/paopao-ce/pkg/xerror" "github.com/sirupsen/logrus" ) var ( - _ api.Pub = (*pubSrv)(nil) - _ api.PubBinding = (*pubBinding)(nil) - _ api.PubRender = (*pubRender)(nil) + _ api.Pub = (*pubSrv)(nil) ) const ( - _LoginErrKey = "PaoPaoUserLoginErr" _MaxLoginErrTimes = 10 _MaxPhoneCaptcha = 10 ) @@ -50,141 +42,18 @@ type pubSrv struct { *base.DaoServant } -type pubBinding struct { - *api.UnimplementedPubBinding -} - -type pubRender struct { - *api.UnimplementedPubRender -} - -func (b *pubBinding) BindTweetComments(c *gin.Context) (*web.TweetCommentsReq, mir.Error) { - tweetId := convert.StrTo(c.Query("id")).MustInt64() - page, pageSize := app.GetPageInfo(c) - return &web.TweetCommentsReq{ - TweetId: tweetId, - Page: page, - PageSize: pageSize, - }, nil - -} - -func (s *pubSrv) TopicList(req *web.TopicListReq) (*web.TopicListResp, mir.Error) { - // tags, err := broker.GetPostTags(¶m) - num := req.Num - if num > conf.AppSetting.MaxPageSize { - num = conf.AppSetting.MaxPageSize - } - - conditions := &core.ConditionsT{} - if req.Type == web.TagTypeHot { - // 热门标签 - conditions = &core.ConditionsT{ - "ORDER": "quote_num DESC", - } - } else if req.Type == web.TagTypeNew { - // 热门标签 - conditions = &core.ConditionsT{ - "ORDER": "id DESC", - } - } - tags, err := s.Ds.GetTags(conditions, 0, num) - if err != nil { - return nil, _errGetPostTagsFailed - } - // 获取创建者User IDs - userIds := []int64{} - for _, tag := range tags { - userIds = append(userIds, tag.UserID) - } - users, _ := s.Ds.GetUsersByIDs(userIds) - tagsFormated := []*core.TagFormated{} - for _, tag := range tags { - tagFormated := tag.Format() - for _, user := range users { - if user.ID == tagFormated.UserID { - tagFormated.User = user.Format() - } - } - tagsFormated = append(tagsFormated, tagFormated) - } - return &web.TopicListResp{ - Topics: tagsFormated, - }, nil -} - -func (s *pubSrv) TweetComments(req *web.TweetCommentsReq) (*web.TweetCommentsResp, mir.Error) { - conditions := &core.ConditionsT{ - "post_id": req.TweetId, - "ORDER": "id ASC", - } - - comments, err := s.Ds.GetComments(conditions, (req.Page-1)*req.PageSize, req.PageSize) - if err != nil { - return nil, _errGetCommentsFailed - } - - userIDs := []int64{} - commentIDs := []int64{} - for _, comment := range comments { - userIDs = append(userIDs, comment.UserID) - commentIDs = append(commentIDs, comment.ID) - } - - users, err := s.Ds.GetUsersByIDs(userIDs) - if err != nil { - return nil, _errGetCommentsFailed - } - - contents, err := s.Ds.GetCommentContentsByIDs(commentIDs) - if err != nil { - return nil, _errGetCommentsFailed - } - - replies, err := s.Ds.GetCommentRepliesByID(commentIDs) - if err != nil { - return nil, _errGetCommentsFailed - } - - commentsFormated := []*core.CommentFormated{} - for _, comment := range comments { - commentFormated := comment.Format() - for _, content := range contents { - if content.CommentID == comment.ID { - commentFormated.Contents = append(commentFormated.Contents, content) - } - } - for _, reply := range replies { - if reply.CommentID == commentFormated.ID { - commentFormated.Replies = append(commentFormated.Replies, reply) - } - } - for _, user := range users { - if user.ID == comment.UserID { - commentFormated.User = user.Format() - } - } - commentsFormated = append(commentsFormated, commentFormated) - } - - // 获取总量 - totalRows, _ := s.Ds.GetCommentCount(conditions) - resp := base.PageRespFrom(commentsFormated, req.Page, req.PageSize, totalRows) - return (*web.TweetCommentsResp)(resp), nil -} - func (s *pubSrv) TweetDetail(req *web.TweetDetailReq) (*web.TweetDetailResp, mir.Error) { post, err := s.Ds.GetPostByID(req.TweetId) if err != nil { - return nil, _errGetPostFailed + return nil, web.ErrGetPostFailed } postContents, err := s.Ds.GetPostContentsByIDs([]int64{post.ID}) if err != nil { - return nil, _errGetPostFailed + return nil, web.ErrGetPostFailed } users, err := s.Ds.GetUsersByIDs([]int64{post.UserID}) if err != nil { - return nil, _errGetPostFailed + return nil, web.ErrGetPostFailed } // 数据整合 postFormated := post.Format() @@ -203,24 +72,22 @@ func (s *pubSrv) SendCaptcha(req *web.SendCaptchaReq) mir.Error { ctx := context.Background() // 验证图片验证码 - if res, err := s.Redis.Get(ctx, "PaoPaoCaptcha:"+req.ImgCaptchaID).Result(); err != nil || res != req.ImgCaptcha { - return _errErrorCaptchaPassword + if captcha, err := s.Redis.GetImgCaptcha(ctx, req.ImgCaptchaID); err != nil || string(captcha) != req.ImgCaptcha { + logrus.Debugf("get captcha err:%s expect:%s got:%s", err, captcha, req.ImgCaptcha) + return web.ErrErrorCaptchaPassword } - s.Redis.Del(ctx, "PaoPaoCaptcha:"+req.ImgCaptchaID).Result() + s.Redis.DelImgCaptcha(ctx, req.ImgCaptchaID) // 今日频次限制 - if res, _ := s.Redis.Get(ctx, "PaoPaoSmsCaptcha:"+req.Phone).Result(); convert.StrTo(res).MustInt() >= _MaxPhoneCaptcha { - return _errTooManyPhoneCaptchaSend + if count, _ := s.Redis.GetCountSmsCaptcha(ctx, req.Phone); count >= _MaxPhoneCaptcha { + return web.ErrTooManyPhoneCaptchaSend } if err := s.Ds.SendPhoneCaptcha(req.Phone); err != nil { return xerror.ServerError } // 写入计数缓存 - s.Redis.Incr(ctx, "PaoPaoSmsCaptcha:"+req.Phone).Result() - currentTime := time.Now() - endTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), 23, 59, 59, 0, currentTime.Location()) - s.Redis.Expire(ctx, "PaoPaoSmsCaptcha:"+req.Phone, endTime.Sub(currentTime)) + s.Redis.IncrCountSmsCaptcha(ctx, req.Phone) return nil } @@ -241,9 +108,9 @@ func (s *pubSrv) GetCaptcha() (*web.GetCaptchaResp, mir.Error) { logrus.Errorf("png.Encode err:%s", err) return nil, xerror.ServerError } - key := util.EncodeMD5(uuid.Must(uuid.NewV4()).String()) + key := utils.EncodeMD5(uuid.Must(uuid.NewV4()).String()) // 五分钟有效期 - s.Redis.SetEX(context.Background(), "PaoPaoCaptcha:"+key, password, time.Minute*5) + s.Redis.SetImgCaptcha(context.Background(), key, password) return &web.GetCaptchaResp{ Id: key, Content: "data:image/png;base64," + base64.StdEncoding.EncodeToString(emptyBuff.Bytes()), @@ -251,6 +118,9 @@ func (s *pubSrv) GetCaptcha() (*web.GetCaptchaResp, mir.Error) { } func (s *pubSrv) Register(req *web.RegisterReq) (*web.RegisterResp, mir.Error) { + if _disallowUserRegister { + return nil, web.ErrDisallowUserRegister + } // 用户名检查 if err := s.validUsername(req.Username); err != nil { return nil, err @@ -258,21 +128,21 @@ func (s *pubSrv) Register(req *web.RegisterReq) (*web.RegisterResp, mir.Error) { // 密码检查 if err := checkPassword(req.Password); err != nil { logrus.Errorf("scheckPassword err: %v", err) - return nil, _errUserRegisterFailed + return nil, web.ErrUserRegisterFailed } password, salt := encryptPasswordAndSalt(req.Password) - user := &core.User{ + user := &ms.User{ Nickname: req.Username, Username: req.Username, Password: password, Avatar: getRandomAvatar(), Salt: salt, - Status: core.UserStatusNormal, + Status: ms.UserStatusNormal, } user, err := s.Ds.CreateUser(user) if err != nil { logrus.Errorf("Ds.CreateUser err: %s", err) - return nil, _errUserRegisterFailed + return nil, web.ErrUserRegisterFailed } return &web.RegisterResp{ UserId: user.ID, @@ -289,24 +159,19 @@ func (s *pubSrv) Login(req *web.LoginReq) (*web.LoginResp, mir.Error) { } if user.Model != nil && user.ID > 0 { - if errTimes, err := s.Redis.Get(ctx, fmt.Sprintf("%s:%d", _LoginErrKey, user.ID)).Result(); err == nil { - if convert.StrTo(errTimes).MustInt() >= _MaxLoginErrTimes { - return nil, _errTooManyLoginError - } + if count, err := s.Redis.GetCountLoginErr(ctx, user.ID); err == nil && count >= _MaxLoginErrTimes { + return nil, web.ErrTooManyLoginError } // 对比密码是否正确 if validPassword(user.Password, req.Password, user.Salt) { - if user.Status == core.UserStatusClosed { - return nil, _errUserHasBeenBanned + if user.Status == ms.UserStatusClosed { + return nil, web.ErrUserHasBeenBanned } // 清空登录计数 - s.Redis.Del(ctx, fmt.Sprintf("%s:%d", _LoginErrKey, user.ID)) + s.Redis.DelCountLoginErr(ctx, user.ID) } else { // 登录错误计数 - _, err = s.Redis.Incr(ctx, fmt.Sprintf("%s:%d", _LoginErrKey, user.ID)).Result() - if err == nil { - s.Redis.Expire(ctx, fmt.Sprintf("%s:%d", _LoginErrKey, user.ID), time.Hour).Result() - } + s.Redis.IncrCountLoginErr(ctx, user.ID) return nil, xerror.UnauthorizedAuthFailed } } else { @@ -325,7 +190,7 @@ func (s *pubSrv) Login(req *web.LoginReq) (*web.LoginResp, mir.Error) { func (s *pubSrv) Version() (*web.VersionResp, mir.Error) { return &web.VersionResp{ - BuildInfo: debug.ReadBuildInfo(), + BuildInfo: version.ReadBuildInfo(), }, nil } @@ -333,17 +198,17 @@ func (s *pubSrv) Version() (*web.VersionResp, mir.Error) { func (s *pubSrv) validUsername(username string) mir.Error { // 检测用户是否合规 if utf8.RuneCountInString(username) < 3 || utf8.RuneCountInString(username) > 12 { - return _errUsernameLengthLimit + return web.ErrUsernameLengthLimit } if !regexp.MustCompile(`^[a-zA-Z0-9]+$`).MatchString(username) { - return _errUsernameCharLimit + return web.ErrUsernameCharLimit } // 重复检查 user, _ := s.Ds.GetUserByUsername(username) if user.Model != nil && user.ID > 0 { - return _errUsernameHasExisted + return web.ErrUsernameHasExisted } return nil } @@ -353,19 +218,3 @@ func newPubSrv(s *base.DaoServant) api.Pub { DaoServant: s, } } - -func newPubBinding() api.PubBinding { - return &pubBinding{ - UnimplementedPubBinding: &api.UnimplementedPubBinding{ - BindAny: base.BindAny, - }, - } -} - -func newPubRender() api.PubRender { - return &pubRender{ - UnimplementedPubRender: &api.UnimplementedPubRender{ - RenderAny: base.RenderAny, - }, - } -} diff --git a/internal/servants/web/routers/api/api.go b/internal/servants/web/routers/api/api.go deleted file mode 100644 index 656ad0bf..00000000 --- a/internal/servants/web/routers/api/api.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package api - -import ( - "github.com/alimy/cfg" - "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/internal/dao" - "github.com/sirupsen/logrus" - "github.com/smartwalle/alipay/v3" -) - -var ( - alipayClient *alipay.Client - objectStorage core.ObjectStorageService -) - -func Initialize() { - objectStorage = dao.ObjectStorageService() - - if cfg.If("Alipay") { - alipayClient = mustAlipayClient() - } -} - -func mustAlipayClient() *alipay.Client { - s := conf.AlipaySetting - // 将 key 的验证调整到初始化阶段 - client, err := alipay.New(s.AppID, s.PrivateKey, s.InProduction) - if err != nil { - logrus.Fatalf("alipay.New err: %s", err) - } - // 加载应用公钥证书 - if err = client.LoadAppPublicCertFromFile(s.AppPublicCertFile); err != nil { - logrus.Fatalf("client.LoadAppPublicCertFromFile err: %s\n", err) - } - // 加载支付宝根证书 - if err = client.LoadAliPayRootCertFromFile(s.RootCertFile); err != nil { - logrus.Fatalf("client.LoadAliPayRootCertFromFile err: %s\n", err) - } - // 加载支付宝公钥证书 - if err = client.LoadAliPayPublicCertFromFile(s.PublicCertFile); err != nil { - logrus.Fatalf("client.LoadAliPayPublicCertFromFile err: %s\n", err) - } - return client -} diff --git a/internal/servants/web/routers/api/attachment.go b/internal/servants/web/routers/api/attachment.go deleted file mode 100644 index fb6a173c..00000000 --- a/internal/servants/web/routers/api/attachment.go +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package api - -import ( - "image" - - "github.com/disintegration/imaging" - "github.com/gin-gonic/gin" - "github.com/gofrs/uuid" - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/internal/servants/web/broker" - "github.com/rocboss/paopao-ce/pkg/app" - "github.com/rocboss/paopao-ce/pkg/convert" - "github.com/rocboss/paopao-ce/pkg/errcode" - "github.com/sirupsen/logrus" -) - -var uploadAttachmentTypeMap = map[string]core.AttachmentType{ - "public/image": core.AttachmentTypeImage, - "public/avatar": core.AttachmentTypeImage, - "public/video": core.AttachmentTypeVideo, - "attachment": core.AttachmentTypeOther, -} - -func GeneratePath(s string) string { - n := len(s) - if n <= 2 { - return s - } - - return GeneratePath(s[:n-2]) + "/" + s[n-2:] -} - -func GetFileExt(s string) (string, error) { - switch s { - case "image/png": - return ".png", nil - case "image/jpg": - return ".jpg", nil - case "image/jpeg": - return ".jpeg", nil - case "image/gif": - return ".gif", nil - case "video/mp4": - return ".mp4", nil - case "video/quicktime": - return ".mov", nil - case "application/zip": - return ".zip", nil - default: - return "", errcode.FileInvalidExt.WithDetails("仅允许 png/jpg/gif/mp4/mov/zip 类型") - } -} -func GetImageSize(img image.Rectangle) (int, int) { - b := img.Bounds() - width := b.Max.X - height := b.Max.Y - return width, height -} - -func fileCheck(uploadType string, size int64) error { - if uploadType != "public/video" && - uploadType != "public/image" && - uploadType != "public/avatar" && - uploadType != "attachment" { - return errcode.InvalidParams - } - - if size > 1024*1024*100 { - return errcode.FileInvalidSize.WithDetails("最大允许100MB") - } - - return nil -} - -func UploadAttachment(c *gin.Context) { - response := app.NewResponse(c) - - uploadType := c.Request.FormValue("type") - file, fileHeader, err := c.Request.FormFile("file") - if err != nil { - logrus.Errorf("api.UploadAttachment err: %v", err) - response.ToErrorResponse(errcode.FileUploadFailed) - return - } - defer file.Close() - - if err = fileCheck(uploadType, fileHeader.Size); err != nil { - cErr, _ := err.(*errcode.Error) - response.ToErrorResponse(cErr) - return - } - - contentType := fileHeader.Header.Get("Content-Type") - fileExt, err := GetFileExt(fileHeader.Header.Get("Content-Type")) - if err != nil { - logrus.Errorf("GetFileExt err: %v", err) - response.ToErrorResponse(err.(*errcode.Error)) - return - } - - // 生成随机路径 - randomPath := uuid.Must(uuid.NewV4()).String() - ossSavePath := uploadType + "/" + GeneratePath(randomPath[:8]) + "/" + randomPath[9:] + fileExt - - objectUrl, err := objectStorage.PutObject(ossSavePath, file, fileHeader.Size, contentType, false) - if err != nil { - logrus.Errorf("putObject err: %v", err) - response.ToErrorResponse(errcode.FileUploadFailed) - return - } - - // 构造附件Model - attachment := &core.Attachment{ - FileSize: fileHeader.Size, - Content: objectUrl, - } - - if userID, exists := c.Get("UID"); exists { - attachment.UserID = userID.(int64) - } - - attachment.Type = uploadAttachmentTypeMap[uploadType] - if attachment.Type == core.AttachmentTypeImage { - var src image.Image - src, err = imaging.Decode(file) - if err == nil { - attachment.ImgWidth, attachment.ImgHeight = GetImageSize(src.Bounds()) - } - } - - attachment, err = broker.CreateAttachment(attachment) - if err != nil { - logrus.Errorf("service.CreateAttachment err: %v", err) - response.ToErrorResponse(errcode.FileUploadFailed) - } - - response.ToResponse(attachment) -} - -func DownloadAttachmentPrecheck(c *gin.Context) { - response := app.NewResponse(c) - - contentID := convert.StrTo(c.Query("id")).MustInt64() - // 加载content - content, err := broker.GetPostContentByID(contentID) - if err != nil { - logrus.Errorf("service.GetPostContentByID err: %v", err) - response.ToErrorResponse(errcode.InvalidDownloadReq) - } - user, _ := c.Get("USER") - if content.Type == core.ContentTypeChargeAttachment { - // 加载post - post, err := broker.GetPost(content.PostID) - if err != nil { - logrus.Errorf("service.GetPost err: %v", err) - response.ToResponse(gin.H{ - "paid": false, - }) - return - } - - // 发布者或管理员免费下载 - if post.UserID == user.(*core.User).ID || user.(*core.User).IsAdmin { - response.ToResponse(gin.H{ - "paid": true, - }) - return - } - - // 检测是否有购买记录 - response.ToResponse(gin.H{ - "paid": broker.CheckPostAttachmentIsPaid(post.ID, user.(*core.User).ID), - }) - return - } - response.ToResponse(gin.H{ - "paid": false, - }) -} - -func DownloadAttachment(c *gin.Context) { - response := app.NewResponse(c) - - contentID := convert.StrTo(c.Query("id")).MustInt64() - - // 加载content - content, err := broker.GetPostContentByID(contentID) - if err != nil { - logrus.Errorf("service.GetPostContentByID err: %v", err) - response.ToErrorResponse(errcode.InvalidDownloadReq) - } - - // 收费附件 - if content.Type == core.ContentTypeChargeAttachment { - user, _ := c.Get("USER") - - // 加载post - post, err := broker.GetPost(content.PostID) - if err != nil { - logrus.Errorf("service.GetPost err: %v", err) - response.ToResponse(gin.H{ - "paid": false, - }) - return - } - - paidFlag := false - - // 发布者或管理员免费下载 - if post.UserID == user.(*core.User).ID || user.(*core.User).IsAdmin { - paidFlag = true - } - - // 检测是否有购买记录 - if broker.CheckPostAttachmentIsPaid(post.ID, user.(*core.User).ID) { - paidFlag = true - } - - if !paidFlag { - // 未购买,则尝试购买 - err := broker.BuyPostAttachment(&core.Post{ - Model: &core.Model{ - ID: post.ID, - }, - UserID: post.UserID, - AttachmentPrice: post.AttachmentPrice, - }, user.(*core.User)) - if err != nil { - logrus.Errorf("service.BuyPostAttachment err: %v", err) - if err == errcode.InsuffientDownloadMoney { - - response.ToErrorResponse(errcode.InsuffientDownloadMoney) - } else { - - response.ToErrorResponse(errcode.DownloadExecFail) - } - return - } - } - } - - objectKey := objectStorage.ObjectKey(content.Content) - signedURL, err := objectStorage.SignURL(objectKey, 60) - if err != nil { - logrus.Errorf("client.SignURL err: %v", err) - response.ToErrorResponse(errcode.DownloadReqError) - return - } - response.ToResponse(gin.H{ - "signed_url": signedURL, - }) -} diff --git a/internal/servants/web/routers/api/comment.go b/internal/servants/web/routers/api/comment.go deleted file mode 100644 index 0779eabb..00000000 --- a/internal/servants/web/routers/api/comment.go +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package api - -import ( - "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/internal/servants/web/broker" - "github.com/rocboss/paopao-ce/pkg/app" - "github.com/rocboss/paopao-ce/pkg/convert" - "github.com/rocboss/paopao-ce/pkg/errcode" - "github.com/sirupsen/logrus" -) - -func GetPostComments(c *gin.Context) { - postID := convert.StrTo(c.Query("id")).MustInt64() - response := app.NewResponse(c) - - contents, totalRows, err := broker.GetPostComments(postID, "id ASC", 0, 0) - - if err != nil { - logrus.Errorf("service.GetPostComments err: %v\n", err) - response.ToErrorResponse(errcode.GetCommentsFailed) - return - } - - response.ToResponseList(contents, totalRows) -} - -func CreatePostComment(c *gin.Context) { - param := broker.CommentCreationReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - userID, _ := c.Get("UID") - comment, err := broker.CreatePostComment(c, userID.(int64), param) - - if err != nil { - if err == errcode.MaxCommentCount { - response.ToErrorResponse(errcode.MaxCommentCount) - } else { - logrus.Errorf("service.CreatePostComment err: %v\n", err) - response.ToErrorResponse(errcode.CreateCommentFailed) - } - return - } - - response.ToResponse(comment) -} - -func DeletePostComment(c *gin.Context) { - param := broker.CommentDelReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - user, _ := c.Get("USER") - - comment, err := broker.GetPostComment(param.ID) - if err != nil { - logrus.Errorf("service.GetPostComment err: %v\n", err) - response.ToErrorResponse(errcode.GetCommentFailed) - return - } - - if user.(*core.User).ID != comment.UserID && !user.(*core.User).IsAdmin { - response.ToErrorResponse(errcode.NoPermission) - return - } - - // 执行删除 - err = broker.DeletePostComment(comment) - if err != nil { - logrus.Errorf("service.DeletePostComment err: %v\n", err) - response.ToErrorResponse(errcode.DeleteCommentFailed) - return - } - - response.ToResponse(nil) -} - -func CreatePostCommentReply(c *gin.Context) { - param := broker.CommentReplyCreationReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - user, _ := c.Get("USER") - - comment, err := broker.CreatePostCommentReply(c, param.CommentID, param.Content, user.(*core.User).ID, param.AtUserID) - if err != nil { - logrus.Errorf("service.CreatePostCommentReply err: %v\n", err) - response.ToErrorResponse(errcode.CreateReplyFailed) - return - } - - response.ToResponse(comment) -} - -func DeletePostCommentReply(c *gin.Context) { - param := broker.ReplyDelReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - user, _ := c.Get("USER") - - reply, err := broker.GetPostCommentReply(param.ID) - if err != nil { - logrus.Errorf("service.GetPostCommentReply err: %v\n", err) - response.ToErrorResponse(errcode.GetReplyFailed) - return - } - - if user.(*core.User).ID != reply.UserID && !user.(*core.User).IsAdmin { - response.ToErrorResponse(errcode.NoPermission) - return - } - - // 执行删除 - err = broker.DeletePostCommentReply(reply) - if err != nil { - logrus.Errorf("service.DeletePostCommentReply err: %v\n", err) - response.ToErrorResponse(errcode.DeleteCommentFailed) - return - } - - response.ToResponse(nil) -} diff --git a/internal/servants/web/routers/api/home.go b/internal/servants/web/routers/api/home.go deleted file mode 100644 index 30f115a9..00000000 --- a/internal/servants/web/routers/api/home.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package api - -import ( - "bytes" - "encoding/base64" - "image/color" - "image/png" - "time" - - "github.com/afocus/captcha" - "github.com/gin-gonic/gin" - "github.com/gofrs/uuid" - "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/internal/servants/web/assets" - "github.com/rocboss/paopao-ce/internal/servants/web/broker" - "github.com/rocboss/paopao-ce/pkg/app" - "github.com/rocboss/paopao-ce/pkg/convert" - "github.com/rocboss/paopao-ce/pkg/debug" - "github.com/rocboss/paopao-ce/pkg/errcode" - "github.com/rocboss/paopao-ce/pkg/util" - "github.com/sirupsen/logrus" -) - -const MAX_PHONE_CAPTCHA = 10 - -func Version(c *gin.Context) { - response := app.NewResponse(c) - response.ToResponse(gin.H{ - "BuildInfo": debug.ReadBuildInfo(), - }) -} - -func SyncSearchIndex(c *gin.Context) { - response := app.NewResponse(c) - - user, _ := c.Get("USER") - - if user.(*core.User).IsAdmin { - go broker.PushPostsToSearch(c) - } - - response.ToResponse(nil) -} - -func GetCaptcha(c *gin.Context) { - cap := captcha.New() - - if err := cap.AddFontFromBytes(assets.ComicBytes); err != nil { - panic(err.Error()) - } - - cap.SetSize(160, 64) - cap.SetDisturbance(captcha.MEDIUM) - cap.SetFrontColor(color.RGBA{0, 0, 0, 255}) - cap.SetBkgColor(color.RGBA{218, 240, 228, 255}) - img, password := cap.Create(6, captcha.NUM) - emptyBuff := bytes.NewBuffer(nil) - _ = png.Encode(emptyBuff, img) - - key := util.EncodeMD5(uuid.Must(uuid.NewV4()).String()) - - // 五分钟有效期 - conf.Redis.SetEX(c, "PaoPaoCaptcha:"+key, password, time.Minute*5) - - response := app.NewResponse(c) - response.ToResponse(gin.H{ - "id": key, - "b64s": "data:image/png;base64," + base64.StdEncoding.EncodeToString(emptyBuff.Bytes()), - }) -} - -func PostCaptcha(c *gin.Context) { - param := broker.PhoneCaptchaReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - // 验证图片验证码 - if res, err := conf.Redis.Get(c.Request.Context(), "PaoPaoCaptcha:"+param.ImgCaptchaID).Result(); err != nil || res != param.ImgCaptcha { - response.ToErrorResponse(errcode.ErrorCaptchaPassword) - return - } - conf.Redis.Del(c.Request.Context(), "PaoPaoCaptcha:"+param.ImgCaptchaID).Result() - - // 今日频次限制 - if res, _ := conf.Redis.Get(c.Request.Context(), "PaoPaoSmsCaptcha:"+param.Phone).Result(); convert.StrTo(res).MustInt() >= MAX_PHONE_CAPTCHA { - response.ToErrorResponse(errcode.TooManyPhoneCaptchaSend) - return - } - - err := broker.SendPhoneCaptcha(c, param.Phone) - if err != nil { - logrus.Errorf("app.SendPhoneCaptcha errs: %v", errs) - response.ToErrorResponse(errcode.GetPhoneCaptchaError) - return - } - - response.ToResponse(nil) -} diff --git a/internal/servants/web/routers/api/message.go b/internal/servants/web/routers/api/message.go deleted file mode 100644 index 9cc72ffd..00000000 --- a/internal/servants/web/routers/api/message.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package api - -import ( - "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/internal/servants/web/broker" - "github.com/rocboss/paopao-ce/pkg/app" - "github.com/rocboss/paopao-ce/pkg/errcode" - "github.com/sirupsen/logrus" -) - -func GetUnreadMsgCount(c *gin.Context) { - response := app.NewResponse(c) - - user := &core.User{} - if u, exists := c.Get("USER"); exists { - user = u.(*core.User) - } - - count, _ := broker.GetUnreadCount(user.ID) - - response.ToResponse(gin.H{ - "count": count, - }) -} - -func GetMessages(c *gin.Context) { - response := app.NewResponse(c) - - userID, _ := c.Get("UID") - messages, totalRows, err := broker.GetMessages(userID.(int64), (app.GetPage(c)-1)*app.GetPageSize(c), app.GetPageSize(c)) - - if err != nil { - logrus.Errorf("service.GetMessages err: %v\n", err) - response.ToErrorResponse(errcode.GetMessagesFailed) - return - } - - response.ToResponseList(messages, totalRows) -} - -func ReadMessage(c *gin.Context) { - param := broker.ReadMessageReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - userID, _ := c.Get("UID") - err := broker.ReadMessage(param.ID, userID.(int64)) - if err != nil { - logrus.Errorf("service.ReadMessage err: %v\n", err) - response.ToErrorResponse(errcode.ReadMessageFailed) - return - } - - response.ToResponse(nil) -} - -func SendUserWhisper(c *gin.Context) { - param := broker.WhisperReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - userID, _ := c.Get("UID") - - // 不允许发送私信给自己 - if userID.(int64) == param.UserID { - response.ToErrorResponse(errcode.NoWhisperToSelf) - return - } - - _, err := broker.CreateWhisper(c, &core.Message{ - SenderUserID: userID.(int64), - ReceiverUserID: param.UserID, - Type: core.MsgTypeWhisper, - Brief: "给你发送新私信了", - Content: param.Content, - }) - - if err != nil { - logrus.Errorf("service.CreateWhisper err: %v\n", err) - - if err == errcode.TooManyWhisperNum { - response.ToErrorResponse(errcode.TooManyWhisperNum) - } else { - response.ToErrorResponse(errcode.SendWhisperFailed) - } - return - } - - response.ToResponse(nil) -} diff --git a/internal/servants/web/routers/api/post.go b/internal/servants/web/routers/api/post.go deleted file mode 100644 index 0dc923b0..00000000 --- a/internal/servants/web/routers/api/post.go +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package api - -import ( - "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/internal/servants/web/broker" - "github.com/rocboss/paopao-ce/pkg/app" - "github.com/rocboss/paopao-ce/pkg/convert" - "github.com/rocboss/paopao-ce/pkg/errcode" - "github.com/sirupsen/logrus" -) - -func GetPostList(c *gin.Context) { - response := app.NewResponse(c) - - q := &core.QueryReq{ - Query: c.Query("query"), - Type: "search", - } - if c.Query("type") == "tag" { - q.Type = "tag" - } - - user, _ := userFrom(c) - offset, limit := app.GetPageOffset(c) - if q.Query == "" && q.Type == "search" { - resp, err := broker.GetIndexPosts(user, offset, limit) - if err != nil { - logrus.Errorf("service.GetPostList err: %v\n", err) - response.ToErrorResponse(errcode.GetPostsFailed) - return - } - - response.ToResponseList(resp.Tweets, resp.Total) - } else { - posts, totalRows, err := broker.GetPostListFromSearch(user, q, offset, limit) - - if err != nil { - logrus.Errorf("service.GetPostListFromSearch err: %v\n", err) - response.ToErrorResponse(errcode.GetPostsFailed) - return - } - response.ToResponseList(posts, totalRows) - } -} - -func GetPost(c *gin.Context) { - postID := convert.StrTo(c.Query("id")).MustInt64() - response := app.NewResponse(c) - - postFormated, err := broker.GetPost(postID) - - if err != nil { - logrus.Errorf("service.GetPost err: %v\n", err) - response.ToErrorResponse(errcode.GetPostFailed) - return - } - - response.ToResponse(postFormated) -} - -func CreatePost(c *gin.Context) { - param := broker.PostCreationReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - userID, _ := c.Get("UID") - post, err := broker.CreatePost(c, userID.(int64), param) - - if err != nil { - logrus.Errorf("service.CreatePost err: %v\n", err) - response.ToErrorResponse(errcode.CreatePostFailed) - return - } - - response.ToResponse(post) -} - -func DeletePost(c *gin.Context) { - param := broker.PostDelReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - user, exist := userFrom(c) - if !exist { - response.ToErrorResponse(errcode.NoPermission) - return - } - - err := broker.DeletePost(user, param.ID) - if err != nil { - logrus.Errorf("service.DeletePost err: %v\n", err) - response.ToErrorResponse(err) - return - } - - response.ToResponse(nil) -} - -func GetPostStar(c *gin.Context) { - postID := convert.StrTo(c.Query("id")).MustInt64() - response := app.NewResponse(c) - - userID, _ := c.Get("UID") - - _, err := broker.GetPostStar(postID, userID.(int64)) - if err != nil { - response.ToResponse(gin.H{ - "status": false, - }) - - return - } - - response.ToResponse(gin.H{ - "status": true, - }) -} - -func PostStar(c *gin.Context) { - param := broker.PostStarReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - userID, _ := c.Get("UID") - - status := false - star, err := broker.GetPostStar(param.ID, userID.(int64)) - if err != nil { - // 创建Star - _, err = broker.CreatePostStar(param.ID, userID.(int64)) - status = true - } else { - // 取消Star - err = broker.DeletePostStar(star) - } - - if err != nil { - response.ToErrorResponse(errcode.NoPermission) - return - } - - response.ToResponse(gin.H{ - "status": status, - }) -} - -func GetPostCollection(c *gin.Context) { - postID := convert.StrTo(c.Query("id")).MustInt64() - response := app.NewResponse(c) - - userID, _ := c.Get("UID") - - _, err := broker.GetPostCollection(postID, userID.(int64)) - if err != nil { - response.ToResponse(gin.H{ - "status": false, - }) - - return - } - - response.ToResponse(gin.H{ - "status": true, - }) -} - -func PostCollection(c *gin.Context) { - param := broker.PostCollectionReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - userID, _ := c.Get("UID") - - status := false - collection, err := broker.GetPostCollection(param.ID, userID.(int64)) - if err != nil { - // 创建collection - _, err = broker.CreatePostCollection(param.ID, userID.(int64)) - status = true - } else { - // 取消Star - err = broker.DeletePostCollection(collection) - } - - if err != nil { - response.ToErrorResponse(errcode.NoPermission) - return - } - - response.ToResponse(gin.H{ - "status": status, - }) -} - -func LockPost(c *gin.Context) { - param := broker.PostLockReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - user, _ := c.Get("USER") - - // 获取Post - postFormated, err := broker.GetPost(param.ID) - if err != nil { - logrus.Errorf("service.GetPost err: %v\n", err) - response.ToErrorResponse(errcode.GetPostFailed) - return - } - - if postFormated.UserID != user.(*core.User).ID && !user.(*core.User).IsAdmin { - response.ToErrorResponse(errcode.NoPermission) - return - } - err = broker.LockPost(param.ID) - if err != nil { - logrus.Errorf("service.LockPost err: %v\n", err) - response.ToErrorResponse(errcode.LockPostFailed) - return - } - - response.ToResponse(gin.H{ - "lock_status": 1 - postFormated.IsLock, - }) -} - -func StickPost(c *gin.Context) { - param := broker.PostStickReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - user, _ := c.Get("USER") - - // 获取Post - postFormated, err := broker.GetPost(param.ID) - if err != nil { - logrus.Errorf("service.GetPost err: %v\n", err) - response.ToErrorResponse(errcode.GetPostFailed) - return - } - - if !user.(*core.User).IsAdmin { - response.ToErrorResponse(errcode.NoPermission) - return - } - err = broker.StickPost(param.ID) - if err != nil { - logrus.Errorf("service.StickPost err: %v\n", err) - response.ToErrorResponse(errcode.LockPostFailed) - return - } - - response.ToResponse(gin.H{ - "top_status": 1 - postFormated.IsTop, - }) -} - -func VisiblePost(c *gin.Context) { - param := broker.PostVisibilityReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - user, _ := userFrom(c) - if err := broker.VisiblePost(user, param.ID, param.Visibility); err != nil { - logrus.Errorf("service.VisiblePost err: %v\n", err) - response.ToErrorResponse(err) - return - } - - response.ToResponse(gin.H{ - "visibility": param.Visibility, - }) -} - -func GetPostTags(c *gin.Context) { - param := broker.PostTagsReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - tags, err := broker.GetPostTags(¶m) - if err != nil { - logrus.Errorf("service.GetPostTags err: %v\n", err) - response.ToErrorResponse(errcode.GetPostTagsFailed) - return - - } - - response.ToResponse(gin.H{ - "topics": tags, - }) -} diff --git a/internal/servants/web/routers/api/user.go b/internal/servants/web/routers/api/user.go deleted file mode 100644 index 89aa6615..00000000 --- a/internal/servants/web/routers/api/user.go +++ /dev/null @@ -1,650 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package api - -import ( - "fmt" - "net/http" - "unicode/utf8" - - "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/internal/core" - "github.com/rocboss/paopao-ce/internal/servants/web/broker" - "github.com/rocboss/paopao-ce/pkg/app" - "github.com/rocboss/paopao-ce/pkg/convert" - "github.com/rocboss/paopao-ce/pkg/errcode" - "github.com/sirupsen/logrus" - "github.com/smartwalle/alipay/v3" -) - -// Login 用户登录 -func Login(c *gin.Context) { - param := broker.AuthRequest{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - user, err := broker.DoLogin(c, ¶m) - if err != nil { - logrus.Errorf("service.DoLogin err: %v", err) - response.ToErrorResponse(err.(*errcode.Error)) - return - } - - token, err := app.GenerateToken(user) - if err != nil { - logrus.Errorf("app.GenerateToken err: %v", err) - response.ToErrorResponse(errcode.UnauthorizedTokenGenerate) - return - } - - response.ToResponse(gin.H{ - "token": token, - }) -} - -// Register 用户注册 -func Register(c *gin.Context) { - - param := broker.RegisterRequest{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - // 用户名检查 - err := broker.ValidUsername(param.Username) - if err != nil { - logrus.Errorf("service.Register err: %v", err) - response.ToErrorResponse(err.(*errcode.Error)) - return - } - - // 密码检查 - err = broker.CheckPassword(param.Password) - if err != nil { - logrus.Errorf("service.Register err: %v", err) - response.ToErrorResponse(err.(*errcode.Error)) - return - } - - user, err := broker.Register( - param.Username, - param.Password, - ) - - if err != nil { - logrus.Errorf("service.Register err: %v", err) - response.ToErrorResponse(errcode.UserRegisterFailed) - return - } - - response.ToResponse(gin.H{ - "id": user.ID, - "username": user.Username, - }) -} - -func RequestingFriend(c *gin.Context) { - param := broker.RequestingFriendReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - user, ok := userFrom(c) - if !ok { - response.ToErrorResponse(errcode.UnauthorizedAuthNotExist) - } - if user.ID == param.UserId { - response.ToErrorResponse(errcode.NoRequestingFriendToSelf) - return - } - - if err := broker.RequestingFriend(user, ¶m); err != nil { - logrus.Errorf("service.RequestingFriend err: %v", err) - response.ToErrorResponse(errcode.SendRequestingFriendFailed) - return - } - - response.ToResponse(nil) -} - -func AddFriend(c *gin.Context) { - param := broker.AddFriendReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - user, ok := userFrom(c) - if !ok { - response.ToErrorResponse(errcode.UnauthorizedAuthNotExist) - } - if user.ID == param.UserId { - response.ToErrorResponse(errcode.NoActionToSelf) - return - } - - if err := broker.AddFriend(user, ¶m); err != nil { - logrus.Errorf("service.AddFriend err: %v", err) - response.ToErrorResponse(errcode.AddFriendFailed) - return - } - - response.ToResponse(nil) -} - -func RejectFriend(c *gin.Context) { - param := broker.RejectFriendReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - user, ok := userFrom(c) - if !ok { - response.ToErrorResponse(errcode.UnauthorizedAuthNotExist) - } - if user.ID == param.UserId { - response.ToErrorResponse(errcode.NoActionToSelf) - return - } - - if err := broker.RejectFriend(user, ¶m); err != nil { - logrus.Errorf("service.RejectFriend err: %v", err) - response.ToErrorResponse(errcode.RejectFriendFailed) - return - } - - response.ToResponse(nil) -} - -func DeleteFriend(c *gin.Context) { - param := broker.DeleteFriendReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - user, ok := userFrom(c) - if !ok { - response.ToErrorResponse(errcode.UnauthorizedAuthNotExist) - } - if user.ID == param.UserId { - response.ToErrorResponse(errcode.NoActionToSelf) - return - } - - if err := broker.DeleteFriend(user, ¶m); err != nil { - logrus.Errorf("service.DeleteFriend err: %v", err) - response.ToErrorResponse(errcode.DeleteFriendFailed) - return - } - - response.ToResponse(nil) -} - -func GetContacts(c *gin.Context) { - response := app.NewResponse(c) - user, ok := userFrom(c) - if !ok { - response.ToErrorResponse(errcode.UnauthorizedAuthNotExist) - } - - offset, limit := app.GetPageOffset(c) - resp, err := broker.GetContacts(user, offset, limit) - if err != nil { - logrus.Errorf("service.DeleteFriend err: %v", err) - response.ToErrorResponse(errcode.GetContactsFailed) - return - } - response.ToResponseList(resp.Contacts, resp.Total) -} - -// 获取用户基本信息 -func GetUserInfo(c *gin.Context) { - param := broker.AuthRequest{} - response := app.NewResponse(c) - - if username, exists := c.Get("USERNAME"); exists { - param.Username = username.(string) - } - - user, err := broker.GetUserInfo(¶m) - - if err != nil { - response.ToErrorResponse(errcode.UnauthorizedAuthNotExist) - return - } - phone := "" - if user.Phone != "" && len(user.Phone) == 11 { - phone = user.Phone[0:3] + "****" + user.Phone[7:] - } - - response.ToResponse(gin.H{ - "id": user.ID, - "nickname": user.Nickname, - "username": user.Username, - "status": user.Status, - "avatar": user.Avatar, - "balance": user.Balance, - "phone": phone, - "is_admin": user.IsAdmin, - }) -} - -// 修改密码 -func ChangeUserPassword(c *gin.Context) { - param := broker.ChangePasswordReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - user := &core.User{} - if u, exists := c.Get("USER"); exists { - user = u.(*core.User) - } - - // 密码检查 - err := broker.CheckPassword(param.Password) - if err != nil { - logrus.Errorf("service.Register err: %v", err) - response.ToErrorResponse(err.(*errcode.Error)) - return - } - - // 旧密码校验 - if !broker.ValidPassword(user.Password, param.OldPassword, user.Salt) { - response.ToErrorResponse(errcode.ErrorOldPassword) - return - } - - // 更新入库 - user.Password, user.Salt = broker.EncryptPasswordAndSalt(param.Password) - broker.UpdateUserInfo(user) - - response.ToResponse(nil) -} - -// 修改昵称 -func ChangeNickname(c *gin.Context) { - param := broker.ChangeNicknameReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - user := &core.User{} - if u, exists := c.Get("USER"); exists { - user = u.(*core.User) - } - - if utf8.RuneCountInString(param.Nickname) < 2 || utf8.RuneCountInString(param.Nickname) > 12 { - response.ToErrorResponse(errcode.NicknameLengthLimit) - return - } - - // 执行绑定 - user.Nickname = param.Nickname - broker.UpdateUserInfo(user) - - response.ToResponse(nil) -} - -// 修改头像 -func ChangeAvatar(c *gin.Context) { - param := broker.ChangeAvatarReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - user, exist := userFrom(c) - if !exist { - response.ToErrorResponse(errcode.UnauthorizedTokenError) - return - } - - if err := broker.ChangeUserAvatar(user, param.Avatar); err != nil { - response.ToErrorResponse(err) - return - } - response.ToResponse(nil) -} - -// 用户绑定手机号 -func BindUserPhone(c *gin.Context) { - param := broker.UserPhoneBindReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - user := &core.User{} - if u, exists := c.Get("USER"); exists { - user = u.(*core.User) - } - - // 手机重复性检查 - if broker.CheckPhoneExist(user.ID, param.Phone) { - response.ToErrorResponse(errcode.ExistedUserPhone) - return - } - - if err := broker.CheckPhoneCaptcha(param.Phone, param.Captcha); err != nil { - logrus.Errorf("service.CheckPhoneCaptcha err: %v\n", err) - response.ToErrorResponse(err) - return - } - - // 执行绑定 - user.Phone = param.Phone - if err := broker.UpdateUserInfo(user); err != nil { - response.ToErrorResponse(err) - return - } - - response.ToResponse(nil) -} - -// 修改用户状态 -func ChangeUserStatus(c *gin.Context) { - param := broker.ChangeUserStatusReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - if param.Status != core.UserStatusNormal && param.Status != core.UserStatusClosed { - response.ToErrorResponse(errcode.InvalidParams) - return - } - - user, err := broker.GetUserByID(param.ID) - if err != nil { - logrus.Errorf("service.GetUserByID err: %v\n", err) - response.ToErrorResponse(errcode.NoExistUsername) - return - } - - // 执行更新 - user.Status = param.Status - broker.UpdateUserInfo(user) - - response.ToResponse(nil) -} - -func GetUserProfile(c *gin.Context) { - response := app.NewResponse(c) - username := c.Query("username") - user, _ := userFrom(c) - - resp, err := broker.GetUserByUsername(user, username) - if err != nil { - logrus.Errorf("service.GetUserByUsername err: %v\n", err) - response.ToErrorResponse(errcode.NoExistUsername) - return - } - - response.ToResponse(resp) -} - -func GetUserPosts(c *gin.Context) { - response := app.NewResponse(c) - username := c.Query("username") - user, exists := userFrom(c) - - other, err := broker.GetUserByUsername(user, username) - if err != nil { - logrus.Errorf("service.GetUserByUsername err: %v\n", err) - response.ToErrorResponse(errcode.NoExistUsername) - return - } - - visibilities := []core.PostVisibleT{core.PostVisitPublic} - if exists { - if user.ID == other.ID || user.IsAdmin { - visibilities = append(visibilities, core.PostVisitPrivate, core.PostVisitFriend) - } else if other.IsFriend { - visibilities = append(visibilities, core.PostVisitFriend) - } - } - conditions := core.ConditionsT{ - "user_id": other.ID, - "visibility IN ?": visibilities, - "ORDER": "latest_replied_on DESC", - } - - _, posts, err := broker.GetPostList(&broker.PostListReq{ - Conditions: &conditions, - Offset: (app.GetPage(c) - 1) * app.GetPageSize(c), - Limit: app.GetPageSize(c), - }) - if err != nil { - logrus.Errorf("service.GetPostList err: %v\n", err) - response.ToErrorResponse(errcode.GetPostsFailed) - return - } - totalRows, _ := broker.GetPostCount(&conditions) - - response.ToResponseList(posts, totalRows) -} - -func GetUserCollections(c *gin.Context) { - response := app.NewResponse(c) - - userID, _ := c.Get("UID") - posts, totalRows, err := broker.GetUserCollections(userID.(int64), (app.GetPage(c)-1)*app.GetPageSize(c), app.GetPageSize(c)) - - if err != nil { - logrus.Errorf("service.GetUserCollections err: %v\n", err) - response.ToErrorResponse(errcode.GetCollectionsFailed) - return - } - - response.ToResponseList(posts, totalRows) -} - -func GetUserStars(c *gin.Context) { - response := app.NewResponse(c) - - userID, _ := c.Get("UID") - posts, totalRows, err := broker.GetUserStars(userID.(int64), (app.GetPage(c)-1)*app.GetPageSize(c), app.GetPageSize(c)) - if err != nil { - logrus.Errorf("service.GetUserStars err: %v\n", err) - response.ToErrorResponse(errcode.GetCollectionsFailed) - return - } - - response.ToResponseList(posts, totalRows) -} - -func GetSuggestUsers(c *gin.Context) { - keyword := c.Query("k") - response := app.NewResponse(c) - - usernames, err := broker.GetSuggestUsers(keyword) - if err != nil { - logrus.Errorf("service.GetSuggestUsers err: %v\n", err) - response.ToErrorResponse(errcode.GetCollectionsFailed) - return - } - - response.ToResponse(gin.H{ - "suggest": usernames, - }) -} - -func GetSuggestTags(c *gin.Context) { - keyword := c.Query("k") - response := app.NewResponse(c) - - tags, err := broker.GetSuggestTags(keyword) - if err != nil { - logrus.Errorf("service.GetSuggestTags err: %v\n", err) - response.ToErrorResponse(errcode.GetCollectionsFailed) - return - } - - response.ToResponse(gin.H{ - "suggest": tags, - }) -} - -func GetUserRechargeLink(c *gin.Context) { - param := broker.RechargeReq{} - response := app.NewResponse(c) - valid, errs := app.BindAndValid(c, ¶m) - if !valid { - logrus.Errorf("app.BindAndValid errs: %v", errs) - response.ToErrorResponse(errcode.InvalidParams.WithDetails(errs.Errors()...)) - return - } - - // 下单 - userID, _ := c.Get("UID") - recharge, err := broker.CreateRecharge(userID.(int64), param.Amount) - if err != nil { - logrus.Errorf("service.CreateRecharge err: %v\n", err) - response.ToErrorResponse(errcode.RechargeReqFail) - return - } - - p := alipay.TradePreCreate{} - p.OutTradeNo = fmt.Sprintf("%d", recharge.ID) - p.Subject = "PaoPao用户钱包充值" - p.TotalAmount = fmt.Sprintf("%.2f", float64(recharge.Amount)/100.0) - p.NotifyURL = "https://" + c.Request.Host + "/v1/alipay/notify" - - rsp, err := alipayClient.TradePreCreate(p) - if err != nil { - logrus.Errorf("client.TradePreCreate err: %v\n", err) - response.ToErrorResponse(errcode.RechargeReqFail) - return - } - if rsp.Content.Code != alipay.CodeSuccess { - response.ToErrorResponse(errcode.RechargeReqFail) - return - } - - response.ToResponse(gin.H{ - "id": recharge.ID, - "pay": rsp.Content.QRCode, - }) -} - -func GetUserRechargeResult(c *gin.Context) { - response := app.NewResponse(c) - - id := c.Query("id") - userID, _ := c.Get("UID") - - recharge, err := broker.GetRechargeByID(convert.StrTo(id).MustInt64()) - if err != nil { - response.ToErrorResponse(errcode.GetRechargeFailed) - return - } - - if recharge.UserID != userID.(int64) { - response.ToErrorResponse(errcode.GetRechargeFailed) - return - } - - response.ToResponse(gin.H{ - "id": recharge.ID, - "status": recharge.TradeStatus, - }) -} - -func AlipayNotify(c *gin.Context) { - response := app.NewResponse(c) - c.Request.ParseForm() - - _, err := alipayClient.GetTradeNotification(c.Request) - if err != nil { - logrus.Errorf("alipayClient.GetTradeNotification err: %v\n", err) - logrus.Infoln(c.Request.Form) - response.ToErrorResponse(errcode.RechargeNotifyError) - return - } - - id := c.Request.Form.Get("out_trade_no") - tradeNo := c.Request.Form.Get("trade_no") - tradeStatus := c.Request.Form.Get("trade_status") - if tradeStatus == "TRADE_SUCCESS" { - // 交易支付成功 - err = broker.FinishRecharge(c, convert.StrTo(id).MustInt64(), tradeNo) - if err != nil { - logrus.Errorf("service.FinishRecharge err: %v\n", err) - response.ToErrorResponse(errcode.RechargeNotifyError) - return - } - } - response.Ctx.String(http.StatusOK, "success") -} - -func GetUserWalletBills(c *gin.Context) { - response := app.NewResponse(c) - - userID, _ := c.Get("UID") - bills, totalRows, err := broker.GetUserWalletBills(userID.(int64), (app.GetPage(c)-1)*app.GetPageSize(c), app.GetPageSize(c)) - - if err != nil { - logrus.Errorf("service.GetUserWalletBills err: %v\n", err) - response.ToErrorResponse(errcode.GetCollectionsFailed) - return - } - - response.ToResponseList(bills, totalRows) -} - -func userFrom(c *gin.Context) (*core.User, bool) { - if u, exists := c.Get("USER"); exists { - user, ok := u.(*core.User) - return user, ok - } - return nil, false -} - -func userIdFrom(c *gin.Context) (int64, bool) { - if u, exists := c.Get("UID"); exists { - uid, ok := u.(int64) - return uid, ok - } - return -1, false -} diff --git a/internal/servants/web/routers/docs.go b/internal/servants/web/routers/docs.go deleted file mode 100644 index bf5e0488..00000000 --- a/internal/servants/web/routers/docs.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -//go:build !docs -// +build !docs - -package routers - -import ( - "github.com/gin-gonic/gin" -) - -// registerDocs stub function for register docs asset route -func registerDocs(e *gin.Engine) { - // empty -} diff --git a/internal/servants/web/routers/docs_embed.go b/internal/servants/web/routers/docs_embed.go deleted file mode 100644 index 20754e1a..00000000 --- a/internal/servants/web/routers/docs_embed.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -//go:build docs -// +build docs - -package routers - -import ( - "github.com/alimy/cfg" - "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/docs/openapi" -) - -// registerDocs register docs asset route -func registerDocs(e *gin.Engine) { - cfg.Be("Docs:OpenAPI", func() { - e.StaticFS("/docs/openapi", openapi.NewFileSystem()) - }) -} diff --git a/internal/servants/web/routers/router.go b/internal/servants/web/routers/router.go deleted file mode 100644 index 70247c6a..00000000 --- a/internal/servants/web/routers/router.go +++ /dev/null @@ -1,351 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package routers - -import ( - "net/http" - "path/filepath" - - "github.com/alimy/cfg" - "github.com/gin-contrib/cors" - "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/internal/servants/chain" - "github.com/rocboss/paopao-ce/internal/servants/web/routers/api" - "github.com/sirupsen/logrus" -) - -func NewRouter() *gin.Engine { - e := gin.New() - e.HandleMethodNotAllowed = true - e.Use(gin.Logger()) - e.Use(gin.Recovery()) - - // 跨域配置 - corsConfig := cors.DefaultConfig() - corsConfig.AllowAllOrigins = true - corsConfig.AddAllowHeaders("Authorization") - e.Use(cors.New(corsConfig)) - - // 按需注册 docs、静态资源、LocalOSS 路由 - { - registerDocs(e) - registerStatick(e) - - cfg.Be("LocalOSS", func() { - routeLocalOSS(e) - }) - } - - // v1 group api - r := e.Group("/v1") - - // 获取version - r.GET("/", api.Version) - - // 用户登录 - r.POST("/auth/login", api.Login) - - // 用户注册 - r.POST("/auth/register", api.Register) - - // 获取验证码 - r.GET("/captcha", api.GetCaptcha) - - // 发送验证码 - r.POST("/captcha", api.PostCaptcha) - - // 无鉴权路由组 - noAuthApi := r.Group("/") - { - // 获取动态详情 - noAuthApi.GET("/post", api.GetPost) - - // 获取动态评论 - noAuthApi.GET("/post/comments", api.GetPostComments) - - // 获取话题列表 - noAuthApi.GET("/tags", api.GetPostTags) - } - - // 宽松鉴权路由组 - looseApi := r.Group("/").Use(chain.JwtLoose()) - { - // 获取广场流 - looseApi.GET("/posts", api.GetPostList) - - // 获取用户动态列表 - looseApi.GET("/user/posts", api.GetUserPosts) - - // 获取用户基本信息 - looseApi.GET("/user/profile", api.GetUserProfile) - } - - // 鉴权路由组 - authApi := r.Group("/").Use(chain.JWT()) - privApi := r.Group("/").Use(chain.JWT()).Use(chain.Priv()) - adminApi := r.Group("/").Use(chain.JWT()).Use(chain.Admin()) - - // 核心路由注册 - routeCore(authApi, privApi, adminApi) - - // 支付宝路由注册 - cfg.Be("Alipay", func() { - routeAlipay(r, authApi) - }) - - // Relationship相关路由注册 - routeRelationship(authApi) - - // 默认404 - e.NoRoute(func(c *gin.Context) { - c.JSON(http.StatusNotFound, gin.H{ - "code": 404, - "msg": "Not Found", - }) - }) - - // 默认405 - e.NoMethod(func(c *gin.Context) { - c.JSON(http.StatusMethodNotAllowed, gin.H{ - "code": 405, - "msg": "Method Not Allowed", - }) - }) - - return e -} - -func RegisterRoute(e *gin.Engine) { - // 按需注册 Web前端静态资源 - cfg.Be("Frontend:EmbedWeb", func() { - registerStatick(e) - }) - - // 按需注册 LocalOSS 路由 - cfg.Be("LocalOSS", func() { - routeLocalOSS(e) - }) - - // v1 group api - r := e.Group("/v1") - - // 获取version - r.GET("/", api.Version) - - // 用户登录 - r.POST("/auth/login", api.Login) - - // 用户注册 - r.POST("/auth/register", api.Register) - - // 获取验证码 - r.GET("/captcha", api.GetCaptcha) - - // 发送验证码 - r.POST("/captcha", api.PostCaptcha) - - // 无鉴权路由组 - noAuthApi := r.Group("/") - { - // 获取动态详情 - noAuthApi.GET("/post", api.GetPost) - - // 获取动态评论 - noAuthApi.GET("/post/comments", api.GetPostComments) - - // 获取话题列表 - noAuthApi.GET("/tags", api.GetPostTags) - } - - // 宽松鉴权路由组 - looseApi := r.Group("/").Use(chain.JwtLoose()) - { - // 获取广场流 - looseApi.GET("/posts", api.GetPostList) - - // 获取用户动态列表 - looseApi.GET("/user/posts", api.GetUserPosts) - - // 获取用户基本信息 - looseApi.GET("/user/profile", api.GetUserProfile) - } - - // 鉴权路由组 - authApi := r.Group("/").Use(chain.JWT()) - privApi := r.Group("/").Use(chain.JWT()).Use(chain.Priv()) - adminApi := r.Group("/").Use(chain.JWT()).Use(chain.Admin()) - - // 核心路由注册 - routeCore(authApi, privApi, adminApi) - - // 支付宝路由注册 - cfg.Be("Alipay", func() { - routeAlipay(r, authApi) - }) - - // Relationship相关路由注册 - routeRelationship(authApi) -} - -func routeCore(authApi gin.IRoutes, privApi gin.IRoutes, adminApi gin.IRoutes) { - // 同步索引 - authApi.GET("/sync/index", api.SyncSearchIndex) - - // 获取当前用户信息 - authApi.GET("/user/info", api.GetUserInfo) - - // 获取当前用户未读消息数量 - authApi.GET("/user/msgcount/unread", api.GetUnreadMsgCount) - - // 获取消息列表 - authApi.GET("/user/messages", api.GetMessages) - - // 标记消息已读 - authApi.POST("/user/message/read", api.ReadMessage) - - // 发送用户私信 - authApi.POST("/user/whisper", api.SendUserWhisper) - - // 获取用户收藏列表 - authApi.GET("/user/collections", api.GetUserCollections) - - // 获取用户点赞列表 - authApi.GET("/user/stars", api.GetUserStars) - - // 绑定用户手机号 - authApi.POST("/user/phone", api.BindUserPhone) - - // 修改密码 - authApi.POST("/user/password", api.ChangeUserPassword) - - // 修改昵称 - authApi.POST("/user/nickname", api.ChangeNickname) - - // 修改头像 - authApi.POST("/user/avatar", api.ChangeAvatar) - - // 检索用户 - authApi.GET("/suggest/users", api.GetSuggestUsers) - - // 检索标签 - authApi.GET("/suggest/tags", api.GetSuggestTags) - - // 上传资源 - privApi.POST("/attachment", api.UploadAttachment) - - // 下载资源预检 - privApi.GET("/attachment/precheck", api.DownloadAttachmentPrecheck) - - // 下载资源 - privApi.GET("/attachment", api.DownloadAttachment) - - // 发布动态 - privApi.POST("/post", api.CreatePost) - - // 删除动态 - privApi.DELETE("/post", api.DeletePost) - - // 获取动态点赞状态 - authApi.GET("/post/star", api.GetPostStar) - - // 动态点赞操作 - privApi.POST("/post/star", api.PostStar) - - // 获取动态收藏状态 - authApi.GET("/post/collection", api.GetPostCollection) - - // 动态收藏操作 - privApi.POST("/post/collection", api.PostCollection) - - // 锁定动态 - privApi.POST("/post/lock", api.LockPost) - - // 置顶动态 - privApi.POST("/post/stick", api.StickPost) - - // 修改动态可见度 - privApi.POST("/post/visibility", api.VisiblePost) - - // 发布动态评论 - privApi.POST("/post/comment", api.CreatePostComment) - - // 删除动态评论 - privApi.DELETE("/post/comment", api.DeletePostComment) - - // 发布评论回复 - privApi.POST("/post/comment/reply", api.CreatePostCommentReply) - - // 删除评论回复 - privApi.DELETE("/post/comment/reply", api.DeletePostCommentReply) - - // 管理·禁言/解封用户 - adminApi.POST("/admin/user/status", api.ChangeUserStatus) -} - -// routeLocalOSS register LocalOSS route if needed -func routeLocalOSS(e *gin.Engine) { - savePath, err := filepath.Abs(conf.LocalOSSSetting.SavePath) - if err != nil { - logrus.Fatalf("get localOSS save path err: %v", err) - } - e.Static("/oss", savePath) - - logrus.Infof("register LocalOSS route in /oss on save path: %s", savePath) -} - -// routeAlipay register Alipay feature releated route if needed -func routeAlipay(public gin.IRoutes, authApi gin.IRoutes) { - // 支付宝回调 - public.POST("/alipay/notify", api.AlipayNotify) - - // 用户充值 - authApi.POST("/user/recharge", api.GetUserRechargeLink) - - // 获取钱包余额 - authApi.GET("/user/recharge", api.GetUserRechargeResult) - - // 获取用户账单 - authApi.GET("/user/wallet/bills", api.GetUserWalletBills) -} - -// routeRelationship register Relationship releated routes -func routeRelationship(authApi gin.IRoutes) { - cfg.In(cfg.Actions{ - "Friendship": func() { - routeFriendship(authApi) - }, - "Followship": func() { - routeFollowship(authApi) - }, - }, func() { - // 暂时默认使用好友模式 - // TODO: 后期提供一种无关系模式(既不是好友模式也不是关注者模式)作为默认的关系模式 - routeFriendship(authApi) - }) -} - -// routeFriendship register Friendship feature releated routes -func routeFriendship(authApi gin.IRoutes) { - // 请求添加朋友 - authApi.POST("/friend/requesting", api.RequestingFriend) - - // 同意添加好友 - authApi.POST("/friend/add", api.AddFriend) - - // 拒绝添加好友 - authApi.POST("/friend/reject", api.RejectFriend) - - // 删除好友 - authApi.POST("/friend/delete", api.DeleteFriend) - - // 获取好友列表 - authApi.GET("/user/contacts", api.GetContacts) -} - -// routeFollowship register Followship feature releated routes -func routeFollowship(authApi gin.IRoutes) { - // TODO: register followship routes -} diff --git a/internal/servants/web/routers/statick.go b/internal/servants/web/routers/statick.go deleted file mode 100644 index c1f2d1cb..00000000 --- a/internal/servants/web/routers/statick.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -//go:build !embed -// +build !embed - -package routers - -import ( - "github.com/gin-gonic/gin" -) - -// registerStatick stub function for register static asset route -func registerStatick(e *gin.Engine) { - // empty -} diff --git a/internal/servants/web/routers/statick_embed.go b/internal/servants/web/routers/statick_embed.go deleted file mode 100644 index dfc729f5..00000000 --- a/internal/servants/web/routers/statick_embed.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -//go:build embed -// +build embed - -package routers - -import ( - "net/http" - - "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/web" -) - -// registerStatick register static assets route -func registerStatick(e *gin.Engine) { - routeStatic(e, "/", "/index.html", "/favicon.ico", "/assets/*filepath") -} - -func routeStatic(e *gin.Engine, paths ...string) { - staticHandler := http.FileServer(web.NewFileSystem()) - handler := func(c *gin.Context) { - staticHandler.ServeHTTP(c.Writer, c.Request) - } - for _, path := range paths { - e.GET(path, handler) - e.HEAD(path, handler) - } -} diff --git a/internal/servants/web/utils.go b/internal/servants/web/utils.go index e42e03b5..0e2696e3 100644 --- a/internal/servants/web/utils.go +++ b/internal/servants/web/utils.go @@ -11,11 +11,12 @@ import ( "time" "unicode/utf8" - "github.com/alimy/mir/v3" - "github.com/gofrs/uuid" + "github.com/alimy/mir/v4" + "github.com/gofrs/uuid/v5" "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" "github.com/rocboss/paopao-ce/internal/model/web" - "github.com/rocboss/paopao-ce/pkg/util" + "github.com/rocboss/paopao-ce/pkg/utils" "github.com/rocboss/paopao-ce/pkg/xerror" "github.com/sirupsen/logrus" ) @@ -82,20 +83,20 @@ func getRandomAvatar() string { func checkPassword(password string) mir.Error { // 检测用户是否合规 if utf8.RuneCountInString(password) < 6 || utf8.RuneCountInString(password) > 16 { - return _errPasswordLengthLimit + return web.ErrPasswordLengthLimit } return nil } // ValidPassword 检查密码是否一致 func validPassword(dbPassword, password, salt string) bool { - return strings.Compare(dbPassword, util.EncodeMD5(util.EncodeMD5(password)+salt)) == 0 + return strings.Compare(dbPassword, utils.EncodeMD5(utils.EncodeMD5(password)+salt)) == 0 } // encryptPasswordAndSalt 密码加密&生成salt func encryptPasswordAndSalt(password string) (string, string) { salt := uuid.Must(uuid.NewV4()).String()[:8] - password = util.EncodeMD5(util.EncodeMD5(password) + salt) + password = utils.EncodeMD5(utils.EncodeMD5(password) + salt) return password, salt } @@ -119,11 +120,11 @@ func persistMediaContents(oss core.ObjectStorageService, contents []*web.PostCon items = make([]string, 0, len(contents)) for _, item := range contents { switch item.Type { - case core.ContentTypeImage, - core.ContentTypeVideo, - core.ContentTypeAudio, - core.ContentTypeAttachment, - core.ContentTypeChargeAttachment: + case ms.ContentTypeImage, + ms.ContentTypeVideo, + ms.ContentTypeAudio, + ms.ContentTypeAttachment, + ms.ContentTypeChargeAttachment: items = append(items, item.Content) if err != nil { continue @@ -144,7 +145,7 @@ func fileCheck(uploadType string, size int64) mir.Error { return xerror.InvalidParams } if size > 1024*1024*100 { - return _errFileInvalidSize.WithDetails("最大允许100MB") + return web.ErrFileInvalidSize.WithDetails("最大允许100MB") } return nil } @@ -163,10 +164,13 @@ func getFileExt(s string) (string, mir.Error) { return ".mp4", nil case "video/quicktime": return ".mov", nil - case "application/zip": + case "application/zip", + "application/x-zip", + "application/octet-stream", + "application/x-zip-compressed": return ".zip", nil default: - return "", _errFileInvalidExt.WithDetails("仅允许 png/jpg/gif/mp4/mov/zip 类型") + return "", web.ErrFileInvalidExt.WithDetails("仅允许 png/jpg/gif/mp4/mov/zip 类型") } } @@ -197,9 +201,9 @@ func tagsFrom(originTags []string) []string { } // checkPermision 检查是否拥有者或管理员 -func checkPermision(user *core.User, targetUserId int64) mir.Error { +func checkPermision(user *ms.User, targetUserId int64) mir.Error { if user == nil || (user.ID != targetUserId && !user.IsAdmin) { - return _errNoPermission + return web.ErrNoPermission } return nil } diff --git a/internal/servants/web/web.go b/internal/servants/web/web.go index 286109d3..e4684a1e 100644 --- a/internal/servants/web/web.go +++ b/internal/servants/web/web.go @@ -5,64 +5,53 @@ package web import ( + "sync" + "github.com/alimy/cfg" "github.com/gin-gonic/gin" api "github.com/rocboss/paopao-ce/auto/api/v1" "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/dao" "github.com/rocboss/paopao-ce/internal/servants/base" - "github.com/sirupsen/logrus" - "github.com/smartwalle/alipay/v3" +) + +var ( + _enablePhoneVerify bool + _disallowUserRegister bool + _onceInitial sync.Once ) // RouteWeb register web route func RouteWeb(e *gin.Engine) { + lazyInitial() oss := dao.ObjectStorageService() - ds := &base.DaoServant{ - Redis: conf.Redis, - Ds: dao.DataService(), - Ts: dao.TweetSearchService(), - } + ds := base.NewDaoServant() // aways register servants - api.RegisterAdminServant(e, newAdminSrv(ds), newAdminBinding(), newAdminRender()) - api.RegisterCoreServant(e, newCoreSrv(ds, oss), newCoreBinding(), newCoreRender()) - api.RegisterLooseServant(e, newLooseSrv(ds), newLooseBinding(), newLooseRender()) - api.RegisterPrivServant(e, newPrivSrv(ds, oss), newPrivBinding(), newPrivRender()) - api.RegisterPubServant(e, newPubSrv(ds), newPubBinding(), newPubRender()) + api.RegisterAdminServant(e, newAdminSrv(ds)) + api.RegisterCoreServant(e, newCoreSrv(ds, oss)) + api.RegisterLooseServant(e, newLooseSrv(ds)) + api.RegisterPrivServant(e, newPrivSrv(ds, oss)) + api.RegisterPubServant(e, newPubSrv(ds)) // regster servants if needed by configure cfg.In(cfg.Actions{ "Alipay": func() { - client := mustAlipayClient() - api.RegisterAlipayPubServant(e, newAlipayPubSrv(ds), newAlipayPubBinding(client), newAlipayPubRender()) - api.RegisterAlipayPrivServant(e, newAlipayPrivSrv(ds, client), newAlipayPrivBinding(), newAlipayPrivRender()) + client := conf.MustAlipayClient() + api.RegisterAlipayPubServant(e, newAlipayPubSrv(ds)) + api.RegisterAlipayPrivServant(e, newAlipayPrivSrv(ds, client)) }, "Followship": func() { - api.RegisterFollowshipServant(e, newFollowshipSrv(ds), newFollowshipBinding(), newFollowshipRender()) + api.RegisterFollowshipServant(e, newFollowshipSrv(ds)) }, "Friendship": func() { - api.RegisterFriendshipServant(e, newFriendshipSrv(ds), newFriendshipBinding(), newFriendshipRender()) + api.RegisterFriendshipServant(e, newFriendshipSrv(ds)) }, }) } -func mustAlipayClient() *alipay.Client { - s := conf.AlipaySetting - // 将 key 的验证调整到初始化阶段 - client, err := alipay.New(s.AppID, s.PrivateKey, s.InProduction) - if err != nil { - logrus.Fatalf("alipay.New err: %s", err) - } - // 加载应用公钥证书 - if err = client.LoadAppPublicCertFromFile(s.AppPublicCertFile); err != nil { - logrus.Fatalf("client.LoadAppPublicCertFromFile err: %s\n", err) - } - // 加载支付宝根证书 - if err = client.LoadAliPayRootCertFromFile(s.RootCertFile); err != nil { - logrus.Fatalf("client.LoadAliPayRootCertFromFile err: %s\n", err) - } - // 加载支付宝公钥证书 - if err = client.LoadAliPayPublicCertFromFile(s.PublicCertFile); err != nil { - logrus.Fatalf("client.LoadAliPayPublicCertFromFile err: %s\n", err) - } - return client +// lazyInitial do some package lazy initialize for performance +func lazyInitial() { + _onceInitial.Do(func() { + _enablePhoneVerify = cfg.If("Sms") + _disallowUserRegister = cfg.If("Web:DisallowUserRegister") + }) } diff --git a/internal/servants/web/xerror.go b/internal/servants/web/xerror.go deleted file mode 100644 index 4de0f4b7..00000000 --- a/internal/servants/web/xerror.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package web - -import ( - "github.com/rocboss/paopao-ce/pkg/xerror" -) - -// nolint -var ( - _errUsernameHasExisted = xerror.NewError(20001, "用户名已存在") - _errUsernameLengthLimit = xerror.NewError(20002, "用户名长度3~12") - _errUsernameCharLimit = xerror.NewError(20003, "用户名只能包含字母、数字") - _errPasswordLengthLimit = xerror.NewError(20004, "密码长度6~16") - _errUserRegisterFailed = xerror.NewError(20005, "用户注册失败") - _errUserHasBeenBanned = xerror.NewError(20006, "该账户已被封停") - _errNoPermission = xerror.NewError(20007, "无权限执行该请求") - _errUserHasBindOTP = xerror.NewError(20008, "当前用户已绑定二次验证") - _errUserOTPInvalid = xerror.NewError(20009, "二次验证码验证失败") - _errUserNoBindOTP = xerror.NewError(20010, "当前用户未绑定二次验证") - _errErrorOldPassword = xerror.NewError(20011, "当前用户密码验证失败") - _errErrorCaptchaPassword = xerror.NewError(20012, "图形验证码验证失败") - _errAccountNoPhoneBind = xerror.NewError(20013, "拒绝操作: 账户未绑定手机号") - _errTooManyLoginError = xerror.NewError(20014, "登录失败次数过多,请稍后再试") - _errGetPhoneCaptchaError = xerror.NewError(20015, "短信验证码获取失败") - _errTooManyPhoneCaptchaSend = xerror.NewError(20016, "短信验证码获取次数已达今日上限") - _errExistedUserPhone = xerror.NewError(20017, "该手机号已被绑定") - _errErrorPhoneCaptcha = xerror.NewError(20018, "手机验证码不正确") - _errMaxPhoneCaptchaUseTimes = xerror.NewError(20019, "手机验证码已达最大使用次数") - _errNicknameLengthLimit = xerror.NewError(20020, "昵称长度2~12") - _errNoExistUsername = xerror.NewError(20021, "用户不存在") - _errNoAdminPermission = xerror.NewError(20022, "无管理权限") - - _errGetPostsFailed = xerror.NewError(30001, "获取动态列表失败") - _errCreatePostFailed = xerror.NewError(30002, "动态发布失败") - _errGetPostFailed = xerror.NewError(30003, "获取动态详情失败") - _errDeletePostFailed = xerror.NewError(30004, "动态删除失败") - _errLockPostFailed = xerror.NewError(30005, "动态锁定失败") - _errGetPostTagsFailed = xerror.NewError(30006, "获取话题列表失败") - _errInvalidDownloadReq = xerror.NewError(30007, "附件下载请求不合法") - _errDownloadReqError = xerror.NewError(30008, "附件下载请求失败") - _errInsuffientDownloadMoney = xerror.NewError(30009, "附件下载失败:账户资金不足") - _errDownloadExecFail = xerror.NewError(30010, "附件下载失败:扣费失败") - _errStickPostFailed = xerror.NewError(30011, "动态置顶失败") - _errVisblePostFailed = xerror.NewError(30012, "更新可见性失败") - - _errGetCommentsFailed = xerror.NewError(40001, "获取评论列表失败") - _errCreateCommentFailed = xerror.NewError(40002, "评论发布失败") - _errGetCommentFailed = xerror.NewError(40003, "获取评论详情失败") - _errDeleteCommentFailed = xerror.NewError(40004, "评论删除失败") - _errCreateReplyFailed = xerror.NewError(40005, "评论回复失败") - _errGetReplyFailed = xerror.NewError(40006, "获取评论详情失败") - _errMaxCommentCount = xerror.NewError(40007, "评论数已达最大限制") - - _errGetMessagesFailed = xerror.NewError(50001, "获取消息列表失败") - _errReadMessageFailed = xerror.NewError(50002, "标记消息已读失败") - _errSendWhisperFailed = xerror.NewError(50003, "私信发送失败") - _errNoWhisperToSelf = xerror.NewError(50004, "不允许给自己发送私信") - _errTooManyWhisperNum = xerror.NewError(50005, "今日私信次数已达上限") - - _errGetCollectionsFailed = xerror.NewError(60001, "获取收藏列表失败") - _errGetStarsFailed = xerror.NewError(60002, "获取点赞列表失败") - - _errRechargeReqFail = xerror.NewError(70001, "充值请求失败") - _errRechargeNotifyError = xerror.NewError(70002, "充值回调失败") - _errGetRechargeFailed = xerror.NewError(70003, "充值详情获取失败") - _errUserWalletBillsFailed = xerror.NewError(70004, "用户钱包账单获取失败") - - _errNoRequestingFriendToSelf = xerror.NewError(80001, "不允许添加自己为好友") - _errNotExistFriendId = xerror.NewError(80002, "好友id不存在") - _errSendRequestingFriendFailed = xerror.NewError(80003, "申请添加朋友请求发送失败") - _errAddFriendFailed = xerror.NewError(80004, "添加好友失败") - _errRejectFriendFailed = xerror.NewError(80005, "拒绝好友失败") - _errDeleteFriendFailed = xerror.NewError(80006, "删除好友失败") - _errGetContactsFailed = xerror.NewError(80007, "获取联系人列表失败") - _errNoActionToSelf = xerror.NewError(80008, "不允许对自己操作") - - _errFileUploadFailed = xerror.NewError(10200, "文件上传失败") - _errFileInvalidExt = xerror.NewError(10201, "文件类型不合法") - _errFileInvalidSize = xerror.NewError(10202, "文件大小超限") -) diff --git a/internal/service/connect_server.go b/internal/service/connect_server.go new file mode 100644 index 00000000..b5a19b6a --- /dev/null +++ b/internal/service/connect_server.go @@ -0,0 +1,67 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package service + +import ( + "context" + "net/http" + + "github.com/bufbuild/connect-go" + hx "github.com/rocboss/paopao-ce/pkg/http" +) + +var ( + _ server = (*connectServer)(nil) +) + +// connectServer wraper for connect +type connectServer struct { + *baseServer + + isTLS bool + certFile string + keyFile string + handlerOpts []connect.HandlerOption + server *http.Server + mux connectMux +} + +type connectMux interface { + http.Handler + Handle(string, http.Handler) +} + +func (s *connectServer) start() error { + s.server.Handler = s.mux + if s.isTLS { + return s.server.ListenAndServeTLS(s.certFile, s.keyFile) + } else { + return s.server.ListenAndServe() + } +} + +func (s *connectServer) stop() error { + return s.server.Shutdown(context.Background()) +} + +func (s *connectServer) register(path string, handler http.Handler) { + s.mux.Handle(path, handler) +} + +func defaultConnectServer(addr string) (s *connectServer) { + s = &connectServer{ + baseServer: newBaseServe(), + server: &http.Server{ + Addr: addr, + }, + mux: &http.ServeMux{}, + } + // TODO: custom value from config + var useConnectMux bool + if useConnectMux { + s.mux = hx.NewConnectMux() + } + return +} diff --git a/internal/service/connect_service.go b/internal/service/connect_service.go new file mode 100644 index 00000000..82059f58 --- /dev/null +++ b/internal/service/connect_service.go @@ -0,0 +1,32 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package service + +import ( + "net/http" + + "github.com/bufbuild/connect-go" +) + +type baseConnectService struct { + baseService + + server *connectServer +} + +func (s *baseConnectService) registerServer(srv Service, h func(func(string, http.Handler), ...connect.HandlerOption), opts ...connect.HandlerOption) { + h(s.server.register, append(opts, s.server.handlerOpts...)...) + s.server.addService(srv) +} + +func (s *baseConnectService) OnStart() error { + // do nothing default + return nil +} + +func (s *baseConnectService) OnStop() error { + // do nothing default + return nil +} diff --git a/internal/service/pprof.go b/internal/service/pprof.go new file mode 100644 index 00000000..80f8c07e --- /dev/null +++ b/internal/service/pprof.go @@ -0,0 +1,61 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package service + +import ( + "fmt" + "net/http" + + "github.com/Masterminds/semver/v3" + "github.com/fatih/color" + "github.com/gin-gonic/gin" + "github.com/rocboss/paopao-ce/internal/conf" +) + +var ( + _ Service = (*pprofService)(nil) +) + +type pprofService struct { + *baseHttpService +} + +func (s *pprofService) Name() string { + return "PprofService" +} + +func (s *pprofService) Version() *semver.Version { + return semver.MustParse("v0.1.0") +} + +func (s *pprofService) OnInit() error { + s.registerRoute(s, func(*gin.Engine) {}) + return nil +} + +func (s *pprofService) String() string { + return fmt.Sprintf("listen on %s\n", color.GreenString("http://%s:%s", conf.PprofServerSetting.HttpIp, conf.PprofServerSetting.HttpPort)) +} + +func newPprofService() Service { + addr := conf.PprofServerSetting.HttpIp + ":" + conf.PprofServerSetting.HttpPort + // notice this step just to register pprof server to start. don't share server with pprof. + server := httpServers.from(addr, func() *httpServer { + engine := newWebEngine() + return &httpServer{ + baseServer: newBaseServe(), + e: engine, + server: &http.Server{ + Addr: addr, + Handler: http.DefaultServeMux, + }, + } + }) + return &pprofService{ + baseHttpService: &baseHttpService{ + server: server, + }, + } +} diff --git a/internal/service/server.go b/internal/service/server.go index 5ebbca04..8d25f6dd 100644 --- a/internal/service/server.go +++ b/internal/service/server.go @@ -6,17 +6,18 @@ package service import ( "fmt" - "sync" "github.com/fatih/color" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/pkg/util" + util "github.com/rocboss/paopao-ce/pkg/utils" + "github.com/sourcegraph/conc" ) var ( - httpServers = newServerPool[*httpServer]() - grpcServers = newServerPool[*grpcServer]() + httpServers = newServerPool[*httpServer]() + grpcServers = newServerPool[*grpcServer]() + connectServers = newServerPool[*connectServer]() ) const ( @@ -50,21 +51,19 @@ func (p *serverPool[T]) from(addr string, newServer func() T) T { return s } -func (p *serverPool[T]) startServer(wg *sync.WaitGroup, maxSidSize int) { +func (p *serverPool[T]) startServer(wg *conc.WaitGroup, maxSidSize int) { for _, srv := range p.servers { - wg.Add(1) - go func(t T) { - ss := t.services() - if len(ss) < 1 { - return - } + ss := srv.services() + if len(ss) == 0 { + continue + } + startSrv := srv.start + wg.Go(func() { for _, s := range ss { colorPrint(actOnStart, s.OnStart(), maxSidSize, s) } - colorPrint(actStart, t.start(), maxSidSize, ss...) - // remember to done sync.WaitGroup - wg.Done() - }(srv) + colorPrint(actStart, startSrv(), maxSidSize, ss...) + }) } } @@ -118,6 +117,7 @@ func checkServices() (int, int) { var ss []Service ss = append(ss, httpServers.allServices()...) ss = append(ss, grpcServers.allServices()...) + ss = append(ss, connectServers.allServices()...) return len(ss), maxSidSize(ss) } @@ -164,7 +164,7 @@ func colorPrint(act byte, err error, l int, ss ...Service) { } // Start start all servers -func Start(wg *sync.WaitGroup) { +func Start(wg *conc.WaitGroup) { srvSize, maxSidSize := checkServices() if srvSize < 1 { return @@ -176,6 +176,7 @@ func Start(wg *sync.WaitGroup) { // start servers httpServers.startServer(wg, maxSidSize) grpcServers.startServer(wg, maxSidSize) + connectServers.startServer(wg, maxSidSize) } // Stop stop all servers @@ -187,4 +188,5 @@ func Stop() { // stop servers httpServers.stopServer(maxSidSize) grpcServers.stopServer(maxSidSize) + connectServers.stopServer(maxSidSize) } diff --git a/internal/service/service.go b/internal/service/service.go index 7af409f3..ad248695 100644 --- a/internal/service/service.go +++ b/internal/service/service.go @@ -72,8 +72,8 @@ func newService() (ss []Service) { "Docs": func() { ss = append(ss, newDocsService()) }, - "Deprecated:OldWeb": func() { - ss = append(ss, newOldWebService()) + "Pprof": func() { + ss = append(ss, newPprofService()) }, }) return diff --git a/internal/service/triplet.go b/internal/service/triplet.go new file mode 100644 index 00000000..596892f2 --- /dev/null +++ b/internal/service/triplet.go @@ -0,0 +1,51 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package service + +import ( + "fmt" + + "github.com/Masterminds/semver/v3" + "github.com/fatih/color" + "github.com/rocboss/paopao-ce/internal/servants" +) + +var ( + _ Service = (*tripletService)(nil) +) + +// tripletService just a demo service for Connect +type tripletService struct { + *baseConnectService +} + +func (s *tripletService) Name() string { + return "TripletService" +} + +func (s *tripletService) Version() *semver.Version { + return semver.MustParse("v0.1.0") +} + +func (s *tripletService) OnInit() error { + s.registerServer(s, servants.RegisterTripletServants) + return nil +} + +func (s *tripletService) String() string { + return fmt.Sprintf("listen on %s\n", color.GreenString("http://localhost:8080")) +} + +func newTripletService() Service { + server := connectServers.from(":8080", func() *connectServer { + // TODO: do something for conenct server initialize + return defaultConnectServer(":8080") + }) + return &tripletService{ + baseConnectService: &baseConnectService{ + server: server, + }, + } +} diff --git a/internal/service/web.go b/internal/service/web.go index 925c03c2..c158f732 100644 --- a/internal/service/web.go +++ b/internal/service/web.go @@ -10,6 +10,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/fatih/color" + sentrygin "github.com/getsentry/sentry-go/gin" "github.com/gin-contrib/cors" "github.com/gin-gonic/gin" "github.com/rocboss/paopao-ce/internal/conf" @@ -52,6 +53,12 @@ func newWebEngine() *gin.Engine { corsConfig.AllowAllOrigins = true corsConfig.AddAllowHeaders("Authorization") e.Use(cors.New(corsConfig)) + // 使用Sentry hook + if conf.UseSentryGin() { + e.Use(sentrygin.New(sentrygin.Options{ + Repanic: true, + })) + } // 默认404 e.NoRoute(func(c *gin.Context) { diff --git a/internal/service/web_old.go b/internal/service/web_old.go deleted file mode 100644 index 9b3fbe9a..00000000 --- a/internal/service/web_old.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package service - -import ( - "fmt" - "net/http" - - "github.com/Masterminds/semver/v3" - "github.com/fatih/color" - "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/internal/servants/web/routers" -) - -var ( - _ Service = (*oldWebService)(nil) -) - -type oldWebService struct { - *baseHttpService -} - -func (s *oldWebService) Name() string { - return "OldWebService" -} - -func (s *oldWebService) Version() *semver.Version { - return semver.MustParse("v0.1.0") -} - -func (s *oldWebService) OnInit() error { - s.registerRoute(s, routers.RegisterRoute) - return nil -} - -func (s *oldWebService) String() string { - return fmt.Sprintf("listen on %s\n", color.GreenString("http://%s:%s", conf.ServerSetting.HttpIp, conf.ServerSetting.HttpPort)) -} - -func newOldWebService() Service { - addr := conf.ServerSetting.HttpIp + ":" + conf.ServerSetting.HttpPort - server := httpServers.from(addr, func() *httpServer { - engine := newWebEngine() - return &httpServer{ - baseServer: newBaseServe(), - e: engine, - server: &http.Server{ - Addr: addr, - Handler: engine, - ReadTimeout: conf.ServerSetting.GetReadTimeout(), - WriteTimeout: conf.ServerSetting.GetWriteTimeout(), - MaxHeaderBytes: 1 << 20, - }, - } - }) - return &oldWebService{ - baseHttpService: &baseHttpService{ - server: server, - }, - } -} diff --git a/main.go b/main.go index 48545822..c2514e19 100644 --- a/main.go +++ b/main.go @@ -10,15 +10,20 @@ import ( "os" "os/signal" "strings" - "sync" "syscall" + "time" + "github.com/alimy/cfg" "github.com/fatih/color" + "github.com/getsentry/sentry-go" "github.com/rocboss/paopao-ce/internal" "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/internal/service" "github.com/rocboss/paopao-ce/pkg/debug" - "github.com/rocboss/paopao-ce/pkg/util" + "github.com/rocboss/paopao-ce/pkg/utils" + "github.com/rocboss/paopao-ce/pkg/version" + "github.com/sourcegraph/conc" + _ "go.uber.org/automaxprocs" ) var ( @@ -42,8 +47,15 @@ func (s *suites) Set(value string) error { func init() { flagParse() - conf.Initialize(features, noDefaultFeatures) - internal.Initialize() + conf.Initial(features, noDefaultFeatures) + internal.Initial() +} + +func deferFn() { + if cfg.If("Sentry") { + // Flush buffered events before the program terminates. + sentry.Flush(2 * time.Second) + } } func flagParse() { @@ -53,19 +65,26 @@ func flagParse() { } func main() { - util.PrintHelloBanner(debug.VersionInfo()) + utils.PrintHelloBanner(version.VersionInfo()) ss := service.MustInitService() if len(ss) < 1 { fmt.Fprintln(color.Output, "no service need start so just exit") return } - wg := &sync.WaitGroup{} + + // do defer function + defer deferFn() + + // start pyroscope if need + debug.StartPyroscope() + // start services + wg := conc.NewWaitGroup() fmt.Fprintf(color.Output, "\nstarting run service...\n\n") service.Start(wg) + // graceful stop services - wg.Add(1) - go func() { + wg.Go(func() { quit := make(chan os.Signal, 1) // kill (no param) default send syscall.SIGTERM // kill -2 is syscall.SIGINT @@ -74,7 +93,6 @@ func main() { <-quit fmt.Fprintf(color.Output, "\nshutting down server...\n\n") service.Stop() - wg.Done() - }() + }) wg.Wait() } diff --git a/mirc/admin/v1/user.go b/mirc/admin/v1/user.go index 6f0dcb79..90dbdab9 100644 --- a/mirc/admin/v1/user.go +++ b/mirc/admin/v1/user.go @@ -1,12 +1,12 @@ package v1 import ( - . "github.com/alimy/mir/v3" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" ) func init() { - AddEntry(new(User)) + Entry[User]() } type AgentInfo struct { @@ -35,8 +35,8 @@ type LoginResp struct { } type User struct { - Chain Chain `mir:"-"` - Group Group `mir:"m/v1"` + Chain `mir:"-"` + Group `mir:"m/v1"` Login func(Post, LoginReq) LoginResp `mir:"/user/login/"` Logout func(Post) `mir:"/user/logout/"` } diff --git a/mirc/bot/v1/user.go b/mirc/bot/v1/user.go index a4839673..11c7330f 100644 --- a/mirc/bot/v1/user.go +++ b/mirc/bot/v1/user.go @@ -1,12 +1,12 @@ package v1 import ( - . "github.com/alimy/mir/v3" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" ) func init() { - AddEntry(new(User)) + Entry[User]() } type AgentInfo struct { @@ -35,8 +35,8 @@ type LoginResp struct { } type User struct { - Chain Chain `mir:"-"` - Group Group `mir:"r/v1"` + Chain `mir:"-"` + Group `mir:"r/v1"` Login func(Post, LoginReq) LoginResp `mir:"/user/login/"` Logout func(Post) `mir:"/user/logout/"` } diff --git a/mirc/main.go b/mirc/gen.go similarity index 66% rename from mirc/main.go rename to mirc/gen.go index 1ec56e76..dcd402ac 100644 --- a/mirc/main.go +++ b/mirc/gen.go @@ -2,13 +2,17 @@ // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. +//go:build generate +// +build generate + package main import ( "log" - . "github.com/alimy/mir/v3/core" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4/core" + . "github.com/alimy/mir/v4/engine" + "github.com/gin-gonic/gin" _ "github.com/rocboss/paopao-ce/mirc/admin/v1" _ "github.com/rocboss/paopao-ce/mirc/bot/v1" @@ -17,17 +21,18 @@ import ( _ "github.com/rocboss/paopao-ce/mirc/web/v1" ) -//go:generate go run main.go +//go:generate go run $GOFILE func main() { - log.Println("generate code start") + log.Println("[Mir] generate code start") opts := Options{ - RunMode(InSerialMode), - GeneratorName(GeneratorGin), - WatchCtxDone(true), + UseGin(), SinkPath("../auto"), + WatchCtxDone(true), + RunMode(InSerialMode), + AssertType[*gin.Context](), } if err := Generate(opts); err != nil { log.Fatal(err) } - log.Println("generate code finish") + log.Println("[Mir] generate code finish") } diff --git a/mirc/localoss/v1/user.go b/mirc/localoss/v1/user.go index 555ff6d7..af558fd6 100644 --- a/mirc/localoss/v1/user.go +++ b/mirc/localoss/v1/user.go @@ -1,12 +1,12 @@ package v1 import ( - . "github.com/alimy/mir/v3" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" ) func init() { - AddEntry(new(User)) + Entry[User]() } type AgentInfo struct { @@ -35,7 +35,7 @@ type LoginResp struct { } type User struct { - Group Group `mir:"s/v1"` + Group `mir:"s/v1"` Index func(Get) `mir:"/index/"` Login func(Post, LoginReq) LoginResp `mir:"/user/login/"` Logout func(Post) `mir:"/user/logout/"` diff --git a/mirc/space/v1/user.go b/mirc/space/v1/user.go index 8dd49fa5..64fd8c7f 100644 --- a/mirc/space/v1/user.go +++ b/mirc/space/v1/user.go @@ -1,12 +1,12 @@ package v1 import ( - . "github.com/alimy/mir/v3" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" ) func init() { - AddEntry(new(User)) + Entry[User]() } type AgentInfo struct { @@ -35,8 +35,8 @@ type LoginResp struct { } type User struct { - Chain Chain `mir:"-"` - Group Group `mir:"x/v1"` + Chain `mir:"-"` + Group `mir:"x/v1"` Login func(Post, LoginReq) LoginResp `mir:"/user/login/"` Logout func(Post) `mir:"/user/logout/"` } diff --git a/mirc/web/v1/admin.go b/mirc/web/v1/admin.go index 4a1d8655..49c07ce4 100644 --- a/mirc/web/v1/admin.go +++ b/mirc/web/v1/admin.go @@ -1,19 +1,19 @@ package v1 import ( - . "github.com/alimy/mir/v3" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" "github.com/rocboss/paopao-ce/internal/model/web" ) func init() { - AddEntry(new(Admin)) + Entry[Admin]() } // Admin 运维相关服务 type Admin struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Chain `mir:"-"` + Group `mir:"v1"` // ChangeUserStatus 管理·禁言/解封用户 ChangeUserStatus func(Post, web.ChangeUserStatusReq) `mir:"/admin/user/status"` diff --git a/mirc/web/v1/alipay.go b/mirc/web/v1/alipay.go index 86ab6936..0234639b 100644 --- a/mirc/web/v1/alipay.go +++ b/mirc/web/v1/alipay.go @@ -1,18 +1,18 @@ package v1 import ( - . "github.com/alimy/mir/v3" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" "github.com/rocboss/paopao-ce/internal/model/web" ) func init() { - AddEntries(new(AlipayPub), new(AlipayPriv)) + AddEntry(new(AlipayPub), new(AlipayPriv)) } // AlipayPub 支付宝相关不用授权的服务 type AlipayPub struct { - Group Group `mir:"v1"` + Group `mir:"v1"` // AlipayNotify 支付宝回调 AlipayNotify func(Post, web.AlipayNotifyReq) `mir:"/alipay/notify"` diff --git a/mirc/web/v1/core.go b/mirc/web/v1/core.go index af835074..f12c7018 100644 --- a/mirc/web/v1/core.go +++ b/mirc/web/v1/core.go @@ -1,19 +1,19 @@ package v1 import ( - . "github.com/alimy/mir/v3" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" "github.com/rocboss/paopao-ce/internal/model/web" ) func init() { - AddEntry(new(Core)) + Entry[Core]() } // Core 核心服务,需要授权访问 type Core struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Chain `mir:"-"` + Group `mir:"v1"` // SyncSearchIndex 同步索引 SyncSearchIndex func(Get, web.SyncSearchIndexReq) `mir:"/sync/index"` diff --git a/mirc/web/v1/followship.go b/mirc/web/v1/followship.go index 99c0dba6..c44c7709 100644 --- a/mirc/web/v1/followship.go +++ b/mirc/web/v1/followship.go @@ -1,19 +1,19 @@ package v1 import ( - . "github.com/alimy/mir/v3" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" "github.com/rocboss/paopao-ce/internal/model/web" ) func init() { - AddEntry(new(Followship)) + Entry[Followship]() } // Followship 关注者模式 服务 type Followship struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Chain `mir:"-"` + Group `mir:"v1"` // AddFollowing 添加关注 AddFollowing func(Post, web.AddFollowingReq) `mir:"/following/add"` diff --git a/mirc/web/v1/friendship.go b/mirc/web/v1/friendship.go index 1013a894..b04f9622 100644 --- a/mirc/web/v1/friendship.go +++ b/mirc/web/v1/friendship.go @@ -1,19 +1,19 @@ package v1 import ( - . "github.com/alimy/mir/v3" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" "github.com/rocboss/paopao-ce/internal/model/web" ) func init() { - AddEntry(new(Friendship)) + Entry[Friendship]() } // Friendship 好友模式 服务 type Friendship struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Chain `mir:"-"` + Group `mir:"v1"` // RequestingFriend 请求添加朋友 RequestingFriend func(Post, web.RequestingFriendReq) `mir:"/friend/requesting"` diff --git a/mirc/web/v1/loose.go b/mirc/web/v1/loose.go index 887e3c9b..a7fe6d7e 100644 --- a/mirc/web/v1/loose.go +++ b/mirc/web/v1/loose.go @@ -1,19 +1,19 @@ package v1 import ( - . "github.com/alimy/mir/v3" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" "github.com/rocboss/paopao-ce/internal/model/web" ) func init() { - AddEntry(new(Loose)) + Entry[Loose]() } // Loose 宽松授权的服务 type Loose struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Chain `mir:"-"` + Group `mir:"v1"` // Timeline 获取广场流 Timeline func(Get, web.TimelineReq) web.TimelineResp `mir:"/posts"` @@ -23,4 +23,10 @@ type Loose struct { // GetUserProfile 获取用户基本信息 GetUserProfile func(Get, web.GetUserProfileReq) web.GetUserProfileResp `mir:"/user/profile"` + + // TopicList 获取话题列表 + TopicList func(Get, web.TopicListReq) web.TopicListResp `mir:"/tags"` + + // TweetComments 获取动态评论 + TweetComments func(Get, web.TweetCommentsReq) web.TweetCommentsResp `mir:"/post/comments"` } diff --git a/mirc/web/v1/priv.go b/mirc/web/v1/priv.go index 9c8d2af3..567de00d 100644 --- a/mirc/web/v1/priv.go +++ b/mirc/web/v1/priv.go @@ -1,19 +1,19 @@ package v1 import ( - . "github.com/alimy/mir/v3" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" "github.com/rocboss/paopao-ce/internal/model/web" ) func init() { - AddEntry(new(Priv)) + Entry[Priv]() } // Priv 私有授权的服务 type Priv struct { - Chain Chain `mir:"-"` - Group Group `mir:"v1"` + Chain `mir:"-"` + Group `mir:"v1"` // UploadAttachment 上传资源 UploadAttachment func(Post, web.UploadAttachmentReq) web.UploadAttachmentResp `mir:"/attachment"` @@ -31,7 +31,7 @@ type Priv struct { DeleteTweet func(Delete, web.DeleteTweetReq) `mir:"/post"` // StarTweet 动态点赞操作 - StarTweet func(Post, web.StarTweetReq) web.StarTweetResp `mir:"/post/start"` + StarTweet func(Post, web.StarTweetReq) web.StarTweetResp `mir:"/post/star"` // CollectionTweet 动态收藏操作 CollectionTweet func(Post, web.CollectionTweetReq) web.CollectionTweetResp `mir:"/post/collection"` @@ -42,6 +42,9 @@ type Priv struct { // StickTweet 置顶动态 StickTweet func(Post, web.StickTweetReq) web.StickTweetResp `mir:"/post/stick"` + // HighlightTweet 推文亮点设置 + HighlightTweet func(Post, web.HighlightTweetReq) web.HighlightTweetResp `mir:"/post/highlight"` + // VisibleTweet 修改动态可见度 VisibleTweet func(Post, web.VisibleTweetReq) web.VisibleTweetResp `mir:"/post/visibility"` @@ -56,4 +59,25 @@ type Priv struct { // DeleteCommentReply 删除评论回复 DeleteCommentReply func(Delete, web.DeleteCommentReplyReq) `mir:"/post/comment/reply"` + + // ThumbsUpTweetComment 点赞评论 + ThumbsUpTweetComment func(Post, web.TweetCommentThumbsReq) `mir:"/tweet/comment/thumbsup"` + + // ThumbsDownTweetComment 点踩评论 + ThumbsDownTweetComment func(Post, web.TweetCommentThumbsReq) `mir:"/tweet/comment/thumbsdown"` + + // ThumbsUpTweetReply 点赞评论回复 + ThumbsUpTweetReply func(Post, web.TweetReplyThumbsReq) `mir:"/tweet/reply/thumbsup"` + + // ThumbsDownTweetReply 点踩评论回复 + ThumbsDownTweetReply func(Post, web.TweetReplyThumbsReq) `mir:"/tweet/reply/thumbsdown"` + + // StickTopic 置顶动态 + StickTopic func(Post, web.StickTopicReq) web.StickTopicResp `mir:"/topic/stick"` + + // FollowTopic 关注话题 + FollowTopic func(Post, web.FollowTopicReq) `mir:"/topic/follow"` + + // UnfollowTopic 取消关注话题 + UnfollowTopic func(Post, web.UnfollowTopicReq) `mir:"/topic/unfollow"` } diff --git a/mirc/web/v1/pub.go b/mirc/web/v1/pub.go index 2364f223..89a90162 100644 --- a/mirc/web/v1/pub.go +++ b/mirc/web/v1/pub.go @@ -1,18 +1,18 @@ package v1 import ( - . "github.com/alimy/mir/v3" - . "github.com/alimy/mir/v3/engine" + . "github.com/alimy/mir/v4" + . "github.com/alimy/mir/v4/engine" "github.com/rocboss/paopao-ce/internal/model/web" ) func init() { - AddEntry(new(Pub)) + Entry[Pub]() } // Pub 不用授权的公开服务 type Pub struct { - Group Group `mir:"v1"` + Group `mir:"v1"` // Version 获取后台版本信息 Version func(Get) web.VersionResp `mir:"/"` @@ -31,10 +31,4 @@ type Pub struct { // TweetDetail 获取动态详情 TweetDetail func(Get, web.TweetDetailReq) web.TweetDetailResp `mir:"/post"` - - // TweetComments 获取动态评论 - TweetComments func(Get, web.TweetCommentsReq) web.TweetCommentsResp `mir:"/post/comments"` - - // TopicList 获取话题列表 - TopicList func(Get, web.TopicListReq) web.TopicListResp `mir:"/tags"` } diff --git a/pkg/app/app.go b/pkg/app/app.go index a98a49a2..2d5c11c5 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -9,7 +9,7 @@ import ( "os" "github.com/gin-gonic/gin" - "github.com/rocboss/paopao-ce/pkg/errcode" + "github.com/rocboss/paopao-ce/pkg/xerror" ) type Response struct { @@ -56,12 +56,12 @@ func (r *Response) ToResponseList(list any, totalRows int64) { }) } -func (r *Response) ToErrorResponse(err *errcode.Error) { - response := gin.H{"code": err.Code(), "msg": err.Msg()} +func (r *Response) ToErrorResponse(err *xerror.Error) { + response := gin.H{"code": err.StatusCode(), "msg": err.Msg()} details := err.Details() if len(details) > 0 { response["details"] = details } - r.Ctx.JSON(err.StatusCode(), response) + r.Ctx.JSON(xerror.HttpStatusCode(err), response) } diff --git a/pkg/app/jwt.go b/pkg/app/jwt.go index b9759e07..a861faa2 100644 --- a/pkg/app/jwt.go +++ b/pkg/app/jwt.go @@ -9,7 +9,7 @@ import ( "github.com/golang-jwt/jwt/v4" "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/ms" ) type Claims struct { @@ -22,7 +22,7 @@ func GetJWTSecret() []byte { return []byte(conf.JWTSetting.Secret) } -func GenerateToken(User *core.User) (string, error) { +func GenerateToken(User *ms.User) (string, error) { expireTime := time.Now().Add(conf.JWTSetting.Expire) claims := Claims{ UID: User.ID, diff --git a/pkg/convert/convert_suite_test.go b/pkg/convert/convert_suite_test.go new file mode 100644 index 00000000..572256fb --- /dev/null +++ b/pkg/convert/convert_suite_test.go @@ -0,0 +1,17 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package convert_test + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestConvert(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Convert Suite") +} diff --git a/pkg/convert/convert_test.go b/pkg/convert/convert_test.go index a31d13e6..c8fb2e69 100644 --- a/pkg/convert/convert_test.go +++ b/pkg/convert/convert_test.go @@ -1,121 +1,78 @@ -// Copyright 2022 ROC. All rights reserved. +// Copyright 2023 ROC. All rights reserved. // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. -package convert +package convert_test import ( - "testing" -) + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" -func TestStrTo_String(t *testing.T) { - type fields struct { - Str string - } - tests := []struct { - name string - fields fields - want string - }{ - { - name: "test", - fields: fields{Str: "test"}, - want: "test", - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - s := StrTo(tt.fields.Str) - if got := s.String(); got != tt.want { - t.Errorf("StrTo.String() = %v, want %v", got, tt.want) - } - }) - } -} + "github.com/rocboss/paopao-ce/pkg/convert" +) -func TestStrTo_Int(t *testing.T) { - var s StrTo = "123" - i, err := s.Int() - if err != nil { - t.Errorf("s.Int() error: %v", err) - } - if i != 123 { - t.Errorf("s.Int() should be 123") - } -} +var _ = Describe("Convert", func() { + It("str to string", func() { + for _, t := range []struct { + str string + want string + }{ + { + str: "test", + want: "test", + }, + } { + Expect(convert.StrTo(t.str).String()).To(Equal(t.want)) + } + }) -func TestStrTo_MustInt(t *testing.T) { - var s StrTo = "123" - i := s.MustInt() - if i != 123 { - t.Errorf("s.MustInt() should be 123") - } -} + It("str to int", func() { + var s convert.StrTo = "123" + i, err := s.Int() + Expect(err).To(BeNil()) + Expect(i).To(Equal(123)) + }) -func TestStrTo_UInt32(t *testing.T) { - var s StrTo = "123" - i, err := s.UInt32() - if err != nil { - t.Errorf("s.UInt32() error: %v", err) - } - if i != 123 { - t.Errorf("s.UInt32() should be 123") - } -} + It("str must int", func() { + var s convert.StrTo = "123" + Expect(s.MustInt()).To(Equal(int(123))) + }) -func TestStrTo_UInt32_2(t *testing.T) { - var s StrTo = "-123" - i, err := s.UInt32() - if err != nil { - t.Errorf("s.UInt32() error: %v", err) - } - if i == 123 { - t.Errorf("s.UInt32() should not be 123") - } -} + It("str to uint32", func() { + s := convert.StrTo("123") + i, err := s.UInt32() + Expect(err).To(BeNil()) + Expect(i).To(Equal(uint32(123))) + }) -func TestStrTo_MustUInt32(t *testing.T) { - var s StrTo = "123" - i := s.MustUInt32() - if i != 123 { - t.Errorf("s.MustUInt32() should be 123") - } -} + It("str to uint32 negative", func() { + s := convert.StrTo("-123") + i, err := s.UInt32() + Expect(err).To(BeNil()) + Expect(i).NotTo(Equal(uint32(123))) + }) -func TestStrTo_Int64(t *testing.T) { - var s StrTo = "123" - i, err := s.Int64() - if err != nil { - t.Errorf("s.Int64() error: %v", err) - } - if i != 123 { - t.Errorf("s.Int64() should be 123") - } -} + It("str to int64", func() { + var s convert.StrTo = "123" + i, err := s.Int64() + Expect(err).To(BeNil()) + Expect(i).To(Equal(int64(123))) + }) -func TestStrTo_MustInt64(t *testing.T) { - var s StrTo = "123" - i := s.MustInt64() - if i != 123 { - t.Errorf("s.MustInt64() should be 123") - } -} + It("str must int64", func() { + var s convert.StrTo = "123" + Expect(s.MustInt64()).To(Equal(int64(123))) + }) -func TestStrTo_Float64(t *testing.T) { - var s StrTo = "123.456" - f, err := s.Float64() - if err != nil { - t.Errorf("s.Float64() error: %v", err) - } - if f != 123.456 { - t.Errorf("s.Float64() should be 123.456") - } -} + It("str to float64", func() { + var s convert.StrTo = "123.456" + f, err := s.Float64() + Expect(err).To(BeNil()) + Expect(f).To(Equal(float64(123.456))) + }) -func TestStrTo_MustFloat64(t *testing.T) { - var s StrTo = "123.456" - f := s.MustFloat64() - if f != 123.456 { - t.Errorf("s.MustFloat64() should be 123.456") - } -} + It("str must float64", func() { + var s convert.StrTo = "123.456" + Expect(s.Float64()).To(Equal(float64(123.456))) + }) +}) diff --git a/pkg/crypto/signature.go b/pkg/crypto/signature.go deleted file mode 100644 index 20a6deaa..00000000 --- a/pkg/crypto/signature.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package crypto - -import ( - "bytes" - "crypto/aes" - "crypto/cipher" - "crypto/ecdsa" - "github.com/ethereum/go-ethereum/crypto" -) - -func Sign(hash []byte, privateKey *ecdsa.PrivateKey) ([]byte, error) { - return crypto.Sign(hash, privateKey) -} - -func VerifySignature(publicKey, hash, signature []byte) bool { - return crypto.VerifySignature(publicKey, hash, signature) -} - -func PKCS7Padding(ciphertext []byte, blockSize int) []byte { - padding := blockSize - len(ciphertext)%blockSize - padtext := bytes.Repeat([]byte{byte(padding)}, padding) - return append(ciphertext, padtext...) -} - -func PKCS7UnPadding(origData []byte) []byte { - length := len(origData) - unpadding := int(origData[length-1]) - return origData[:(length - unpadding)] -} - -func AesEncrypt(origData, key []byte) ([]byte, error) { - block, err := aes.NewCipher(key) - if err != nil { - return nil, err - } - blockSize := block.BlockSize() - origData = PKCS7Padding(origData, blockSize) - blockMode := cipher.NewCBCEncrypter(block, key[:blockSize]) - crypted := make([]byte, len(origData)) - blockMode.CryptBlocks(crypted, origData) - return crypted, nil -} - -func AesDecrypt(crypted, key []byte) ([]byte, error) { - block, err := aes.NewCipher(key) - if err != nil { - return nil, err - } - blockSize := block.BlockSize() - blockMode := cipher.NewCBCDecrypter(block, key[:blockSize]) - origData := make([]byte, len(crypted)) - blockMode.CryptBlocks(origData, crypted) - origData = PKCS7UnPadding(origData) - return origData, nil -} diff --git a/pkg/debug/annotation.go b/pkg/debug/annotation.go new file mode 100644 index 00000000..227399d0 --- /dev/null +++ b/pkg/debug/annotation.go @@ -0,0 +1,17 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package debug + +import ( + "github.com/sirupsen/logrus" +) + +func TODO() { + logrus.Fatalln("in todo progress") +} + +func NotImplemented() { + logrus.Fatalln("not implemented") +} diff --git a/pkg/debug/errors.go b/pkg/debug/errors.go new file mode 100644 index 00000000..04a404ca --- /dev/null +++ b/pkg/debug/errors.go @@ -0,0 +1,13 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package debug + +import ( + "errors" +) + +var ( + ErrNotImplemented = errors.New("not implemented") +) diff --git a/pkg/debug/pprof_embed.go b/pkg/debug/pprof_embed.go new file mode 100644 index 00000000..a2511e6b --- /dev/null +++ b/pkg/debug/pprof_embed.go @@ -0,0 +1,12 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +//go:build pprof +// +build pprof + +package debug + +import ( + _ "net/http/pprof" +) diff --git a/pkg/debug/pyroscope.go b/pkg/debug/pyroscope.go new file mode 100644 index 00000000..60a8ed74 --- /dev/null +++ b/pkg/debug/pyroscope.go @@ -0,0 +1,19 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +//go:build !pyroscope +// +build !pyroscope + +package debug + +import ( + "github.com/alimy/cfg" + "github.com/sirupsen/logrus" +) + +func StartPyroscope() { + if cfg.If("Pyroscope") { + logrus.Infoln("want Pyroscope feature but not support in this compile version") + } +} diff --git a/pkg/debug/pyroscope_embed.go b/pkg/debug/pyroscope_embed.go new file mode 100644 index 00000000..80a9e149 --- /dev/null +++ b/pkg/debug/pyroscope_embed.go @@ -0,0 +1,47 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +//go:build pyroscope +// +build pyroscope + +package debug + +import ( + "os" + + "github.com/alimy/cfg" + "github.com/pyroscope-io/client/pyroscope" + "github.com/rocboss/paopao-ce/internal/conf" + "github.com/sirupsen/logrus" +) + +func StartPyroscope() { + if !cfg.If("Pyroscope") { + logrus.Infoln("skip Pyroscope because not add Pyroscope feature in config.yaml") + return + } + s := conf.PyroscopeSetting + c := pyroscope.Config{ + ApplicationName: s.AppName, + ServerAddress: s.Endpoint, + AuthToken: os.Getenv("PYROSCOPE_AUTH_TOKEN"), + Logger: s.GetLogger(), + ProfileTypes: []pyroscope.ProfileType{ + pyroscope.ProfileCPU, + pyroscope.ProfileGoroutines, + pyroscope.ProfileAllocObjects, + pyroscope.ProfileAllocSpace, + pyroscope.ProfileInuseObjects, + pyroscope.ProfileInuseSpace, + pyroscope.ProfileBlockCount, + pyroscope.ProfileBlockDuration, + pyroscope.ProfileMutexCount, + pyroscope.ProfileMutexDuration, + }, + } + if len(c.AuthToken) == 0 { + c.AuthToken = s.AuthToken + } + pyroscope.Start(c) +} diff --git a/pkg/errcode/common_code.go b/pkg/errcode/common_code.go deleted file mode 100644 index 1f15f8c5..00000000 --- a/pkg/errcode/common_code.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package errcode - -var ( - Success = NewError(0, "成功") - ServerError = NewError(10000, "服务内部错误") - InvalidParams = NewError(10001, "入参错误") - NotFound = NewError(10002, "找不到") - UnauthorizedAuthNotExist = NewError(10003, "账户不存在") - UnauthorizedAuthFailed = NewError(10004, "账户密码错误") - UnauthorizedTokenError = NewError(10005, "鉴权失败,Token 错误或丢失") - UnauthorizedTokenTimeout = NewError(10006, "鉴权失败,Token 超时") - UnauthorizedTokenGenerate = NewError(10007, "鉴权失败,Token 生成失败") - TooManyRequests = NewError(10008, "请求过多") - - GatewayMethodsLimit = NewError(10109, "网关仅接受GET或POST请求") - GatewayLostSign = NewError(10110, "网关请求缺少签名") - GatewayLostAppKey = NewError(10111, "网关请求缺少APP KEY") - GatewayAppKeyInvalid = NewError(10112, "网关请求无效APP KEY") - GatewayAppKeyClosed = NewError(10113, "网关请求APP KEY已停用") - GatewayParamSignError = NewError(10114, "网关请求参数签名错误") - GatewayTooManyRequests = NewError(10115, "网关请求频次超限") - - FileUploadFailed = NewError(10200, "文件上传失败") - FileInvalidExt = NewError(10201, "文件类型不合法") - FileInvalidSize = NewError(10202, "文件大小超限") -) diff --git a/pkg/errcode/errcode.go b/pkg/errcode/errcode.go deleted file mode 100644 index 5143aabb..00000000 --- a/pkg/errcode/errcode.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package errcode - -import ( - "fmt" - "net/http" -) - -type Error struct { - code int - msg string - details []string -} - -var codes = map[int]string{} - -func NewError(code int, msg string) *Error { - if _, ok := codes[code]; ok { - panic(fmt.Sprintf("错误码 %d 已经存在,请更换一个", code)) - } - codes[code] = msg - return &Error{code: code, msg: msg} -} - -func (e *Error) Error() string { - return fmt.Sprintf("错误码: %d, 错误信息: %s", e.Code(), e.Msg()) -} - -func (e *Error) Code() int { - return e.code -} - -func (e *Error) Msg() string { - return e.msg -} - -func (e *Error) Msgf(args []any) string { - return fmt.Sprintf(e.msg, args...) -} - -func (e *Error) Details() []string { - return e.details -} - -func (e *Error) WithDetails(details ...string) *Error { - newError := *e - newError.details = []string{} - newError.details = append(newError.details, details...) - - return &newError -} - -func (e *Error) StatusCode() int { - switch e.Code() { - case Success.Code(): - return http.StatusOK - case ServerError.Code(): - return http.StatusInternalServerError - case InvalidParams.Code(): - return http.StatusBadRequest - case UnauthorizedAuthNotExist.Code(): - fallthrough - case UnauthorizedAuthFailed.Code(): - fallthrough - case UnauthorizedTokenError.Code(): - fallthrough - case UnauthorizedTokenGenerate.Code(): - fallthrough - case UnauthorizedTokenTimeout.Code(): - return http.StatusUnauthorized - case TooManyRequests.Code(): - return http.StatusTooManyRequests - } - - return http.StatusInternalServerError -} diff --git a/pkg/errcode/module_code.go b/pkg/errcode/module_code.go deleted file mode 100644 index 9543624b..00000000 --- a/pkg/errcode/module_code.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package errcode - -var ( - UsernameHasExisted = NewError(20001, "用户名已存在") - UsernameLengthLimit = NewError(20002, "用户名长度3~12") - UsernameCharLimit = NewError(20003, "用户名只能包含字母、数字") - PasswordLengthLimit = NewError(20004, "密码长度6~16") - UserRegisterFailed = NewError(20005, "用户注册失败") - UserHasBeenBanned = NewError(20006, "该账户已被封停") - NoPermission = NewError(20007, "无权限执行该请求") - UserHasBindOTP = NewError(20008, "当前用户已绑定二次验证") - UserOTPInvalid = NewError(20009, "二次验证码验证失败") - UserNoBindOTP = NewError(20010, "当前用户未绑定二次验证") - ErrorOldPassword = NewError(20011, "当前用户密码验证失败") - ErrorCaptchaPassword = NewError(20012, "图形验证码验证失败") - AccountNoPhoneBind = NewError(20013, "拒绝操作: 账户未绑定手机号") - TooManyLoginError = NewError(20014, "登录失败次数过多,请稍后再试") - GetPhoneCaptchaError = NewError(20015, "短信验证码获取失败") - TooManyPhoneCaptchaSend = NewError(20016, "短信验证码获取次数已达今日上限") - ExistedUserPhone = NewError(20017, "该手机号已被绑定") - ErrorPhoneCaptcha = NewError(20018, "手机验证码不正确") - MaxPhoneCaptchaUseTimes = NewError(20019, "手机验证码已达最大使用次数") - NicknameLengthLimit = NewError(20020, "昵称长度2~12") - NoExistUsername = NewError(20021, "用户不存在") - NoAdminPermission = NewError(20022, "无管理权限") - - GetPostsFailed = NewError(30001, "获取动态列表失败") - CreatePostFailed = NewError(30002, "动态发布失败") - GetPostFailed = NewError(30003, "获取动态详情失败") - DeletePostFailed = NewError(30004, "动态删除失败") - LockPostFailed = NewError(30005, "动态锁定失败") - GetPostTagsFailed = NewError(30006, "获取话题列表失败") - InvalidDownloadReq = NewError(30007, "附件下载请求不合法") - DownloadReqError = NewError(30008, "附件下载请求失败") - InsuffientDownloadMoney = NewError(30009, "附件下载失败:账户资金不足") - DownloadExecFail = NewError(30010, "附件下载失败:扣费失败") - StickPostFailed = NewError(30011, "动态置顶失败") - VisblePostFailed = NewError(30012, "更新可见性失败") - - GetCommentsFailed = NewError(40001, "获取评论列表失败") - CreateCommentFailed = NewError(40002, "评论发布失败") - GetCommentFailed = NewError(40003, "获取评论详情失败") - DeleteCommentFailed = NewError(40004, "评论删除失败") - CreateReplyFailed = NewError(40005, "评论回复失败") - GetReplyFailed = NewError(40006, "获取评论详情失败") - MaxCommentCount = NewError(40007, "评论数已达最大限制") - - GetMessagesFailed = NewError(50001, "获取消息列表失败") - ReadMessageFailed = NewError(50002, "标记消息已读失败") - SendWhisperFailed = NewError(50003, "私信发送失败") - NoWhisperToSelf = NewError(50004, "不允许给自己发送私信") - TooManyWhisperNum = NewError(50005, "今日私信次数已达上限") - - GetCollectionsFailed = NewError(60001, "获取收藏列表失败") - GetStarsFailed = NewError(60002, "获取点赞列表失败") - - RechargeReqFail = NewError(70001, "充值请求失败") - RechargeNotifyError = NewError(70002, "充值回调失败") - GetRechargeFailed = NewError(70003, "充值详情获取失败") - - NoRequestingFriendToSelf = NewError(80001, "不允许添加自己为好友") - NotExistFriendId = NewError(80002, "好友id不存在") - SendRequestingFriendFailed = NewError(80003, "申请添加朋友请求发送失败") - AddFriendFailed = NewError(80004, "添加好友失败") - RejectFriendFailed = NewError(80005, "拒绝好友失败") - DeleteFriendFailed = NewError(80006, "删除好友失败") - GetContactsFailed = NewError(80007, "获取联系人列表失败") - NoActionToSelf = NewError(80008, "不允许对自己操作") -) diff --git a/pkg/http/http.go b/pkg/http/http.go new file mode 100644 index 00000000..efb096d7 --- /dev/null +++ b/pkg/http/http.go @@ -0,0 +1,5 @@ +// Copyright 2023 Michael Li . All rights reserved. +// Use of this source code is governed by Apache License 2.0 that +// can be found in the LICENSE file. + +package http diff --git a/pkg/http/http_suite_test.go b/pkg/http/http_suite_test.go new file mode 100644 index 00000000..ef72f36b --- /dev/null +++ b/pkg/http/http_suite_test.go @@ -0,0 +1,17 @@ +// Copyright 2023 Michael Li . All rights reserved. +// Use of this source code is governed by Apache License 2.0 that +// can be found in the LICENSE file. + +package http_test + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestHttp(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Http Suite") +} diff --git a/pkg/http/mux.go b/pkg/http/mux.go new file mode 100644 index 00000000..46a76b02 --- /dev/null +++ b/pkg/http/mux.go @@ -0,0 +1,134 @@ +// Copyright 2023 Michael Li . All rights reserved. +// Use of this source code is governed by Apache License 2.0 that +// can be found in the LICENSE file. + +package http + +import ( + "net/http" + "strings" + "sync" +) + +// ConnectMux mux used for Connect +type ConnectMux struct { + mu sync.RWMutex + m muxMap[http.Handler] +} + +type muxMap[T any] interface { + set(path string, val T) bool + get(path string) (T, bool) + match(pattern string) (T, bool) +} + +type simpleMuxMap[T any] map[string]T + +type prefixMuxMap[T any] struct { + prefix string + m map[string]T +} + +func (m simpleMuxMap[T]) set(path string, val T) bool { + if _, exist := m[path]; exist { + return false + } + m[path] = val + return true +} + +func (m simpleMuxMap[T]) get(path string) (val T, exist bool) { + val, exist = m[path] + return +} + +// match assume pattern like `/core.v1.AuthenticateService/login` +func (m simpleMuxMap[T]) match(pattern string) (val T, exist bool) { + idx := strings.IndexByte(pattern[1:], '/') + if idx < 0 { + return + } + return m.get(pattern[:idx+2]) +} + +func (m *prefixMuxMap[T]) set(path string, val T) bool { + if _, exist := m.m[path]; exist { + return false + } + m.m[path] = val + return true +} + +func (m *prefixMuxMap[T]) get(path string) (val T, exist bool) { + val, exist = m.m[path] + return +} + +// match assume pattern like `/core.v1.AuthenticateService/login` +func (m *prefixMuxMap[T]) match(pattern string) (val T, exist bool) { + path, found := strings.CutPrefix(pattern, m.prefix) + if !found { + exist = false + return + } + idx := strings.IndexByte(path[1:], '/') + if idx < 0 { + return + } + return m.get(path[:idx+2]) +} + +// ServeHTTP dispatches the request to the handler whose +// pattern most closely matches the request URL. +func (mux *ConnectMux) ServeHTTP(w http.ResponseWriter, r *http.Request) { + if r.RequestURI == "*" { + if r.ProtoAtLeast(1, 1) { + w.Header().Set("Connection", "close") + } + w.WriteHeader(http.StatusBadRequest) + return + } + h := mux.handler(r.URL.Path) + h.ServeHTTP(w, r) +} + +// Handle registers the handler for the given path. +// If a handler already exists for path, Handle panics. +func (mux *ConnectMux) Handle(path string, handler http.Handler) { + mux.mu.Lock() + defer mux.mu.Unlock() + + if path == "" { + panic("http: invalid pattern") + } + if handler == nil { + panic("http: nil handler") + } + if ok := mux.m.set(path, handler); !ok { + panic("http: multiple registrations for " + path) + } +} + +// handler is the main implementation of Handler. +// The path is known to be in canonical form, except for CONNECT methods. +func (mux *ConnectMux) handler(path string) (h http.Handler) { + mux.mu.RLock() + defer mux.mu.RUnlock() + + if h, _ = mux.m.match(path); h == nil { + h = http.NotFoundHandler() + } + return +} + +// NewConnectMux allocates and returns a new ConnectMux. +func NewConnectMux(pathPrefix ...string) *ConnectMux { + var m muxMap[http.Handler] = make(simpleMuxMap[http.Handler]) + if len(pathPrefix) > 0 { + m = &prefixMuxMap[http.Handler]{ + m: make(map[string]http.Handler), + prefix: pathPrefix[0], + } + } + return &ConnectMux{m: m} +} diff --git a/pkg/http/mux_test.go b/pkg/http/mux_test.go new file mode 100644 index 00000000..e67d5f47 --- /dev/null +++ b/pkg/http/mux_test.go @@ -0,0 +1,73 @@ +// Copyright 2023 Michael Li . All rights reserved. +// Use of this source code is governed by Apache License 2.0 that +// can be found in the LICENSE file. + +package http + +import ( + g "github.com/onsi/ginkgo/v2" + m "github.com/onsi/gomega" +) + +var _ = g.Describe("Mux", g.Ordered, func() { + var smm, pmm muxMap[int] + + g.BeforeAll(func() { + smm = make(simpleMuxMap[int]) + pmm = &prefixMuxMap[int]{ + m: make(map[string]int), + prefix: "/connect", + } + }) + + g.It("simple mux map", func() { + ok := smm.set("/core.v1.AuthenticateService/", 1) + m.Expect(ok).To(m.BeTrue()) + + ok = smm.set("/core.v1.AuthenticateService/", 2) + m.Expect(ok).To(m.BeFalse()) + + smm.set("/greet.v1.GreetService/", 2) + val, exist := smm.get("/greet.v1.GreetService/") + m.Expect(val).To(m.Equal(2)) + m.Expect(exist).To(m.BeTrue()) + + _, exist = smm.get("/greet.v1.OtherService/") + m.Expect(exist).To(m.BeFalse()) + + val, exist = smm.match("/core.v1.AuthenticateService/login") + m.Expect(val).To(m.Equal(1)) + m.Expect(exist).To(m.BeTrue()) + + val, exist = smm.match("/core.v1.AuthenticateService/logout") + m.Expect(val).To(m.Equal(1)) + m.Expect(exist).To(m.BeTrue()) + }) + + g.It("prefix mux map", func() { + ok := pmm.set("/core.v1.AuthenticateService/", 1) + m.Expect(ok).To(m.BeTrue()) + + ok = pmm.set("/core.v1.AuthenticateService/", 2) + m.Expect(ok).To(m.BeFalse()) + + pmm.set("/greet.v1.GreetService/", 2) + val, exist := pmm.get("/greet.v1.GreetService/") + m.Expect(val).To(m.Equal(2)) + m.Expect(exist).To(m.BeTrue()) + + _, exist = pmm.get("/greet.v1.OtherService/") + m.Expect(exist).To(m.BeFalse()) + + val, exist = pmm.match("/connect/core.v1.AuthenticateService/login") + m.Expect(val).To(m.Equal(1)) + m.Expect(exist).To(m.BeTrue()) + + val, exist = pmm.match("/connect/core.v1.AuthenticateService/logout") + m.Expect(val).To(m.Equal(1)) + m.Expect(exist).To(m.BeTrue()) + + _, exist = pmm.match("/core.v1.AuthenticateService/logout") + m.Expect(exist).To(m.BeFalse()) + }) +}) diff --git a/pkg/json/json.go b/pkg/json/json.go index a26d7db2..c5f3efc8 100644 --- a/pkg/json/json.go +++ b/pkg/json/json.go @@ -2,8 +2,10 @@ // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. -//go:build !jsoniter && !go_json -// +build !jsoniter,!go_json +//go:build !jsoniter && !go_json && !(sonic && avx && (linux || windows || darwin) && amd64) +// +build !jsoniter +// +build !go_json +// +build !sonic !avx !linux,!windows,!darwin !amd64 package json diff --git a/pkg/naming/naming.go b/pkg/naming/naming.go new file mode 100644 index 00000000..abf10f1c --- /dev/null +++ b/pkg/naming/naming.go @@ -0,0 +1,10 @@ +// Copyright 2020 Michael Li . All rights reserved. +// Use of this source code is governed by Apache License 2.0 that +// can be found in the LICENSE file. + +package naming + +// NamingStrategy naming strategy interface +type NamingStrategy interface { + Naming(string) string +} diff --git a/pkg/naming/naming_test.go b/pkg/naming/naming_test.go new file mode 100644 index 00000000..fb89aa97 --- /dev/null +++ b/pkg/naming/naming_test.go @@ -0,0 +1,57 @@ +// Copyright 2020 Michael Li . All rights reserved. +// Use of this source code is governed by Apache License 2.0 that +// can be found in the LICENSE file. + +package naming + +import "testing" + +func TestSnakeNamingStrategy_Naming(t *testing.T) { + ns := NewSnakeNamingStrategy() + for _, cs := range []struct { + name string + expected string + }{ + {name: "abc", expected: "abc"}, + {name: "Abc", expected: "abc"}, + {name: "HostName", expected: "host_name"}, + {name: "Host_Name", expected: "host_name"}, + {name: "RESTfulAPI", expected: "res_tful_api"}, + {name: "HTTPS_API", expected: "https_api"}, + {name: "PKG_Name", expected: "pkg_name"}, + {name: "UserID", expected: "user_id"}, + {name: "UserId", expected: "user_id"}, + {name: "IPLoc", expected: "ip_loc"}, + {name: "API", expected: "api"}, + {name: "HTTP", expected: "http"}, + {name: "IP", expected: "ip"}, + } { + result := ns.Naming(cs.name) + if result != cs.expected { + t.Errorf("give:%s expected:%s result:%s", cs.name, cs.expected, result) + } + } +} + +func TestSimpleNamingStrategy_Naming(t *testing.T) { + ns := NewSimpleNamingStrategy() + for _, cs := range []struct { + name string + expected string + }{ + {name: "abc", expected: "abc"}, + {name: "Abc", expected: "abc"}, + {name: "HostName", expected: "host_name"}, + {name: "Host_Name", expected: "host__name"}, + {name: "RESTfulAPI", expected: "r_e_s_tful_a_p_i"}, + {name: "HTTPS_API", expected: "h_t_t_p_s__a_p_i"}, + {name: "PKG_Name", expected: "p_k_g__name"}, + {name: "API", expected: "a_p_i"}, + {name: "HTTP", expected: "h_t_t_p"}, + } { + result := ns.Naming(cs.name) + if result != cs.expected { + t.Errorf("give:%s expected:%s result:%s", cs.name, cs.expected, result) + } + } +} diff --git a/pkg/naming/simple_ns.go b/pkg/naming/simple_ns.go new file mode 100644 index 00000000..2b4dd733 --- /dev/null +++ b/pkg/naming/simple_ns.go @@ -0,0 +1,37 @@ +// Copyright 2020 Michael Li . All rights reserved. +// Use of this source code is governed by Apache License 2.0 that +// can be found in the LICENSE file. + +package naming + +import ( + "strings" + "unicode" +) + +type simpleNamingStrategy struct { + // just empty +} + +func (s *simpleNamingStrategy) Naming(name string) string { + b := &strings.Builder{} + notFirst := false + b.Grow(len(name) + 3) + for _, r := range name { + if unicode.IsUpper(r) { + if notFirst { + b.WriteRune('_') + } + b.WriteRune(unicode.ToLower(r)) + } else { + b.WriteRune(r) + } + notFirst = true + } + return b.String() +} + +// NewSimpleNamingStrategy return simple naming strategy instance +func NewSimpleNamingStrategy() NamingStrategy { + return &simpleNamingStrategy{} +} diff --git a/pkg/naming/snake_ns.go b/pkg/naming/snake_ns.go new file mode 100644 index 00000000..0c870931 --- /dev/null +++ b/pkg/naming/snake_ns.go @@ -0,0 +1,76 @@ +// Copyright 2020 Michael Li . All rights reserved. +// Use of this source code is governed by Apache License 2.0 that +// can be found in the LICENSE file. + +package naming + +import ( + "bytes" + "strings" +) + +// snakeNamingStrategy snake naming strategy implement +// This implement is inspiration from https://github.com/jingzhu/gorm's naming logic. +type snakeNamingStrategy struct { + initialismsReplacer *strings.Replacer +} + +func (s *snakeNamingStrategy) Naming(name string) string { + if name == "" { + return "" + } + + var lastCase, currCase, nextCase, nextNumber bool + value := s.initialismsReplacer.Replace(name) + buf := bytes.NewBufferString("") + lower, upper := false, true + for i, v := range value[:len(value)-1] { + nextCase = value[i+1] >= 'A' && value[i+1] <= 'Z' + nextNumber = value[i+1] >= '0' && value[i+1] <= '9' + if i > 0 { + if currCase == upper { + if lastCase == upper && (nextCase == upper || nextNumber == upper) { + buf.WriteRune(v) + } else { + if value[i-1] != '_' && value[i+1] != '_' { + buf.WriteRune('_') + } + buf.WriteRune(v) + } + } else { + buf.WriteRune(v) + if i == len(value)-2 && (nextCase == upper && nextNumber == lower) { + buf.WriteRune('_') + } + } + } else { + currCase = upper + buf.WriteRune(v) + } + lastCase, currCase = currCase, nextCase + } + + buf.WriteByte(value[len(value)-1]) + res := strings.ToLower(buf.String()) + return res +} + +// NewSnakeNamingStrategy return snake naming strategy instance +func NewSnakeNamingStrategy() NamingStrategy { + // Copied from golint + initialisms := []string{ + "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", + "HTTPS", "ID", "IP", "JSON", "LHS", "QPS", "RAM", "RHS", "RPC", "SLA", + "SMTP", "SSH", "TLS", "TTL", "UID", "UI", "UUID", "URI", "URL", "UTF8", + "VM", "XML", "XSRF", "XSS"} + + var oldnews []string + for _, initialism := range initialisms { + oldnews = append(oldnews, initialism, strings.Title(strings.ToLower(initialism))) + } + replacer := strings.NewReplacer(oldnews...) + + return &snakeNamingStrategy{ + initialismsReplacer: replacer, + } +} diff --git a/pkg/sign/sign.go b/pkg/sign/sign.go deleted file mode 100644 index fc7c10e9..00000000 --- a/pkg/sign/sign.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package sign - -import ( - "crypto/ecdsa" - "crypto/sha256" - "time" - - "github.com/fbsobreira/gotron-sdk/pkg/proto/core" - "github.com/rocboss/paopao-ce/pkg/crypto" - "google.golang.org/protobuf/proto" -) - -// SignTransaction 签名交易 -func SignTransaction(transaction *core.Transaction, key *ecdsa.PrivateKey) ([]byte, error) { - transaction.GetRawData().Timestamp = time.Now().UnixNano() / 1000000 - rawData, err := proto.Marshal(transaction.GetRawData()) - if err != nil { - return nil, err - } - h256h := sha256.New() - h256h.Write(rawData) - hash := h256h.Sum(nil) - contractList := transaction.GetRawData().GetContract() - for range contractList { - signature, err := crypto.Sign(hash, key) - if err != nil { - return nil, err - } - transaction.Signature = append(transaction.Signature, signature) - } - return hash, nil -} - -func TrimLeftZeroes(s []byte) []byte { - idx := 0 - for ; idx < len(s); idx++ { - if s[idx] != 48 { - break - } - } - return s[idx:] -} diff --git a/pkg/types/json_box.go b/pkg/types/json_box.go new file mode 100644 index 00000000..7a83e950 --- /dev/null +++ b/pkg/types/json_box.go @@ -0,0 +1,82 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package types + +import ( + "database/sql" + "database/sql/driver" + stdjson "encoding/json" + "fmt" + + "github.com/cockroachdb/errors" + "github.com/rocboss/paopao-ce/pkg/json" +) + +var ( + _ stdjson.Marshaler = (*JsonBox[any])(nil) + _ stdjson.Unmarshaler = (*JsonBox[any])(nil) + _ driver.Valuer = (*JsonBox[any])(nil) + _ sql.Scanner = (*JsonBox[any])(nil) + _ Boxes[any] = (*JsonBox[any])(nil) +) + +// JsonBox Json box for process database/sql json data +type JsonBox[T any] struct { + data T +} + +func (j *JsonBox[T]) Box(t T) { + j.data = t +} + +func (j *JsonBox[T]) Unbox() T { + return j.data +} + +func (j *JsonBox[T]) MarshalJSON() ([]byte, error) { + if j == nil { + return []byte(`null`), nil + } + return json.Marshal(j.data) +} + +func (j *JsonBox[T]) UnmarshalJSON(data []byte) error { + if j == nil { + return errors.New("JsonBox.UnmarshalJSON: on nil pointer") + } + return json.Unmarshal(data, &j.data) + +} + +func (j *JsonBox[T]) Value() (driver.Value, error) { + if j == nil { + return nil, nil + } + return j.MarshalJSON() +} + +func (j *JsonBox[T]) Scan(value any) error { + if value == nil { + return nil + } + var b []byte + switch v := value.(type) { + case []byte: + b = v + case string: + b = []byte(v) + default: + return fmt.Errorf("JsonBox.Scan: expected []byte or string, got %T (%q)", value, value) + } + return j.UnmarshalJSON(b) +} + +// NewJsonBox create a new JsonBox instance +func NewJsonBox[T any](t ...T) *JsonBox[T] { + if len(t) > 0 { + return &JsonBox[T]{data: t[0]} + } + return &JsonBox[T]{} +} diff --git a/pkg/types/json_box_test.go b/pkg/types/json_box_test.go new file mode 100644 index 00000000..b45c5a4f --- /dev/null +++ b/pkg/types/json_box_test.go @@ -0,0 +1,85 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package types_test + +import ( + "encoding/json" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/rocboss/paopao-ce/pkg/types" +) + +var _ = Describe("JsonBox", Ordered, func() { + type jsonCases []struct { + j *types.JsonBox[json.RawMessage] + b []byte + } + var samples jsonCases + + BeforeAll(func() { + samples = jsonCases{ + { + j: types.NewJsonBox(json.RawMessage(`null`)), + b: []byte(`null`), + }, + { + j: types.NewJsonBox(json.RawMessage(`{}`)), + b: []byte(`{}`), + }, + { + j: types.NewJsonBox(json.RawMessage(`[]`)), + b: []byte(`[]`), + }, + { + j: types.NewJsonBox(json.RawMessage(`[{"b":true,"n":123},{"s":"foo","obj":{"f1":456,"f2":false}},[null]]`)), + b: []byte(`[{"b":true,"n":123},{"s":"foo","obj":{"f1":456,"f2":false}},[null]]`), + }, + } + }) + + It("boxes Box and Unbox", func() { + for _, t := range samples { + jv := types.NewJsonBox[json.RawMessage]() + jv.Box(json.RawMessage(t.b)) + Expect(jv.Unbox()).To(Equal(t.j.Unbox())) + } + }) + + It("json marshaler", func() { + for _, t := range samples { + mv, err := t.j.MarshalJSON() + Expect(err).To(BeNil()) + Expect(mv).To(Equal(t.b)) + } + }) + + It("json unmarshaler", func() { + for _, t := range samples { + jv := types.NewJsonBox[json.RawMessage]() + err := jv.UnmarshalJSON(t.b) + Expect(err).To(BeNil()) + Expect(t.j.Unbox()).To(Equal(jv.Unbox())) + } + }) + + It("driver valuer", func() { + for _, t := range samples { + v, err := t.j.Value() + Expect(err).To(BeNil()) + Expect(v).To(Equal(t.b)) + } + }) + + It("sql scaner", func() { + for _, t := range samples { + jv := types.NewJsonBox[json.RawMessage]() + err := jv.Scan(t.b) + Expect(err).To(BeNil()) + Expect(jv.Unbox()).To(Equal(t.j.Unbox())) + } + }) +}) diff --git a/pkg/types/types.go b/pkg/types/types.go index 830c56c6..725f18e4 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -4,8 +4,22 @@ package types +const ( + // No 二态值 否 + No int8 = 0 + + // Yes 二态值 是 + Yes int8 = 1 +) + // Empty empty alias type type Empty = struct{} // Fn empty argument func alias type type Fn = func() + +// Boxes Box/Unbox interface +type Boxes[T any] interface { + Box(t T) + Unbox() T +} diff --git a/pkg/types/types_suite_test.go b/pkg/types/types_suite_test.go new file mode 100644 index 00000000..18ffa976 --- /dev/null +++ b/pkg/types/types_suite_test.go @@ -0,0 +1,17 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package types_test + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestTypes(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Types Suite") +} diff --git a/pkg/util/ip_test.go b/pkg/util/ip_test.go deleted file mode 100644 index 0740ffd5..00000000 --- a/pkg/util/ip_test.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package util - -import "testing" - -func TestGetIPLoc(t *testing.T) { - type args struct { - ip string - } - tests := []struct { - name string - args args - want string - }{ - { - name: "test1", - args: args{ - ip: "", - }, - want: "", - }, - { - name: "test2", - args: args{ - ip: "103.197.70.244", - }, - want: "香港", - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := GetIPLoc(tt.args.ip); got != tt.want { - t.Errorf("GetIPLoc() = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/pkg/util/iploc/iploc_test.go b/pkg/util/iploc/iploc_test.go deleted file mode 100644 index a38bb106..00000000 --- a/pkg/util/iploc/iploc_test.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package iploc - -import ( - "testing" -) - -func TestFind(t *testing.T) { - for _, data := range []struct { - ip string - country string - city string - }{ - {ip: "127.0.0.1", country: "本机地址", city: " CZ88.NET"}, - {ip: "180.89.94.9", country: "北京市", city: "鹏博士宽带"}, - } { - country, city := Find(data.ip) - t.Logf("ip:%v, country:%v, city:%v", data.ip, country, city) - if country != data.country { - t.Errorf("find ip:%s expect country: %s got: %s", data.ip, data.country, country) - } - if city != data.city { - t.Errorf("find ip:%s expect city: %s got: %s", data.ip, data.city, city) - } - } -} diff --git a/pkg/util/md5_test.go b/pkg/util/md5_test.go deleted file mode 100644 index 12c14c86..00000000 --- a/pkg/util/md5_test.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2022 ROC. All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. - -package util - -import "testing" - -func TestEncodeMD5(t *testing.T) { - type args struct { - value string - } - tests := []struct { - name string - args args - want string - }{ - { - name: "test1", - args: args{ - value: "123456", - }, - want: "e10adc3949ba59abbe56e057f20f883e", - }, - { - name: "test2", - args: args{ - value: "", - }, - want: "d41d8cd98f00b204e9800998ecf8427e", // really odd, why? - }, - { - name: "test3", - args: args{ - value: "paopaocestr", - }, - want: "8a5033dda1a8919224c66e68d846a289", - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := EncodeMD5(tt.args.value); got != tt.want { - t.Errorf("EncodeMD5() = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/pkg/util/banner.go b/pkg/utils/banner.go similarity index 97% rename from pkg/util/banner.go rename to pkg/utils/banner.go index b8f16971..6862273d 100644 --- a/pkg/util/banner.go +++ b/pkg/utils/banner.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. -package util +package utils import ( "fmt" diff --git a/pkg/util/ip.go b/pkg/utils/ip.go similarity index 77% rename from pkg/util/ip.go rename to pkg/utils/ip.go index 4561d8a6..8e812995 100644 --- a/pkg/util/ip.go +++ b/pkg/utils/ip.go @@ -2,9 +2,9 @@ // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. -package util +package utils -import "github.com/rocboss/paopao-ce/pkg/util/iploc" +import "github.com/rocboss/paopao-ce/pkg/utils/iploc" func GetIPLoc(ip string) string { country, _ := iploc.Find(ip) diff --git a/pkg/utils/ip_test.go b/pkg/utils/ip_test.go new file mode 100644 index 00000000..863d20b4 --- /dev/null +++ b/pkg/utils/ip_test.go @@ -0,0 +1,39 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package utils_test + +import ( + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/rocboss/paopao-ce/pkg/utils" +) + +var _ = Describe("Ip", Ordered, func() { + type iplocs []struct { + ip string + location string + } + var samples iplocs + + BeforeAll(func() { + samples = iplocs{ + { + ip: "", + location: "", + }, + { + ip: "103.197.70.244", + location: "香港", + }, + } + }) + + It("get ip location", func() { + for _, t := range samples { + Expect(utils.GetIPLoc(t.ip)).To(Equal(t.location)) + } + }) +}) diff --git a/pkg/util/iploc/iploc.go b/pkg/utils/iploc/iploc.go similarity index 100% rename from pkg/util/iploc/iploc.go rename to pkg/utils/iploc/iploc.go diff --git a/pkg/utils/iploc/iploc_suite_test.go b/pkg/utils/iploc/iploc_suite_test.go new file mode 100644 index 00000000..b0ea3d14 --- /dev/null +++ b/pkg/utils/iploc/iploc_suite_test.go @@ -0,0 +1,17 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package iploc_test + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestIploc(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Iploc Suite") +} diff --git a/pkg/utils/iploc/iploc_test.go b/pkg/utils/iploc/iploc_test.go new file mode 100644 index 00000000..1d06ff27 --- /dev/null +++ b/pkg/utils/iploc/iploc_test.go @@ -0,0 +1,44 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package iploc_test + +import ( + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/rocboss/paopao-ce/pkg/utils/iploc" +) + +var _ = Describe("Iploc", Ordered, func() { + type iplocCases []struct { + ip string + country string + city string + } + var samples iplocCases + + BeforeAll(func() { + samples = iplocCases{ + { + ip: "127.0.0.1", + country: "本机地址", + city: " CZ88.NET", + }, + { + ip: "180.89.94.9", + country: "北京市", + city: "鹏博士宽带", + }, + } + }) + + It("find country and city by ip", func() { + for _, t := range samples { + country, city := iploc.Find(t.ip) + Expect(country).To(Equal(t.country)) + Expect(city).To(Equal(t.city)) + } + }) +}) diff --git a/pkg/util/iploc/qqwry.dat b/pkg/utils/iploc/qqwry.dat similarity index 54% rename from pkg/util/iploc/qqwry.dat rename to pkg/utils/iploc/qqwry.dat index 555db577..65459eb6 100644 Binary files a/pkg/util/iploc/qqwry.dat and b/pkg/utils/iploc/qqwry.dat differ diff --git a/pkg/util/md5.go b/pkg/utils/md5.go similarity index 95% rename from pkg/util/md5.go rename to pkg/utils/md5.go index 477cd5ff..d9b1e908 100644 --- a/pkg/util/md5.go +++ b/pkg/utils/md5.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. -package util +package utils import ( "crypto/md5" diff --git a/pkg/utils/md5_test.go b/pkg/utils/md5_test.go new file mode 100644 index 00000000..7fa71ed9 --- /dev/null +++ b/pkg/utils/md5_test.go @@ -0,0 +1,43 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package utils_test + +import ( + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + + "github.com/rocboss/paopao-ce/pkg/utils" +) + +var _ = Describe("Md5", Ordered, func() { + type md5Cases []struct { + value string + md5 string + } + var samples md5Cases + + BeforeAll(func() { + samples = md5Cases{ + { + value: "123456", + md5: "e10adc3949ba59abbe56e057f20f883e", + }, + { + value: "", + md5: "d41d8cd98f00b204e9800998ecf8427e", // really odd, why? + }, + { + value: "paopaocestr", + md5: "8a5033dda1a8919224c66e68d846a289", + }, + } + }) + + It("encode md5", func() { + for _, t := range samples { + Expect(utils.EncodeMD5(t.value)).To(Equal(t.md5)) + } + }) +}) diff --git a/pkg/util/str.go b/pkg/utils/str.go similarity index 98% rename from pkg/util/str.go rename to pkg/utils/str.go index 8b62217d..a69f02ec 100644 --- a/pkg/util/str.go +++ b/pkg/utils/str.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. -package util +package utils import ( "math/rand" diff --git a/pkg/utils/utils_suite_test.go b/pkg/utils/utils_suite_test.go new file mode 100644 index 00000000..9e442d2d --- /dev/null +++ b/pkg/utils/utils_suite_test.go @@ -0,0 +1,17 @@ +// Copyright 2022 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package utils_test + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestUtil(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Utils Suite") +} diff --git a/pkg/debug/version.go b/pkg/version/version.go similarity index 97% rename from pkg/debug/version.go rename to pkg/version/version.go index 12623f96..b3683bef 100644 --- a/pkg/debug/version.go +++ b/pkg/version/version.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. -package debug +package version import ( "fmt" diff --git a/pkg/xerror/xerror.go b/pkg/xerror/xerror.go index 0fc7878c..2f8d01f2 100644 --- a/pkg/xerror/xerror.go +++ b/pkg/xerror/xerror.go @@ -9,13 +9,13 @@ import ( "net/http" "strings" - "github.com/alimy/mir/v3" + "github.com/alimy/mir/v4" ) var ( _ mir.Error = (*Error)(nil) - codes = map[int]string{} + // codes = map[int]string{} ) type Error struct { @@ -47,10 +47,10 @@ func (v ValidErrors) Errors() []string { } func NewError(code int, msg string) *Error { - if _, ok := codes[code]; ok { - panic(fmt.Sprintf("错误码 %d 已经存在,请更换一个", code)) - } - codes[code] = msg + // if _, ok := codes[code]; ok { + // panic(fmt.Sprintf("错误码 %d 已经存在,请更换一个", code)) + // } + // codes[code] = msg return &Error{code: code, msg: msg} } diff --git a/pkg/zinc/zinc.go b/pkg/zinc/zinc.go index cc200a55..4f44bb78 100644 --- a/pkg/zinc/zinc.go +++ b/pkg/zinc/zinc.go @@ -5,13 +5,12 @@ package zinc import ( - "errors" "fmt" "net/http" "time" + "github.com/cockroachdb/errors" "github.com/go-resty/resty/v2" - "github.com/rocboss/paopao-ce/internal/conf" "github.com/rocboss/paopao-ce/pkg/json" ) @@ -75,12 +74,12 @@ type HitItem struct { } // NewClient 获取ZincClient新实例 -func NewClient(conf *conf.ZincSettingS) *ZincClient { +func NewClient(host, user, passwd string) *ZincClient { return &ZincClient{ ZincClientConfig: &ZincClientConfig{ - ZincHost: conf.Endpoint(), - ZincUser: conf.User, - ZincPassword: conf.Password, + ZincHost: host, + ZincUser: user, + ZincPassword: passwd, }, } } diff --git a/proto/buf.lock b/proto/buf.lock deleted file mode 100644 index 19abf63f..00000000 --- a/proto/buf.lock +++ /dev/null @@ -1,7 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: googleapis - repository: googleapis - commit: 75b4300737fb4efca0831636be94e517 diff --git a/proto/buf.yaml b/proto/buf.yaml index eda8f330..5482f8ba 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -1,10 +1,9 @@ version: v1 -lint: - use: - - DEFAULT breaking: use: - FILE - +lint: + use: + - DEFAULT deps: - buf.build/googleapis/googleapis diff --git a/proto/v1/auth.proto b/proto/core/v1/auth.proto similarity index 50% rename from proto/v1/auth.proto rename to proto/core/v1/auth.proto index 16c340ce..f0b2cf09 100644 --- a/proto/v1/auth.proto +++ b/proto/core/v1/auth.proto @@ -1,28 +1,28 @@ syntax = "proto3"; -package auth; +package core.v1; -option go_package = "github.com/rocboss/paopao-ce/auto/rpc/v1"; +option go_package = "github.com/rocboss/paopao-ce/auto/connect/core/v1;corev1"; message User { - string phoneNum = 1; + string phone_num = 1; } message UserVerify { - string phoneNum = 1; - string VerificationCode = 2; + string phone_num = 1; + string verification_code = 2; } message LoginReply { - int32 statuCode = 1; + int32 status_code = 1; string token = 2; } message ActionReply { - int32 statusCode = 1; + int32 status_code = 1; } -service Authenticate { +service AuthenticateService { rpc preLogin(User) returns (ActionReply); rpc login(User) returns (LoginReply); rpc logout(User) returns (ActionReply); diff --git a/proto/greet/v1/greet.proto b/proto/greet/v1/greet.proto new file mode 100644 index 00000000..0f2b688d --- /dev/null +++ b/proto/greet/v1/greet.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package greet.v1; + +option go_package = "github.com/rocboss/paopao-ce/auto/rpc/greet/v1;greetv1"; + +message GreetRequest { + string name = 1; +} + +message GreetResponse { + string greeting = 1; +} + +service GreetService { + rpc Greet(GreetRequest) returns (GreetResponse) {} +} \ No newline at end of file diff --git a/scripts/docker/Dockerfile-backend-builder b/scripts/docker/Dockerfile-backend-builder new file mode 100644 index 00000000..cd523edf --- /dev/null +++ b/scripts/docker/Dockerfile-backend-builder @@ -0,0 +1,5 @@ +FROM golang:1.20-alpine +RUN apk --no-cache --no-progress add --virtual \ + build-deps \ + build-base \ + git diff --git a/scripts/docker/Dockerfile-backend-runner b/scripts/docker/Dockerfile-backend-runner new file mode 100644 index 00000000..7e8589f8 --- /dev/null +++ b/scripts/docker/Dockerfile-backend-runner @@ -0,0 +1,3 @@ +FROM alpine:3.17 +ENV TZ=Asia/Shanghai +RUN apk update && apk add --no-cache ca-certificates && update-ca-certificates diff --git a/scripts/docker/README.md b/scripts/docker/README.md new file mode 100644 index 00000000..4e83a1df --- /dev/null +++ b/scripts/docker/README.md @@ -0,0 +1,6 @@ +### Dockerfile builer pre-build images + +```sh +docker build -t bitbus/paopao-ce-backend-builder:latest -f Dockerfile-backend-builder . +docker build -t bitbus/paopao-ce-backend-runner:latest -f Dockerfile-backend-runner . +``` \ No newline at end of file diff --git a/scripts/migration/mysql/1_initialize_schema.down.sql b/scripts/migration/mysql/0001_initialize_schema.down.sql similarity index 100% rename from scripts/migration/mysql/1_initialize_schema.down.sql rename to scripts/migration/mysql/0001_initialize_schema.down.sql diff --git a/scripts/migration/mysql/1_initialize_schema.up.sql b/scripts/migration/mysql/0001_initialize_schema.up.sql similarity index 100% rename from scripts/migration/mysql/1_initialize_schema.up.sql rename to scripts/migration/mysql/0001_initialize_schema.up.sql diff --git a/scripts/migration/mysql/2_post_visibility.down.sql b/scripts/migration/mysql/0002_post_visibility.down.sql similarity index 52% rename from scripts/migration/mysql/2_post_visibility.down.sql rename to scripts/migration/mysql/0002_post_visibility.down.sql index 5b61db49..bc0931c8 100644 --- a/scripts/migration/mysql/2_post_visibility.down.sql +++ b/scripts/migration/mysql/0002_post_visibility.down.sql @@ -1,3 +1 @@ ALTER TABLE `p_post` DROP COLUMN `visibility`; - -DROP INDEX `idx_visibility` ON `p_post`; diff --git a/scripts/migration/mysql/2_post_visibility.up.sql b/scripts/migration/mysql/0002_post_visibility.up.sql similarity index 99% rename from scripts/migration/mysql/2_post_visibility.up.sql rename to scripts/migration/mysql/0002_post_visibility.up.sql index 349d0553..8b8770e6 100644 --- a/scripts/migration/mysql/2_post_visibility.up.sql +++ b/scripts/migration/mysql/0002_post_visibility.up.sql @@ -1,3 +1,2 @@ ALTER TABLE `p_post` ADD COLUMN `visibility` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '可见性 0公开 1私密 2好友可见'; - CREATE INDEX `idx_visibility` ON `p_post` ( `visibility` ) USING BTREE; diff --git a/scripts/migration/mysql/3_feature_contact.down.sql b/scripts/migration/mysql/0003_feature_contact.down.sql similarity index 100% rename from scripts/migration/mysql/3_feature_contact.down.sql rename to scripts/migration/mysql/0003_feature_contact.down.sql diff --git a/scripts/migration/mysql/3_feature_contact.up.sql b/scripts/migration/mysql/0003_feature_contact.up.sql similarity index 100% rename from scripts/migration/mysql/3_feature_contact.up.sql rename to scripts/migration/mysql/0003_feature_contact.up.sql diff --git a/scripts/migration/mysql/0004_optimize_idx.down.sql b/scripts/migration/mysql/0004_optimize_idx.down.sql new file mode 100644 index 00000000..29a27a3d --- /dev/null +++ b/scripts/migration/mysql/0004_optimize_idx.down.sql @@ -0,0 +1,66 @@ +ALTER TABLE `p_attachment` + RENAME KEY `idx_attachment_user_id` TO `idx_user`; + +ALTER TABLE `p_captcha` + RENAME KEY `idx_captcha_phone` TO `idx_phone`, + RENAME KEY `idx_captcha_expired_on` TO `idx_expired_on`, + RENAME KEY `idx_captcha_use_times` TO `idx_use_times`; + +ALTER TABLE `p_comment` + RENAME KEY `idx_comment_post_id` TO `idx_post`, + RENAME KEY `idx_comment_user_id` TO `idx_user`; + +ALTER TABLE `p_comment_content` + RENAME KEY `idx_comment_content_comment_id` TO `idx_reply`, + RENAME KEY `idx_comment_content_user_id` TO `idx_user`, + RENAME KEY `idx_comment_content_type` TO `idx_type`, + RENAME KEY `idx_comment_content_sort` TO `idx_sort`; + +ALTER TABLE `p_comment_reply` + RENAME KEY `idx_comment_reply_comment_id` TO `idx_comment`; + +ALTER TABLE `p_message` + RENAME KEY `idx_message_receiver_user_id` TO `idx_receiver`, + RENAME KEY `idx_message_is_read` TO `idx_is_read`, + RENAME KEY `idx_message_type` TO `idx_type`; + +ALTER TABLE `p_post` + RENAME KEY `idx_post_user_id` TO `idx_user`, + RENAME KEY `idx_post_visibility` TO `idx_visibility`; + +ALTER TABLE `p_post_attachment_bill` + RENAME KEY `idx_post_attachment_bill_post_id` TO `idx_post`, + RENAME KEY `idx_post_attachment_bill_user_id` TO `idx_user`; + +ALTER TABLE `p_post_collection` + RENAME KEY `idx_post_collection_post_id` TO `idx_post`, + RENAME KEY `idx_post_collection_user_id` TO `idx_user`; + +ALTER TABLE `p_post_content` + RENAME KEY `idx_post_content_post_id` TO `idx_post`, + RENAME KEY `idx_post_content_user_id` TO `idx_user`; + +ALTER TABLE `p_post_star` + RENAME KEY `idx_post_star_post_id` TO `idx_post`, + RENAME KEY `idx_post_star_user_id` TO `idx_user`; + +ALTER TABLE `p_tag` + RENAME KEY `idx_tag_user_id` TO `idx_user`, + RENAME KEY `idx_tag_quote_num` TO `idx_num`; + +ALTER TABLE `p_user` + RENAME KEY `idx_user_username` TO `idx_username`, + RENAME KEY `idx_user_phone` TO `idx_phone`; + +ALTER TABLE `p_wallet_recharge` + RENAME KEY `idx_wallet_recharge_user_id` TO `idx_user`, + RENAME KEY `idx_wallet_recharge_trade_no` TO `idx_trade_no`, + RENAME KEY `idx_wallet_recharge_trade_status` TO `idx_trade_status`; + +ALTER TABLE `p_wallet_statement` + RENAME KEY `idx_wallet_statement_user_id` TO `idx_user`; + +ALTER TABLE `p_contact` + RENAME KEY `idx_contact_user_friend` TO `idx_user_friend_id`, + RENAME KEY `idx_contact_user_friend_status` TO `idx_user_friend_status`; + \ No newline at end of file diff --git a/scripts/migration/mysql/0004_optimize_idx.up.sql b/scripts/migration/mysql/0004_optimize_idx.up.sql new file mode 100644 index 00000000..b87a7973 --- /dev/null +++ b/scripts/migration/mysql/0004_optimize_idx.up.sql @@ -0,0 +1,65 @@ +ALTER TABLE `p_attachment` + RENAME KEY `idx_user` TO `idx_attachment_user_id`; + +ALTER TABLE `p_captcha` + RENAME KEY `idx_phone` TO `idx_captcha_phone`, + RENAME KEY `idx_expired_on` TO `idx_captcha_expired_on`, + RENAME KEY `idx_use_times` TO `idx_captcha_use_times`; + +ALTER TABLE `p_comment` + RENAME KEY `idx_post` TO `idx_comment_post_id`, + RENAME KEY `idx_user` TO `idx_comment_user_id`; + +ALTER TABLE `p_comment_content` + RENAME KEY `idx_reply` TO `idx_comment_content_comment_id`, + RENAME KEY `idx_user` TO `idx_comment_content_user_id`, + RENAME KEY `idx_type` TO `idx_comment_content_type`, + RENAME KEY `idx_sort` TO `idx_comment_content_sort`; + +ALTER TABLE `p_comment_reply` + RENAME KEY `idx_comment` TO `idx_comment_reply_comment_id`; + +ALTER TABLE `p_message` + RENAME KEY `idx_receiver` TO `idx_message_receiver_user_id`, + RENAME KEY `idx_is_read` TO `idx_message_is_read`, + RENAME KEY `idx_type` TO `idx_message_type`; + +ALTER TABLE `p_post` + RENAME KEY `idx_user` TO `idx_post_user_id`, + RENAME KEY `idx_visibility` TO `idx_post_visibility`; + +ALTER TABLE `p_post_attachment_bill` + RENAME KEY `idx_post` TO `idx_post_attachment_bill_post_id`, + RENAME KEY `idx_user` TO `idx_post_attachment_bill_user_id`; + +ALTER TABLE `p_post_collection` + RENAME KEY `idx_post` TO `idx_post_collection_post_id`, + RENAME KEY `idx_user` TO `idx_post_collection_user_id`; + +ALTER TABLE `p_post_content` + RENAME KEY `idx_post` TO `idx_post_content_post_id`, + RENAME KEY `idx_user` TO `idx_post_content_user_id`; + +ALTER TABLE `p_post_star` + RENAME KEY `idx_post` TO `idx_post_star_post_id`, + RENAME KEY `idx_user` TO `idx_post_star_user_id`; + +ALTER TABLE `p_tag` + RENAME KEY `idx_user` TO `idx_tag_user_id`, + RENAME KEY `idx_num` TO `idx_tag_quote_num`; + +ALTER TABLE `p_user` + RENAME KEY `idx_username` TO `idx_user_username`, + RENAME KEY `idx_phone` TO `idx_user_phone`; + +ALTER TABLE `p_wallet_recharge` + RENAME KEY `idx_user` TO `idx_wallet_recharge_user_id`, + RENAME KEY `idx_trade_no` TO `idx_wallet_recharge_trade_no`, + RENAME KEY `idx_trade_status` TO `idx_wallet_recharge_trade_status`; + +ALTER TABLE `p_wallet_statement` + RENAME KEY `idx_user` To `idx_wallet_statement_user_id`; + +ALTER TABLE `p_contact` + RENAME KEY `idx_user_friend_id` TO `idx_contact_user_friend`, + RENAME KEY `idx_user_friend_status` TO `idx_contact_user_friend_status`; diff --git a/scripts/migration/mysql/0005_share_count.down.sql b/scripts/migration/mysql/0005_share_count.down.sql new file mode 100644 index 00000000..4c98d48b --- /dev/null +++ b/scripts/migration/mysql/0005_share_count.down.sql @@ -0,0 +1 @@ +ALTER TABLE `p_post` DROP COLUMN `share_count`; diff --git a/scripts/migration/mysql/0005_share_count.up.sql b/scripts/migration/mysql/0005_share_count.up.sql new file mode 100644 index 00000000..b5d69caf --- /dev/null +++ b/scripts/migration/mysql/0005_share_count.up.sql @@ -0,0 +1 @@ +ALTER TABLE `p_post` ADD COLUMN `share_count` BIGINT unsigned NOT NULL DEFAULT 0; \ No newline at end of file diff --git a/scripts/migration/mysql/0006_topic_follow.down.sql b/scripts/migration/mysql/0006_topic_follow.down.sql new file mode 100644 index 00000000..d826f2fb --- /dev/null +++ b/scripts/migration/mysql/0006_topic_follow.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS `p_topic_user`; \ No newline at end of file diff --git a/scripts/migration/mysql/0006_topic_follow.up.sql b/scripts/migration/mysql/0006_topic_follow.up.sql new file mode 100644 index 00000000..1f169aa3 --- /dev/null +++ b/scripts/migration/mysql/0006_topic_follow.up.sql @@ -0,0 +1,17 @@ +CREATE TABLE `p_topic_user` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + `topic_id` BIGINT UNSIGNED NOT NULL COMMENT '标签ID', + `user_id` BIGINT UNSIGNED NOT NULL COMMENT '创建者ID', + `alias_name` VARCHAR ( 255 ) COMMENT '别名', + `remark` VARCHAR ( 512 ) COMMENT '备注', + `quote_num` BIGINT UNSIGNED COMMENT '引用数', + `is_top` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否置顶 0 为未置顶、1 为已置顶', + `created_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `reserve_a` VARCHAR ( 255 ) COMMENT '保留字段a', + `reserve_b` VARCHAR ( 255 ) COMMENT '保留字段b', + PRIMARY KEY ( `id` ) USING BTREE, + UNIQUE KEY `idx_topic_user_uid_tid` ( `topic_id`, `user_id` ) USING BTREE +) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户话题'; \ No newline at end of file diff --git a/scripts/migration/mysql/0007_comment_thumbs.down.sql b/scripts/migration/mysql/0007_comment_thumbs.down.sql new file mode 100644 index 00000000..38e4e51b --- /dev/null +++ b/scripts/migration/mysql/0007_comment_thumbs.down.sql @@ -0,0 +1,6 @@ +ALTER TABLE `p_comment` DROP COLUMN `thumbs_up_count`; +ALTER TABLE `p_comment` DROP COLUMN `thumbs_down_count`; +ALTER TABLE `p_comment_reply` DROP COLUMN `thumbs_up_count`; +ALTER TABLE `p_comment_reply` DROP COLUMN `thumbs_down_count`; + +DROP TABLE IF EXISTS `p_tweet_comment_thumbs`; diff --git a/scripts/migration/mysql/0007_comment_thumbs.up.sql b/scripts/migration/mysql/0007_comment_thumbs.up.sql new file mode 100644 index 00000000..e483142b --- /dev/null +++ b/scripts/migration/mysql/0007_comment_thumbs.up.sql @@ -0,0 +1,21 @@ +ALTER TABLE `p_comment` ADD COLUMN `thumbs_up_count` INT unsigned NOT NULL DEFAULT '0' COMMENT '点赞数'; +ALTER TABLE `p_comment` ADD COLUMN `thumbs_down_count` INT unsigned NOT NULL DEFAULT '0' COMMENT '点踩数'; +ALTER TABLE `p_comment_reply` ADD COLUMN `thumbs_up_count` INT unsigned NOT NULL DEFAULT '0' COMMENT '点赞数'; +ALTER TABLE `p_comment_reply` ADD COLUMN `thumbs_down_count` INT unsigned NOT NULL DEFAULT '0' COMMENT '点踩数'; + +CREATE TABLE `p_tweet_comment_thumbs` ( + `id` BIGINT unsigned NOT NULL AUTO_INCREMENT COMMENT 'thumbs ID', + `user_id` BIGINT unsigned NOT NULL, + `tweet_id` BIGINT unsigned NOT NULL COMMENT '推文ID', + `comment_id` BIGINT unsigned NOT NULL COMMENT '评论ID', + `reply_id` BIGINT unsigned COMMENT '评论回复ID', + `comment_type` TINYINT NOT NULL DEFAULT '0' COMMENT '评论类型 0为推文评论、1为评论回复', + `is_thumbs_up` TINYINT unsigned NOT NULL DEFAULT '0' COMMENT '是否点赞', + `is_thumbs_down` TINYINT unsigned NOT NULL DEFAULT '0' COMMENT '是否点踩', + `created_on` BIGINT unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` TINYINT unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_tweet_comment_thumbs_uid_tid` (`user_id`, `tweet_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='推文评论点赞'; diff --git a/scripts/migration/mysql/0008_content_type_alter.down.sql b/scripts/migration/mysql/0008_content_type_alter.down.sql new file mode 100644 index 00000000..97d8e80e --- /dev/null +++ b/scripts/migration/mysql/0008_content_type_alter.down.sql @@ -0,0 +1,3 @@ +ALTER TABLE `p_post_content` MODIFY COLUMN `content` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容'; +ALTER TABLE `p_comment_content` MODIFY COLUMN `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容'; +ALTER TABLE `p_comment_reply` MODIFY COLUMN `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容'; \ No newline at end of file diff --git a/scripts/migration/mysql/0008_content_type_alter.up.sql b/scripts/migration/mysql/0008_content_type_alter.up.sql new file mode 100644 index 00000000..511c47ec --- /dev/null +++ b/scripts/migration/mysql/0008_content_type_alter.up.sql @@ -0,0 +1,3 @@ +ALTER TABLE `p_post_content` MODIFY COLUMN `content` varchar(65535) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容'; +ALTER TABLE `p_comment_content` MODIFY COLUMN `content` varchar(65535) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容'; +ALTER TABLE `p_comment_reply` MODIFY COLUMN `content` varchar(65535) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容'; diff --git a/scripts/migration/postgres/0001_initialize_schema.down.sql b/scripts/migration/postgres/0001_initialize_schema.down.sql new file mode 100644 index 00000000..52326aff --- /dev/null +++ b/scripts/migration/postgres/0001_initialize_schema.down.sql @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS p_attachment; +DROP TABLE IF EXISTS p_captcha; +DROP TABLE IF EXISTS p_comment; +DROP TABLE IF EXISTS p_comment_content; +DROP TABLE IF EXISTS p_comment_reply; +DROP TABLE IF EXISTS p_message; +DROP TABLE IF EXISTS p_post; +DROP TABLE IF EXISTS p_post_attachment_bill; +DROP TABLE IF EXISTS p_post_collection; +DROP TABLE IF EXISTS p_post_content; +DROP TABLE IF EXISTS p_post_star; +DROP TABLE IF EXISTS p_tag; +DROP TABLE IF EXISTS p_user; +DROP TABLE IF EXISTS p_wallet_recharge; +DROP TABLE IF EXISTS p_wallet_statement; +DROP SEQUENCE IF EXISTS post_id_seq; diff --git a/scripts/migration/postgres/0001_initialize_schema.up.sql b/scripts/migration/postgres/0001_initialize_schema.up.sql new file mode 100644 index 00000000..cfaccf28 --- /dev/null +++ b/scripts/migration/postgres/0001_initialize_schema.up.sql @@ -0,0 +1,232 @@ +CREATE TABLE p_attachment ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL DEFAULT 0, + file_size BIGINT NOT NULL, + img_width BIGINT NOT NULL DEFAULT 0, + img_height BIGINT NOT NULL DEFAULT 0, + "type" SMALLINT NOT NULL DEFAULT 1, -- 1图片、2视频、3其他附件 + content VARCHAR(255) NOT NULL DEFAULT '', + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 -- 是否删除 0为未删除、1为已删除 +); +CREATE INDEX idx_attachment_user_id ON p_attachment USING btree (id); + +CREATE TABLE p_captcha ( + id BIGSERIAL PRIMARY KEY, + phone VARCHAR(16), + captcha VARCHAR(16), + use_times INTEGER NOT NULL DEFAULT 0, + expired_on BIGINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 -- 是否删除 0为未删除、1为已删除' +); +CREATE INDEX idx_captcha_phone ON p_captcha USING btree (phone); +CREATE INDEX idx_captcha_expired_on ON p_captcha USING btree (expired_on); +CREATE INDEX idx_captcha_use_times ON p_captcha USING btree (use_times); + +CREATE TABLE p_comment ( + id BIGSERIAL PRIMARY KEY, + post_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + ip VARCHAR(64) NOT NULL DEFAULT '', + ip_loc VARCHAR(64) NOT NULL DEFAULT '', + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_comment_post_id ON p_comment USING btree (post_id); +CREATE INDEX idx_comment_user_id ON p_comment USING btree (user_id); + +CREATE TABLE p_comment_content ( + id BIGSERIAL PRIMARY KEY, + comment_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + content VARCHAR(255) NOT NULL DEFAULT '', + "type" SMALLINT NOT NULL DEFAULT 2, -- 类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址, + sort BIGINT NOT NULL DEFAULT 100, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_comment_content_comment_id ON p_comment_content USING btree (comment_id); +CREATE INDEX idx_comment_content_user_id ON p_comment_content USING btree (user_id); +CREATE INDEX idx_comment_content_type ON p_comment_content USING btree ("type"); +CREATE INDEX idx_comment_content_sort ON p_comment_content USING btree (sort); + +CREATE TABLE p_comment_reply ( + id BIGSERIAL PRIMARY KEY, + comment_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + at_user_id BIGINT NOT NULL DEFAULT 0, + content VARCHAR(255) NOT NULL DEFAULT '', + ip VARCHAR(64) NOT NULL DEFAULT '', + ip_loc VARCHAR(64) NOT NULL DEFAULT '', + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_comment_reply_comment_id ON p_comment_reply USING btree (comment_id); + +CREATE TABLE p_message ( + id BIGSERIAL PRIMARY KEY, + sender_user_id BIGINT NOT NULL DEFAULT 0, + receiver_user_id BIGINT NOT NULL DEFAULT 0, + type SMALLINT NOT NULL DEFAULT 1, + brief VARCHAR(255) NOT NULL DEFAULT '', + content VARCHAR(255) NOT NULL DEFAULT '', + post_id BIGINT NOT NULL DEFAULT 0, + comment_id BIGINT NOT NULL DEFAULT 0, + reply_id BIGINT NOT NULL DEFAULT 0, + is_read SMALLINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_message_receiver_user_id ON p_message USING btree (receiver_user_id); +CREATE INDEX idx_message_is_read ON p_message USING btree (is_read); +CREATE INDEX idx_message_type ON p_message USING btree ("type"); + +CREATE SEQUENCE IF NOT EXISTS post_id_seq AS BIGINT MINVALUE 1080017989 NO MAXVALUE; +CREATE TABLE p_post ( + id BIGINT NOT NULL DEFAULT nextval('post_id_seq'::regclass), + user_id BIGINT NOT NULL DEFAULT 0, + comment_count BIGINT NOT NULL DEFAULT 0, + collection_count BIGINT NOT NULL DEFAULT 0, + upvote_count BIGINT NOT NULL DEFAULT 0, + is_top SMALLINT NOT NULL DEFAULT 0, -- 是否置顶 + is_essence SMALLINT NOT NULL DEFAULT 0, -- 是否精华 + is_lock SMALLINT NOT NULL DEFAULT 0, -- 是否锁定 + latest_replied_on BIGINT NOT NULL DEFAULT 0, -- 最新回复时间 + tags VARCHAR(255) NOT NULL DEFAULT '', + attachment_price BIGINT NOT NULL DEFAULT 0, -- 附件价格(分) + ip VARCHAR(64) NOT NULL DEFAULT '', -- IP地址 + ip_loc VARCHAR(64) NOT NULL DEFAULT '', -- IP城市地址 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0, + PRIMARY KEY (id) +); +CREATE INDEX idx_post_user_id ON p_post USING btree (user_id); + +CREATE TABLE p_post_attachment_bill ( + id BIGSERIAL PRIMARY KEY, + post_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + paid_amount BIGINT NOT NULL DEFAULT 0, -- 支付金额 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_post_attachment_bill_post_id ON p_post_attachment_bill USING btree (post_id); +CREATE INDEX idx_post_attachment_bill_user_id ON p_post_attachment_bill USING btree (user_id); + +CREATE TABLE p_post_collection ( + id BIGSERIAL PRIMARY KEY, + post_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_post_collection_post_id ON p_post_collection USING btree (post_id); +CREATE INDEX idx_post_collection_user_id ON p_post_collection USING btree (user_id); + +CREATE TABLE p_post_content ( + id BIGSERIAL PRIMARY KEY, + post_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + content VARCHAR(2000) NOT NULL DEFAULT '', + "type" SMALLINT NOT NULL DEFAULT 2, -- 类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源,8收费资源 + sort SMALLINT NOT NULL DEFAULT 100, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_post_content_post_id ON p_post_content USING btree (post_id); +CREATE INDEX idx_post_content_user_id ON p_post_content USING btree (user_id); + +CREATE TABLE p_post_star ( + id BIGSERIAL PRIMARY KEY, + post_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_post_star_post_id ON p_post_star USING btree (post_id); +CREATE INDEX idx_post_star_user_id ON p_post_star USING btree (user_id); + +CREATE TABLE p_tag ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL DEFAULT 0, + tag VARCHAR(255) NOT NULL, + quote_num BIGINT NOT NULL DEFAULT 0, -- 引用数 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE UNIQUE INDEX idx_tag_tag ON p_tag USING btree (tag); +CREATE INDEX idx_tag_user_id ON p_tag USING btree (user_id); +CREATE INDEX idx_tag_quote_num ON p_tag USING btree (quote_num); + +CREATE TABLE p_user ( + id BIGSERIAL PRIMARY KEY, + nickname VARCHAR(32) NOT NULL DEFAULT '', + username VARCHAR(32) NOT NULL DEFAULT '', + phone VARCHAR(16) NOT NULL DEFAULT '', -- 手机号 + password VARCHAR(32) NOT NULL DEFAULT '', -- MD5密码 + salt VARCHAR(16) NOT NULL DEFAULT '', -- 盐值 + status SMALLINT NOT NULL DEFAULT 1, -- 状态,1正常,2停用 + avatar VARCHAR(255) NOT NULL DEFAULT '', + balance BIGINT NOT NULL, -- 用户余额(分) + is_admin BOOLEAN NOT NULL DEFAULT false, -- 是否管理员 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE UNIQUE INDEX idx_user_username ON p_user USING btree (username); +CREATE INDEX idx_user_phone ON p_user USING btree (phone); + +CREATE TABLE p_wallet_recharge ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL DEFAULT 0, + amount BIGINT NOT NULL DEFAULT 0, -- 充值金额 + trade_no VARCHAR(64) NOT NULL DEFAULT '', -- 支付宝订单号 + trade_status VARCHAR(32) NOT NULL DEFAULT '', -- 交易状态 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 -- 是否删除 0 为未删除、1 为已删除 +); +CREATE INDEX idx_wallet_recharge_user_id ON p_wallet_recharge USING btree (user_id); +CREATE INDEX idx_wallet_recharge_trade_no ON p_wallet_recharge USING btree (trade_no); +CREATE INDEX idx_wallet_recharge_trade_status ON p_wallet_recharge USING btree (trade_status); + +CREATE TABLE p_wallet_statement ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL DEFAULT 0, + change_amount BIGINT NOT NULL DEFAULT 0, -- 变动金额 + balance_snapshot BIGINT NOT NULL DEFAULT 0, -- 资金快照 + reason VARCHAR(255) NOT NULL, -- 变动原因 + post_id BIGINT NOT NULL DEFAULT 0, -- 关联动态 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_wallet_statement_user_id ON p_wallet_statement USING btree (user_id); diff --git a/scripts/migration/postgres/0002_post_visibility.down.sql b/scripts/migration/postgres/0002_post_visibility.down.sql new file mode 100644 index 00000000..2c9986ac --- /dev/null +++ b/scripts/migration/postgres/0002_post_visibility.down.sql @@ -0,0 +1 @@ +ALTER TABLE p_post DROP COLUMN visibility; diff --git a/scripts/migration/postgres/0002_post_visibility.up.sql b/scripts/migration/postgres/0002_post_visibility.up.sql new file mode 100644 index 00000000..673432ab --- /dev/null +++ b/scripts/migration/postgres/0002_post_visibility.up.sql @@ -0,0 +1 @@ +ALTER TABLE p_post ADD COLUMN visibility SMALLINT NOT NULL DEFAULT 0; -- 可见性 0公开 1私密 2好友可见 diff --git a/scripts/migration/postgres/0003_feature_contact.down.sql b/scripts/migration/postgres/0003_feature_contact.down.sql new file mode 100644 index 00000000..d3eb2b4e --- /dev/null +++ b/scripts/migration/postgres/0003_feature_contact.down.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS p_contact; +DROP TABLE IF EXISTS p_contact_group; diff --git a/scripts/migration/postgres/0003_feature_contact.up.sql b/scripts/migration/postgres/0003_feature_contact.up.sql new file mode 100644 index 00000000..9177db77 --- /dev/null +++ b/scripts/migration/postgres/0003_feature_contact.up.sql @@ -0,0 +1,27 @@ +CREATE TABLE p_contact ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL, + friend_id BIGINT NOT NULL, + group_id BIGINT NOT NULL DEFAULT 0, -- 好友分组ID:默认为0无分组 + remark VARCHAR(32) NOT NULL DEFAULT '', -- 好友备注 + status SMALLINT NOT NULL DEFAULT 0, -- 好友状态: 1请求好友, 2已好友, 3拒绝好友, 4已删好友 + is_top SMALLINT NOT NULL DEFAULT 0, -- 是否置顶, 0否, 1是 + is_black SMALLINT NOT NULL DEFAULT 0, -- 是否为黑名单, 0否, 1是 + is_del SMALLINT NOT NULL DEFAULT 0, -- 否删除好友, 0否, 1是 + notice_enable SMALLINT NOT NULL DEFAULT 0, -- 是否有消息提醒, 0否, 1是 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0 +); +CREATE UNIQUE INDEX idx_contact_user_friend ON p_contact USING btree (user_id,friend_id); +CREATE INDEX idx_contact_user_friend_status ON p_contact USING btree (user_id, friend_id, status); + +CREATE TABLE p_contact_group ( + id BIGSERIAL PRIMARY KEY, + user_id int NOT NULL DEFAULT 0, + name VARCHAR(32) NOT NULL DEFAULT '', -- 分组名称 + is_del SMALLINT NOT NULL DEFAULT 1, -- 是否删除, 0否, 1是 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0 +); diff --git a/scripts/migration/postgres/0004_share_count.down.sql b/scripts/migration/postgres/0004_share_count.down.sql new file mode 100644 index 00000000..ee44bbe9 --- /dev/null +++ b/scripts/migration/postgres/0004_share_count.down.sql @@ -0,0 +1 @@ +ALTER TABLE p_post DROP COLUMN share_count; diff --git a/scripts/migration/postgres/0004_share_count.up.sql b/scripts/migration/postgres/0004_share_count.up.sql new file mode 100644 index 00000000..22c4aa90 --- /dev/null +++ b/scripts/migration/postgres/0004_share_count.up.sql @@ -0,0 +1 @@ +ALTER TABLE p_post ADD COLUMN share_count BIGINT NOT NULL DEFAULT 0; -- 分享数 diff --git a/scripts/migration/postgres/0005_topic_follow.down.sql b/scripts/migration/postgres/0005_topic_follow.down.sql new file mode 100644 index 00000000..fe5b9746 --- /dev/null +++ b/scripts/migration/postgres/0005_topic_follow.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS p_topic_user; \ No newline at end of file diff --git a/scripts/migration/postgres/0005_topic_follow.up.sql b/scripts/migration/postgres/0005_topic_follow.up.sql new file mode 100644 index 00000000..5398a4c8 --- /dev/null +++ b/scripts/migration/postgres/0005_topic_follow.up.sql @@ -0,0 +1,16 @@ +CREATE TABLE p_topic_user ( + ID BIGSERIAL PRIMARY KEY, + topic_id BIGINT NOT NULL,-- 标签ID + user_id BIGINT NOT NULL,-- 创建者ID + alias_name VARCHAR ( 255 ),-- 别名 + remark VARCHAR ( 512 ),-- 备注 + quote_num BIGINT,-- 引用数 + is_top SMALLINT NOT NULL DEFAULT 0,-- 是否置顶 0 为未置顶、1 为已置顶 + created_on BIGINT NOT NULL DEFAULT 0,-- 创建时间 + modified_on BIGINT NOT NULL DEFAULT 0,-- 修改时间 + deleted_on BIGINT NOT NULL DEFAULT 0,-- 删除时间 + is_del SMALLINT NOT NULL DEFAULT 0,-- 是否删除 0 为未删除、1 为已删除 + reserve_a VARCHAR ( 255 ),-- 保留字段a + reserve_b VARCHAR ( 255 ) -- 保留字段b +); +CREATE UNIQUE INDEX idx_topic_user_uid_tid ON p_topic_user USING btree ( topic_id, user_id ); \ No newline at end of file diff --git a/scripts/migration/postgres/0006_comment_thumbs.down.sql b/scripts/migration/postgres/0006_comment_thumbs.down.sql new file mode 100644 index 00000000..79f878e2 --- /dev/null +++ b/scripts/migration/postgres/0006_comment_thumbs.down.sql @@ -0,0 +1,6 @@ +ALTER TABLE p_comment DROP COLUMN thumbs_up_count; +ALTER TABLE p_comment DROP COLUMN thumbs_down_count; +ALTER TABLE p_comment_reply DROP COLUMN thumbs_up_count; +ALTER TABLE p_comment_reply DROP COLUMN thumbs_down_count; + +DROP TABLE IF EXISTS p_tweet_comment_thumbs; diff --git a/scripts/migration/postgres/0006_comment_thumbs.up.sql b/scripts/migration/postgres/0006_comment_thumbs.up.sql new file mode 100644 index 00000000..02250b7d --- /dev/null +++ b/scripts/migration/postgres/0006_comment_thumbs.up.sql @@ -0,0 +1,20 @@ +ALTER TABLE p_comment ADD COLUMN thumbs_up_count INT NOT NULL DEFAULT 0; +ALTER TABLE p_comment ADD COLUMN thumbs_down_count INT NOT NULL DEFAULT 0; +ALTER TABLE p_comment_reply ADD COLUMN thumbs_up_count INT NOT NULL DEFAULT 0; +ALTER TABLE p_comment_reply ADD COLUMN thumbs_down_count INT NOT NULL DEFAULT 0; + +CREATE TABLE p_tweet_comment_thumbs ( + ID BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL, + tweet_id BIGINT NOT NULL, + comment_id BIGINT NOT NULL, + reply_id BIGINT, + comment_type SMALLINT NOT NULL DEFAULT 0,-- 评论类型 0为推文评论、1为评论回复 + is_thumbs_up SMALLINT NOT NULL DEFAULT 0,-- 是否点赞 0 为否 1为是 + is_thumbs_down SMALLINT NOT NULL DEFAULT 0,-- 是否点踩 0 为否 1为是 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 -- 是否删除 0 为未删除、1 为已删除 +); +CREATE INDEX idx_tweet_comment_thumbs_uid_tid ON p_tweet_comment_thumbs USING btree ( user_id, tweet_id ); \ No newline at end of file diff --git a/scripts/migration/postgres/0007_content_type_alter.down.sql b/scripts/migration/postgres/0007_content_type_alter.down.sql new file mode 100644 index 00000000..e95cb5d1 --- /dev/null +++ b/scripts/migration/postgres/0007_content_type_alter.down.sql @@ -0,0 +1 @@ +-- nothing diff --git a/scripts/migration/postgres/0007_content_type_alter.up.sql b/scripts/migration/postgres/0007_content_type_alter.up.sql new file mode 100644 index 00000000..4df0470d --- /dev/null +++ b/scripts/migration/postgres/0007_content_type_alter.up.sql @@ -0,0 +1,3 @@ +ALTER TABLE p_post_content ALTER COLUMN content SET DATA TYPE TEXT NOT NULL DEFAULT ''; +ALTER TABLE p_comment_content ALTER COLUMN content SET DATA TYPE TEXT NOT NULL DEFAULT ''; +ALTER TABLE p_comment_reply ALTER COLUMN content SET DATA TYPE TEXT NOT NULL DEFAULT ''; diff --git a/scripts/migration/postgres/1_initialize_schema.down.sql b/scripts/migration/postgres/1_initialize_schema.down.sql deleted file mode 100644 index 3ce95155..00000000 --- a/scripts/migration/postgres/1_initialize_schema.down.sql +++ /dev/null @@ -1 +0,0 @@ --- TODO: WIP diff --git a/scripts/migration/postgres/1_initialize_schema.up.sql b/scripts/migration/postgres/1_initialize_schema.up.sql deleted file mode 100644 index 3ce95155..00000000 --- a/scripts/migration/postgres/1_initialize_schema.up.sql +++ /dev/null @@ -1 +0,0 @@ --- TODO: WIP diff --git a/scripts/migration/postgres/2_post_visibility.down.sql b/scripts/migration/postgres/2_post_visibility.down.sql deleted file mode 100644 index 3ce95155..00000000 --- a/scripts/migration/postgres/2_post_visibility.down.sql +++ /dev/null @@ -1 +0,0 @@ --- TODO: WIP diff --git a/scripts/migration/postgres/2_post_visibility.up.sql b/scripts/migration/postgres/2_post_visibility.up.sql deleted file mode 100644 index 3ce95155..00000000 --- a/scripts/migration/postgres/2_post_visibility.up.sql +++ /dev/null @@ -1 +0,0 @@ --- TODO: WIP diff --git a/scripts/migration/postgres/3_feature_contact.down.sql b/scripts/migration/postgres/3_feature_contact.down.sql deleted file mode 100644 index 3ce95155..00000000 --- a/scripts/migration/postgres/3_feature_contact.down.sql +++ /dev/null @@ -1 +0,0 @@ --- TODO: WIP diff --git a/scripts/migration/postgres/3_feature_contact.up.sql b/scripts/migration/postgres/3_feature_contact.up.sql deleted file mode 100644 index 3ce95155..00000000 --- a/scripts/migration/postgres/3_feature_contact.up.sql +++ /dev/null @@ -1 +0,0 @@ --- TODO: WIP diff --git a/scripts/migration/sqlite3/1_initialize_schema.down.sql b/scripts/migration/sqlite3/0001_initialize_schema.down.sql similarity index 100% rename from scripts/migration/sqlite3/1_initialize_schema.down.sql rename to scripts/migration/sqlite3/0001_initialize_schema.down.sql diff --git a/scripts/migration/sqlite3/1_initialize_schema.up.sql b/scripts/migration/sqlite3/0001_initialize_schema.up.sql similarity index 100% rename from scripts/migration/sqlite3/1_initialize_schema.up.sql rename to scripts/migration/sqlite3/0001_initialize_schema.up.sql diff --git a/scripts/migration/sqlite3/0002_post_visibility.down.sql b/scripts/migration/sqlite3/0002_post_visibility.down.sql new file mode 100644 index 00000000..bc0931c8 --- /dev/null +++ b/scripts/migration/sqlite3/0002_post_visibility.down.sql @@ -0,0 +1 @@ +ALTER TABLE `p_post` DROP COLUMN `visibility`; diff --git a/scripts/migration/sqlite3/2_post_visibility.up.sql b/scripts/migration/sqlite3/0002_post_visibility.up.sql similarity index 100% rename from scripts/migration/sqlite3/2_post_visibility.up.sql rename to scripts/migration/sqlite3/0002_post_visibility.up.sql diff --git a/scripts/migration/sqlite3/3_feature_contact.down.sql b/scripts/migration/sqlite3/0003_feature_contact.down.sql similarity index 100% rename from scripts/migration/sqlite3/3_feature_contact.down.sql rename to scripts/migration/sqlite3/0003_feature_contact.down.sql diff --git a/scripts/migration/sqlite3/3_feature_contact.up.sql b/scripts/migration/sqlite3/0003_feature_contact.up.sql similarity index 100% rename from scripts/migration/sqlite3/3_feature_contact.up.sql rename to scripts/migration/sqlite3/0003_feature_contact.up.sql diff --git a/scripts/migration/sqlite3/0004_optimize_idx.down.sql b/scripts/migration/sqlite3/0004_optimize_idx.down.sql new file mode 100644 index 00000000..f0bd5fe4 --- /dev/null +++ b/scripts/migration/sqlite3/0004_optimize_idx.down.sql @@ -0,0 +1,39 @@ +PRAGMA foreign_keys = false; + +DROP INDEX IF EXISTS "idx_attachment_user_id"; +DROP INDEX IF EXISTS "idx_captcha_expired_on"; +DROP INDEX IF EXISTS "idx_captcha_phone"; +DROP INDEX IF EXISTS "idx_captcha_use_times"; +DROP INDEX IF EXISTS "idx_comment_post_id"; +DROP INDEX IF EXISTS "idx_comment_user_id"; +DROP INDEX IF EXISTS "idx_comment_content_comment_id"; +DROP INDEX IF EXISTS "idx_comment_content_sort"; +DROP INDEX IF EXISTS "idx_comment_content_type"; +DROP INDEX IF EXISTS "idx_comment_content_user_id"; +DROP INDEX IF EXISTS "idx_comment_reply_comment_id"; +DROP INDEX IF EXISTS "idx_contact_user_friend"; +DROP INDEX IF EXISTS "idx_contact_user_friend_status"; +DROP INDEX IF EXISTS "idx_message_is_read"; +DROP INDEX IF EXISTS "idx_message_receiver_user_id"; +DROP INDEX IF EXISTS "idx_message_type"; +DROP INDEX IF EXISTS "idx_post_user_id"; +DROP INDEX IF EXISTS "idx_post_visibility"; +DROP INDEX IF EXISTS "idx_post_attachment_bill_post_id"; +DROP INDEX IF EXISTS "idx_post_attachment_bill_user_id"; +DROP INDEX IF EXISTS "idx_post_collection_post_id"; +DROP INDEX IF EXISTS "idx_post_collection_user_id"; +DROP INDEX IF EXISTS "idx_post_content_post_id"; +DROP INDEX IF EXISTS "idx_post_content_user_id"; +DROP INDEX IF EXISTS "idx_post_star_post_id"; +DROP INDEX IF EXISTS "idx_post_star_user_id"; +DROP INDEX IF EXISTS "idx_tag"; +DROP INDEX IF EXISTS "idx_tag_quote_num"; +DROP INDEX IF EXISTS "idx_tag_user_id"; +DROP INDEX IF EXISTS "idx_user_phone"; +DROP INDEX IF EXISTS "idx_user_username"; +DROP INDEX IF EXISTS "idx_wallet_recharge_trade_no"; +DROP INDEX IF EXISTS "idx_wallet_recharge_trade_status"; +DROP INDEX IF EXISTS "idx_wallet_recharge_user_id"; +DROP INDEX IF EXISTS "idx_wallet_statement_user_id"; + +PRAGMA foreign_keys = true; diff --git a/scripts/migration/sqlite3/0004_optimize_idx.up.sql b/scripts/migration/sqlite3/0004_optimize_idx.up.sql new file mode 100644 index 00000000..006565ae --- /dev/null +++ b/scripts/migration/sqlite3/0004_optimize_idx.up.sql @@ -0,0 +1,219 @@ +PRAGMA foreign_keys = false; + +DROP INDEX IF EXISTS "main"."idx_user"; +DROP INDEX IF EXISTS "main"."idx_expired_on"; +DROP INDEX IF EXISTS "main"."idx_phone"; +DROP INDEX IF EXISTS "main"."idx_use_times"; +DROP INDEX IF EXISTS "main"."idx_post"; +DROP INDEX IF EXISTS "main"."idx_user_friend_id"; +DROP INDEX IF EXISTS "main"."idx_user_friend_status"; +DROP INDEX IF EXISTS "main"."idx_visibility"; + +-- ---------------------------- +-- Indexes structure for table p_attachment +-- ---------------------------- +CREATE INDEX "idx_attachment_user_id" +ON "p_attachment" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_captcha +-- ---------------------------- +CREATE INDEX "idx_captcha_expired_on" +ON "p_captcha" ( + "expired_on" ASC +); +CREATE INDEX "idx_captcha_phone" +ON "p_captcha" ( + "phone" ASC +); +CREATE INDEX "idx_captcha_use_times" +ON "p_captcha" ( + "use_times" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_comment +-- ---------------------------- +CREATE INDEX "idx_comment_post_id" +ON "p_comment" ( + "post_id" ASC +); +CREATE INDEX "idx_comment_user_id" +ON "p_comment" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_comment_content +-- ---------------------------- +CREATE INDEX "idx_comment_content_comment_id" +ON "p_comment_content" ( + "comment_id" ASC +); +CREATE INDEX "idx_comment_content_sort" +ON "p_comment_content" ( + "sort" ASC +); +CREATE INDEX "idx_comment_content_type" +ON "p_comment_content" ( + "type" ASC +); +CREATE INDEX "idx_comment_content_user_id" +ON "p_comment_content" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_comment_reply +-- ---------------------------- +CREATE INDEX "idx_comment_reply_comment_id" +ON "p_comment_reply" ( + "comment_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_contact +-- ---------------------------- +CREATE UNIQUE INDEX "idx_contact_user_friend" +ON "p_contact" ( + "user_id" ASC, + "friend_id" ASC +); +CREATE INDEX "idx_contact_user_friend_status" +ON "p_contact" ( + "user_id" ASC, + "friend_id" ASC, + "status" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_message +-- ---------------------------- +CREATE INDEX "idx_message_is_read" +ON "p_message" ( + "is_read" ASC +); +CREATE INDEX "idx_message_receiver_user_id" +ON "p_message" ( + "receiver_user_id" ASC +); +CREATE INDEX "idx_message_type" +ON "p_message" ( + "type" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_post +-- ---------------------------- +CREATE INDEX "idx_post_user_id" +ON "p_post" ( + "user_id" ASC +); +CREATE INDEX "idx_post_visibility" +ON "p_post" ( + "visibility" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_post_attachment_bill +-- ---------------------------- +CREATE INDEX "idx_post_attachment_bill_post_id" +ON "p_post_attachment_bill" ( + "post_id" ASC +); +CREATE INDEX "idx_post_attachment_bill_user_id" +ON "p_post_attachment_bill" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_post_collection +-- ---------------------------- +CREATE INDEX "idx_post_collection_post_id" +ON "p_post_collection" ( + "post_id" ASC +); +CREATE INDEX "idx_post_collection_user_id" +ON "p_post_collection" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_post_content +-- ---------------------------- +CREATE INDEX "idx_post_content_post_id" +ON "p_post_content" ( + "post_id" ASC +); +CREATE INDEX "idx_post_content_user_id" +ON "p_post_content" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_post_star +-- ---------------------------- +CREATE INDEX "idx_post_star_post_id" +ON "p_post_star" ( + "post_id" ASC +); +CREATE INDEX "idx_post_star_user_id" +ON "p_post_star" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_tag +-- ---------------------------- +CREATE UNIQUE INDEX "idx_tag" +ON "p_tag" ( + "tag" ASC +); +CREATE INDEX "idx_tag_quote_num" +ON "p_tag" ( + "quote_num" ASC +); +CREATE INDEX "idx_tag_user_id" +ON "p_tag" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_user +-- ---------------------------- +CREATE INDEX "idx_user_phone" +ON "p_user" ( + "phone" ASC +); +CREATE UNIQUE INDEX "idx_user_username" +ON "p_user" ( + "username" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_wallet_recharge +-- ---------------------------- +CREATE INDEX "idx_wallet_recharge_trade_no" +ON "p_wallet_recharge" ( + "trade_no" ASC +); +CREATE INDEX "idx_wallet_recharge_trade_status" +ON "p_wallet_recharge" ( + "trade_status" ASC +); +CREATE INDEX "idx_wallet_recharge_user_id" +ON "p_wallet_recharge" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_wallet_statement +-- ---------------------------- +CREATE INDEX "idx_wallet_statement_user_id" +ON "p_wallet_statement" ( + "user_id" ASC +); + +PRAGMA foreign_keys = true; diff --git a/scripts/migration/sqlite3/0005_share_count.down.sql b/scripts/migration/sqlite3/0005_share_count.down.sql new file mode 100644 index 00000000..4c98d48b --- /dev/null +++ b/scripts/migration/sqlite3/0005_share_count.down.sql @@ -0,0 +1 @@ +ALTER TABLE `p_post` DROP COLUMN `share_count`; diff --git a/scripts/migration/sqlite3/0005_share_count.up.sql b/scripts/migration/sqlite3/0005_share_count.up.sql new file mode 100644 index 00000000..058b7389 --- /dev/null +++ b/scripts/migration/sqlite3/0005_share_count.up.sql @@ -0,0 +1 @@ +ALTER TABLE `p_post` ADD COLUMN `share_count` integer NOT NULL DEFAULT 0; \ No newline at end of file diff --git a/scripts/migration/sqlite3/0006_topic_follow.down.sql b/scripts/migration/sqlite3/0006_topic_follow.down.sql new file mode 100644 index 00000000..d826f2fb --- /dev/null +++ b/scripts/migration/sqlite3/0006_topic_follow.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS `p_topic_user`; \ No newline at end of file diff --git a/scripts/migration/sqlite3/0006_topic_follow.up.sql b/scripts/migration/sqlite3/0006_topic_follow.up.sql new file mode 100644 index 00000000..96022230 --- /dev/null +++ b/scripts/migration/sqlite3/0006_topic_follow.up.sql @@ -0,0 +1,17 @@ +CREATE TABLE "p_topic_user" ( + "id" integer, + "topic_id" integer NOT NULL,-- 标签ID + "user_id" integer NOT NULL,-- 创建者ID + "alias_name" text ( 255 ),-- 别名 + "remark" text ( 512 ),-- 备注 + "quote_num" integer,-- 引用数 + "is_top" integer NOT NULL DEFAULT 0,-- 是否置顶 0 为未置顶、1 为已置顶 + "created_on" integer NOT NULL DEFAULT 0,-- 创建时间 + "modified_on" integer NOT NULL DEFAULT 0,-- 修改时间 + "deleted_on" integer NOT NULL DEFAULT 0,-- 删除时间 + "is_del" integer NOT NULL DEFAULT 0,-- 是否删除 0 为未删除、1 为已删除 + "reserve_a" text,-- 保留字段a + "reserve_b" text,-- 保留字段b + PRIMARY KEY ( "id" ) +); +CREATE UNIQUE INDEX "idx_topic_user_uid_tid" ON "p_topic_user" ( "topic_id", "user_id" ); \ No newline at end of file diff --git a/scripts/migration/sqlite3/0007_comment_thumbs.down.sql b/scripts/migration/sqlite3/0007_comment_thumbs.down.sql new file mode 100644 index 00000000..2ed41f59 --- /dev/null +++ b/scripts/migration/sqlite3/0007_comment_thumbs.down.sql @@ -0,0 +1,6 @@ +ALTER TABLE "p_comment" DROP COLUMN "thumbs_up_count"; +ALTER TABLE "p_comment" DROP COLUMN "thumbs_down_count"; +ALTER TABLE "p_comment_reply" DROP COLUMN "thumbs_up_count"; +ALTER TABLE "p_comment_reply" DROP COLUMN "thumbs_down_count"; + +DROP TABLE IF EXISTS "p_tweet_comment_thumbs"; diff --git a/scripts/migration/sqlite3/0007_comment_thumbs.up.sql b/scripts/migration/sqlite3/0007_comment_thumbs.up.sql new file mode 100644 index 00000000..33d87ad2 --- /dev/null +++ b/scripts/migration/sqlite3/0007_comment_thumbs.up.sql @@ -0,0 +1,19 @@ +ALTER TABLE "p_comment" ADD COLUMN "thumbs_up_count" integer NOT NULL DEFAULT 0; +ALTER TABLE "p_comment" ADD COLUMN "thumbs_down_count" integer NOT NULL DEFAULT 0; +ALTER TABLE "p_comment_reply" ADD COLUMN "thumbs_up_count" integer NOT NULL DEFAULT 0; +ALTER TABLE "p_comment_reply" ADD COLUMN "thumbs_down_count" integer NOT NULL DEFAULT 0; + +CREATE TABLE "p_tweet_comment_thumbs" ( + "id" integer PRIMARY KEY, + "user_id" integer NOT NULL, + "tweet_id" integer NOT NULL, + "comment_id" integer NOT NULL, + "reply_id" integer, + "comment_type" integer NOT NULL DEFAULT 0, -- 评论类型 0为推文评论、1为评论回复 + "is_thumbs_up" integer NOT NULL DEFAULT 0, -- 是否点赞 0 为否 1为是 + "is_thumbs_down" integer NOT NULL DEFAULT 0, -- 是否点踩 0 为否 1为是 + "created_on" integer NOT NULL DEFAULT 0, + "modified_on" integer NOT NULL DEFAULT 0, + "deleted_on" integer NOT NULL DEFAULT 0, + "is_del" integer NOT NULL DEFAULT 0 -- 是否删除 0 为未删除、1 为已删除 +); diff --git a/scripts/migration/sqlite3/0008_content_type_alter.down.sql b/scripts/migration/sqlite3/0008_content_type_alter.down.sql new file mode 100644 index 00000000..e95cb5d1 --- /dev/null +++ b/scripts/migration/sqlite3/0008_content_type_alter.down.sql @@ -0,0 +1 @@ +-- nothing diff --git a/scripts/migration/sqlite3/0008_content_type_alter.up.sql b/scripts/migration/sqlite3/0008_content_type_alter.up.sql new file mode 100644 index 00000000..ba4db9e1 --- /dev/null +++ b/scripts/migration/sqlite3/0008_content_type_alter.up.sql @@ -0,0 +1,154 @@ +PRAGMA foreign_keys=off; + +BEGIN TRANSACTION; + +ALTER TABLE p_post_content RENAME TO _p_post_content; + +ALTER TABLE p_comment_content RENAME TO _p_comment_content; + +ALTER TABLE p_comment_reply RENAME TO _p_comment_reply; + +CREATE TABLE p_post_content +( "id" integer NOT NULL, + "post_id" integer NOT NULL, + "user_id" integer NOT NULL, + "content" text NOT NULL, + "type" integer NOT NULL, + "sort" integer NOT NULL, + "created_on" integer NOT NULL, + "modified_on" integer NOT NULL, + "deleted_on" integer NOT NULL, + "is_del" integer NOT NULL, + PRIMARY KEY ("id") +); + +CREATE TABLE p_comment_content +( "id" integer NOT NULL, + "comment_id" integer NOT NULL, + "user_id" integer NOT NULL, + "content" text NOT NULL, + "type" integer NOT NULL, + "sort" integer NOT NULL, + "created_on" integer NOT NULL, + "modified_on" integer NOT NULL, + "deleted_on" integer NOT NULL, + "is_del" integer NOT NULL, + PRIMARY KEY ("id") +); + +CREATE TABLE p_comment_reply +( "id" integer NOT NULL, + "comment_id" integer NOT NULL, + "user_id" integer NOT NULL, + "at_user_id" integer NOT NULL, + "content" text NOT NULL, + "ip" text(64) NOT NULL, + "ip_loc" text(64) NOT NULL, + "thumbs_up_count" integer NOT NULL DEFAULT 0, -- 点赞数 + "thumbs_down_count" integer NOT NULL DEFAULT 0, -- 点踩数 + "created_on" integer NOT NULL, + "modified_on" integer NOT NULL, + "deleted_on" integer NOT NULL, + "is_del" integer NOT NULL, + PRIMARY KEY ("id") +); + +-- ---------------------------- +-- Indexes structure for table p_post_content +-- ---------------------------- +CREATE INDEX "idx_post_content_post_id" +ON "p_post_content" ( + "post_id" ASC +); +CREATE INDEX "idx_post_content_user_id" +ON "p_post_content" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_comment_reply +-- ---------------------------- +CREATE INDEX "idx_comment_reply_comment_id" +ON "p_comment_reply" ( + "comment_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_comment_content +-- ---------------------------- +CREATE INDEX "idx_comment_content_comment_id" +ON "p_comment_content" ( + "comment_id" ASC +); +CREATE INDEX "idx_comment_content_sort" +ON "p_comment_content" ( + "sort" ASC +); +CREATE INDEX "idx_comment_content_type" +ON "p_comment_content" ( + "type" ASC +); +CREATE INDEX "idx_comment_content_user_id" +ON "p_comment_content" ( + "user_id" ASC +); + +INSERT INTO p_post_content (id, post_id, user_id, content, `type`, sort, created_on, modified_on, deleted_on, is_del) + SELECT id, post_id, user_id, content, `type`, sort, created_on, modified_on, deleted_on, is_del + FROM _p_post_content; + +INSERT INTO p_comment_content (id, comment_id, user_id, content, `type`, sort, created_on, modified_on, deleted_on, is_del) + SELECT id, comment_id, user_id, content, `type`, sort, created_on, modified_on, deleted_on, is_del + FROM _p_comment_content; + +INSERT INTO p_comment_reply (id, comment_id, user_id, at_user_id, content, ip, ip_loc, thumbs_up_count, thumbs_down_count, created_on, modified_on, deleted_on, is_del) + SELECT id, comment_id, user_id, at_user_id, content, ip, ip_loc, thumbs_up_count, thumbs_down_count, created_on, modified_on, deleted_on, is_del + FROM _p_comment_reply; + +DROP TABLE _p_post_content; +DROP TABLE _p_comment_content; +DROP TABLE _p_comment_reply; + +-- ---------------------------- +-- Indexes structure for table p_post_content +-- ---------------------------- +CREATE INDEX "idx_post_content_post_id" +ON "p_post_content" ( + "post_id" ASC +); +CREATE INDEX "idx_post_content_user_id" +ON "p_post_content" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_comment_reply +-- ---------------------------- +CREATE INDEX "idx_comment_reply_comment_id" +ON "p_comment_reply" ( + "comment_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_comment_content +-- ---------------------------- +CREATE INDEX "idx_comment_content_comment_id" +ON "p_comment_content" ( + "comment_id" ASC +); +CREATE INDEX "idx_comment_content_sort" +ON "p_comment_content" ( + "sort" ASC +); +CREATE INDEX "idx_comment_content_type" +ON "p_comment_content" ( + "type" ASC +); +CREATE INDEX "idx_comment_content_user_id" +ON "p_comment_content" ( + "user_id" ASC +); + +COMMIT; + +PRAGMA foreign_keys=on; diff --git a/scripts/migration/sqlite3/2_post_visibility.down.sql b/scripts/migration/sqlite3/2_post_visibility.down.sql deleted file mode 100644 index 551017c1..00000000 --- a/scripts/migration/sqlite3/2_post_visibility.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `p_post` DROP COLUMN `visibility`; - -DROP INDEX "main"."idx_visibility" ON "p_post" diff --git a/scripts/paopao-mysql.sql b/scripts/paopao-mysql.sql index 18525ab3..419cc53e 100644 --- a/scripts/paopao-mysql.sql +++ b/scripts/paopao-mysql.sql @@ -6,19 +6,19 @@ SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- DROP TABLE IF EXISTS `p_attachment`; CREATE TABLE `p_attachment` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `user_id` bigint unsigned NOT NULL DEFAULT '0', - `file_size` bigint unsigned NOT NULL, - `img_width` bigint unsigned NOT NULL DEFAULT '0', - `img_height` bigint unsigned NOT NULL DEFAULT '0', - `type` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '1图片,2视频,3其他附件', - `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_user` (`user_id`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `user_id` bigint unsigned NOT NULL DEFAULT '0', + `file_size` bigint unsigned NOT NULL, + `img_width` bigint unsigned NOT NULL DEFAULT '0', + `img_height` bigint unsigned NOT NULL DEFAULT '0', + `type` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '1图片,2视频,3其他附件', + `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_attachment_user` (`user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=100041 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='附件'; -- ---------------------------- @@ -26,19 +26,19 @@ CREATE TABLE `p_attachment` ( -- ---------------------------- DROP TABLE IF EXISTS `p_captcha`; CREATE TABLE `p_captcha` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '验证码ID', - `phone` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号', - `captcha` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '验证码', - `use_times` int unsigned NOT NULL DEFAULT '0' COMMENT '使用次数', - `expired_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '过期时间', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_phone` (`phone`) USING BTREE, - KEY `idx_expired_on` (`expired_on`) USING BTREE, - KEY `idx_use_times` (`use_times`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '验证码ID', + `phone` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号', + `captcha` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '验证码', + `use_times` int unsigned NOT NULL DEFAULT '0' COMMENT '使用次数', + `expired_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '过期时间', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_captcha_phone` (`phone`) USING BTREE, + KEY `idx_captcha_expired_on` (`expired_on`) USING BTREE, + KEY `idx_captcha_use_times` (`use_times`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1021 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='手机验证码'; -- ---------------------------- @@ -46,18 +46,20 @@ CREATE TABLE `p_captcha` ( -- ---------------------------- DROP TABLE IF EXISTS `p_comment`; CREATE TABLE `p_comment` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '评论ID', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP地址', - `ip_loc` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP城市地址', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_post` (`post_id`) USING BTREE, - KEY `idx_user` (`user_id`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '评论ID', + `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', + `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP地址', + `ip_loc` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP城市地址', + `thumbs_up_count` int unsigned NOT NULL DEFAULT '0' COMMENT '点赞数', + `thumbs_down_count` int unsigned NOT NULL DEFAULT '0' COMMENT '点踩数', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_comment_post_id` (`post_id`) USING BTREE, + KEY `idx_comment_user_id` (`user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=6001736 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='评论'; -- ---------------------------- @@ -65,21 +67,21 @@ CREATE TABLE `p_comment` ( -- ---------------------------- DROP TABLE IF EXISTS `p_comment_content`; CREATE TABLE `p_comment_content` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '内容ID', - `comment_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '评论ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容', - `type` tinyint unsigned NOT NULL DEFAULT '2' COMMENT '类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址', - `sort` bigint unsigned NOT NULL DEFAULT '100' COMMENT '排序,越小越靠前', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_reply` (`comment_id`) USING BTREE, - KEY `idx_user` (`user_id`) USING BTREE, - KEY `idx_type` (`type`) USING BTREE, - KEY `idx_sort` (`sort`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '内容ID', + `comment_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '评论ID', + `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `content` varchar(65535) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容', + `type` tinyint unsigned NOT NULL DEFAULT '2' COMMENT '类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址', + `sort` bigint unsigned NOT NULL DEFAULT '100' COMMENT '排序,越小越靠前', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_comment_content_comment_id` (`comment_id`) USING BTREE, + KEY `idx_comment_content_user_id` (`user_id`) USING BTREE, + KEY `idx_comment_content_type` (`type`) USING BTREE, + KEY `idx_comment_content_sort` (`sort`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=11001738 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='评论内容'; -- ---------------------------- @@ -87,44 +89,67 @@ CREATE TABLE `p_comment_content` ( -- ---------------------------- DROP TABLE IF EXISTS `p_comment_reply`; CREATE TABLE `p_comment_reply` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '回复ID', - `comment_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '评论ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `at_user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '@用户ID', - `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容', - `ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP地址', - `ip_loc` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP城市地址', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_comment` (`comment_id`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '回复ID', + `comment_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '评论ID', + `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `at_user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '@用户ID', + `content` varchar(65535) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容', + `ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP地址', + `ip_loc` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP城市地址', + `thumbs_up_count` int unsigned NOT NULL DEFAULT '0' COMMENT '点赞数', + `thumbs_down_count` int unsigned NOT NULL DEFAULT '0' COMMENT '点踩数', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_comment_reply_comment_id` (`comment_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=12000015 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='评论回复'; +-- ---------------------------- +-- Table structure for p_tweet_comment_thumbs +-- ---------------------------- +DROP TABLE IF EXISTS `p_tweet_comment_thumbs`; +CREATE TABLE `p_tweet_comment_thumbs` ( + `id` BIGINT unsigned NOT NULL AUTO_INCREMENT COMMENT 'thumbs ID', + `user_id` BIGINT unsigned NOT NULL, + `tweet_id` BIGINT unsigned NOT NULL COMMENT '推文ID', + `comment_id` BIGINT unsigned NOT NULL COMMENT '评论ID', + `reply_id` BIGINT unsigned COMMENT '评论回复ID', + `comment_type` TINYINT NOT NULL DEFAULT '0' COMMENT '评论类型 0为推文评论、1为评论回复', + `is_thumbs_up` TINYINT unsigned NOT NULL DEFAULT '0' COMMENT '是否点赞', + `is_thumbs_down` TINYINT unsigned NOT NULL DEFAULT '0' COMMENT '是否点踩', + `created_on` BIGINT unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` TINYINT unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_tweet_comment_thumbs_uid_tid` (`user_id`, `tweet_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='推文评论点赞'; + -- ---------------------------- -- Table structure for p_message -- ---------------------------- DROP TABLE IF EXISTS `p_message`; CREATE TABLE `p_message` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '消息通知ID', - `sender_user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '发送方用户ID', - `receiver_user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '接收方用户ID', - `type` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '通知类型,1动态,2评论,3回复,4私信,99系统通知', - `brief` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '摘要说明', - `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细内容', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '动态ID', - `comment_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '评论ID', - `reply_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '回复ID', - `is_read` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否已读', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_receiver` (`receiver_user_id`) USING BTREE, - KEY `idx_is_read` (`is_read`) USING BTREE, - KEY `idx_type` (`type`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '消息通知ID', + `sender_user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '发送方用户ID', + `receiver_user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '接收方用户ID', + `type` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '通知类型,1动态,2评论,3回复,4私信,99系统通知', + `brief` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '摘要说明', + `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细内容', + `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '动态ID', + `comment_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '评论ID', + `reply_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '回复ID', + `is_read` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否已读', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_message_receiver_user_id` (`receiver_user_id`) USING BTREE, + KEY `idx_message_is_read` (`is_read`) USING BTREE, + KEY `idx_message_type` (`type`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=16000033 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='消息通知'; -- ---------------------------- @@ -132,27 +157,28 @@ CREATE TABLE `p_message` ( -- ---------------------------- DROP TABLE IF EXISTS `p_post`; CREATE TABLE `p_post` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主题ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `comment_count` bigint unsigned NOT NULL DEFAULT '0' COMMENT '评论数', - `collection_count` bigint unsigned NOT NULL DEFAULT '0' COMMENT '收藏数', - `upvote_count` bigint unsigned NOT NULL DEFAULT '0' COMMENT '点赞数', - `visibility` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '可见性 0公开 1私密 2好友可见', - `is_top` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否置顶', - `is_essence` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否精华', - `is_lock` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否锁定', - `latest_replied_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '最新回复时间', - `tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '标签', - `attachment_price` bigint unsigned NOT NULL DEFAULT '0' COMMENT '附件价格(分)', - `ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP地址', - `ip_loc` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP城市地址', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_user` (`user_id`) USING BTREE, - KEY `idx_visibility` (`visibility`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主题ID', + `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `comment_count` bigint unsigned NOT NULL DEFAULT '0' COMMENT '评论数', + `collection_count` bigint unsigned NOT NULL DEFAULT '0' COMMENT '收藏数', + `upvote_count` bigint unsigned NOT NULL DEFAULT '0' COMMENT '点赞数', + `share_count` bigint unsigned NOT NULL DEFAULT '0' COMMENT '分享数', + `visibility` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '可见性 0公开 1私密 2好友可见', + `is_top` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否置顶', + `is_essence` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否精华', + `is_lock` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否锁定', + `latest_replied_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '最新回复时间', + `tags` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '标签', + `attachment_price` bigint unsigned NOT NULL DEFAULT '0' COMMENT '附件价格(分)', + `ip` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP地址', + `ip_loc` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'IP城市地址', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_post_user_id` (`user_id`) USING BTREE, + KEY `idx_post_visibility` (`visibility`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1080017989 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='冒泡/文章'; -- ---------------------------- @@ -160,17 +186,17 @@ CREATE TABLE `p_post` ( -- ---------------------------- DROP TABLE IF EXISTS `p_post_attachment_bill`; CREATE TABLE `p_post_attachment_bill` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '购买记录ID', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `paid_amount` bigint unsigned NOT NULL DEFAULT '0' COMMENT '支付金额', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_post` (`post_id`) USING BTREE, - KEY `idx_user` (`user_id`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '购买记录ID', + `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', + `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `paid_amount` bigint unsigned NOT NULL DEFAULT '0' COMMENT '支付金额', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_post_attachment_bill_post_id` (`post_id`) USING BTREE, + KEY `idx_post_attachment_bill_user_id` (`user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=5000002 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='冒泡/文章附件账单'; -- ---------------------------- @@ -178,16 +204,16 @@ CREATE TABLE `p_post_attachment_bill` ( -- ---------------------------- DROP TABLE IF EXISTS `p_post_collection`; CREATE TABLE `p_post_collection` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '收藏ID', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_post` (`post_id`) USING BTREE, - KEY `idx_user` (`user_id`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '收藏ID', + `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', + `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_post_collection_post_id` (`post_id`) USING BTREE, + KEY `idx_post_collection_user_id` (`user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=6000012 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='冒泡/文章收藏'; -- ---------------------------- @@ -195,19 +221,19 @@ CREATE TABLE `p_post_collection` ( -- ---------------------------- DROP TABLE IF EXISTS `p_post_content`; CREATE TABLE `p_post_content` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '内容ID', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `content` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容', - `type` tinyint unsigned NOT NULL DEFAULT '2' COMMENT '类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源,8收费资源', - `sort` int unsigned NOT NULL DEFAULT '100' COMMENT '排序,越小越靠前', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_post` (`post_id`) USING BTREE, - KEY `idx_user` (`user_id`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '内容ID', + `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', + `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `content` varchar(65535) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '内容', + `type` tinyint unsigned NOT NULL DEFAULT '2' COMMENT '类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源,8收费资源', + `sort` int unsigned NOT NULL DEFAULT '100' COMMENT '排序,越小越靠前', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_post_content_post_id` (`post_id`) USING BTREE, + KEY `idx_post_content_user_id` (`user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=180022546 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='冒泡/文章内容'; -- ---------------------------- @@ -215,16 +241,16 @@ CREATE TABLE `p_post_content` ( -- ---------------------------- DROP TABLE IF EXISTS `p_post_star`; CREATE TABLE `p_post_star` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '收藏ID', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_post` (`post_id`) USING BTREE, - KEY `idx_user` (`user_id`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '收藏ID', + `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT 'POST ID', + `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_post_star_post_id` (`post_id`) USING BTREE, + KEY `idx_post_star_user_id` (`user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=6000028 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='冒泡/文章点赞'; -- ---------------------------- @@ -232,42 +258,64 @@ CREATE TABLE `p_post_star` ( -- ---------------------------- DROP TABLE IF EXISTS `p_tag`; CREATE TABLE `p_tag` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '标签ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建者ID', - `tag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标签名', - `quote_num` bigint unsigned NOT NULL DEFAULT '0' COMMENT '引用数', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE KEY `idx_tag` (`tag`) USING BTREE, - KEY `idx_user` (`user_id`) USING BTREE, - KEY `idx_num` (`quote_num`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '标签ID', + `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建者ID', + `tag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标签名', + `quote_num` bigint unsigned NOT NULL DEFAULT '0' COMMENT '引用数', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `idx_tag_tag` (`tag`) USING BTREE, + KEY `idx_tag_user_id` (`user_id`) USING BTREE, + KEY `idx_tag_quote_num` (`quote_num`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=9000065 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='标签'; +-- ---------------------------- +-- Table structure for p_topic_user +-- ---------------------------- +DROP TABLE IF EXISTS `p_topic_user`; +CREATE TABLE `p_topic_user` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + `topic_id` BIGINT UNSIGNED NOT NULL COMMENT '标签ID', + `user_id` BIGINT UNSIGNED NOT NULL COMMENT '创建者ID', + `alias_name` VARCHAR ( 255 ) COMMENT '别名', + `remark` VARCHAR ( 512 ) COMMENT '备注', + `quote_num` BIGINT UNSIGNED COMMENT '引用数', + `is_top` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否置顶 0 为未置顶、1 为已置顶', + `created_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` BIGINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` TINYINT UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + `reserve_a` VARCHAR ( 255 ) COMMENT '保留字段a', + `reserve_b` VARCHAR ( 255 ) COMMENT '保留字段b', + PRIMARY KEY ( `id` ) USING BTREE, + UNIQUE KEY `idx_topic_user_uid_tid` ( `topic_id`, `user_id` ) USING BTREE +) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户话题'; + -- ---------------------------- -- Table structure for p_user -- ---------------------------- DROP TABLE IF EXISTS `p_user`; CREATE TABLE `p_user` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID', - `nickname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '昵称', - `username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户名', - `phone` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号', - `password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'MD5密码', - `salt` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '盐值', - `status` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '状态,1正常,2停用', - `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户头像', - `balance` bigint unsigned NOT NULL COMMENT '用户余额(分)', - `is_admin` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否管理员', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE KEY `idx_username` (`username`) USING BTREE, - KEY `idx_phone` (`phone`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID', + `nickname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '昵称', + `username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户名', + `phone` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号', + `password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'MD5密码', + `salt` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '盐值', + `status` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '状态,1正常,2停用', + `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户头像', + `balance` bigint unsigned NOT NULL COMMENT '用户余额(分)', + `is_admin` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否管理员', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `idx_user_username` (`username`) USING BTREE, + KEY `idx_user_phone` (`phone`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=100058 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户'; -- ---------------------------- @@ -275,22 +323,22 @@ CREATE TABLE `p_user` ( -- ---------------------------- DROP TABLE IF EXISTS `p_contact`; CREATE TABLE `p_contact` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '联系人ID', - `user_id` bigint unsigned NOT NULL COMMENT '用户ID', - `friend_id` bigint unsigned NOT NULL COMMENT '好友ID', - `group_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '好友分组ID:默认为0无分组', - `remark` varchar(32) NOT NULL DEFAULT '' COMMENT '好友备注', - `status` tinyint NOT NULL DEFAULT '0' COMMENT '好友状态: 1请求好友, 2已好友, 3拒绝好友, 4已删好友', - `is_top` tinyint NOT NULL DEFAULT '0' COMMENT '是否置顶, 0否, 1是', - `is_black` tinyint NOT NULL DEFAULT '0' COMMENT '是否为黑名单, 0否, 1是', - `is_delete` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除好友, 0否, 1是', - `notice_enable` tinyint NOT NULL DEFAULT '0' COMMENT '是否有消息提醒, 0否, 1是', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - PRIMARY KEY (`id`) USING BTREE, - UNIQUE KEY `idx_user_friend_id` (`user_id`,`friend_id`) USING BTREE, - KEY `idx_user_friend_status` (`user_id`, `friend_id`, `status`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '联系人ID', + `user_id` bigint unsigned NOT NULL COMMENT '用户ID', + `friend_id` bigint unsigned NOT NULL COMMENT '好友ID', + `group_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '好友分组ID:默认为0无分组', + `remark` varchar(32) NOT NULL DEFAULT '' COMMENT '好友备注', + `status` tinyint NOT NULL DEFAULT '0' COMMENT '好友状态: 1请求好友, 2已好友, 3拒绝好友, 4已删好友', + `is_top` tinyint NOT NULL DEFAULT '0' COMMENT '是否置顶, 0否, 1是', + `is_black` tinyint NOT NULL DEFAULT '0' COMMENT '是否为黑名单, 0否, 1是', + `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '是否删除好友, 0否, 1是', + `notice_enable` tinyint NOT NULL DEFAULT '0' COMMENT '是否有消息提醒, 0否, 1是', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `idx_contact_user_friend` (`user_id`,`friend_id`) USING BTREE, + KEY `idx_contact_user_friend_status` (`user_id`, `friend_id`, `status`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='联系人'; -- ---------------------------- @@ -298,14 +346,14 @@ CREATE TABLE `p_contact` ( -- ---------------------------- DROP TABLE IF EXISTS `p_contact_group`; CREATE TABLE `p_contact_group` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '联系人ID', - `user_id` int NOT NULL DEFAULT '0' COMMENT '用户id', - `name` varchar(32) NOT NULL DEFAULT '' COMMENT '分组名称', - `is_delete` tinyint NOT NULL DEFAULT '1' COMMENT '是否删除, 0否, 1是', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - PRIMARY KEY (`id`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '联系人ID', + `user_id` int NOT NULL DEFAULT '0' COMMENT '用户id', + `name` varchar(32) NOT NULL DEFAULT '' COMMENT '分组名称', + `is_del` tinyint NOT NULL DEFAULT '1' COMMENT '是否删除, 0否, 1是', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='联系人分组'; -- ---------------------------- @@ -313,19 +361,19 @@ CREATE TABLE `p_contact_group` ( -- ---------------------------- DROP TABLE IF EXISTS `p_wallet_recharge`; CREATE TABLE `p_wallet_recharge` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '充值ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `amount` bigint NOT NULL DEFAULT '0' COMMENT '充值金额', - `trade_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付宝订单号', - `trade_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '交易状态', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_user` (`user_id`) USING BTREE, - KEY `idx_trade_no` (`trade_no`) USING BTREE, - KEY `idx_trade_status` (`trade_status`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '充值ID', + `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `amount` bigint NOT NULL DEFAULT '0' COMMENT '充值金额', + `trade_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付宝订单号', + `trade_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '交易状态', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_wallet_recharge_user_id` (`user_id`) USING BTREE, + KEY `idx_wallet_recharge_trade_no` (`trade_no`) USING BTREE, + KEY `idx_wallet_recharge_trade_status` (`trade_status`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=10023 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='钱包流水'; -- ---------------------------- @@ -333,18 +381,18 @@ CREATE TABLE `p_wallet_recharge` ( -- ---------------------------- DROP TABLE IF EXISTS `p_wallet_statement`; CREATE TABLE `p_wallet_statement` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '账单ID', - `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', - `change_amount` bigint NOT NULL DEFAULT '0' COMMENT '变动金额', - `balance_snapshot` bigint NOT NULL DEFAULT '0' COMMENT '资金快照', - `reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '变动原因', - `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '关联动态', - `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', - `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', - `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', - `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', - PRIMARY KEY (`id`) USING BTREE, - KEY `idx_user` (`user_id`) USING BTREE + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '账单ID', + `user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID', + `change_amount` bigint NOT NULL DEFAULT '0' COMMENT '变动金额', + `balance_snapshot` bigint NOT NULL DEFAULT '0' COMMENT '资金快照', + `reason` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '变动原因', + `post_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '关联动态', + `created_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', + `modified_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '修改时间', + `deleted_on` bigint unsigned NOT NULL DEFAULT '0' COMMENT '删除时间', + `is_del` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 0 为未删除、1 为已删除', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_wallet_statement_user_id` (`user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=10010 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='钱包流水'; SET FOREIGN_KEY_CHECKS = 1; diff --git a/scripts/paopao-postgres.sql b/scripts/paopao-postgres.sql index 3ce95155..9cc7a14f 100644 --- a/scripts/paopao-postgres.sql +++ b/scripts/paopao-postgres.sql @@ -1 +1,327 @@ --- TODO: WIP +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = off; +SET check_function_bodies = false; +SET client_min_messages = warning; +SET escape_string_warning = off; + +DROP TABLE IF EXISTS p_attachment; +CREATE TABLE p_attachment ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL DEFAULT 0, + file_size BIGINT NOT NULL, + img_width BIGINT NOT NULL DEFAULT 0, + img_height BIGINT NOT NULL DEFAULT 0, + "type" SMALLINT NOT NULL DEFAULT 1, -- 1图片、2视频、3其他附件 + content VARCHAR(255) NOT NULL DEFAULT '', + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 -- 是否删除 0为未删除、1为已删除 +); +CREATE INDEX idx_attachment_user_id ON p_attachment USING btree (id); + +DROP TABLE IF EXISTS p_captcha; +CREATE TABLE p_captcha ( + id BIGSERIAL PRIMARY KEY, + phone VARCHAR(16), + captcha VARCHAR(16), + use_times INTEGER NOT NULL DEFAULT 0, + expired_on BIGINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 -- 是否删除 0为未删除、1为已删除' +); +CREATE INDEX idx_captcha_phone ON p_captcha USING btree (phone); +CREATE INDEX idx_captcha_expired_on ON p_captcha USING btree (expired_on); +CREATE INDEX idx_captcha_use_times ON p_captcha USING btree (use_times); + +DROP TABLE IF EXISTS p_comment; +CREATE TABLE p_comment ( + id BIGSERIAL PRIMARY KEY, + post_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + ip VARCHAR(64) NOT NULL DEFAULT '', + ip_loc VARCHAR(64) NOT NULL DEFAULT '', + thumbs_up_count int NOT NULL DEFAULT 0, -- 点赞数 + thumbs_down_count int NOT NULL DEFAULT 0, -- 点踩数 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_comment_post_id ON p_comment USING btree (post_id); +CREATE INDEX idx_comment_user_id ON p_comment USING btree (user_id); + +DROP TABLE IF EXISTS p_comment_content; +CREATE TABLE p_comment_content ( + id BIGSERIAL PRIMARY KEY, + comment_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + content TEXT NOT NULL DEFAULT '', + "type" SMALLINT NOT NULL DEFAULT 2, -- 类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址, + sort BIGINT NOT NULL DEFAULT 100, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_comment_content_comment_id ON p_comment_content USING btree (comment_id); +CREATE INDEX idx_comment_content_user_id ON p_comment_content USING btree (user_id); +CREATE INDEX idx_comment_content_type ON p_comment_content USING btree ("type"); +CREATE INDEX idx_comment_content_sort ON p_comment_content USING btree (sort); + +DROP TABLE IF EXISTS p_comment_reply; +CREATE TABLE p_comment_reply ( + id BIGSERIAL PRIMARY KEY, + comment_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + at_user_id BIGINT NOT NULL DEFAULT 0, + content TEXT NOT NULL DEFAULT '', + ip VARCHAR(64) NOT NULL DEFAULT '', + ip_loc VARCHAR(64) NOT NULL DEFAULT '', + thumbs_up_count int NOT NULL DEFAULT 0, -- 点赞数 + thumbs_down_count int NOT NULL DEFAULT 0, -- 点踩数 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_comment_reply_comment_id ON p_comment_reply USING btree (comment_id); + +DROP TABLE IF EXISTS p_tweet_comment_thumbs; +CREATE TABLE p_tweet_comment_thumbs ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL, + tweet_id BIGINT NOT NULL, + comment_id BIGINT NOT NULL, + reply_id BIGINT, + comment_type SMALLINT NOT NULL DEFAULT 0, -- 评论类型 0为推文评论、1为评论回复 + is_thumbs_up SMALLINT NOT NULL DEFAULT 0, -- 是否点赞 0 为否 1为是 + is_thumbs_down SMALLINT NOT NULL DEFAULT 0, -- 是否点踩 0 为否 1为是 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 -- 是否删除 0 为未删除、1 为已删除 +); +CREATE INDEX idx_tweet_comment_thumbs_uid_tid ON p_tweet_comment_thumbs USING btree (user_id, tweet_id); + +DROP TABLE IF EXISTS p_message; +CREATE TABLE p_message ( + id BIGSERIAL PRIMARY KEY, + sender_user_id BIGINT NOT NULL DEFAULT 0, + receiver_user_id BIGINT NOT NULL DEFAULT 0, + "type" SMALLINT NOT NULL DEFAULT 1, + brief VARCHAR(255) NOT NULL DEFAULT '', + content VARCHAR(255) NOT NULL DEFAULT '', + post_id BIGINT NOT NULL DEFAULT 0, + comment_id BIGINT NOT NULL DEFAULT 0, + reply_id BIGINT NOT NULL DEFAULT 0, + is_read SMALLINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_message_receiver_user_id ON p_message USING btree (receiver_user_id); +CREATE INDEX idx_message_is_read ON p_message USING btree (is_read); +CREATE INDEX idx_message_type ON p_message USING btree ("type"); + +CREATE SEQUENCE IF NOT EXISTS post_id_seq AS BIGINT MINVALUE 1080017989 NO MAXVALUE; +DROP TABLE IF EXISTS p_post; +CREATE TABLE p_post ( + id BIGINT NOT NULL DEFAULT nextval('post_id_seq'::regclass), + user_id BIGINT NOT NULL DEFAULT 0, + comment_count BIGINT NOT NULL DEFAULT 0, + collection_count BIGINT NOT NULL DEFAULT 0, + upvote_count BIGINT NOT NULL DEFAULT 0, + share_count BIGINT NOT NULL DEFAULT 0, + visibility SMALLINT NOT NULL DEFAULT 0, -- 可见性 0公开 1私密 2好友可见 + is_top SMALLINT NOT NULL DEFAULT 0, -- 是否置顶 + is_essence SMALLINT NOT NULL DEFAULT 0, -- 是否精华 + is_lock SMALLINT NOT NULL DEFAULT 0, -- 是否锁定 + latest_replied_on BIGINT NOT NULL DEFAULT 0, -- 最新回复时间 + tags VARCHAR(255) NOT NULL DEFAULT '', + attachment_price BIGINT NOT NULL DEFAULT 0, -- 附件价格(分) + ip VARCHAR(64) NOT NULL DEFAULT '', -- IP地址 + ip_loc VARCHAR(64) NOT NULL DEFAULT '', -- IP城市地址 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0, + PRIMARY KEY (id) +); +CREATE INDEX idx_post_user_id ON p_post USING btree (user_id); +CREATE INDEX idx_post_visibility ON p_post USING btree (visibility); + +DROP TABLE IF EXISTS p_post_attachment_bill; +CREATE TABLE p_post_attachment_bill ( + id BIGSERIAL PRIMARY KEY, + post_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + paid_amount BIGINT NOT NULL DEFAULT 0, -- 支付金额 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_post_attachment_bill_post_id ON p_post_attachment_bill USING btree (post_id); +CREATE INDEX idx_post_attachment_bill_user_id ON p_post_attachment_bill USING btree (user_id); + +DROP TABLE IF EXISTS p_post_collection; +CREATE TABLE p_post_collection ( + id BIGSERIAL PRIMARY KEY, + post_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_post_collection_post_id ON p_post_collection USING btree (post_id); +CREATE INDEX idx_post_collection_user_id ON p_post_collection USING btree (user_id); + +DROP TABLE IF EXISTS p_post_content; +CREATE TABLE p_post_content ( + id BIGSERIAL PRIMARY KEY, + post_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + content TEXT NOT NULL DEFAULT '', + "type" SMALLINT NOT NULL DEFAULT 2, -- 类型,1标题,2文字段落,3图片地址,4视频地址,5语音地址,6链接地址,7附件资源,8收费资源 + sort SMALLINT NOT NULL DEFAULT 100, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_post_content_post_id ON p_post_content USING btree (post_id); +CREATE INDEX idx_post_content_user_id ON p_post_content USING btree (user_id); + +DROP TABLE IF EXISTS p_post_star; +CREATE TABLE p_post_star ( + id BIGSERIAL PRIMARY KEY, + post_id BIGINT NOT NULL DEFAULT 0, + user_id BIGINT NOT NULL DEFAULT 0, + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_post_star_post_id ON p_post_star USING btree (post_id); +CREATE INDEX idx_post_star_user_id ON p_post_star USING btree (user_id); + +DROP TABLE IF EXISTS p_tag; +CREATE TABLE p_tag ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL DEFAULT 0, + tag VARCHAR(255) NOT NULL, + quote_num BIGINT NOT NULL DEFAULT 0, -- 引用数 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE UNIQUE INDEX idx_tag_tag ON p_tag USING btree (tag); +CREATE INDEX idx_tag_user_id ON p_tag USING btree (user_id); +CREATE INDEX idx_tag_quote_num ON p_tag USING btree (quote_num); + +DROP TABLE IF EXISTS p_topic_user; +CREATE TABLE p_topic_user ( + ID BIGSERIAL PRIMARY KEY, + topic_id BIGINT NOT NULL,-- 标签ID + user_id BIGINT NOT NULL,-- 创建者ID + alias_name VARCHAR ( 255 ),-- 别名 + remark VARCHAR ( 512 ),-- 备注 + quote_num BIGINT,-- 引用数 + is_top SMALLINT NOT NULL DEFAULT 0,-- 是否置顶 0 为未置顶、1 为已置顶 + created_on BIGINT NOT NULL DEFAULT 0,-- 创建时间 + modified_on BIGINT NOT NULL DEFAULT 0,-- 修改时间 + deleted_on BIGINT NOT NULL DEFAULT 0,-- 删除时间 + is_del SMALLINT NOT NULL DEFAULT 0,-- 是否删除 0 为未删除、1 为已删除 + reserve_a VARCHAR ( 255 ),-- 保留字段a + reserve_b VARCHAR ( 255 ) -- 保留字段b +); +CREATE UNIQUE INDEX idx_topic_user_uid_tid ON p_topic_user USING btree ( topic_id, user_id ); + +CREATE SEQUENCE IF NOT EXISTS user_id_seq AS BIGINT MINVALUE 100058 NO MAXVALUE; +DROP TABLE IF EXISTS p_user; +CREATE TABLE p_user ( + id BIGINT NOT NULL DEFAULT nextval('user_id_seq'::regclass), + nickname VARCHAR(32) NOT NULL DEFAULT '', + username VARCHAR(32) NOT NULL DEFAULT '', + phone VARCHAR(16) NOT NULL DEFAULT '', -- 手机号 + password VARCHAR(32) NOT NULL DEFAULT '', -- MD5密码 + salt VARCHAR(16) NOT NULL DEFAULT '', -- 盐值 + status SMALLINT NOT NULL DEFAULT 1, -- 状态,1正常,2停用 + avatar VARCHAR(255) NOT NULL DEFAULT '', + balance BIGINT NOT NULL, -- 用户余额(分) + is_admin BOOLEAN NOT NULL DEFAULT false, -- 是否管理员 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0, + PRIMARY KEY (id) +); +CREATE UNIQUE INDEX idx_user_username ON p_user USING btree (username); +CREATE INDEX idx_user_phone ON p_user USING btree (phone); + +DROP TABLE IF EXISTS p_contact; +CREATE TABLE p_contact ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL, + friend_id BIGINT NOT NULL, + group_id BIGINT NOT NULL DEFAULT 0, -- 好友分组ID:默认为0无分组 + remark VARCHAR(32) NOT NULL DEFAULT '', -- 好友备注 + status SMALLINT NOT NULL DEFAULT 0, -- 好友状态: 1请求好友, 2已好友, 3拒绝好友, 4已删好友 + is_top SMALLINT NOT NULL DEFAULT 0, -- 是否置顶, 0否, 1是 + is_black SMALLINT NOT NULL DEFAULT 0, -- 是否为黑名单, 0否, 1是 + is_del SMALLINT NOT NULL DEFAULT 0, -- 否删除好友, 0否, 1是 + notice_enable SMALLINT NOT NULL DEFAULT 0, -- 是否有消息提醒, 0否, 1是 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0 +); +CREATE UNIQUE INDEX idx_contact_user_friend ON p_contact USING btree (user_id,friend_id); +CREATE INDEX idx_contact_user_friend_status ON p_contact USING btree (user_id, friend_id, status); + +DROP TABLE IF EXISTS p_contact_group; +CREATE TABLE p_contact_group ( + id BIGSERIAL PRIMARY KEY, + user_id int NOT NULL DEFAULT 0, + name VARCHAR(32) NOT NULL DEFAULT '', -- 分组名称 + is_del SMALLINT NOT NULL DEFAULT 1, -- 是否删除, 0否, 1是 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0 +); + +DROP TABLE IF EXISTS p_wallet_recharge; +CREATE TABLE p_wallet_recharge ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL DEFAULT 0, + amount BIGINT NOT NULL DEFAULT 0, -- 充值金额 + trade_no VARCHAR(64) NOT NULL DEFAULT '', -- 支付宝订单号 + trade_status VARCHAR(32) NOT NULL DEFAULT '', -- 交易状态 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 -- 是否删除 0 为未删除、1 为已删除 +); +CREATE INDEX idx_wallet_recharge_user_id ON p_wallet_recharge USING btree (user_id); +CREATE INDEX idx_wallet_recharge_trade_no ON p_wallet_recharge USING btree (trade_no); +CREATE INDEX idx_wallet_recharge_trade_status ON p_wallet_recharge USING btree (trade_status); + +DROP TABLE IF EXISTS p_wallet_statement; +CREATE TABLE p_wallet_statement ( + id BIGSERIAL PRIMARY KEY, + user_id BIGINT NOT NULL DEFAULT 0, + change_amount BIGINT NOT NULL DEFAULT 0, -- 变动金额 + balance_snapshot BIGINT NOT NULL DEFAULT 0, -- 资金快照 + reason VARCHAR(255) NOT NULL, -- 变动原因 + post_id BIGINT NOT NULL DEFAULT 0, -- 关联动态 + created_on BIGINT NOT NULL DEFAULT 0, + modified_on BIGINT NOT NULL DEFAULT 0, + deleted_on BIGINT NOT NULL DEFAULT 0, + is_del SMALLINT NOT NULL DEFAULT 0 +); +CREATE INDEX idx_wallet_statement_user_id ON p_wallet_statement USING btree (user_id); diff --git a/scripts/paopao-sqlite3.sql b/scripts/paopao-sqlite3.sql index a82c4a34..51c427de 100644 --- a/scripts/paopao-sqlite3.sql +++ b/scripts/paopao-sqlite3.sql @@ -46,6 +46,8 @@ CREATE TABLE "p_comment" ( "user_id" integer NOT NULL, "ip" text(64) NOT NULL, "ip_loc" text(64) NOT NULL, + "thumbs_up_count" integer NOT NULL DEFAULT 0, -- 点赞数 + "thumbs_down_count" integer NOT NULL DEFAULT 0, -- 点踩数 "created_on" integer NOT NULL, "modified_on" integer NOT NULL, "deleted_on" integer NOT NULL, @@ -61,7 +63,7 @@ CREATE TABLE "p_comment_content" ( "id" integer NOT NULL, "comment_id" integer NOT NULL, "user_id" integer NOT NULL, - "content" text(255) NOT NULL, + "content" text NOT NULL, "type" integer NOT NULL, "sort" integer NOT NULL, "created_on" integer NOT NULL, @@ -80,9 +82,11 @@ CREATE TABLE "p_comment_reply" ( "comment_id" integer NOT NULL, "user_id" integer NOT NULL, "at_user_id" integer NOT NULL, - "content" text(255) NOT NULL, + "content" text NOT NULL, "ip" text(64) NOT NULL, "ip_loc" text(64) NOT NULL, + "thumbs_up_count" integer NOT NULL DEFAULT 0, -- 点赞数 + "thumbs_down_count" integer NOT NULL DEFAULT 0, -- 点踩数 "created_on" integer NOT NULL, "modified_on" integer NOT NULL, "deleted_on" integer NOT NULL, @@ -90,6 +94,25 @@ CREATE TABLE "p_comment_reply" ( PRIMARY KEY ("id") ); +-- ---------------------------- +-- Table structure for p_tweet_comment_thumbs +-- ---------------------------- +DROP TABLE IF EXISTS p_tweet_comment_thumbs; +CREATE TABLE "p_tweet_comment_thumbs" ( + "id" integer PRIMARY KEY, + "user_id" integer NOT NULL, + "tweet_id" integer NOT NULL, + "comment_id" integer NOT NULL, + "reply_id" integer, + "comment_type" integer NOT NULL DEFAULT 0, -- 评论类型 0为推文评论、1为评论回复 + "is_thumbs_up" integer NOT NULL DEFAULT 0, -- 是否点赞 0 为否 1为是 + "is_thumbs_down" integer NOT NULL DEFAULT 0, -- 是否点踩 0 为否 1为是 + "created_on" integer NOT NULL DEFAULT 0, + "modified_on" integer NOT NULL DEFAULT 0, + "deleted_on" integer NOT NULL DEFAULT 0, + "is_del" integer NOT NULL DEFAULT 0 -- 是否删除 0 为未删除、1 为已删除 +); + -- ---------------------------- -- Table structure for p_contact -- ---------------------------- @@ -101,10 +124,10 @@ CREATE TABLE "p_contact" ( "group_id" integer NOT NULL, "remark" text(32) NOT NULL, "status" integer NOT NULL, + "notice_enable" integer NOT NULL, "is_top" integer NOT NULL, "is_black" integer NOT NULL, - "is_delete" integer NOT NULL, - "notice_enable" integer NOT NULL, + "is_del" integer NOT NULL, "created_on" integer NOT NULL, "modified_on" integer NOT NULL, "deleted_on" integer NOT NULL, @@ -119,7 +142,7 @@ CREATE TABLE "p_contact_group" ( "id" integer NOT NULL, "user_id" integer NOT NULL, "name" text(32) NOT NULL, - "is_delete" integer NOT NULL, + "is_del" integer NOT NULL, "created_on" integer NOT NULL, "modified_on" integer NOT NULL, "deleted_on" integer NOT NULL, @@ -158,6 +181,7 @@ CREATE TABLE "p_post" ( "comment_count" integer NOT NULL, "collection_count" integer NOT NULL, "upvote_count" integer NOT NULL, + "share_count" integer NOT NULL, "is_top" integer NOT NULL, "is_essence" integer NOT NULL, "is_lock" integer NOT NULL, @@ -169,7 +193,8 @@ CREATE TABLE "p_post" ( "created_on" integer NOT NULL, "modified_on" integer NOT NULL, "deleted_on" integer NOT NULL, - "is_del" integer NOT NULL, `visibility` integer NOT NULL DEFAULT '0', + "is_del" integer NOT NULL, + "visibility" integer NOT NULL, PRIMARY KEY ("id") ); @@ -212,7 +237,7 @@ CREATE TABLE "p_post_content" ( "id" integer NOT NULL, "post_id" integer NOT NULL, "user_id" integer NOT NULL, - "content" text(2000) NOT NULL, + "content" text NOT NULL, "type" integer NOT NULL, "sort" integer NOT NULL, "created_on" integer NOT NULL, @@ -253,6 +278,27 @@ CREATE TABLE "p_tag" ( PRIMARY KEY ("id") ); +-- ---------------------------- +-- Table structure for p_topic_user +-- ---------------------------- +DROP TABLE IF EXISTS "p_topic_user"; +CREATE TABLE "p_topic_user" ( + "id" integer, + "topic_id" integer NOT NULL,-- 标签ID + "user_id" integer NOT NULL,-- 创建者ID + "alias_name" text ( 255 ),-- 别名 + "remark" text ( 512 ),-- 备注 + "quote_num" integer,-- 引用数 + "is_top" integer NOT NULL DEFAULT 0,-- 是否置顶 0 为未置顶、1 为已置顶 + "created_on" integer NOT NULL DEFAULT 0,-- 创建时间 + "modified_on" integer NOT NULL DEFAULT 0,-- 修改时间 + "deleted_on" integer NOT NULL DEFAULT 0,-- 删除时间 + "is_del" integer NOT NULL DEFAULT 0,-- 是否删除 0 为未删除、1 为已删除 + "reserve_a" text,-- 保留字段a + "reserve_b" text,-- 保留字段b + PRIMARY KEY ( "id" ) +); + -- ---------------------------- -- Table structure for p_user -- ---------------------------- @@ -313,7 +359,7 @@ CREATE TABLE "p_wallet_statement" ( -- ---------------------------- -- Indexes structure for table p_attachment -- ---------------------------- -CREATE INDEX "main"."idx_user" +CREATE INDEX "idx_attachment_user_id" ON "p_attachment" ( "user_id" ASC ); @@ -321,15 +367,15 @@ ON "p_attachment" ( -- ---------------------------- -- Indexes structure for table p_captcha -- ---------------------------- -CREATE INDEX "main"."idx_expired_on" +CREATE INDEX "idx_captcha_expired_on" ON "p_captcha" ( "expired_on" ASC ); -CREATE INDEX "main"."idx_phone" +CREATE INDEX "idx_captcha_phone" ON "p_captcha" ( "phone" ASC ); -CREATE INDEX "main"."idx_use_times" +CREATE INDEX "idx_captcha_use_times" ON "p_captcha" ( "use_times" ASC ); @@ -337,32 +383,202 @@ ON "p_captcha" ( -- ---------------------------- -- Indexes structure for table p_comment -- ---------------------------- -CREATE INDEX "main"."idx_post" +CREATE INDEX "idx_comment_post_id" ON "p_comment" ( "post_id" ASC ); +CREATE INDEX "idx_comment_user_id" +ON "p_comment" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_comment_content +-- ---------------------------- +CREATE INDEX "idx_comment_content_comment_id" +ON "p_comment_content" ( + "comment_id" ASC +); +CREATE INDEX "idx_comment_content_sort" +ON "p_comment_content" ( + "sort" ASC +); +CREATE INDEX "idx_comment_content_type" +ON "p_comment_content" ( + "type" ASC +); +CREATE INDEX "idx_comment_content_user_id" +ON "p_comment_content" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_comment_reply +-- ---------------------------- +CREATE INDEX "idx_comment_reply_comment_id" +ON "p_comment_reply" ( + "comment_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table idx_tweet_comment_thumbs_uid_tid +-- ---------------------------- +CREATE INDEX "idx_tweet_comment_thumbs_uid_tid" +ON "p_tweet_comment_thumbs"( + "user_id" ASC, + "tweet_id" ASC +); -- ---------------------------- -- Indexes structure for table p_contact -- ---------------------------- -CREATE UNIQUE INDEX "main"."idx_user_friend_id" +CREATE UNIQUE INDEX "idx_contact_user_friend" ON "p_contact" ( "user_id" ASC, "friend_id" ASC ); -CREATE INDEX "main"."idx_user_friend_status" +CREATE INDEX "idx_contact_user_friend_status" ON "p_contact" ( "user_id" ASC, "friend_id" ASC, "status" ASC ); +-- ---------------------------- +-- Indexes structure for table p_message +-- ---------------------------- +CREATE INDEX "idx_message_is_read" +ON "p_message" ( + "is_read" ASC +); +CREATE INDEX "idx_message_receiver_user_id" +ON "p_message" ( + "receiver_user_id" ASC +); +CREATE INDEX "idx_message_type" +ON "p_message" ( + "type" ASC +); + -- ---------------------------- -- Indexes structure for table p_post -- ---------------------------- -CREATE INDEX "main"."idx_visibility" +CREATE INDEX "idx_post_user_id" +ON "p_post" ( + "user_id" ASC +); +CREATE INDEX "idx_post_visibility" ON "p_post" ( "visibility" ASC ); +-- ---------------------------- +-- Indexes structure for table p_post_attachment_bill +-- ---------------------------- +CREATE INDEX "idx_post_attachment_bill_post_id" +ON "p_post_attachment_bill" ( + "post_id" ASC +); +CREATE INDEX "idx_post_attachment_bill_user_id" +ON "p_post_attachment_bill" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_post_collection +-- ---------------------------- +CREATE INDEX "idx_post_collection_post_id" +ON "p_post_collection" ( + "post_id" ASC +); +CREATE INDEX "idx_post_collection_user_id" +ON "p_post_collection" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_post_content +-- ---------------------------- +CREATE INDEX "idx_post_content_post_id" +ON "p_post_content" ( + "post_id" ASC +); +CREATE INDEX "idx_post_content_user_id" +ON "p_post_content" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_post_star +-- ---------------------------- +CREATE INDEX "idx_post_star_post_id" +ON "p_post_star" ( + "post_id" ASC +); +CREATE INDEX "idx_post_star_user_id" +ON "p_post_star" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_tag +-- ---------------------------- +CREATE UNIQUE INDEX "idx_tag" +ON "p_tag" ( + "tag" ASC +); +CREATE INDEX "idx_tag_quote_num" +ON "p_tag" ( + "quote_num" ASC +); +CREATE INDEX "idx_tag_user_id" +ON "p_tag" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_topic_user +-- ---------------------------- +CREATE UNIQUE INDEX "idx_topic_user_uid_tid" +ON "p_topic_user" ( + "topic_id", + "user_id" +); + +-- ---------------------------- +-- Indexes structure for table p_user +-- ---------------------------- +CREATE INDEX "idx_user_phone" +ON "p_user" ( + "phone" ASC +); +CREATE UNIQUE INDEX "idx_user_username" +ON "p_user" ( + "username" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_wallet_recharge +-- ---------------------------- +CREATE INDEX "idx_wallet_recharge_trade_no" +ON "p_wallet_recharge" ( + "trade_no" ASC +); +CREATE INDEX "idx_wallet_recharge_trade_status" +ON "p_wallet_recharge" ( + "trade_status" ASC +); +CREATE INDEX "idx_wallet_recharge_user_id" +ON "p_wallet_recharge" ( + "user_id" ASC +); + +-- ---------------------------- +-- Indexes structure for table p_wallet_statement +-- ---------------------------- +CREATE INDEX "idx_wallet_statement_user_id" +ON "p_wallet_statement" ( + "user_id" ASC +); + PRAGMA foreign_keys = true; diff --git a/web/.env b/web/.env index 6d3d734c..720afc11 100644 --- a/web/.env +++ b/web/.env @@ -9,16 +9,23 @@ VITE_ALLOW_TWEET_ATTACHMENT=true VITE_ALLOW_TWEET_ATTACHMENT_PRICE=false VITE_ALLOW_TWEET_VIDEO=true VITE_ALLOW_TWEET_VISIBILITY=true +VITE_ALLOW_USER_REGISTER=true VITE_ALLOW_ACTIVATION=false VITE_ALLOW_PHONE_BIND=true # 局部参数 -VITE_DEFAULT_TWEET_VISIBILITY=friend -VITE_COPYRIGHT_TOP="2022 paopao.info" +VITE_DEFAULT_MSG_LOOP_INTERVAL=5000 # 拉取未读消息的间隔,单位:毫秒, 默认5000ms +VITE_DEFAULT_TWEET_VISIBILITY=friend # 推文可见性,默认好友可见 +VITE_DEFAULT_TWEET_MAX_LENGTH=400 # 推文最大长度, 默认400字 +VITE_DEFAULT_COMMENT_MAX_LENGTH=300 # 评论最大长度, 默认300字 +VITE_DEFAULT_REPLY_MAX_LENGTH=300 # 评论最大长度, 默认300字 +VITE_RIGHT_FOLLOW_TOPIC_MAX_SIZE=6 # 右侧关注话题最大条目数, 默认6条 +VITE_RIGHT_HOT_TOPIC_MAX_SIZE=12 # 右侧热门话题最大条目数, 默认12条 +VITE_COPYRIGHT_TOP="2023 paopao.info" VITE_COPYRIGHT_LEFT="Roc's Me" VITE_COPYRIGHT_LEFT_LINK="" VITE_COPYRIGHT_RIGHT="泡泡(PaoPao)开源社区" -VITE_COPYRIGHT_RIGHT_LINK="https://paopao.info" +VITE_COPYRIGHT_RIGHT_LINK="https://www.paopao.info" # 图片推文参数 VITE_DEFAULT_TWEET_IMAGE_404="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png" diff --git a/web/.gitignore b/web/.gitignore index 97679738..37fd5405 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -26,3 +26,4 @@ dist-ssr yarn.lock package-lock.json components.d.ts +/stats.html diff --git a/web/dist/assets/404-020b2afd.css b/web/dist/assets/404-020b2afd.css new file mode 100644 index 00000000..6395cfa0 --- /dev/null +++ b/web/dist/assets/404-020b2afd.css @@ -0,0 +1 @@ +.wrap404[data-v-e62daa85]{min-height:500px;display:flex;align-items:center;justify-content:center}.dark .main-content-wra[data-v-e62daa85]{background-color:#101014bf} diff --git a/web/dist/assets/404-c808adcf.js b/web/dist/assets/404-c808adcf.js new file mode 100644 index 00000000..84f58de0 --- /dev/null +++ b/web/dist/assets/404-c808adcf.js @@ -0,0 +1 @@ +import{_ as s}from"./main-nav.vue_vue_type_style_index_0_lang-be35896a.js";import{u as a}from"./vue-router-b8e3382f.js";import{F as i,e as c,a2 as u}from"./naive-ui-62663ad7.js";import{d as l,c as d,V as t,a1 as o,o as f,e as x}from"./@vue-e0e89260.js";import{_ as g}from"./index-347d1d96.js";import"./vuex-473b3783.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-8f91201d.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const v=l({__name:"404",setup(h){const e=a(),_=()=>{e.push({path:"/"})};return(k,w)=>{const n=s,p=c,r=u,m=i;return f(),d("div",null,[t(n,{title:"404"}),t(m,{class:"main-content-wrap wrap404",bordered:""},{default:o(()=>[t(r,{status:"404",title:"404 资源不存在",description:"再看看其他的吧"},{footer:o(()=>[t(p,{onClick:_},{default:o(()=>[x("回主页")]),_:1})]),_:1})]),_:1})])}}});const M=g(v,[["__scopeId","data-v-e62daa85"]]);export{M as default}; diff --git a/web/dist/assets/404.9c166a4c.css b/web/dist/assets/404.9c166a4c.css deleted file mode 100644 index bf6eac15..00000000 --- a/web/dist/assets/404.9c166a4c.css +++ /dev/null @@ -1 +0,0 @@ -.wrap404[data-v-4c5da4ba]{min-height:500px;display:flex;align-items:center;justify-content:center} diff --git a/web/dist/assets/404.dfeb5539.js b/web/dist/assets/404.dfeb5539.js deleted file mode 100644 index d94075b8..00000000 --- a/web/dist/assets/404.dfeb5539.js +++ /dev/null @@ -1,32 +0,0 @@ -import{_ as F}from"./main-nav.3167f221.js";import{h as e,c as u,f as p,d as m,u as E,x as h,cP as S,y as _,z as d,A as V,N as D,bI as M,bF as I,bH as R,bG as $,ai as L,Y as P,a4 as f,a5 as v,W as T,a9 as H,al as N,K as j}from"./index.d4f5aad2.js";import{_ as k}from"./List.a66e9ae7.js";var O=e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},e("circle",{fill:"#FFCB4C",cx:"18",cy:"17.018",r:"17"}),e("path",{fill:"#65471B",d:"M14.524 21.036c-.145-.116-.258-.274-.312-.464-.134-.46.13-.918.59-1.021 4.528-1.021 7.577 1.363 7.706 1.465.384.306.459.845.173 1.205-.286.358-.828.401-1.211.097-.11-.084-2.523-1.923-6.182-1.098-.274.061-.554-.016-.764-.184z"}),e("ellipse",{fill:"#65471B",cx:"13.119",cy:"11.174",rx:"2.125",ry:"2.656"}),e("ellipse",{fill:"#65471B",cx:"24.375",cy:"12.236",rx:"2.125",ry:"2.656"}),e("path",{fill:"#F19020",d:"M17.276 35.149s1.265-.411 1.429-1.352c.173-.972-.624-1.167-.624-1.167s1.041-.208 1.172-1.376c.123-1.101-.861-1.363-.861-1.363s.97-.4 1.016-1.539c.038-.959-.995-1.428-.995-1.428s5.038-1.221 5.556-1.341c.516-.12 1.32-.615 1.069-1.694-.249-1.08-1.204-1.118-1.697-1.003-.494.115-6.744 1.566-8.9 2.068l-1.439.334c-.54.127-.785-.11-.404-.512.508-.536.833-1.129.946-2.113.119-1.035-.232-2.313-.433-2.809-.374-.921-1.005-1.649-1.734-1.899-1.137-.39-1.945.321-1.542 1.561.604 1.854.208 3.375-.833 4.293-2.449 2.157-3.588 3.695-2.83 6.973.828 3.575 4.377 5.876 7.952 5.048l3.152-.681z"}),e("path",{fill:"#65471B",d:"M9.296 6.351c-.164-.088-.303-.224-.391-.399-.216-.428-.04-.927.393-1.112 4.266-1.831 7.699-.043 7.843.034.433.231.608.747.391 1.154-.216.405-.74.546-1.173.318-.123-.063-2.832-1.432-6.278.047-.257.109-.547.085-.785-.042zm12.135 3.75c-.156-.098-.286-.243-.362-.424-.187-.442.023-.927.468-1.084 4.381-1.536 7.685.48 7.823.567.415.26.555.787.312 1.178-.242.39-.776.495-1.191.238-.12-.072-2.727-1.621-6.267-.379-.266.091-.553.046-.783-.096z"})),W=e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},e("path",{fill:"#FFCC4D",d:"M36 18c0 9.941-8.059 18-18 18-9.94 0-18-8.059-18-18C0 8.06 8.06 0 18 0c9.941 0 18 8.06 18 18"}),e("ellipse",{fill:"#664500",cx:"18",cy:"27",rx:"5",ry:"6"}),e("path",{fill:"#664500",d:"M5.999 11c-.208 0-.419-.065-.599-.2-.442-.331-.531-.958-.2-1.4C8.462 5.05 12.816 5 13 5c.552 0 1 .448 1 1 0 .551-.445.998-.996 1-.155.002-3.568.086-6.204 3.6-.196.262-.497.4-.801.4zm24.002 0c-.305 0-.604-.138-.801-.4-2.64-3.521-6.061-3.598-6.206-3.6-.55-.006-.994-.456-.991-1.005C22.006 5.444 22.45 5 23 5c.184 0 4.537.05 7.8 4.4.332.442.242 1.069-.2 1.4-.18.135-.39.2-.599.2zm-16.087 4.5l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L12.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L13.914 15.5zm11 0l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L23.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L24.914 15.5z"})),A=e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},e("ellipse",{fill:"#292F33",cx:"18",cy:"26",rx:"18",ry:"10"}),e("ellipse",{fill:"#66757F",cx:"18",cy:"24",rx:"18",ry:"10"}),e("path",{fill:"#E1E8ED",d:"M18 31C3.042 31 1 16 1 12h34c0 2-1.958 19-17 19z"}),e("path",{fill:"#77B255",d:"M35 12.056c0 5.216-7.611 9.444-17 9.444S1 17.271 1 12.056C1 6.84 8.611 3.611 18 3.611s17 3.229 17 8.445z"}),e("ellipse",{fill:"#A6D388",cx:"18",cy:"13",rx:"15",ry:"7"}),e("path",{d:"M21 17c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.739-1.109.9-2.246.478-3.377-.461-1.236-1.438-1.996-1.731-2.077-.553 0-.958-.443-.958-.996 0-.552.491-.995 1.043-.995.997 0 2.395 1.153 3.183 2.625 1.034 1.933.91 4.039-.351 5.929-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.196-.451.294-.707.294zm-6-2c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.727-1.091.893-2.083.494-2.947-.444-.961-1.431-1.469-1.684-1.499-.552 0-.989-.447-.989-1 0-.552.458-1 1.011-1 .997 0 2.585.974 3.36 2.423.481.899 1.052 2.761-.528 5.131-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.197-.451.295-.707.295z",fill:"#5C913B"})),K=e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},e("path",{fill:"#EF9645",d:"M15.5 2.965c1.381 0 2.5 1.119 2.5 2.5v.005L20.5.465c1.381 0 2.5 1.119 2.5 2.5V4.25l2.5-1.535c1.381 0 2.5 1.119 2.5 2.5V8.75L29 18H15.458L15.5 2.965z"}),e("path",{fill:"#FFDC5D",d:"M4.625 16.219c1.381-.611 3.354.208 4.75 2.188.917 1.3 1.187 3.151 2.391 3.344.46.073 1.234-.313 1.234-1.397V4.5s0-2 2-2 2 2 2 2v11.633c0-.029 1-.064 1-.082V2s0-2 2-2 2 2 2 2v14.053c0 .017 1 .041 1 .069V4.25s0-2 2-2 2 2 2 2v12.638c0 .118 1 .251 1 .398V8.75s0-2 2-2 2 2 2 2V24c0 6.627-5.373 12-12 12-4.775 0-8.06-2.598-9.896-5.292C8.547 28.423 8.096 26.051 8 25.334c0 0-.123-1.479-1.156-2.865-1.469-1.969-2.5-3.156-3.125-3.866-.317-.359-.625-1.707.906-2.384z"})),G=u("result",` - color: var(--n-text-color); - line-height: var(--n-line-height); - font-size: var(--n-font-size); - transition: - color .3s var(--n-bezier); -`,[u("result-icon",` - display: flex; - justify-content: center; - transition: color .3s var(--n-bezier); - `,[p("status-image",` - font-size: var(--n-icon-size); - width: 1em; - height: 1em; - `),u("base-icon",` - color: var(--n-icon-color); - font-size: var(--n-icon-size); - `)]),u("result-content",{marginTop:"24px"}),u("result-footer",` - margin-top: 24px; - text-align: center; - `),u("result-header",[p("title",` - margin-top: 16px; - font-weight: var(--n-title-font-weight); - transition: color .3s var(--n-bezier); - text-align: center; - color: var(--n-title-text-color); - font-size: var(--n-title-font-size); - `),p("description",` - margin-top: 4px; - text-align: center; - font-size: var(--n-font-size); - `)])]);const Y={403:K,404:O,418:A,500:W,info:e(M,null),success:e(I,null),warning:e(R,null),error:e($,null)},q=Object.assign(Object.assign({},h.props),{size:{type:String,default:"medium"},status:{type:String,default:"info"},title:String,description:String});var J=m({name:"Result",props:q,setup(n){const{mergedClsPrefixRef:r,inlineThemeDisabled:t}=E(n),s=h("Result","-result",G,S,n,r),o=_(()=>{const{size:l,status:a}=n,{common:{cubicBezierEaseInOut:c},self:{textColor:g,lineHeight:x,titleTextColor:z,titleFontWeight:w,[d("iconColor",a)]:C,[d("fontSize",l)]:y,[d("titleFontSize",l)]:B,[d("iconSize",l)]:b}}=s.value;return{"--n-bezier":c,"--n-font-size":y,"--n-icon-size":b,"--n-line-height":x,"--n-text-color":g,"--n-title-font-size":B,"--n-title-font-weight":w,"--n-title-text-color":z,"--n-icon-color":C||""}}),i=t?V("result",_(()=>{const{size:l,status:a}=n;let c="";return l&&(c+=l[0]),a&&(c+=a[0]),c}),o,n):void 0;return{mergedClsPrefix:r,cssVars:t?void 0:o,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var n;const{status:r,$slots:t,mergedClsPrefix:s,onRender:o}=this;return o==null||o(),e("div",{class:[`${s}-result`,this.themeClass],style:this.cssVars},e("div",{class:`${s}-result-icon`},((n=t.icon)===null||n===void 0?void 0:n.call(t))||e(D,{clsPrefix:s},{default:()=>Y[r]})),e("div",{class:`${s}-result-header`},this.title?e("div",{class:`${s}-result-header__title`},this.title):null,this.description?e("div",{class:`${s}-result-header__description`},this.description):null),t.default&&e("div",{class:`${s}-result-content`},t),t.footer&&e("div",{class:`${s}-result-footer`},t.footer()))}});const Q=m({__name:"404",setup(n){const r=N(),t=()=>{r.push({path:"/"})};return(s,o)=>{const i=F,l=j,a=J,c=k;return T(),P("div",null,[f(i,{title:"404"}),f(c,{class:"main-content-wrap wrap404",bordered:""},{default:v(()=>[f(a,{status:"404",title:"404 \u8D44\u6E90\u4E0D\u5B58\u5728",description:"\u518D\u770B\u770B\u5176\u4ED6\u7684\u5427"},{footer:v(()=>[f(l,{onClick:t},{default:v(()=>[H("\u56DE\u4E3B\u9875")]),_:1})]),_:1})]),_:1})])}}});var e1=L(Q,[["__scopeId","data-v-4c5da4ba"]]);export{e1 as default}; diff --git a/web/dist/assets/@css-render-580d83ec.js b/web/dist/assets/@css-render-580d83ec.js new file mode 100644 index 00000000..049d462d --- /dev/null +++ b/web/dist/assets/@css-render-580d83ec.js @@ -0,0 +1,3 @@ +import{i as d}from"./@vue-e0e89260.js";function C(i){let r=".",s="__",m="--",f;if(i){let e=i.blockPrefix;e&&(r=e),e=i.elementPrefix,e&&(s=e),e=i.modifierPrefix,e&&(m=e)}const b={install(e){f=e.c;const l=e.context;l.bem={},l.bem.b=null,l.bem.els=null}};function y(e){let l,n;return{before(t){l=t.bem.b,n=t.bem.els,t.bem.els=null},after(t){t.bem.b=l,t.bem.els=n},$({context:t,props:u}){return e=typeof e=="string"?e:e({context:t,props:u}),t.bem.b=e,`${(u==null?void 0:u.bPrefix)||r}${t.bem.b}`}}}function v(e){let l;return{before(n){l=n.bem.els},after(n){n.bem.els=l},$({context:n,props:t}){return e=typeof e=="string"?e:e({context:n,props:t}),n.bem.els=e.split(",").map(u=>u.trim()),n.bem.els.map(u=>`${(t==null?void 0:t.bPrefix)||r}${n.bem.b}${s}${u}`).join(", ")}}}function P(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=e.split(",").map(o=>o.trim());function u(o){return t.map(x=>`&${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${o!==void 0?`${s}${o}`:""}${m}${x}`).join(", ")}const c=l.bem.els;return c!==null?u(c[0]):u()}}}function _(e){return{$({context:l,props:n}){e=typeof e=="string"?e:e({context:l,props:n});const t=l.bem.els;return`&:not(${(n==null?void 0:n.bPrefix)||r}${l.bem.b}${t!==null&&t.length>0?`${s}${t[0]}`:""}${m}${e})`}}}return Object.assign(b,{cB:(...e)=>f(y(e[0]),e[1],e[2]),cE:(...e)=>f(v(e[0]),e[1],e[2]),cM:(...e)=>f(P(e[0]),e[1],e[2]),cNotM:(...e)=>f(_(e[0]),e[1],e[2])}),b}const $=Symbol("@css-render/vue3-ssr");function M(i,r){return``}function S(i,r){const s=d($,null);if(s===null){console.error("[css-render/vue3-ssr]: no ssr context found.");return}const{styles:m,ids:f}=s;f.has(i)||m!==null&&(f.add(i),m.push(M(i,r)))}const j=typeof document<"u";function N(){if(j)return;const i=d($,null);if(i!==null)return{adapter:S,context:i}}export{C as p,N as u}; diff --git a/web/dist/assets/@emotion-8a8e73f6.js b/web/dist/assets/@emotion-8a8e73f6.js new file mode 100644 index 00000000..dd329898 --- /dev/null +++ b/web/dist/assets/@emotion-8a8e73f6.js @@ -0,0 +1 @@ +function d(e){for(var f=0,x,a=0,c=e.length;c>=4;++a,c-=4)x=e.charCodeAt(a)&255|(e.charCodeAt(++a)&255)<<8|(e.charCodeAt(++a)&255)<<16|(e.charCodeAt(++a)&255)<<24,x=(x&65535)*1540483477+((x>>>16)*59797<<16),x^=x>>>24,f=(x&65535)*1540483477+((x>>>16)*59797<<16)^(f&65535)*1540483477+((f>>>16)*59797<<16);switch(c){case 3:f^=(e.charCodeAt(a+2)&255)<<16;case 2:f^=(e.charCodeAt(a+1)&255)<<8;case 1:f^=e.charCodeAt(a)&255,f=(f&65535)*1540483477+((f>>>16)*59797<<16)}return f^=f>>>13,f=(f&65535)*1540483477+((f>>>16)*59797<<16),((f^f>>>15)>>>0).toString(36)}export{d as m}; diff --git a/web/dist/assets/@juggle-41516555.js b/web/dist/assets/@juggle-41516555.js new file mode 100644 index 00000000..61bd4dcb --- /dev/null +++ b/web/dist/assets/@juggle-41516555.js @@ -0,0 +1 @@ +var c=[],ne=function(){return c.some(function(e){return e.activeTargets.length>0})},oe=function(){return c.some(function(e){return e.skippedTargets.length>0})},P="ResizeObserver loop completed with undelivered notifications.",se=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:P}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=P),window.dispatchEvent(e)},b;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(b||(b={}));var u=function(e){return Object.freeze(e)},ae=function(){function e(t,r){this.inlineSize=t,this.blockSize=r,u(this)}return e}(),q=function(){function e(t,r,i,n){return this.x=t,this.y=r,this.width=i,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,u(this)}return e.prototype.toJSON=function(){var t=this,r=t.x,i=t.y,n=t.top,s=t.right,o=t.bottom,h=t.left,d=t.width,v=t.height;return{x:r,y:i,top:n,right:s,bottom:o,left:h,width:d,height:v}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),C=function(e){return e instanceof SVGElement&&"getBBox"in e},G=function(e){if(C(e)){var t=e.getBBox(),r=t.width,i=t.height;return!r&&!i}var n=e,s=n.offsetWidth,o=n.offsetHeight;return!(s||o||e.getClientRects().length)},I=function(e){var t;if(e instanceof Element)return!0;var r=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},ve=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},p=typeof window<"u"?window:{},z=new WeakMap,_=/auto|scroll/,ce=/^tb|vertical/,ue=/msie|trident/i.test(p.navigator&&p.navigator.userAgent),a=function(e){return parseFloat(e||"0")},f=function(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=!1),new ae((r?t:e)||0,(r?e:t)||0)},W=u({devicePixelContentBoxSize:f(),borderBoxSize:f(),contentBoxSize:f(),contentRect:new q(0,0,0,0)}),J=function(e,t){if(t===void 0&&(t=!1),z.has(e)&&!t)return z.get(e);if(G(e))return z.set(e,W),W;var r=getComputedStyle(e),i=C(e)&&e.ownerSVGElement&&e.getBBox(),n=!ue&&r.boxSizing==="border-box",s=ce.test(r.writingMode||""),o=!i&&_.test(r.overflowY||""),h=!i&&_.test(r.overflowX||""),d=i?0:a(r.paddingTop),v=i?0:a(r.paddingRight),R=i?0:a(r.paddingBottom),l=i?0:a(r.paddingLeft),Q=i?0:a(r.borderTopWidth),Z=i?0:a(r.borderRightWidth),$=i?0:a(r.borderBottomWidth),j=i?0:a(r.borderLeftWidth),D=l+v,k=d+R,y=j+Z,T=Q+$,N=h?e.offsetHeight-T-e.clientHeight:0,A=o?e.offsetWidth-y-e.clientWidth:0,ee=n?D+y:0,te=n?k+T:0,g=i?i.width:a(r.width)-ee-A,x=i?i.height:a(r.height)-te-N,re=g+D+A+y,ie=x+k+N+T,M=u({devicePixelContentBoxSize:f(Math.round(g*devicePixelRatio),Math.round(x*devicePixelRatio),s),borderBoxSize:f(re,ie,s),contentBoxSize:f(g,x,s),contentRect:new q(l,d,g,x)});return z.set(e,M),M},U=function(e,t,r){var i=J(e,r),n=i.borderBoxSize,s=i.contentBoxSize,o=i.devicePixelContentBoxSize;switch(t){case b.DEVICE_PIXEL_CONTENT_BOX:return o;case b.BORDER_BOX:return n;default:return s}},he=function(){function e(t){var r=J(t);this.target=t,this.contentRect=r.contentRect,this.borderBoxSize=u([r.borderBoxSize]),this.contentBoxSize=u([r.contentBoxSize]),this.devicePixelContentBoxSize=u([r.devicePixelContentBoxSize])}return e}(),Y=function(e){if(G(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},de=function(){var e=1/0,t=[];c.forEach(function(o){if(o.activeTargets.length!==0){var h=[];o.activeTargets.forEach(function(v){var R=new he(v.target),l=Y(v.target);h.push(R),v.lastReportedSize=U(v.target,v.observedBox),le?r.activeTargets.push(n):r.skippedTargets.push(n))})})},fe=function(){var e=0;for(L(e);ne();)e=de(),L(e);return oe()&&se(),e>0},m,K=[],le=function(){return K.splice(0).forEach(function(e){return e()})},pe=function(e){if(!m){var t=0,r=document.createTextNode(""),i={characterData:!0};new MutationObserver(function(){return le()}).observe(r,i),m=function(){r.textContent="".concat(t?t--:t++)}}K.push(e),m()},be=function(e){pe(function(){requestAnimationFrame(e)})},w=0,ge=function(){return!!w},xe=250,ze={attributes:!0,characterData:!0,childList:!0,subtree:!0},F=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],H=function(e){return e===void 0&&(e=0),Date.now()+e},B=!1,Ee=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var r=this;if(t===void 0&&(t=xe),!B){B=!0;var i=H(t);be(function(){var n=!1;try{n=fe()}finally{if(B=!1,t=i-H(),!ge())return;n?r.run(1e3):t>0?r.run(t):r.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,r=function(){return t.observer&&t.observer.observe(document.body,ze)};document.body?r():p.addEventListener("DOMContentLoaded",r)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),F.forEach(function(r){return p.addEventListener(r,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),F.forEach(function(r){return p.removeEventListener(r,t.listener,!0)}),this.stopped=!0)},e}(),S=new Ee,V=function(e){!w&&e>0&&S.start(),w+=e,!w&&S.stop()},Oe=function(e){return!C(e)&&!ve(e)&&getComputedStyle(e).display==="inline"},we=function(){function e(t,r){this.target=t,this.observedBox=r||b.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=U(this.target,this.observedBox,!0);return Oe(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Re=function(){function e(t,r){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=r}return e}(),E=new WeakMap,X=function(e,t){for(var r=0;r=0&&(s&&c.splice(c.indexOf(i),1),i.observationTargets.splice(n,1),V(-1))},e.disconnect=function(t){var r=this,i=E.get(t);i.observationTargets.slice().forEach(function(n){return r.unobserve(t,n.target)}),i.activeTargets.splice(0,i.activeTargets.length)},e}(),ye=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");O.connect(this,t)}return e.prototype.observe=function(t,r){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!I(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");O.observe(this,t,r)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!I(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");O.unobserve(this,t)},e.prototype.disconnect=function(){O.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();export{ye as R}; diff --git a/web/dist/assets/@vicons-8f91201d.js b/web/dist/assets/@vicons-8f91201d.js new file mode 100644 index 00000000..a940d6e2 --- /dev/null +++ b/web/dist/assets/@vicons-8f91201d.js @@ -0,0 +1 @@ +import{d as n,o,c as e,a as t,b as i}from"./@vue-e0e89260.js";const c={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},h=t("path",{d:"M216.08 192v143.85a40.08 40.08 0 0 0 80.15 0l.13-188.55a67.94 67.94 0 1 0-135.87 0v189.82a95.51 95.51 0 1 0 191 0V159.74",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),d=[h],Ko=n({name:"AttachOutline",render:function(s,l){return o(),e("svg",c,d)}}),a={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},w=t("path",{d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16z",fill:"currentColor"},null,-1),u=[w],Wo=n({name:"Bookmark",render:function(s,l){return o(),e("svg",a,u)}}),_={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},k=t("path",{d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),p=[k],Qo=n({name:"BookmarkOutline",render:function(s,l){return o(),e("svg",_,p)}}),x={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},m=t("path",{d:"M128 80V64a48.14 48.14 0 0 1 48-48h224a48.14 48.14 0 0 1 48 48v368l-80-64",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),g=t("path",{d:"M320 96H112a48.14 48.14 0 0 0-48 48v352l152-128l152 128V144a48.14 48.14 0 0 0-48-48z",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),v=[m,g],Xo=n({name:"BookmarksOutline",render:function(s,l){return o(),e("svg",x,v)}}),$={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},f=t("path",{d:"M408 64H104a56.16 56.16 0 0 0-56 56v192a56.16 56.16 0 0 0 56 56h40v80l93.72-78.14a8 8 0 0 1 5.13-1.86H408a56.16 56.16 0 0 0 56-56V120a56.16 56.16 0 0 0-56-56z",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),C=[f],Yo=n({name:"ChatboxOutline",render:function(s,l){return o(),e("svg",$,C)}}),M={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},O=t("path",{d:"M431 320.6c-1-3.6 1.2-8.6 3.3-12.2a33.68 33.68 0 0 1 2.1-3.1A162 162 0 0 0 464 215c.3-92.2-77.5-167-173.7-167c-83.9 0-153.9 57.1-170.3 132.9a160.7 160.7 0 0 0-3.7 34.2c0 92.3 74.8 169.1 171 169.1c15.3 0 35.9-4.6 47.2-7.7s22.5-7.2 25.4-8.3a26.44 26.44 0 0 1 9.3-1.7a26 26 0 0 1 10.1 2l56.7 20.1a13.52 13.52 0 0 0 3.9 1a8 8 0 0 0 8-8a12.85 12.85 0 0 0-.5-2.7z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),z=t("path",{d:"M66.46 232a146.23 146.23 0 0 0 6.39 152.67c2.31 3.49 3.61 6.19 3.21 8s-11.93 61.87-11.93 61.87a8 8 0 0 0 2.71 7.68A8.17 8.17 0 0 0 72 464a7.26 7.26 0 0 0 2.91-.6l56.21-22a15.7 15.7 0 0 1 12 .2c18.94 7.38 39.88 12 60.83 12A159.21 159.21 0 0 0 284 432.11",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),j=[O,z],Zo=n({name:"ChatbubblesOutline",render:function(s,l){return o(),e("svg",M,j)}}),B={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},L=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M464 128L240 384l-96-96"},null,-1),H=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M144 384l-96-96"},null,-1),V=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128L232 284"},null,-1),A=[L,H,V],t1=n({name:"CheckmarkDoneOutline",render:function(s,l){return o(),e("svg",B,A)}}),b={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},y=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"},null,-1),P=[y],n1=n({name:"CheckmarkOutline",render:function(s,l){return o(),e("svg",b,P)}}),T={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},D=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 368L144 144"},null,-1),S=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 144L144 368"},null,-1),E=[D,S],o1=n({name:"CloseOutline",render:function(s,l){return o(),e("svg",T,E)}}),F={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},R=t("path",{d:"M320 336h76c55 0 100-21.21 100-75.6s-53-73.47-96-75.6C391.11 99.74 329 48 256 48c-69 0-113.44 45.79-128 91.2c-60 5.7-112 35.88-112 98.4S70 336 136 336h56",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),q=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 400.1l64 63.9l64-63.9"},null,-1),I=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 224v224.03"},null,-1),N=[R,q,I],e1=n({name:"CloudDownloadOutline",render:function(s,l){return o(),e("svg",F,N)}}),U={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},G=t("path",{d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),J=t("path",{d:"M350.67 150.93l-117.2 46.88a64 64 0 0 0-35.66 35.66l-46.88 117.2a8 8 0 0 0 10.4 10.4l117.2-46.88a64 64 0 0 0 35.66-35.66l46.88-117.2a8 8 0 0 0-10.4-10.4zM256 280a24 24 0 1 1 24-24a24 24 0 0 1-24 24z",fill:"currentColor"},null,-1),K=[G,J],r1=n({name:"CompassOutline",render:function(s,l){return o(),e("svg",U,K)}}),W={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Q=t("path",{d:"M448 341.37V170.61A32 32 0 0 0 432.11 143l-152-88.46a47.94 47.94 0 0 0-48.24 0L79.89 143A32 32 0 0 0 64 170.61v170.76A32 32 0 0 0 79.89 369l152 88.46a48 48 0 0 0 48.24 0l152-88.46A32 32 0 0 0 448 341.37z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),X=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M69 153.99l187 110l187-110"},null,-1),Y=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 463.99v-200"},null,-1),Z=[Q,X,Y],s1=n({name:"CubeOutline",render:function(s,l){return o(),e("svg",W,Z)}}),tt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},nt=i('',5),ot=[nt],l1=n({name:"EyeOffOutline",render:function(s,l){return o(),e("svg",tt,ot)}}),et={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},rt=t("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),st=t("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),lt=[rt,st],i1=n({name:"EyeOutline",render:function(s,l){return o(),e("svg",et,lt)}}),it={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},ct=t("path",{d:"M112 320c0-93 124-165 96-272c66 0 192 96 192 272a144 144 0 0 1-288 0z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),ht=t("path",{d:"M320 368c0 57.71-32 80-64 80s-64-22.29-64-80s40-86 32-128c42 0 96 70.29 96 128z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),dt=[ct,ht],c1=n({name:"FlameOutline",render:function(s,l){return o(),e("svg",it,dt)}}),at={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},wt=t("path",{d:"M256 448a32 32 0 0 1-18-5.57c-78.59-53.35-112.62-89.93-131.39-112.8c-40-48.75-59.15-98.8-58.61-153C48.63 114.52 98.46 64 159.08 64c44.08 0 74.61 24.83 92.39 45.51a6 6 0 0 0 9.06 0C278.31 88.81 308.84 64 352.92 64c60.62 0 110.45 50.52 111.08 112.64c.54 54.21-18.63 104.26-58.61 153c-18.77 22.87-52.8 59.45-131.39 112.8a32 32 0 0 1-18 5.56z",fill:"currentColor"},null,-1),ut=[wt],h1=n({name:"Heart",render:function(s,l){return o(),e("svg",at,ut)}}),_t={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},kt=t("path",{d:"M352.92 80C288 80 256 144 256 144s-32-64-96.92-64c-52.76 0-94.54 44.14-95.08 96.81c-1.1 109.33 86.73 187.08 183 252.42a16 16 0 0 0 18 0c96.26-65.34 184.09-143.09 183-252.42c-.54-52.67-42.32-96.81-95.08-96.81z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),pt=[kt],d1=n({name:"HeartOutline",render:function(s,l){return o(),e("svg",_t,pt)}}),xt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},mt=t("path",{d:"M80 212v236a16 16 0 0 0 16 16h96V328a24 24 0 0 1 24-24h80a24 24 0 0 1 24 24v136h96a16 16 0 0 0 16-16V212",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),gt=t("path",{d:"M480 256L266.89 52c-5-5.28-16.69-5.34-21.78 0L32 256",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),vt=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M400 179V64h-48v69"},null,-1),$t=[mt,gt,vt],a1=n({name:"HomeOutline",render:function(s,l){return o(),e("svg",xt,$t)}}),ft={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ct=t("rect",{x:"48",y:"80",width:"416",height:"352",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),Mt=t("circle",{cx:"336",cy:"176",r:"32",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Ot=t("path",{d:"M304 335.79l-90.66-90.49a32 32 0 0 0-43.87-1.3L48 352",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),zt=t("path",{d:"M224 432l123.34-123.34a32 32 0 0 1 43.11-2L464 368",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),jt=[Ct,Mt,Ot,zt],w1=n({name:"ImageOutline",render:function(s,l){return o(),e("svg",ft,jt)}}),Bt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Lt=t("path",{d:"M321.89 171.42C233 114 141 155.22 56 65.22c-19.8-21-8.3 235.5 98.1 332.7c77.79 71 197.9 63.08 238.4-5.92s18.28-163.17-70.61-220.58z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Ht=t("path",{d:"M173 253c86 81 175 129 292 147",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Vt=[Lt,Ht],u1=n({name:"LeafOutline",render:function(s,l){return o(),e("svg",Bt,Vt)}}),At={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},bt=t("path",{d:"M208 352h-64a96 96 0 0 1 0-192h64",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"36"},null,-1),yt=t("path",{d:"M304 160h64a96 96 0 0 1 0 192h-64",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"36"},null,-1),Pt=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"36",d:"M163.29 256h187.42"},null,-1),Tt=[bt,yt,Pt],_1=n({name:"LinkOutline",render:function(s,l){return o(),e("svg",At,Tt)}}),Dt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},St=t("path",{d:"M336 208v-95a80 80 0 0 0-160 0v95",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Et=t("rect",{x:"96",y:"208",width:"320",height:"272",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Ft=[St,Et],k1=n({name:"LockClosedOutline",render:function(s,l){return o(),e("svg",Dt,Ft)}}),Rt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},qt=t("path",{d:"M336 112a80 80 0 0 0-160 0v96",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),It=t("rect",{x:"96",y:"208",width:"320",height:"272",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Nt=[qt,It],p1=n({name:"LockOpenOutline",render:function(s,l){return o(),e("svg",Rt,Nt)}}),Ut={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Gt=t("path",{d:"M304 336v40a40 40 0 0 1-40 40H104a40 40 0 0 1-40-40V136a40 40 0 0 1 40-40h152c22.09 0 48 17.91 48 40v40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Jt=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 336l80-80l-80-80"},null,-1),Kt=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 256h256"},null,-1),Wt=[Gt,Jt,Kt],x1=n({name:"LogOutOutline",render:function(s,l){return o(),e("svg",Ut,Wt)}}),Qt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Xt=t("path",{d:"M102.41 32C62.38 32 32 64.12 32 103.78v304.45C32 447.86 64.38 480 104.41 480h303.2c40 0 72.39-32.14 72.39-71.77v-3.11c-1.35-.56-115.47-48.57-174.5-76.7c-39.82 48.57-91.18 78-144.5 78c-90.18 0-120.8-78.22-78.1-129.72c9.31-11.22 25.15-21.94 49.73-28c38.45-9.36 99.64 5.85 157 24.61a309.41 309.41 0 0 0 25.46-61.67H138.34V194h91.13v-31.83H119.09v-17.75h110.38V99s0-7.65 7.82-7.65h44.55v53H391v17.75H281.84V194h89.08a359.41 359.41 0 0 1-37.72 94.43c27 9.69 49.31 18.88 67.39 24.89c60.32 20 77.23 22.45 79.41 22.7V103.78C480 64.12 447.6 32 407.61 32h-305.2zM152 274.73q-5.81.06-11.67.63c-11.3 1.13-32.5 6.07-44.09 16.23c-34.74 30-13.94 84.93 56.37 84.93c40.87 0 81.71-25.9 113.79-67.37c-41.36-20-77-34.85-114.4-34.42z",fill:"currentColor"},null,-1),Yt=[Xt],m1=n({name:"LogoAlipay",render:function(s,l){return o(),e("svg",Qt,Yt)}}),Zt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},tn=i('',6),nn=[tn],g1=n({name:"MegaphoneOutline",render:function(s,l){return o(),e("svg",Zt,nn)}}),on={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},en=t("path",{d:"M53.12 199.94l400-151.39a8 8 0 0 1 10.33 10.33l-151.39 400a8 8 0 0 1-15-.34l-67.4-166.09a16 16 0 0 0-10.11-10.11L53.46 215a8 8 0 0 1-.34-15.06z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),rn=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M460 52L227 285"},null,-1),sn=[en,rn],v1=n({name:"PaperPlaneOutline",render:function(s,l){return o(),e("svg",on,sn)}}),ln={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},cn=t("path",{d:"M402 168c-2.93 40.67-33.1 72-66 72s-63.12-31.32-66-72c-3-42.31 26.37-72 66-72s69 30.46 66 72z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),hn=t("path",{d:"M336 304c-65.17 0-127.84 32.37-143.54 95.41c-2.08 8.34 3.15 16.59 11.72 16.59h263.65c8.57 0 13.77-8.25 11.72-16.59C463.85 335.36 401.18 304 336 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),dn=t("path",{d:"M200 185.94c-2.34 32.48-26.72 58.06-53 58.06s-50.7-25.57-53-58.06C91.61 152.15 115.34 128 147 128s55.39 24.77 53 57.94z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),an=t("path",{d:"M206 306c-18.05-8.27-37.93-11.45-59-11.45c-52 0-102.1 25.85-114.65 76.2c-1.65 6.66 2.53 13.25 9.37 13.25H154",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),wn=[cn,hn,dn,an],$1=n({name:"PeopleOutline",render:function(s,l){return o(),e("svg",ln,wn)}}),un={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},_n=t("path",{d:"M376 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),kn=t("path",{d:"M288 304c-87 0-175.3 48-191.64 138.6c-2 10.92 4.21 21.4 15.65 21.4H464c11.44 0 17.62-10.48 15.65-21.4C463.3 352 375 304 288 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),pn=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M88 176v112"},null,-1),xn=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M144 232H32"},null,-1),mn=[_n,kn,pn,xn],f1=n({name:"PersonAddOutline",render:function(s,l){return o(),e("svg",un,mn)}}),gn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},vn=t("path",{d:"M344 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),$n=t("path",{d:"M256 304c-87 0-175.3 48-191.64 138.6C62.39 453.52 68.57 464 80 464h352c11.44 0 17.62-10.48 15.65-21.4C431.3 352 343 304 256 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),fn=[vn,$n],C1=n({name:"PersonOutline",render:function(s,l){return o(),e("svg",gn,fn)}}),Cn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Mn=t("path",{d:"M376 144c-3.92 52.87-44 96-88 96s-84.15-43.12-88-96c-4-55 35-96 88-96s92 42 88 96z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),On=t("path",{d:"M288 304c-87 0-175.3 48-191.64 138.6c-2 10.92 4.21 21.4 15.65 21.4H464c11.44 0 17.62-10.48 15.65-21.4C463.3 352 375 304 288 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),zn=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M144 232H32"},null,-1),jn=[Mn,On,zn],M1=n({name:"PersonRemoveOutline",render:function(s,l){return o(),e("svg",Cn,jn)}}),Bn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ln=t("path",{d:"M336 336h40a40 40 0 0 0 40-40V88a40 40 0 0 0-40-40H136a40 40 0 0 0-40 40v208a40 40 0 0 0 40 40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Hn=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 240l80-80l80 80"},null,-1),Vn=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 464V176"},null,-1),An=[Ln,Hn,Vn],O1=n({name:"PushOutline",render:function(s,l){return o(),e("svg",Bn,An)}}),bn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},yn=t("path",{d:"M456.69 421.39L362.6 327.3a173.81 173.81 0 0 0 34.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 0 0 327.3 362.6l94.09 94.09a25 25 0 0 0 35.3-35.3zM97.92 222.72a124.8 124.8 0 1 1 124.8 124.8a124.95 124.95 0 0 1-124.8-124.8z",fill:"currentColor"},null,-1),Pn=[yn],z1=n({name:"Search",render:function(s,l){return o(),e("svg",bn,Pn)}}),Tn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Dn=t("path",{d:"M262.29 192.31a64 64 0 1 0 57.4 57.4a64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22a155.3 155.3 0 0 1-21.46-12.57a16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22a155.3 155.3 0 0 1 21.46 12.57a16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Sn=[Dn],j1=n({name:"SettingsOutline",render:function(s,l){return o(),e("svg",Tn,Sn)}}),En={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Fn=t("path",{d:"M336 192h40a40 40 0 0 1 40 40v192a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V232a40 40 0 0 1 40-40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Rn=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 128l-80-80l-80 80"},null,-1),qn=t("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 321V48"},null,-1),In=[Fn,Rn,qn],B1=n({name:"ShareOutline",render:function(s,l){return o(),e("svg",En,In)}}),Nn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Un=i('',5),Gn=[Un],L1=n({name:"ShareSocialOutline",render:function(s,l){return o(),e("svg",Nn,Gn)}}),Jn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Kn=i('',6),Wn=[Kn],H1=n({name:"TrashOutline",render:function(s,l){return o(),e("svg",Jn,Wn)}}),Qn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Xn=t("path",{d:"M374.79 308.78L457.5 367a16 16 0 0 0 22.5-14.62V159.62A16 16 0 0 0 457.5 145l-82.71 58.22A16 16 0 0 0 368 216.3v79.4a16 16 0 0 0 6.79 13.08z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Yn=t("path",{d:"M268 384H84a52.15 52.15 0 0 1-52-52V180a52.15 52.15 0 0 1 52-52h184.48A51.68 51.68 0 0 1 320 179.52V332a52.15 52.15 0 0 1-52 52z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Zn=[Xn,Yn],V1=n({name:"VideocamOutline",render:function(s,l){return o(),e("svg",Qn,Zn)}}),to={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},no=t("rect",{x:"48",y:"144",width:"416",height:"288",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),oo=t("path",{d:"M411.36 144v-30A50 50 0 0 0 352 64.9L88.64 109.85A50 50 0 0 0 48 159v49",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),eo=t("path",{d:"M368 320a32 32 0 1 1 32-32a32 32 0 0 1-32 32z",fill:"currentColor"},null,-1),ro=[no,oo,eo],A1=n({name:"WalletOutline",render:function(s,l){return o(),e("svg",to,ro)}}),so={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},lo=t("g",{fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M9 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-3"}),t("path",{d:"M9 15h3l8.5-8.5a1.5 1.5 0 0 0-3-3L9 12v3"}),t("path",{d:"M16 5l3 3"})],-1),io=[lo],b1=n({name:"Edit",render:function(s,l){return o(),e("svg",so,io)}}),co={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ho=i('',1),ao=[ho],y1=n({name:"Hash",render:function(s,l){return o(),e("svg",co,ao)}}),wo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},uo=i('',1),_o=[uo],P1=n({name:"Trash",render:function(s,l){return o(),e("svg",wo,_o)}}),ko={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},po=t("path",{d:"M14.71 6.71a.996.996 0 0 0-1.41 0L8.71 11.3a.996.996 0 0 0 0 1.41l4.59 4.59a.996.996 0 1 0 1.41-1.41L10.83 12l3.88-3.88c.39-.39.38-1.03 0-1.41z",fill:"currentColor"},null,-1),xo=[po],T1=n({name:"ChevronLeftRound",render:function(s,l){return o(),e("svg",ko,xo)}}),mo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},go=t("path",{d:"M9.37 5.51A7.35 7.35 0 0 0 9.1 7.5c0 4.08 3.32 7.4 7.4 7.4c.68 0 1.35-.09 1.99-.27A7.014 7.014 0 0 1 12 19c-3.86 0-7-3.14-7-7c0-2.93 1.81-5.45 4.37-6.49zM12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26a5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"},null,-1),vo=[go],D1=n({name:"DarkModeOutlined",render:function(s,l){return o(),e("svg",mo,vo)}}),$o={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},fo=t("path",{d:"M2 17c0 .55.45 1 1 1h18c.55 0 1-.45 1-1s-.45-1-1-1H3c-.55 0-1 .45-1 1zm0-5c0 .55.45 1 1 1h18c.55 0 1-.45 1-1s-.45-1-1-1H3c-.55 0-1 .45-1 1zm0-5c0 .55.45 1 1 1h18c.55 0 1-.45 1-1s-.45-1-1-1H3c-.55 0-1 .45-1 1z",fill:"currentColor"},null,-1),Co=[fo],S1=n({name:"DehazeRound",render:function(s,l){return o(),e("svg",$o,Co)}}),Mo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Oo=t("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3s-3-1.35-3-3s1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5s5-2.24 5-5s-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 0 0-1.41 0a.996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 0 0-1.41 0a.996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 0 0 0-1.41a.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 0 0 0-1.41a.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z",fill:"currentColor"},null,-1),zo=[Oo],E1=n({name:"LightModeOutlined",render:function(s,l){return o(),e("svg",Mo,zo)}}),jo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Bo=t("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z",fill:"currentColor"},null,-1),Lo=[Bo],F1=n({name:"MoreHorizFilled",render:function(s,l){return o(),e("svg",jo,Lo)}}),Ho={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Vo=t("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2s-2 .9-2 2s.9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z",fill:"currentColor"},null,-1),Ao=[Vo],R1=n({name:"MoreVertOutlined",render:function(s,l){return o(),e("svg",Ho,Ao)}}),bo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},yo=t("path",{d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57l-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h4v12h-4z",fill:"currentColor"},null,-1),Po=[yo],q1=n({name:"ThumbDownOutlined",render:function(s,l){return o(),e("svg",bo,Po)}}),To={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Do=t("path",{opacity:".3",d:"M3 12v2h9l-1.34 5.34L15 15V5H6z",fill:"currentColor"},null,-1),So=t("path",{d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57l-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm0 12l-4.34 4.34L12 14H3v-2l3-7h9v10zm4-12h4v12h-4z",fill:"currentColor"},null,-1),Eo=[Do,So],I1=n({name:"ThumbDownTwotone",render:function(s,l){return o(),e("svg",To,Eo)}}),Fo={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ro=t("path",{d:"M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57l.03-.32c0-.41-.17-.79-.44-1.06L14.17 1L7.58 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h4v12H1z",fill:"currentColor"},null,-1),qo=[Ro],N1=n({name:"ThumbUpOutlined",render:function(s,l){return o(),e("svg",Fo,qo)}}),Io={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},No=t("path",{opacity:".3",d:"M21 12v-2h-9l1.34-5.34L9 9v10h9z",fill:"currentColor"},null,-1),Uo=t("path",{d:"M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57l.03-.32c0-.41-.17-.79-.44-1.06L14.17 1L7.58 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2zM9 9l4.34-4.34L12 10h9v2l-3 7H9V9zM1 9h4v12H1z",fill:"currentColor"},null,-1),Go=[No,Uo],U1=n({name:"ThumbUpTwotone",render:function(s,l){return o(),e("svg",Io,Go)}});export{Ko as A,Xo as B,Zo as C,B1 as D,i1 as E,c1 as F,n1 as G,a1 as H,w1 as I,o1 as J,t1 as K,u1 as L,g1 as M,_1 as N,e1 as O,$1 as P,m1 as Q,b1 as R,z1 as S,P1 as T,S1 as U,V1 as V,A1 as W,T1 as X,E1 as Y,D1 as Z,j1 as a,y1 as b,x1 as c,r1 as d,N1 as e,U1 as f,q1 as g,I1 as h,F1 as i,d1 as j,h1 as k,Yo as l,Qo as m,Wo as n,L1 as o,H1 as p,k1 as q,p1 as r,O1 as s,l1 as t,C1 as u,R1 as v,v1 as w,s1 as x,M1 as y,f1 as z}; diff --git a/web/dist/assets/@vue-e0e89260.js b/web/dist/assets/@vue-e0e89260.js new file mode 100644 index 00000000..f2c0ab85 --- /dev/null +++ b/web/dist/assets/@vue-e0e89260.js @@ -0,0 +1 @@ +function Un(e,t){const n=Object.create(null),s=e.split(",");for(let r=0;r!!n[r.toLowerCase()]:r=>!!n[r]}const Z={},it=[],Te=()=>{},yo=()=>!1,vo=/^on[^a-z]/,nn=e=>vo.test(e),Kn=e=>e.startsWith("onUpdate:"),ne=Object.assign,kn=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},xo=Object.prototype.hasOwnProperty,U=(e,t)=>xo.call(e,t),N=Array.isArray,lt=e=>Lt(e)==="[object Map]",ir=e=>Lt(e)==="[object Set]",Co=e=>Lt(e)==="[object RegExp]",L=e=>typeof e=="function",ee=e=>typeof e=="string",Vn=e=>typeof e=="symbol",Y=e=>e!==null&&typeof e=="object",lr=e=>Y(e)&&L(e.then)&&L(e.catch),cr=Object.prototype.toString,Lt=e=>cr.call(e),Eo=e=>Lt(e).slice(8,-1),fr=e=>Lt(e)==="[object Object]",Wn=e=>ee(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Wt=Un(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),sn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},To=/-(\w)/g,Pe=sn(e=>e.replace(To,(t,n)=>n?n.toUpperCase():"")),wo=/\B([A-Z])/g,et=sn(e=>e.replace(wo,"-$1").toLowerCase()),rn=sn(e=>e.charAt(0).toUpperCase()+e.slice(1)),_n=sn(e=>e?`on${rn(e)}`:""),Ot=(e,t)=>!Object.is(e,t),ct=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},An=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Ao=e=>{const t=ee(e)?Number(e):NaN;return isNaN(t)?e:t};let xs;const On=()=>xs||(xs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function zn(e){if(N(e)){const t={};for(let n=0;n{if(n){const s=n.split(Io);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function qn(e){let t="";if(ee(e))t=e;else if(N(e))for(let n=0;nee(e)?e:e==null?"":N(e)||Y(e)&&(e.toString===cr||!L(e.toString))?JSON.stringify(e,ar,2):String(e),ar=(e,t)=>t&&t.__v_isRef?ar(e,t.value):lt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r])=>(n[`${s} =>`]=r,n),{})}:ir(t)?{[`Set(${t.size})`]:[...t.values()]}:Y(t)&&!N(t)&&!fr(t)?String(t):t;let xe;class dr{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=xe,!t&&xe&&(this.index=(xe.scopes||(xe.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=xe;try{return xe=this,t()}finally{xe=n}}}on(){xe=this}off(){xe=this.parent}stop(t){if(this._active){let n,s;for(n=0,s=this.effects.length;n{const t=new Set(e);return t.w=0,t.n=0,t},hr=e=>(e.w&ke)>0,pr=e=>(e.n&ke)>0,Lo=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let s=0;s{(d==="length"||d>=f)&&l.push(u)})}else switch(n!==void 0&&l.push(i.get(n)),t){case"add":N(e)?Wn(n)&&l.push(i.get("length")):(l.push(i.get(Ze)),lt(e)&&l.push(i.get(Pn)));break;case"delete":N(e)||(l.push(i.get(Ze)),lt(e)&&l.push(i.get(Pn)));break;case"set":lt(e)&&l.push(i.get(Ze));break}if(l.length===1)l[0]&&Fn(l[0]);else{const f=[];for(const u of l)u&&f.push(...u);Fn(Jn(f))}}function Fn(e,t){const n=N(e)?e:[...e];for(const s of n)s.computed&&Es(s);for(const s of n)s.computed||Es(s)}function Es(e,t){(e!==Ce||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}function Ho(e,t){var n;return(n=Xt.get(e))==null?void 0:n.get(t)}const Bo=Un("__proto__,__v_isRef,__isVue"),_r=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Vn)),$o=Yn(),jo=Yn(!1,!0),Uo=Yn(!0),Ts=Ko();function Ko(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const s=j(this);for(let o=0,i=this.length;o{e[t]=function(...n){gt();const s=j(this)[t].apply(this,n);return mt(),s}}),e}function ko(e){const t=j(this);return de(t,"has",e),t.hasOwnProperty(e)}function Yn(e=!1,t=!1){return function(s,r,o){if(r==="__v_isReactive")return!e;if(r==="__v_isReadonly")return e;if(r==="__v_isShallow")return t;if(r==="__v_raw"&&o===(e?t?oi:Cr:t?xr:vr).get(s))return s;const i=N(s);if(!e){if(i&&U(Ts,r))return Reflect.get(Ts,r,o);if(r==="hasOwnProperty")return ko}const l=Reflect.get(s,r,o);return(Vn(r)?_r.has(r):Bo(r))||(e||de(s,"get",r),t)?l:ie(l)?i&&Wn(r)?l:l.value:Y(l)?e?Er(l):Gn(l):l}}const Vo=br(),Wo=br(!0);function br(e=!1){return function(n,s,r,o){let i=n[s];if(dt(i)&&ie(i)&&!ie(r))return!1;if(!e&&(!Zt(r)&&!dt(r)&&(i=j(i),r=j(r)),!N(n)&&ie(i)&&!ie(r)))return i.value=r,!0;const l=N(n)&&Wn(s)?Number(s)e,on=e=>Reflect.getPrototypeOf(e);function Bt(e,t,n=!1,s=!1){e=e.__v_raw;const r=j(e),o=j(t);n||(t!==o&&de(r,"get",t),de(r,"get",o));const{has:i}=on(r),l=s?Xn:n?ts:It;if(i.call(r,t))return l(e.get(t));if(i.call(r,o))return l(e.get(o));e!==r&&e.get(t)}function $t(e,t=!1){const n=this.__v_raw,s=j(n),r=j(e);return t||(e!==r&&de(s,"has",e),de(s,"has",r)),e===r?n.has(e):n.has(e)||n.has(r)}function jt(e,t=!1){return e=e.__v_raw,!t&&de(j(e),"iterate",Ze),Reflect.get(e,"size",e)}function ws(e){e=j(e);const t=j(this);return on(t).has.call(t,e)||(t.add(e),Ne(t,"add",e,e)),this}function As(e,t){t=j(t);const n=j(this),{has:s,get:r}=on(n);let o=s.call(n,e);o||(e=j(e),o=s.call(n,e));const i=r.call(n,e);return n.set(e,t),o?Ot(t,i)&&Ne(n,"set",e,t):Ne(n,"add",e,t),this}function Os(e){const t=j(this),{has:n,get:s}=on(t);let r=n.call(t,e);r||(e=j(e),r=n.call(t,e)),s&&s.call(t,e);const o=t.delete(e);return r&&Ne(t,"delete",e,void 0),o}function Is(){const e=j(this),t=e.size!==0,n=e.clear();return t&&Ne(e,"clear",void 0,void 0),n}function Ut(e,t){return function(s,r){const o=this,i=o.__v_raw,l=j(i),f=t?Xn:e?ts:It;return!e&&de(l,"iterate",Ze),i.forEach((u,d)=>s.call(r,f(u),f(d),o))}}function Kt(e,t,n){return function(...s){const r=this.__v_raw,o=j(r),i=lt(o),l=e==="entries"||e===Symbol.iterator&&i,f=e==="keys"&&i,u=r[e](...s),d=n?Xn:t?ts:It;return!t&&de(o,"iterate",f?Pn:Ze),{next(){const{value:p,done:g}=u.next();return g?{value:p,done:g}:{value:l?[d(p[0]),d(p[1])]:d(p),done:g}},[Symbol.iterator](){return this}}}}function De(e){return function(...t){return e==="delete"?!1:this}}function Xo(){const e={get(o){return Bt(this,o)},get size(){return jt(this)},has:$t,add:ws,set:As,delete:Os,clear:Is,forEach:Ut(!1,!1)},t={get(o){return Bt(this,o,!1,!0)},get size(){return jt(this)},has:$t,add:ws,set:As,delete:Os,clear:Is,forEach:Ut(!1,!0)},n={get(o){return Bt(this,o,!0)},get size(){return jt(this,!0)},has(o){return $t.call(this,o,!0)},add:De("add"),set:De("set"),delete:De("delete"),clear:De("clear"),forEach:Ut(!0,!1)},s={get(o){return Bt(this,o,!0,!0)},get size(){return jt(this,!0)},has(o){return $t.call(this,o,!0)},add:De("add"),set:De("set"),delete:De("delete"),clear:De("clear"),forEach:Ut(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{e[o]=Kt(o,!1,!1),n[o]=Kt(o,!0,!1),t[o]=Kt(o,!1,!0),s[o]=Kt(o,!0,!0)}),[e,n,t,s]}const[Zo,Go,ei,ti]=Xo();function Zn(e,t){const n=t?e?ti:ei:e?Go:Zo;return(s,r,o)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(U(n,r)&&r in s?n:s,r,o)}const ni={get:Zn(!1,!1)},si={get:Zn(!1,!0)},ri={get:Zn(!0,!1)},vr=new WeakMap,xr=new WeakMap,Cr=new WeakMap,oi=new WeakMap;function ii(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function li(e){return e.__v_skip||!Object.isExtensible(e)?0:ii(Eo(e))}function Gn(e){return dt(e)?e:es(e,!1,yr,ni,vr)}function ci(e){return es(e,!1,Yo,si,xr)}function Er(e){return es(e,!0,Qo,ri,Cr)}function es(e,t,n,s,r){if(!Y(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=r.get(e);if(o)return o;const i=li(e);if(i===0)return e;const l=new Proxy(e,i===2?s:n);return r.set(e,l),l}function ft(e){return dt(e)?ft(e.__v_raw):!!(e&&e.__v_isReactive)}function dt(e){return!!(e&&e.__v_isReadonly)}function Zt(e){return!!(e&&e.__v_isShallow)}function Tr(e){return ft(e)||dt(e)}function j(e){const t=e&&e.__v_raw;return t?j(t):e}function wr(e){return Yt(e,"__v_skip",!0),e}const It=e=>Y(e)?Gn(e):e,ts=e=>Y(e)?Er(e):e;function Ar(e){Ue&&Ce&&(e=j(e),mr(e.dep||(e.dep=Jn())))}function Or(e,t){e=j(e);const n=e.dep;n&&Fn(n)}function ie(e){return!!(e&&e.__v_isRef===!0)}function fi(e){return Ir(e,!1)}function hc(e){return Ir(e,!0)}function Ir(e,t){return ie(e)?e:new ui(e,t)}class ui{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:j(t),this._value=n?t:It(t)}get value(){return Ar(this),this._value}set value(t){const n=this.__v_isShallow||Zt(t)||dt(t);t=n?t:j(t),Ot(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:It(t),Or(this))}}function ai(e){return ie(e)?e.value:e}const di={get:(e,t,n)=>ai(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return ie(r)&&!ie(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Pr(e){return ft(e)?e:new Proxy(e,di)}function pc(e){const t=N(e)?new Array(e.length):{};for(const n in e)t[n]=Fr(e,n);return t}class hi{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Ho(j(this._object),this._key)}}class pi{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function gc(e,t,n){return ie(e)?e:L(e)?new pi(e):Y(e)&&arguments.length>1?Fr(e,t,n):fi(e)}function Fr(e,t,n){const s=e[t];return ie(s)?s:new hi(e,t,n)}class gi{constructor(t,n,s,r){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new Qn(t,()=>{this._dirty||(this._dirty=!0,Or(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!r,this.__v_isReadonly=s}get value(){const t=j(this);return Ar(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function mi(e,t,n=!1){let s,r;const o=L(e);return o?(s=e,r=Te):(s=e.get,r=e.set),new gi(s,r,o||!r,n)}function Ke(e,t,n,s){let r;try{r=s?e(...s):e()}catch(o){ln(o,t,n)}return r}function be(e,t,n,s){if(L(e)){const o=Ke(e,t,n,s);return o&&lr(o)&&o.catch(i=>{ln(i,t,n)}),o}const r=[];for(let o=0;o>>1;Ft(fe[s])Ie&&fe.splice(t,1)}function xi(e){N(e)?ut.push(...e):(!Se||!Se.includes(e,e.allowRecurse?Qe+1:Qe))&&ut.push(e),Sr()}function Ps(e,t=Pt?Ie+1:0){for(;tFt(n)-Ft(s)),Qe=0;Qee.id==null?1/0:e.id,Ci=(e,t)=>{const n=Ft(e)-Ft(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Rr(e){Mn=!1,Pt=!0,fe.sort(Ci);const t=Te;try{for(Ie=0;Ieee(w)?w.trim():w)),p&&(r=n.map(An))}let l,f=s[l=_n(t)]||s[l=_n(Pe(t))];!f&&o&&(f=s[l=_n(et(t))]),f&&be(f,e,6,r);const u=s[l+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,be(u,e,6,r)}}function Lr(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(r!==void 0)return r;const o=e.emits;let i={},l=!1;if(!L(e)){const f=u=>{const d=Lr(u,t,!0);d&&(l=!0,ne(i,d))};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}return!o&&!l?(Y(e)&&s.set(e,null),null):(N(o)?o.forEach(f=>i[f]=null):ne(i,o),Y(e)&&s.set(e,i),i)}function cn(e,t){return!e||!nn(t)?!1:(t=t.slice(2).replace(/Once$/,""),U(e,t[0].toLowerCase()+t.slice(1))||U(e,et(t))||U(e,t))}let ce=null,fn=null;function Gt(e){const t=ce;return ce=e,fn=e&&e.type.__scopeId||null,t}function mc(e){fn=e}function _c(){fn=null}function Ti(e,t=ce,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&Ks(-1);const o=Gt(t);let i;try{i=e(...r)}finally{Gt(o),s._d&&Ks(1)}return i};return s._n=!0,s._c=!0,s._d=!0,s}function bn(e){const{type:t,vnode:n,proxy:s,withProxy:r,props:o,propsOptions:[i],slots:l,attrs:f,emit:u,render:d,renderCache:p,data:g,setupState:w,ctx:D,inheritAttrs:O}=e;let K,V;const T=Gt(e);try{if(n.shapeFlag&4){const v=r||s;K=Oe(d.call(v,v,p,o,w,g,D)),V=f}else{const v=t;K=Oe(v.length>1?v(o,{attrs:f,slots:l,emit:u}):v(o,null)),V=t.props?f:wi(f)}}catch(v){At.length=0,ln(v,e,1),K=ue(ye)}let I=K;if(V&&O!==!1){const v=Object.keys(V),{shapeFlag:H}=I;v.length&&H&7&&(i&&v.some(Kn)&&(V=Ai(V,i)),I=Re(I,V))}return n.dirs&&(I=Re(I),I.dirs=I.dirs?I.dirs.concat(n.dirs):n.dirs),n.transition&&(I.transition=n.transition),K=I,Gt(T),K}const wi=e=>{let t;for(const n in e)(n==="class"||n==="style"||nn(n))&&((t||(t={}))[n]=e[n]);return t},Ai=(e,t)=>{const n={};for(const s in e)(!Kn(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Oi(e,t,n){const{props:s,children:r,component:o}=e,{props:i,children:l,patchFlag:f}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&f>=0){if(f&1024)return!0;if(f&16)return s?Fs(s,i,u):!!i;if(f&8){const d=t.dynamicProps;for(let p=0;pe.__isSuspense;function Pi(e,t){t&&t.pendingBranch?N(e)?t.effects.push(...e):t.effects.push(e):xi(e)}function bc(e,t){return rs(e,null,t)}const kt={};function zt(e,t,n){return rs(e,t,n)}function rs(e,t,{immediate:n,deep:s,flush:r,onTrack:o,onTrigger:i}=Z){var l;const f=Ro()===((l=oe)==null?void 0:l.scope)?oe:null;let u,d=!1,p=!1;if(ie(e)?(u=()=>e.value,d=Zt(e)):ft(e)?(u=()=>e,s=!0):N(e)?(p=!0,d=e.some(v=>ft(v)||Zt(v)),u=()=>e.map(v=>{if(ie(v))return v.value;if(ft(v))return Xe(v);if(L(v))return Ke(v,f,2)})):L(e)?t?u=()=>Ke(e,f,2):u=()=>{if(!(f&&f.isUnmounted))return g&&g(),be(e,f,3,[w])}:u=Te,t&&s){const v=u;u=()=>Xe(v())}let g,w=v=>{g=T.onStop=()=>{Ke(v,f,4)}},D;if(Rt)if(w=Te,t?n&&be(t,f,3,[u(),p?[]:void 0,w]):u(),r==="sync"){const v=wl();D=v.__watcherHandles||(v.__watcherHandles=[])}else return Te;let O=p?new Array(e.length).fill(kt):kt;const K=()=>{if(T.active)if(t){const v=T.run();(s||d||(p?v.some((H,q)=>Ot(H,O[q])):Ot(v,O)))&&(g&&g(),be(t,f,3,[v,O===kt?void 0:p&&O[0]===kt?[]:O,w]),O=v)}else T.run()};K.allowRecurse=!!t;let V;r==="sync"?V=K:r==="post"?V=()=>le(K,f&&f.suspense):(K.pre=!0,f&&(K.id=f.uid),V=()=>ss(K));const T=new Qn(u,V);t?n?K():O=T.run():r==="post"?le(T.run.bind(T),f&&f.suspense):T.run();const I=()=>{T.stop(),f&&f.scope&&kn(f.scope.effects,T)};return D&&D.push(I),I}function Fi(e,t,n){const s=this.proxy,r=ee(e)?e.includes(".")?Hr(s,e):()=>s[e]:e.bind(s,s);let o;L(t)?o=t:(o=t.handler,n=t);const i=oe;pt(this);const l=rs(r,o.bind(s),n);return i?pt(i):Ge(),l}function Hr(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r{Xe(n,t)});else if(fr(e))for(const n in e)Xe(e[n],t);return e}function yc(e,t){const n=ce;if(n===null)return e;const s=pn(n)||n.proxy,r=e.dirs||(e.dirs=[]);for(let o=0;o{e.isMounted=!0}),cs(()=>{e.isUnmounting=!0}),e}const me=[Function,Array],$r={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:me,onEnter:me,onAfterEnter:me,onEnterCancelled:me,onBeforeLeave:me,onLeave:me,onAfterLeave:me,onLeaveCancelled:me,onBeforeAppear:me,onAppear:me,onAfterAppear:me,onAppearCancelled:me},Mi={name:"BaseTransition",props:$r,setup(e,{slots:t}){const n=ps(),s=Br();let r;return()=>{const o=t.default&&os(t.default(),!0);if(!o||!o.length)return;let i=o[0];if(o.length>1){for(const O of o)if(O.type!==ye){i=O;break}}const l=j(e),{mode:f}=l;if(s.isLeaving)return yn(i);const u=Ms(i);if(!u)return yn(i);const d=Mt(u,l,s,n);ht(u,d);const p=n.subTree,g=p&&Ms(p);let w=!1;const{getTransitionKey:D}=u.type;if(D){const O=D();r===void 0?r=O:O!==r&&(r=O,w=!0)}if(g&&g.type!==ye&&(!je(u,g)||w)){const O=Mt(g,l,s,n);if(ht(g,O),f==="out-in")return s.isLeaving=!0,O.afterLeave=()=>{s.isLeaving=!1,n.update.active!==!1&&n.update()},yn(i);f==="in-out"&&u.type!==ye&&(O.delayLeave=(K,V,T)=>{const I=jr(s,g);I[String(g.key)]=g,K._leaveCb=()=>{V(),K._leaveCb=void 0,delete d.delayedLeave},d.delayedLeave=T})}return i}}},Si=Mi;function jr(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Mt(e,t,n,s){const{appear:r,mode:o,persisted:i=!1,onBeforeEnter:l,onEnter:f,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:g,onAfterLeave:w,onLeaveCancelled:D,onBeforeAppear:O,onAppear:K,onAfterAppear:V,onAppearCancelled:T}=t,I=String(e.key),v=jr(n,e),H=(S,k)=>{S&&be(S,s,9,k)},q=(S,k)=>{const $=k[1];H(S,k),N(S)?S.every(X=>X.length<=1)&&$():S.length<=1&&$()},W={mode:o,persisted:i,beforeEnter(S){let k=l;if(!n.isMounted)if(r)k=O||l;else return;S._leaveCb&&S._leaveCb(!0);const $=v[I];$&&je(e,$)&&$.el._leaveCb&&$.el._leaveCb(),H(k,[S])},enter(S){let k=f,$=u,X=d;if(!n.isMounted)if(r)k=K||f,$=V||u,X=T||d;else return;let P=!1;const G=S._enterCb=he=>{P||(P=!0,he?H(X,[S]):H($,[S]),W.delayedLeave&&W.delayedLeave(),S._enterCb=void 0)};k?q(k,[S,G]):G()},leave(S,k){const $=String(e.key);if(S._enterCb&&S._enterCb(!0),n.isUnmounting)return k();H(p,[S]);let X=!1;const P=S._leaveCb=G=>{X||(X=!0,k(),G?H(D,[S]):H(w,[S]),S._leaveCb=void 0,v[$]===e&&delete v[$])};v[$]=e,g?q(g,[S,P]):P()},clone(S){return Mt(S,t,n,s)}};return W}function yn(e){if(un(e))return e=Re(e),e.children=null,e}function Ms(e){return un(e)?e.children?e.children[0]:void 0:e}function ht(e,t){e.shapeFlag&6&&e.component?ht(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function os(e,t=!1,n){let s=[],r=0;for(let o=0;o1)for(let o=0;one({name:e.name},t,{setup:e}))():e}const at=e=>!!e.type.__asyncLoader,un=e=>e.type.__isKeepAlive,Ni={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=ps(),s=n.ctx;if(!s.renderer)return()=>{const T=t.default&&t.default();return T&&T.length===1?T[0]:T};const r=new Map,o=new Set;let i=null;const l=n.suspense,{renderer:{p:f,m:u,um:d,o:{createElement:p}}}=s,g=p("div");s.activate=(T,I,v,H,q)=>{const W=T.component;u(T,I,v,0,l),f(W.vnode,T,I,v,W,l,H,T.slotScopeIds,q),le(()=>{W.isDeactivated=!1,W.a&&ct(W.a);const S=T.props&&T.props.onVnodeMounted;S&&_e(S,W.parent,T)},l)},s.deactivate=T=>{const I=T.component;u(T,g,null,1,l),le(()=>{I.da&&ct(I.da);const v=T.props&&T.props.onVnodeUnmounted;v&&_e(v,I.parent,T),I.isDeactivated=!0},l)};function w(T){vn(T),d(T,n,l,!0)}function D(T){r.forEach((I,v)=>{const H=Bn(I.type);H&&(!T||!T(H))&&O(v)})}function O(T){const I=r.get(T);!i||!je(I,i)?w(I):i&&vn(i),r.delete(T),o.delete(T)}zt(()=>[e.include,e.exclude],([T,I])=>{T&&D(v=>Ct(T,v)),I&&D(v=>!Ct(I,v))},{flush:"post",deep:!0});let K=null;const V=()=>{K!=null&&r.set(K,xn(n.subTree))};return is(V),ls(V),cs(()=>{r.forEach(T=>{const{subTree:I,suspense:v}=n,H=xn(I);if(T.type===H.type&&T.key===H.key){vn(H);const q=H.component.da;q&&le(q,v);return}w(T)})}),()=>{if(K=null,!t.default)return null;const T=t.default(),I=T[0];if(T.length>1)return i=null,T;if(!Nt(I)||!(I.shapeFlag&4)&&!(I.shapeFlag&128))return i=null,I;let v=xn(I);const H=v.type,q=Bn(at(v)?v.type.__asyncResolved||{}:H),{include:W,exclude:S,max:k}=e;if(W&&(!q||!Ct(W,q))||S&&q&&Ct(S,q))return i=v,I;const $=v.key==null?H:v.key,X=r.get($);return v.el&&(v=Re(v),I.shapeFlag&128&&(I.ssContent=v)),K=$,X?(v.el=X.el,v.component=X.component,v.transition&&ht(v,v.transition),v.shapeFlag|=512,o.delete($),o.add($)):(o.add($),k&&o.size>parseInt(k,10)&&O(o.values().next().value)),v.shapeFlag|=256,i=v,Dr(I.type)?I:v}}},xc=Ni;function Ct(e,t){return N(e)?e.some(n=>Ct(n,t)):ee(e)?e.split(",").includes(t):Co(e)?e.test(t):!1}function Ri(e,t){Ur(e,"a",t)}function Li(e,t){Ur(e,"da",t)}function Ur(e,t,n=oe){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(an(t,s,n),n){let r=n.parent;for(;r&&r.parent;)un(r.parent.vnode)&&Di(s,t,n,r),r=r.parent}}function Di(e,t,n,s){const r=an(t,e,s,!0);Kr(()=>{kn(s[t],r)},n)}function vn(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function xn(e){return e.shapeFlag&128?e.ssContent:e}function an(e,t,n=oe,s=!1){if(n){const r=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{if(n.isUnmounted)return;gt(),pt(n);const l=be(t,n,e,i);return Ge(),mt(),l});return s?r.unshift(o):r.push(o),o}}const Le=e=>(t,n=oe)=>(!Rt||e==="sp")&&an(e,(...s)=>t(...s),n),Hi=Le("bm"),is=Le("m"),Bi=Le("bu"),ls=Le("u"),cs=Le("bum"),Kr=Le("um"),$i=Le("sp"),ji=Le("rtg"),Ui=Le("rtc");function Ki(e,t=oe){an("ec",e,t)}const fs="components";function Cc(e,t){return Vr(fs,e,!0,t)||e}const kr=Symbol.for("v-ndc");function Ec(e){return ee(e)?Vr(fs,e,!1)||e:e||kr}function Vr(e,t,n=!0,s=!1){const r=ce||oe;if(r){const o=r.type;if(e===fs){const l=Bn(o,!1);if(l&&(l===t||l===Pe(t)||l===rn(Pe(t))))return o}const i=Ss(r[e]||o[e],t)||Ss(r.appContext[e],t);return!i&&s?o:i}}function Ss(e,t){return e&&(e[t]||e[Pe(t)]||e[rn(Pe(t))])}function Tc(e,t,n,s){let r;const o=n&&n[s];if(N(e)||ee(e)){r=new Array(e.length);for(let i=0,l=e.length;it(i,l,void 0,o&&o[l]));else{const i=Object.keys(e);r=new Array(i.length);for(let l=0,f=i.length;l{const o=s.fn(...r);return o&&(o.key=s.key),o}:s.fn)}return e}function Ac(e,t,n={},s,r){if(ce.isCE||ce.parent&&at(ce.parent)&&ce.parent.isCE)return t!=="default"&&(n.name=t),ue("slot",n,s&&s());let o=e[t];o&&o._c&&(o._d=!1),eo();const i=o&&Wr(o(n)),l=no(ge,{key:n.key||i&&i.key||`_${t}`},i||(s?s():[]),i&&e._===1?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function Wr(e){return e.some(t=>Nt(t)?!(t.type===ye||t.type===ge&&!Wr(t.children)):!0)?e:null}const Sn=e=>e?oo(e)?pn(e)||e.proxy:Sn(e.parent):null,Tt=ne(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=>Sn(e.parent),$root:e=>Sn(e.root),$emit:e=>e.emit,$options:e=>us(e),$forceUpdate:e=>e.f||(e.f=()=>ss(e.update)),$nextTick:e=>e.n||(e.n=bi.bind(e.proxy)),$watch:e=>Fi.bind(e)}),Cn=(e,t)=>e!==Z&&!e.__isScriptSetup&&U(e,t),ki={get({_:e},t){const{ctx:n,setupState:s,data:r,props:o,accessCache:i,type:l,appContext:f}=e;let u;if(t[0]!=="$"){const w=i[t];if(w!==void 0)switch(w){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return o[t]}else{if(Cn(s,t))return i[t]=1,s[t];if(r!==Z&&U(r,t))return i[t]=2,r[t];if((u=e.propsOptions[0])&&U(u,t))return i[t]=3,o[t];if(n!==Z&&U(n,t))return i[t]=4,n[t];Nn&&(i[t]=0)}}const d=Tt[t];let p,g;if(d)return t==="$attrs"&&de(e,"get",t),d(e);if((p=l.__cssModules)&&(p=p[t]))return p;if(n!==Z&&U(n,t))return i[t]=4,n[t];if(g=f.config.globalProperties,U(g,t))return g[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:o}=e;return Cn(r,t)?(r[t]=n,!0):s!==Z&&U(s,t)?(s[t]=n,!0):U(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:o}},i){let l;return!!n[i]||e!==Z&&U(e,i)||Cn(t,i)||(l=o[0])&&U(l,i)||U(s,i)||U(Tt,i)||U(r.config.globalProperties,i)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:U(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ns(e){return N(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Nn=!0;function Vi(e){const t=us(e),n=e.proxy,s=e.ctx;Nn=!1,t.beforeCreate&&Rs(t.beforeCreate,e,"bc");const{data:r,computed:o,methods:i,watch:l,provide:f,inject:u,created:d,beforeMount:p,mounted:g,beforeUpdate:w,updated:D,activated:O,deactivated:K,beforeDestroy:V,beforeUnmount:T,destroyed:I,unmounted:v,render:H,renderTracked:q,renderTriggered:W,errorCaptured:S,serverPrefetch:k,expose:$,inheritAttrs:X,components:P,directives:G,filters:he}=t;if(u&&Wi(u,s,null),i)for(const te in i){const J=i[te];L(J)&&(s[te]=J.bind(n))}if(r){const te=r.call(n,n);Y(te)&&(e.data=Gn(te))}if(Nn=!0,o)for(const te in o){const J=o[te],Ve=L(J)?J.bind(n,n):L(J.get)?J.get.bind(n,n):Te,Dt=!L(J)&&L(J.set)?J.set.bind(n):Te,We=Cl({get:Ve,set:Dt});Object.defineProperty(s,te,{enumerable:!0,configurable:!0,get:()=>We.value,set:we=>We.value=we})}if(l)for(const te in l)zr(l[te],s,n,te);if(f){const te=L(f)?f.call(n):f;Reflect.ownKeys(te).forEach(J=>{Xi(J,te[J])})}d&&Rs(d,e,"c");function re(te,J){N(J)?J.forEach(Ve=>te(Ve.bind(n))):J&&te(J.bind(n))}if(re(Hi,p),re(is,g),re(Bi,w),re(ls,D),re(Ri,O),re(Li,K),re(Ki,S),re(Ui,q),re(ji,W),re(cs,T),re(Kr,v),re($i,k),N($))if($.length){const te=e.exposed||(e.exposed={});$.forEach(J=>{Object.defineProperty(te,J,{get:()=>n[J],set:Ve=>n[J]=Ve})})}else e.exposed||(e.exposed={});H&&e.render===Te&&(e.render=H),X!=null&&(e.inheritAttrs=X),P&&(e.components=P),G&&(e.directives=G)}function Wi(e,t,n=Te){N(e)&&(e=Rn(e));for(const s in e){const r=e[s];let o;Y(r)?"default"in r?o=qt(r.from||s,r.default,!0):o=qt(r.from||s):o=qt(r),ie(o)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[s]=o}}function Rs(e,t,n){be(N(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function zr(e,t,n,s){const r=s.includes(".")?Hr(n,s):()=>n[s];if(ee(e)){const o=t[e];L(o)&&zt(r,o)}else if(L(e))zt(r,e.bind(n));else if(Y(e))if(N(e))e.forEach(o=>zr(o,t,n,s));else{const o=L(e.handler)?e.handler.bind(n):t[e.handler];L(o)&&zt(r,o,e)}}function us(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,l=o.get(t);let f;return l?f=l:!r.length&&!n&&!s?f=t:(f={},r.length&&r.forEach(u=>en(f,u,i,!0)),en(f,t,i)),Y(t)&&o.set(t,f),f}function en(e,t,n,s=!1){const{mixins:r,extends:o}=t;o&&en(e,o,n,!0),r&&r.forEach(i=>en(e,i,n,!0));for(const i in t)if(!(s&&i==="expose")){const l=zi[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const zi={data:Ls,props:Ds,emits:Ds,methods:Et,computed:Et,beforeCreate:ae,created:ae,beforeMount:ae,mounted:ae,beforeUpdate:ae,updated:ae,beforeDestroy:ae,beforeUnmount:ae,destroyed:ae,unmounted:ae,activated:ae,deactivated:ae,errorCaptured:ae,serverPrefetch:ae,components:Et,directives:Et,watch:Ji,provide:Ls,inject:qi};function Ls(e,t){return t?e?function(){return ne(L(e)?e.call(this,this):e,L(t)?t.call(this,this):t)}:t:e}function qi(e,t){return Et(Rn(e),Rn(t))}function Rn(e){if(N(e)){const t={};for(let n=0;n1)return n&&L(t)?t.call(s&&s.proxy):t}}function Zi(e,t,n,s=!1){const r={},o={};Yt(o,hn,1),e.propsDefaults=Object.create(null),Jr(e,t,r,o);for(const i in e.propsOptions[0])i in r||(r[i]=void 0);n?e.props=s?r:ci(r):e.type.props?e.props=r:e.props=o,e.attrs=o}function Gi(e,t,n,s){const{props:r,attrs:o,vnode:{patchFlag:i}}=e,l=j(r),[f]=e.propsOptions;let u=!1;if((s||i>0)&&!(i&16)){if(i&8){const d=e.vnode.dynamicProps;for(let p=0;p{f=!0;const[g,w]=Qr(p,t,!0);ne(i,g),w&&l.push(...w)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!o&&!f)return Y(e)&&s.set(e,it),it;if(N(o))for(let d=0;d-1,w[1]=O<0||D-1||U(w,"default"))&&l.push(p)}}}const u=[i,l];return Y(e)&&s.set(e,u),u}function Hs(e){return e[0]!=="$"}function Bs(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function $s(e,t){return Bs(e)===Bs(t)}function js(e,t){return N(t)?t.findIndex(n=>$s(n,e)):L(t)&&$s(t,e)?0:-1}const Yr=e=>e[0]==="_"||e==="$stable",as=e=>N(e)?e.map(Oe):[Oe(e)],el=(e,t,n)=>{if(t._n)return t;const s=Ti((...r)=>as(t(...r)),n);return s._c=!1,s},Xr=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Yr(r))continue;const o=e[r];if(L(o))t[r]=el(r,o,s);else if(o!=null){const i=as(o);t[r]=()=>i}}},Zr=(e,t)=>{const n=as(t);e.slots.default=()=>n},tl=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=j(t),Yt(t,"_",n)):Xr(t,e.slots={})}else e.slots={},t&&Zr(e,t);Yt(e.slots,hn,1)},nl=(e,t,n)=>{const{vnode:s,slots:r}=e;let o=!0,i=Z;if(s.shapeFlag&32){const l=t._;l?n&&l===1?o=!1:(ne(r,t),!n&&l===1&&delete r._):(o=!t.$stable,Xr(t,r)),i=t}else t&&(Zr(e,t),i={default:1});if(o)for(const l in r)!Yr(l)&&!(l in i)&&delete r[l]};function Dn(e,t,n,s,r=!1){if(N(e)){e.forEach((g,w)=>Dn(g,t&&(N(t)?t[w]:t),n,s,r));return}if(at(s)&&!r)return;const o=s.shapeFlag&4?pn(s.component)||s.component.proxy:s.el,i=r?null:o,{i:l,r:f}=e,u=t&&t.r,d=l.refs===Z?l.refs={}:l.refs,p=l.setupState;if(u!=null&&u!==f&&(ee(u)?(d[u]=null,U(p,u)&&(p[u]=null)):ie(u)&&(u.value=null)),L(f))Ke(f,l,12,[i,d]);else{const g=ee(f),w=ie(f);if(g||w){const D=()=>{if(e.f){const O=g?U(p,f)?p[f]:d[f]:f.value;r?N(O)&&kn(O,o):N(O)?O.includes(o)||O.push(o):g?(d[f]=[o],U(p,f)&&(p[f]=d[f])):(f.value=[o],e.k&&(d[e.k]=f.value))}else g?(d[f]=i,U(p,f)&&(p[f]=i)):w&&(f.value=i,e.k&&(d[e.k]=i))};i?(D.id=-1,le(D,n)):D()}}}const le=Pi;function sl(e){return rl(e)}function rl(e,t){const n=On();n.__VUE__=!0;const{insert:s,remove:r,patchProp:o,createElement:i,createText:l,createComment:f,setText:u,setElementText:d,parentNode:p,nextSibling:g,setScopeId:w=Te,insertStaticContent:D}=e,O=(c,a,h,_=null,m=null,x=null,E=!1,y=null,C=!!a.dynamicChildren)=>{if(c===a)return;c&&!je(c,a)&&(_=Ht(c),we(c,m,x,!0),c=null),a.patchFlag===-2&&(C=!1,a.dynamicChildren=null);const{type:b,ref:F,shapeFlag:A}=a;switch(b){case dn:K(c,a,h,_);break;case ye:V(c,a,h,_);break;case Jt:c==null&&T(a,h,_,E);break;case ge:P(c,a,h,_,m,x,E,y,C);break;default:A&1?H(c,a,h,_,m,x,E,y,C):A&6?G(c,a,h,_,m,x,E,y,C):(A&64||A&128)&&b.process(c,a,h,_,m,x,E,y,C,tt)}F!=null&&m&&Dn(F,c&&c.ref,x,a||c,!a)},K=(c,a,h,_)=>{if(c==null)s(a.el=l(a.children),h,_);else{const m=a.el=c.el;a.children!==c.children&&u(m,a.children)}},V=(c,a,h,_)=>{c==null?s(a.el=f(a.children||""),h,_):a.el=c.el},T=(c,a,h,_)=>{[c.el,c.anchor]=D(c.children,a,h,_,c.el,c.anchor)},I=({el:c,anchor:a},h,_)=>{let m;for(;c&&c!==a;)m=g(c),s(c,h,_),c=m;s(a,h,_)},v=({el:c,anchor:a})=>{let h;for(;c&&c!==a;)h=g(c),r(c),c=h;r(a)},H=(c,a,h,_,m,x,E,y,C)=>{E=E||a.type==="svg",c==null?q(a,h,_,m,x,E,y,C):k(c,a,m,x,E,y,C)},q=(c,a,h,_,m,x,E,y)=>{let C,b;const{type:F,props:A,shapeFlag:M,transition:R,dirs:B}=c;if(C=c.el=i(c.type,x,A&&A.is,A),M&8?d(C,c.children):M&16&&S(c.children,C,null,_,m,x&&F!=="foreignObject",E,y),B&&ze(c,null,_,"created"),W(C,c,c.scopeId,E,_),A){for(const z in A)z!=="value"&&!Wt(z)&&o(C,z,null,A[z],x,c.children,_,m,Fe);"value"in A&&o(C,"value",null,A.value),(b=A.onVnodeBeforeMount)&&_e(b,_,c)}B&&ze(c,null,_,"beforeMount");const Q=(!m||m&&!m.pendingBranch)&&R&&!R.persisted;Q&&R.beforeEnter(C),s(C,a,h),((b=A&&A.onVnodeMounted)||Q||B)&&le(()=>{b&&_e(b,_,c),Q&&R.enter(C),B&&ze(c,null,_,"mounted")},m)},W=(c,a,h,_,m)=>{if(h&&w(c,h),_)for(let x=0;x<_.length;x++)w(c,_[x]);if(m){let x=m.subTree;if(a===x){const E=m.vnode;W(c,E,E.scopeId,E.slotScopeIds,m.parent)}}},S=(c,a,h,_,m,x,E,y,C=0)=>{for(let b=C;b{const y=a.el=c.el;let{patchFlag:C,dynamicChildren:b,dirs:F}=a;C|=c.patchFlag&16;const A=c.props||Z,M=a.props||Z;let R;h&&qe(h,!1),(R=M.onVnodeBeforeUpdate)&&_e(R,h,a,c),F&&ze(a,c,h,"beforeUpdate"),h&&qe(h,!0);const B=m&&a.type!=="foreignObject";if(b?$(c.dynamicChildren,b,y,h,_,B,x):E||J(c,a,y,null,h,_,B,x,!1),C>0){if(C&16)X(y,a,A,M,h,_,m);else if(C&2&&A.class!==M.class&&o(y,"class",null,M.class,m),C&4&&o(y,"style",A.style,M.style,m),C&8){const Q=a.dynamicProps;for(let z=0;z{R&&_e(R,h,a,c),F&&ze(a,c,h,"updated")},_)},$=(c,a,h,_,m,x,E)=>{for(let y=0;y{if(h!==_){if(h!==Z)for(const y in h)!Wt(y)&&!(y in _)&&o(c,y,h[y],null,E,a.children,m,x,Fe);for(const y in _){if(Wt(y))continue;const C=_[y],b=h[y];C!==b&&y!=="value"&&o(c,y,b,C,E,a.children,m,x,Fe)}"value"in _&&o(c,"value",h.value,_.value)}},P=(c,a,h,_,m,x,E,y,C)=>{const b=a.el=c?c.el:l(""),F=a.anchor=c?c.anchor:l("");let{patchFlag:A,dynamicChildren:M,slotScopeIds:R}=a;R&&(y=y?y.concat(R):R),c==null?(s(b,h,_),s(F,h,_),S(a.children,h,F,m,x,E,y,C)):A>0&&A&64&&M&&c.dynamicChildren?($(c.dynamicChildren,M,h,m,x,E,y),(a.key!=null||m&&a===m.subTree)&&ds(c,a,!0)):J(c,a,h,F,m,x,E,y,C)},G=(c,a,h,_,m,x,E,y,C)=>{a.slotScopeIds=y,c==null?a.shapeFlag&512?m.ctx.activate(a,h,_,E,C):he(a,h,_,m,x,E,C):_t(c,a,C)},he=(c,a,h,_,m,x,E)=>{const y=c.component=ml(c,_,m);if(un(c)&&(y.ctx.renderer=tt),_l(y),y.asyncDep){if(m&&m.registerDep(y,re),!c.el){const C=y.subTree=ue(ye);V(null,C,a,h)}return}re(y,c,a,h,m,x,E)},_t=(c,a,h)=>{const _=a.component=c.component;if(Oi(c,a,h))if(_.asyncDep&&!_.asyncResolved){te(_,a,h);return}else _.next=a,vi(_.update),_.update();else a.el=c.el,_.vnode=a},re=(c,a,h,_,m,x,E)=>{const y=()=>{if(c.isMounted){let{next:F,bu:A,u:M,parent:R,vnode:B}=c,Q=F,z;qe(c,!1),F?(F.el=B.el,te(c,F,E)):F=B,A&&ct(A),(z=F.props&&F.props.onVnodeBeforeUpdate)&&_e(z,R,F,B),qe(c,!0);const se=bn(c),ve=c.subTree;c.subTree=se,O(ve,se,p(ve.el),Ht(ve),c,m,x),F.el=se.el,Q===null&&Ii(c,se.el),M&&le(M,m),(z=F.props&&F.props.onVnodeUpdated)&&le(()=>_e(z,R,F,B),m)}else{let F;const{el:A,props:M}=a,{bm:R,m:B,parent:Q}=c,z=at(a);if(qe(c,!1),R&&ct(R),!z&&(F=M&&M.onVnodeBeforeMount)&&_e(F,Q,a),qe(c,!0),A&&mn){const se=()=>{c.subTree=bn(c),mn(A,c.subTree,c,m,null)};z?a.type.__asyncLoader().then(()=>!c.isUnmounted&&se()):se()}else{const se=c.subTree=bn(c);O(null,se,h,_,c,m,x),a.el=se.el}if(B&&le(B,m),!z&&(F=M&&M.onVnodeMounted)){const se=a;le(()=>_e(F,Q,se),m)}(a.shapeFlag&256||Q&&at(Q.vnode)&&Q.vnode.shapeFlag&256)&&c.a&&le(c.a,m),c.isMounted=!0,a=h=_=null}},C=c.effect=new Qn(y,()=>ss(b),c.scope),b=c.update=()=>C.run();b.id=c.uid,qe(c,!0),b()},te=(c,a,h)=>{a.component=c;const _=c.vnode.props;c.vnode=a,c.next=null,Gi(c,a.props,_,h),nl(c,a.children,h),gt(),Ps(),mt()},J=(c,a,h,_,m,x,E,y,C=!1)=>{const b=c&&c.children,F=c?c.shapeFlag:0,A=a.children,{patchFlag:M,shapeFlag:R}=a;if(M>0){if(M&128){Dt(b,A,h,_,m,x,E,y,C);return}else if(M&256){Ve(b,A,h,_,m,x,E,y,C);return}}R&8?(F&16&&Fe(b,m,x),A!==b&&d(h,A)):F&16?R&16?Dt(b,A,h,_,m,x,E,y,C):Fe(b,m,x,!0):(F&8&&d(h,""),R&16&&S(A,h,_,m,x,E,y,C))},Ve=(c,a,h,_,m,x,E,y,C)=>{c=c||it,a=a||it;const b=c.length,F=a.length,A=Math.min(b,F);let M;for(M=0;MF?Fe(c,m,x,!0,!1,A):S(a,h,_,m,x,E,y,C,A)},Dt=(c,a,h,_,m,x,E,y,C)=>{let b=0;const F=a.length;let A=c.length-1,M=F-1;for(;b<=A&&b<=M;){const R=c[b],B=a[b]=C?$e(a[b]):Oe(a[b]);if(je(R,B))O(R,B,h,null,m,x,E,y,C);else break;b++}for(;b<=A&&b<=M;){const R=c[A],B=a[M]=C?$e(a[M]):Oe(a[M]);if(je(R,B))O(R,B,h,null,m,x,E,y,C);else break;A--,M--}if(b>A){if(b<=M){const R=M+1,B=RM)for(;b<=A;)we(c[b],m,x,!0),b++;else{const R=b,B=b,Q=new Map;for(b=B;b<=M;b++){const pe=a[b]=C?$e(a[b]):Oe(a[b]);pe.key!=null&&Q.set(pe.key,b)}let z,se=0;const ve=M-B+1;let nt=!1,bs=0;const bt=new Array(ve);for(b=0;b=ve){we(pe,m,x,!0);continue}let Ae;if(pe.key!=null)Ae=Q.get(pe.key);else for(z=B;z<=M;z++)if(bt[z-B]===0&&je(pe,a[z])){Ae=z;break}Ae===void 0?we(pe,m,x,!0):(bt[Ae-B]=b+1,Ae>=bs?bs=Ae:nt=!0,O(pe,a[Ae],h,null,m,x,E,y,C),se++)}const ys=nt?ol(bt):it;for(z=ys.length-1,b=ve-1;b>=0;b--){const pe=B+b,Ae=a[pe],vs=pe+1{const{el:x,type:E,transition:y,children:C,shapeFlag:b}=c;if(b&6){We(c.component.subTree,a,h,_);return}if(b&128){c.suspense.move(a,h,_);return}if(b&64){E.move(c,a,h,tt);return}if(E===ge){s(x,a,h);for(let A=0;Ay.enter(x),m);else{const{leave:A,delayLeave:M,afterLeave:R}=y,B=()=>s(x,a,h),Q=()=>{A(x,()=>{B(),R&&R()})};M?M(x,B,Q):Q()}else s(x,a,h)},we=(c,a,h,_=!1,m=!1)=>{const{type:x,props:E,ref:y,children:C,dynamicChildren:b,shapeFlag:F,patchFlag:A,dirs:M}=c;if(y!=null&&Dn(y,null,h,c,!0),F&256){a.ctx.deactivate(c);return}const R=F&1&&M,B=!at(c);let Q;if(B&&(Q=E&&E.onVnodeBeforeUnmount)&&_e(Q,a,c),F&6)bo(c.component,h,_);else{if(F&128){c.suspense.unmount(h,_);return}R&&ze(c,null,a,"beforeUnmount"),F&64?c.type.remove(c,a,h,m,tt,_):b&&(x!==ge||A>0&&A&64)?Fe(b,a,h,!1,!0):(x===ge&&A&384||!m&&F&16)&&Fe(C,a,h),_&&ms(c)}(B&&(Q=E&&E.onVnodeUnmounted)||R)&&le(()=>{Q&&_e(Q,a,c),R&&ze(c,null,a,"unmounted")},h)},ms=c=>{const{type:a,el:h,anchor:_,transition:m}=c;if(a===ge){_o(h,_);return}if(a===Jt){v(c);return}const x=()=>{r(h),m&&!m.persisted&&m.afterLeave&&m.afterLeave()};if(c.shapeFlag&1&&m&&!m.persisted){const{leave:E,delayLeave:y}=m,C=()=>E(h,x);y?y(c.el,x,C):C()}else x()},_o=(c,a)=>{let h;for(;c!==a;)h=g(c),r(c),c=h;r(a)},bo=(c,a,h)=>{const{bum:_,scope:m,update:x,subTree:E,um:y}=c;_&&ct(_),m.stop(),x&&(x.active=!1,we(E,c,a,h)),y&&le(y,a),le(()=>{c.isUnmounted=!0},a),a&&a.pendingBranch&&!a.isUnmounted&&c.asyncDep&&!c.asyncResolved&&c.suspenseId===a.pendingId&&(a.deps--,a.deps===0&&a.resolve())},Fe=(c,a,h,_=!1,m=!1,x=0)=>{for(let E=x;Ec.shapeFlag&6?Ht(c.component.subTree):c.shapeFlag&128?c.suspense.next():g(c.anchor||c.el),_s=(c,a,h)=>{c==null?a._vnode&&we(a._vnode,null,null,!0):O(a._vnode||null,c,a,null,null,null,h),Ps(),Nr(),a._vnode=c},tt={p:O,um:we,m:We,r:ms,mt:he,mc:S,pc:J,pbc:$,n:Ht,o:e};let gn,mn;return t&&([gn,mn]=t(tt)),{render:_s,hydrate:gn,createApp:Yi(_s,gn)}}function qe({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function ds(e,t,n=!1){const s=e.children,r=t.children;if(N(s)&&N(r))for(let o=0;o>1,e[n[l]]0&&(t[s]=n[o-1]),n[o]=s)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}const il=e=>e.__isTeleport,wt=e=>e&&(e.disabled||e.disabled===""),Us=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Hn=(e,t)=>{const n=e&&e.to;return ee(n)?t?t(n):null:n},ll={__isTeleport:!0,process(e,t,n,s,r,o,i,l,f,u){const{mc:d,pc:p,pbc:g,o:{insert:w,querySelector:D,createText:O,createComment:K}}=u,V=wt(t.props);let{shapeFlag:T,children:I,dynamicChildren:v}=t;if(e==null){const H=t.el=O(""),q=t.anchor=O("");w(H,n,s),w(q,n,s);const W=t.target=Hn(t.props,D),S=t.targetAnchor=O("");W&&(w(S,W),i=i||Us(W));const k=($,X)=>{T&16&&d(I,$,X,r,o,i,l,f)};V?k(n,q):W&&k(W,S)}else{t.el=e.el;const H=t.anchor=e.anchor,q=t.target=e.target,W=t.targetAnchor=e.targetAnchor,S=wt(e.props),k=S?n:q,$=S?H:W;if(i=i||Us(q),v?(g(e.dynamicChildren,v,k,r,o,i,l),ds(e,t,!0)):f||p(e,t,k,$,r,o,i,l,!1),V)S||Vt(t,n,H,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const X=t.target=Hn(t.props,D);X&&Vt(t,X,null,u,0)}else S&&Vt(t,q,W,u,1)}Gr(t)},remove(e,t,n,s,{um:r,o:{remove:o}},i){const{shapeFlag:l,children:f,anchor:u,targetAnchor:d,target:p,props:g}=e;if(p&&o(d),(i||!wt(g))&&(o(u),l&16))for(let w=0;w0?Ee||it:null,fl(),St>0&&Ee&&Ee.push(e),e}function Ic(e,t,n,s,r,o){return to(ro(e,t,n,s,r,o,!0))}function no(e,t,n,s,r){return to(ue(e,t,n,s,r,!0))}function Nt(e){return e?e.__v_isVNode===!0:!1}function je(e,t){return e.type===t.type&&e.key===t.key}const hn="__vInternal",so=({key:e})=>e??null,Qt=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ee(e)||ie(e)||L(e)?{i:ce,r:e,k:t,f:!!n}:e:null);function ro(e,t=null,n=null,s=0,r=null,o=e===ge?0:1,i=!1,l=!1){const f={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&so(t),ref:t&&Qt(t),scopeId:fn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:ce};return l?(hs(f,n),o&128&&e.normalize(f)):n&&(f.shapeFlag|=ee(n)?8:16),St>0&&!i&&Ee&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&Ee.push(f),f}const ue=ul;function ul(e,t=null,n=null,s=0,r=null,o=!1){if((!e||e===kr)&&(e=ye),Nt(e)){const l=Re(e,t,!0);return n&&hs(l,n),St>0&&!o&&Ee&&(l.shapeFlag&6?Ee[Ee.indexOf(e)]=l:Ee.push(l)),l.patchFlag|=-2,l}if(xl(e)&&(e=e.__vccOpts),t){t=al(t);let{class:l,style:f}=t;l&&!ee(l)&&(t.class=qn(l)),Y(f)&&(Tr(f)&&!N(f)&&(f=ne({},f)),t.style=zn(f))}const i=ee(e)?1:Dr(e)?128:il(e)?64:Y(e)?4:L(e)?2:0;return ro(e,t,n,s,r,i,o,!0)}function al(e){return e?Tr(e)||hn in e?ne({},e):e:null}function Re(e,t,n=!1){const{props:s,ref:r,patchFlag:o,children:i}=e,l=t?hl(s||{},t):s;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&so(l),ref:t&&t.ref?n&&r?N(r)?r.concat(Qt(t)):[r,Qt(t)]:Qt(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ge?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Re(e.ssContent),ssFallback:e.ssFallback&&Re(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function dl(e=" ",t=0){return ue(dn,null,e,t)}function Pc(e,t){const n=ue(Jt,null,e);return n.staticCount=t,n}function Fc(e="",t=!1){return t?(eo(),no(ye,null,e)):ue(ye,null,e)}function Oe(e){return e==null||typeof e=="boolean"?ue(ye):N(e)?ue(ge,null,e.slice()):typeof e=="object"?$e(e):ue(dn,null,String(e))}function $e(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Re(e)}function hs(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(N(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),hs(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!(hn in t)?t._ctx=ce:r===3&&ce&&(ce.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else L(t)?(t={default:t,_ctx:ce},n=32):(t=String(t),s&64?(n=16,t=[dl(t)]):n=8);e.children=t,e.shapeFlag|=n}function hl(...e){const t={};for(let n=0;noe||ce;let gs,st,ks="__VUE_INSTANCE_SETTERS__";(st=On()[ks])||(st=On()[ks]=[]),st.push(e=>oe=e),gs=e=>{st.length>1?st.forEach(t=>t(e)):st[0](e)};const pt=e=>{gs(e),e.scope.on()},Ge=()=>{oe&&oe.scope.off(),gs(null)};function oo(e){return e.vnode.shapeFlag&4}let Rt=!1;function _l(e,t=!1){Rt=t;const{props:n,children:s}=e.vnode,r=oo(e);Zi(e,n,r,t),tl(e,s);const o=r?bl(e,t):void 0;return Rt=!1,o}function bl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=wr(new Proxy(e.ctx,ki));const{setup:s}=n;if(s){const r=e.setupContext=s.length>1?vl(e):null;pt(e),gt();const o=Ke(s,e,0,[e.props,r]);if(mt(),Ge(),lr(o)){if(o.then(Ge,Ge),t)return o.then(i=>{Vs(e,i,t)}).catch(i=>{ln(i,e,0)});e.asyncDep=o}else Vs(e,o,t)}else io(e,t)}function Vs(e,t,n){L(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Y(t)&&(e.setupState=Pr(t)),io(e,n)}let Ws;function io(e,t,n){const s=e.type;if(!e.render){if(!t&&Ws&&!s.render){const r=s.template||us(e).template;if(r){const{isCustomElement:o,compilerOptions:i}=e.appContext.config,{delimiters:l,compilerOptions:f}=s,u=ne(ne({isCustomElement:o,delimiters:l},i),f);s.render=Ws(r,u)}}e.render=s.render||Te}pt(e),gt(),Vi(e),mt(),Ge()}function yl(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return de(e,"get","$attrs"),t[n]}}))}function vl(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return yl(e)},slots:e.slots,emit:e.emit,expose:t}}function pn(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Pr(wr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Tt)return Tt[n](e)},has(t,n){return n in t||n in Tt}}))}function Bn(e,t=!0){return L(e)?e.displayName||e.name:e.name||t&&e.__name}function xl(e){return L(e)&&"__vccOpts"in e}const Cl=(e,t)=>mi(e,t,Rt);function El(e,t,n){const s=arguments.length;return s===2?Y(t)&&!N(t)?Nt(t)?ue(e,null,[t]):ue(e,t):ue(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Nt(n)&&(n=[n]),ue(e,t,n))}const Tl=Symbol.for("v-scx"),wl=()=>qt(Tl),Al="3.3.4",Ol="http://www.w3.org/2000/svg",Ye=typeof document<"u"?document:null,zs=Ye&&Ye.createElement("template"),Il={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t?Ye.createElementNS(Ol,e):Ye.createElement(e,n?{is:n}:void 0);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Ye.createTextNode(e),createComment:e=>Ye.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ye.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,o){const i=n?n.previousSibling:t.lastChild;if(r&&(r===o||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===o||!(r=r.nextSibling)););else{zs.innerHTML=s?`${e}`:e;const l=zs.content;if(s){const f=l.firstChild;for(;f.firstChild;)l.appendChild(f.firstChild);l.removeChild(f)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function Pl(e,t,n){const s=e._vtc;s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function Fl(e,t,n){const s=e.style,r=ee(n);if(n&&!r){if(t&&!ee(t))for(const o in t)n[o]==null&&$n(s,o,"");for(const o in n)$n(s,o,n[o])}else{const o=s.display;r?t!==n&&(s.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(s.display=o)}}const qs=/\s*!important$/;function $n(e,t,n){if(N(n))n.forEach(s=>$n(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Ml(e,t);qs.test(n)?e.setProperty(et(s),n.replace(qs,""),"important"):e[s]=n}}const Js=["Webkit","Moz","ms"],En={};function Ml(e,t){const n=En[t];if(n)return n;let s=Pe(t);if(s!=="filter"&&s in e)return En[t]=s;s=rn(s);for(let r=0;rTn||(Hl.then(()=>Tn=0),Tn=Date.now());function $l(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;be(jl(s,n.value),t,5,[s])};return n.value=e,n.attached=Bl(),n}function jl(e,t){if(N(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const Xs=/^on[a-z]/,Ul=(e,t,n,s,r=!1,o,i,l,f)=>{t==="class"?Pl(e,s,r):t==="style"?Fl(e,n,s):nn(t)?Kn(t)||Ll(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Kl(e,t,s,r))?Nl(e,t,s,o,i,l,f):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Sl(e,t,s,r))};function Kl(e,t,n,s){return s?!!(t==="innerHTML"||t==="textContent"||t in e&&Xs.test(t)&&L(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||Xs.test(t)&&ee(n)?!1:t in e}const He="transition",yt="animation",lo=(e,{slots:t})=>El(Si,fo(e),t);lo.displayName="Transition";const co={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},kl=lo.props=ne({},$r,co),Je=(e,t=[])=>{N(e)?e.forEach(n=>n(...t)):e&&e(...t)},Zs=e=>e?N(e)?e.some(t=>t.length>1):e.length>1:!1;function fo(e){const t={};for(const P in e)P in co||(t[P]=e[P]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:f=o,appearActiveClass:u=i,appearToClass:d=l,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:g=`${n}-leave-active`,leaveToClass:w=`${n}-leave-to`}=e,D=Vl(r),O=D&&D[0],K=D&&D[1],{onBeforeEnter:V,onEnter:T,onEnterCancelled:I,onLeave:v,onLeaveCancelled:H,onBeforeAppear:q=V,onAppear:W=T,onAppearCancelled:S=I}=t,k=(P,G,he)=>{Be(P,G?d:l),Be(P,G?u:i),he&&he()},$=(P,G)=>{P._isLeaving=!1,Be(P,p),Be(P,w),Be(P,g),G&&G()},X=P=>(G,he)=>{const _t=P?W:T,re=()=>k(G,P,he);Je(_t,[G,re]),Gs(()=>{Be(G,P?f:o),Me(G,P?d:l),Zs(_t)||er(G,s,O,re)})};return ne(t,{onBeforeEnter(P){Je(V,[P]),Me(P,o),Me(P,i)},onBeforeAppear(P){Je(q,[P]),Me(P,f),Me(P,u)},onEnter:X(!1),onAppear:X(!0),onLeave(P,G){P._isLeaving=!0;const he=()=>$(P,G);Me(P,p),ao(),Me(P,g),Gs(()=>{P._isLeaving&&(Be(P,p),Me(P,w),Zs(v)||er(P,s,K,he))}),Je(v,[P,he])},onEnterCancelled(P){k(P,!1),Je(I,[P])},onAppearCancelled(P){k(P,!0),Je(S,[P])},onLeaveCancelled(P){$(P),Je(H,[P])}})}function Vl(e){if(e==null)return null;if(Y(e))return[wn(e.enter),wn(e.leave)];{const t=wn(e);return[t,t]}}function wn(e){return Ao(e)}function Me(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e._vtc||(e._vtc=new Set)).add(t)}function Be(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function Gs(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Wl=0;function er(e,t,n,s){const r=e._endId=++Wl,o=()=>{r===e._endId&&s()};if(n)return setTimeout(o,n);const{type:i,timeout:l,propCount:f}=uo(e,t);if(!i)return s();const u=i+"end";let d=0;const p=()=>{e.removeEventListener(u,g),o()},g=w=>{w.target===e&&++d>=f&&p()};setTimeout(()=>{d(n[D]||"").split(", "),r=s(`${He}Delay`),o=s(`${He}Duration`),i=tr(r,o),l=s(`${yt}Delay`),f=s(`${yt}Duration`),u=tr(l,f);let d=null,p=0,g=0;t===He?i>0&&(d=He,p=i,g=o.length):t===yt?u>0&&(d=yt,p=u,g=f.length):(p=Math.max(i,u),d=p>0?i>u?He:yt:null,g=d?d===He?o.length:f.length:0);const w=d===He&&/\b(transform|all)(,|$)/.test(s(`${He}Property`).toString());return{type:d,timeout:p,propCount:g,hasTransform:w}}function tr(e,t){for(;e.lengthnr(n)+nr(e[s])))}function nr(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function ao(){return document.body.offsetHeight}const ho=new WeakMap,po=new WeakMap,go={name:"TransitionGroup",props:ne({},kl,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ps(),s=Br();let r,o;return ls(()=>{if(!r.length)return;const i=e.moveClass||`${e.name||"v"}-move`;if(!Yl(r[0].el,n.vnode.el,i))return;r.forEach(ql),r.forEach(Jl);const l=r.filter(Ql);ao(),l.forEach(f=>{const u=f.el,d=u.style;Me(u,i),d.transform=d.webkitTransform=d.transitionDuration="";const p=u._moveCb=g=>{g&&g.target!==u||(!g||/transform$/.test(g.propertyName))&&(u.removeEventListener("transitionend",p),u._moveCb=null,Be(u,i))};u.addEventListener("transitionend",p)})}),()=>{const i=j(e),l=fo(i);let f=i.tag||ge;r=o,o=t.default?os(t.default()):[];for(let u=0;udelete e.mode;go.props;const Mc=go;function ql(e){const t=e.el;t._moveCb&&t._moveCb(),t._enterCb&&t._enterCb()}function Jl(e){po.set(e,e.el.getBoundingClientRect())}function Ql(e){const t=ho.get(e),n=po.get(e),s=t.left-n.left,r=t.top-n.top;if(s||r){const o=e.el.style;return o.transform=o.webkitTransform=`translate(${s}px,${r}px)`,o.transitionDuration="0s",e}}function Yl(e,t,n){const s=e.cloneNode();e._vtc&&e._vtc.forEach(i=>{i.split(/\s+/).forEach(l=>l&&s.classList.remove(l))}),n.split(/\s+/).forEach(i=>i&&s.classList.add(i)),s.style.display="none";const r=t.nodeType===1?t:t.parentNode;r.appendChild(s);const{hasTransform:o}=uo(s);return r.removeChild(s),o}const sr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return N(t)?n=>ct(t,n):t};function Xl(e){e.target.composing=!0}function rr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Sc={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e._assign=sr(r);const o=s||r.props&&r.props.type==="number";ot(e,t?"change":"input",i=>{if(i.target.composing)return;let l=e.value;n&&(l=l.trim()),o&&(l=An(l)),e._assign(l)}),n&&ot(e,"change",()=>{e.value=e.value.trim()}),t||(ot(e,"compositionstart",Xl),ot(e,"compositionend",rr),ot(e,"change",rr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:s,number:r}},o){if(e._assign=sr(o),e.composing||document.activeElement===e&&e.type!=="range"&&(n||s&&e.value.trim()===t||(r||e.type==="number")&&An(e.value)===t))return;const i=t??"";e.value!==i&&(e.value=i)}},Zl=["ctrl","shift","alt","meta"],Gl={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)=>Zl.some(n=>e[`${n}Key`]&&!t.includes(n))},Nc=(e,t)=>(n,...s)=>{for(let r=0;rn=>{if(!("key"in n))return;const s=et(n.key);if(t.some(r=>r===s||ec[r]===s))return e(n)},Lc={beforeMount(e,{value:t},{transition:n}){e._vod=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):vt(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),vt(e,!0),s.enter(e)):s.leave(e,()=>{vt(e,!1)}):vt(e,t))},beforeUnmount(e,{value:t}){vt(e,t)}};function vt(e,t){e.style.display=t?e._vod:"none"}const tc=ne({patchProp:Ul},Il);let or;function nc(){return or||(or=sl(tc))}const Dc=(...e)=>{const t=nc().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=sc(s);if(!r)return;const o=t._component;!L(o)&&!o.render&&!o.template&&(o.template=r.innerHTML),r.innerHTML="";const i=n(r,!1,r instanceof SVGElement);return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},t};function sc(e){return ee(e)?document.querySelector(e):e}function rc(){return mo().__VUE_DEVTOOLS_GLOBAL_HOOK__}function mo(){return typeof navigator<"u"&&typeof window<"u"?window:typeof global<"u"?global:{}}const oc=typeof Proxy=="function",ic="devtools-plugin:setup",lc="plugin:settings:set";let rt,jn;function cc(){var e;return rt!==void 0||(typeof window<"u"&&window.performance?(rt=!0,jn=window.performance):typeof global<"u"&&(!((e=global.perf_hooks)===null||e===void 0)&&e.performance)?(rt=!0,jn=global.perf_hooks.performance):rt=!1),rt}function fc(){return cc()?jn.now():Date.now()}class uc{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const s={};if(t.settings)for(const i in t.settings){const l=t.settings[i];s[i]=l.defaultValue}const r=`__vue-devtools-plugin-settings__${t.id}`;let o=Object.assign({},s);try{const i=localStorage.getItem(r),l=JSON.parse(i);Object.assign(o,l)}catch{}this.fallbacks={getSettings(){return o},setSettings(i){try{localStorage.setItem(r,JSON.stringify(i))}catch{}o=i},now(){return fc()}},n&&n.on(lc,(i,l)=>{i===this.plugin.id&&this.fallbacks.setSettings(l)}),this.proxiedOn=new Proxy({},{get:(i,l)=>this.target?this.target.on[l]:(...f)=>{this.onQueue.push({method:l,args:f})}}),this.proxiedTarget=new Proxy({},{get:(i,l)=>this.target?this.target[l]:l==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(l)?(...f)=>(this.targetQueue.push({method:l,args:f,resolve:()=>{}}),this.fallbacks[l](...f)):(...f)=>new Promise(u=>{this.targetQueue.push({method:l,args:f,resolve:u})})})}async setRealTarget(t){this.target=t;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function Hc(e,t){const n=e,s=mo(),r=rc(),o=oc&&n.enableEarlyProxy;if(r&&(s.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))r.emit(ic,e,t);else{const i=o?new uc(n,r):null;(s.__VUE_DEVTOOLS_PLUGINS__=s.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:i}),i&&t(i.proxiedTarget)}}export{dc as $,Re as A,dn as B,ye as C,wr as D,Gn as E,ge as F,Tr as G,j as H,Kr as I,zn as J,Oc as K,qn as L,ac as M,Sc as N,Fc as O,Rc as P,no as Q,Ec as R,pc as S,lo as T,Ac as U,ue as V,mc as W,_c as X,Er as Y,hc as Z,ai as _,ro as a,Hc as a0,Ti as a1,Nc as a2,Cc as a3,Tc as a4,xc as a5,Dc as a6,wc as a7,Pc as b,Ic as c,vc as d,dl as e,Nt as f,ps as g,cs as h,qt as i,is as j,Hi as k,Ri as l,Li as m,Cl as n,eo as o,Xi as p,bc as q,fi as r,El as s,Mc as t,gc as u,Lc as v,zt as w,hl as x,bi as y,yc as z}; diff --git a/web/dist/assets/Alert.6cb9deb6.js b/web/dist/assets/Alert.6cb9deb6.js deleted file mode 100644 index b195e7c2..00000000 --- a/web/dist/assets/Alert.6cb9deb6.js +++ /dev/null @@ -1,48 +0,0 @@ -import{k as M,cm as O,cn as u,m as v,c as P,f as i,e as H,bM as N,b as V,d as K,u as D,x as E,j as G,y as $,bm as q,z as c,A as J,r as Q,h as s,bd as U,co as X,L as Y,B as Z,bK as oo,N as eo,bG as ro,bH as no,bI as lo,bF as so}from"./index.d4f5aad2.js";const to=r=>{const{lineHeight:e,borderRadius:d,fontWeightStrong:C,baseColor:t,dividerColor:b,actionColor:S,textColor1:g,textColor2:l,closeColorHover:h,closeColorPressed:f,closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:n,infoColor:o,successColor:I,warningColor:x,errorColor:z,fontSize:T}=r;return Object.assign(Object.assign({},O),{fontSize:T,lineHeight:e,titleFontWeight:C,borderRadius:d,border:`1px solid ${b}`,color:S,titleTextColor:g,iconColor:l,contentTextColor:l,closeBorderRadius:d,closeColorHover:h,closeColorPressed:f,closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:n,borderInfo:`1px solid ${u(t,v(o,{alpha:.25}))}`,colorInfo:u(t,v(o,{alpha:.08})),titleTextColorInfo:g,iconColorInfo:o,contentTextColorInfo:l,closeColorHoverInfo:h,closeColorPressedInfo:f,closeIconColorInfo:m,closeIconColorHoverInfo:p,closeIconColorPressedInfo:n,borderSuccess:`1px solid ${u(t,v(I,{alpha:.25}))}`,colorSuccess:u(t,v(I,{alpha:.08})),titleTextColorSuccess:g,iconColorSuccess:I,contentTextColorSuccess:l,closeColorHoverSuccess:h,closeColorPressedSuccess:f,closeIconColorSuccess:m,closeIconColorHoverSuccess:p,closeIconColorPressedSuccess:n,borderWarning:`1px solid ${u(t,v(x,{alpha:.33}))}`,colorWarning:u(t,v(x,{alpha:.08})),titleTextColorWarning:g,iconColorWarning:x,contentTextColorWarning:l,closeColorHoverWarning:h,closeColorPressedWarning:f,closeIconColorWarning:m,closeIconColorHoverWarning:p,closeIconColorPressedWarning:n,borderError:`1px solid ${u(t,v(z,{alpha:.25}))}`,colorError:u(t,v(z,{alpha:.08})),titleTextColorError:g,iconColorError:z,contentTextColorError:l,closeColorHoverError:h,closeColorPressedError:f,closeIconColorError:m,closeIconColorHoverError:p,closeIconColorPressedError:n})},io={name:"Alert",common:M,self:to};var ao=io,co=P("alert",` - line-height: var(--n-line-height); - border-radius: var(--n-border-radius); - position: relative; - transition: background-color .3s var(--n-bezier); - background-color: var(--n-color); - text-align: start; - word-break: break-word; -`,[i("border",` - border-radius: inherit; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - transition: border-color .3s var(--n-bezier); - border: var(--n-border); - pointer-events: none; - `),H("closable",[P("alert-body",[i("title",` - padding-right: 24px; - `)])]),i("icon",{color:"var(--n-icon-color)"}),P("alert-body",{padding:"var(--n-padding)"},[i("title",{color:"var(--n-title-text-color)"}),i("content",{color:"var(--n-content-text-color)"})]),N({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),i("icon",` - position: absolute; - left: 0; - top: 0; - align-items: center; - justify-content: center; - display: flex; - width: var(--n-icon-size); - height: var(--n-icon-size); - font-size: var(--n-icon-size); - margin: var(--n-icon-margin); - `),i("close",` - transition: - color .3s var(--n-bezier), - background-color .3s var(--n-bezier); - position: absolute; - right: 0; - top: 0; - margin: var(--n-close-margin); - `),H("show-icon",[P("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),P("alert-body",` - border-radius: var(--n-border-radius); - transition: border-color .3s var(--n-bezier); - `,[i("title",` - transition: color .3s var(--n-bezier); - font-size: 16px; - line-height: 19px; - font-weight: var(--n-title-font-weight); - `,[V("& +",[i("content",{marginTop:"9px"})])]),i("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),i("icon",{transition:"color .3s var(--n-bezier)"})]);const go=Object.assign(Object.assign({},E.props),{title:String,showIcon:{type:Boolean,default:!0},type:{type:String,default:"default"},bordered:{type:Boolean,default:!0},closable:Boolean,onClose:Function,onAfterLeave:Function,onAfterHide:Function});var uo=K({name:"Alert",inheritAttrs:!1,props:go,setup(r){const{mergedClsPrefixRef:e,mergedBorderedRef:d,inlineThemeDisabled:C,mergedRtlRef:t}=D(r),b=E("Alert","-alert",co,ao,r,e),S=G("Alert",t,e),g=$(()=>{const{common:{cubicBezierEaseInOut:n},self:o}=b.value,{fontSize:I,borderRadius:x,titleFontWeight:z,lineHeight:T,iconSize:R,iconMargin:y,iconMarginRtl:_,closeIconSize:A,closeBorderRadius:W,closeSize:w,closeMargin:B,closeMarginRtl:L,padding:k}=o,{type:a}=r,{left:j,right:F}=q(y);return{"--n-bezier":n,"--n-color":o[c("color",a)],"--n-close-icon-size":A,"--n-close-border-radius":W,"--n-close-color-hover":o[c("closeColorHover",a)],"--n-close-color-pressed":o[c("closeColorPressed",a)],"--n-close-icon-color":o[c("closeIconColor",a)],"--n-close-icon-color-hover":o[c("closeIconColorHover",a)],"--n-close-icon-color-pressed":o[c("closeIconColorPressed",a)],"--n-icon-color":o[c("iconColor",a)],"--n-border":o[c("border",a)],"--n-title-text-color":o[c("titleTextColor",a)],"--n-content-text-color":o[c("contentTextColor",a)],"--n-line-height":T,"--n-border-radius":x,"--n-font-size":I,"--n-title-font-weight":z,"--n-icon-size":R,"--n-icon-margin":y,"--n-icon-margin-rtl":_,"--n-close-size":w,"--n-close-margin":B,"--n-close-margin-rtl":L,"--n-padding":k,"--n-icon-margin-left":j,"--n-icon-margin-right":F}}),l=C?J("alert",$(()=>r.type[0]),g,r):void 0,h=Q(!0),f=()=>{const{onAfterLeave:n,onAfterHide:o}=r;n&&n(),o&&o()};return{rtlEnabled:S,mergedClsPrefix:e,mergedBordered:d,visible:h,handleCloseClick:()=>{var n;Promise.resolve((n=r.onClose)===null||n===void 0?void 0:n.call(r)).then(o=>{o!==!1&&(h.value=!1)})},handleAfterLeave:()=>{f()},mergedTheme:b,cssVars:C?void 0:g,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var r;return(r=this.onRender)===null||r===void 0||r.call(this),s(oo,{onAfterLeave:this.handleAfterLeave},{default:()=>{const{mergedClsPrefix:e,$slots:d}=this,C={class:[`${e}-alert`,this.themeClass,this.closable&&`${e}-alert--closable`,this.showIcon&&`${e}-alert--show-icon`,this.rtlEnabled&&`${e}-alert--rtl`],style:this.cssVars,role:"alert"};return this.visible?s("div",Object.assign({},U(this.$attrs,C)),this.closable&&s(X,{clsPrefix:e,class:`${e}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&s("div",{class:`${e}-alert__border`}),this.showIcon&&s("div",{class:`${e}-alert__icon`,"aria-hidden":"true"},Y(d.icon,()=>[s(eo,{clsPrefix:e},{default:()=>{switch(this.type){case"success":return s(so,null);case"info":return s(lo,null);case"warning":return s(no,null);case"error":return s(ro,null);default:return null}}})])),s("div",{class:[`${e}-alert-body`,this.mergedBordered&&`${e}-alert-body--bordered`]},Z(d.header,t=>{const b=t||this.title;return b?s("div",{class:`${e}-alert-body__title`},b):null}),d.default&&s("div",{class:`${e}-alert-body__content`},d))):null}})}});export{uo as _}; diff --git a/web/dist/assets/Anouncement-662e2d95.css b/web/dist/assets/Anouncement-662e2d95.css new file mode 100644 index 00000000..3f3d20ef --- /dev/null +++ b/web/dist/assets/Anouncement-662e2d95.css @@ -0,0 +1 @@ +.balance-wrap[data-v-d4d04859]{padding:16px}.balance-wrap .balance-line[data-v-d4d04859]{display:flex;justify-content:space-between}.balance-wrap .balance-line .balance-opts[data-v-d4d04859]{display:flex;flex-direction:column}.bill-line[data-v-d4d04859]{padding:16px;display:flex;justify-content:space-between}.bill-line .income[data-v-d4d04859],.bill-line .out[data-v-d4d04859]{font-weight:700}.bill-line .income[data-v-d4d04859]{color:#18a058}.pagination-wrap[data-v-d4d04859]{padding:10px;display:flex;justify-content:center;overflow:hidden}.qrcode-wrap[data-v-d4d04859]{display:flex;flex-direction:column;align-items:center;justify-content:center}.qrcode-wrap .pay-tips[data-v-d4d04859]{margin-top:16px}.qrcode-wrap .pay-sub-tips[data-v-d4d04859]{margin-top:4px;font-size:12px;opacity:.75;display:flex;align-items:center}.dark .income[data-v-d4d04859]{color:#63e2b7} diff --git a/web/dist/assets/Anouncement-cdcdf9cc.js b/web/dist/assets/Anouncement-cdcdf9cc.js new file mode 100644 index 00000000..9cd603eb --- /dev/null +++ b/web/dist/assets/Anouncement-cdcdf9cc.js @@ -0,0 +1 @@ +import{_ as F}from"./post-skeleton-ffa76165.js";import{_ as N}from"./main-nav.vue_vue_type_style_index_0_lang-be35896a.js";import{u as V}from"./vuex-473b3783.js";import{b as z}from"./vue-router-b8e3382f.js";import{a as A}from"./formatTime-cdf4e6f1.js";import{d as R,r as n,j as S,c as o,V as a,a1 as p,o as e,_ as u,O as l,F as I,a4 as L,Q as M,a as s,M as _,L as O}from"./@vue-e0e89260.js";import{F as P,G as j,I as q,H as D}from"./naive-ui-62663ad7.js";import{_ as E}from"./index-347d1d96.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./@vicons-8f91201d.js";import"./moment-2ab8298d.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";/* empty css */const G={key:0,class:"pagination-wrap"},H={key:0,class:"skeleton-wrap"},Q={key:1},T={key:0,class:"empty-wrap"},U={class:"bill-line"},$=R({__name:"Anouncement",setup(J){const d=V(),g=z(),v=n(!1),r=n([]),i=n(+g.query.p||1),f=n(20),c=n(0),h=m=>{i.value=m};return S(()=>{}),(m,K)=>{const y=N,k=j,x=F,w=q,B=D,C=P;return e(),o("div",null,[a(y,{title:"公告"}),a(C,{class:"main-content-wrap",bordered:""},{footer:p(()=>[c.value>1?(e(),o("div",G,[a(k,{page:i.value,"onUpdate:page":h,"page-slot":u(d).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:p(()=>[v.value?(e(),o("div",H,[a(x,{num:f.value},null,8,["num"])])):(e(),o("div",Q,[r.value.length===0?(e(),o("div",T,[a(w,{size:"large",description:"暂无数据"})])):l("",!0),(e(!0),o(I,null,L(r.value,t=>(e(),M(B,{key:t.id},{default:p(()=>[s("div",U,[s("div",null,"NO."+_(t.id),1),s("div",null,_(t.reason),1),s("div",{class:O({income:t.change_amount>=0,out:t.change_amount<0})},_((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),s("div",null,_(u(A)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});const kt=E($,[["__scopeId","data-v-d4d04859"]]);export{kt as default}; diff --git a/web/dist/assets/Anouncement.4c2503ee.js b/web/dist/assets/Anouncement.4c2503ee.js deleted file mode 100644 index c5ed7ab1..00000000 --- a/web/dist/assets/Anouncement.4c2503ee.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as B}from"./post-skeleton.38f0f247.js";import{_ as N}from"./main-nav.3167f221.js";import{ai as z,d as E,r as a,a2 as R,Y as t,a4 as o,a5 as c,aj as S,W as n,a3 as m,a7 as l,ab as V,ac as F,$ as P,a6 as $,Z as s,aa as _,cb as j}from"./index.d4f5aad2.js";import{f as q}from"./formatTime.e07969bb.js";import{_ as D}from"./List.a66e9ae7.js";import{_ as I}from"./Pagination.c13c2d34.js";import{a as L,_ as M}from"./Skeleton.e1c16fcb.js";const O={key:0,class:"pagination-wrap"},T={key:0,class:"skeleton-wrap"},U={key:1},W={key:0,class:"empty-wrap"},Y={class:"bill-line"},Z=E({__name:"Anouncement",setup(G){const d=P(),g=S(),v=a(!1),u=a([]),r=a(+g.query.p||1),f=a(20),p=a(0),h=i=>{r.value=i};return R(()=>{}),(i,H)=>{const y=N,k=I,x=B,w=L,C=M,A=D;return n(),t("div",null,[o(y,{title:"\u516C\u544A"}),o(A,{class:"main-content-wrap",bordered:""},{footer:c(()=>[p.value>1?(n(),t("div",O,[o(k,{page:r.value,"onUpdate:page":h,"page-slot":m(d).state.collapsedRight?5:8,"page-count":p.value},null,8,["page","page-slot","page-count"])])):l("",!0)]),default:c(()=>[v.value?(n(),t("div",T,[o(x,{num:f.value},null,8,["num"])])):(n(),t("div",U,[u.value.length===0?(n(),t("div",W,[o(w,{size:"large",description:"\u6682\u65E0\u6570\u636E"})])):l("",!0),(n(!0),t(V,null,F(u.value,e=>(n(),$(C,{key:e.id},{default:c(()=>[s("div",Y,[s("div",null,"NO."+_(e.id),1),s("div",null,_(e.reason),1),s("div",{class:j({income:e.change_amount>=0,out:e.change_amount<0})},_((e.change_amount>0?"+":"")+(e.change_amount/100).toFixed(2)),3),s("div",null,_(m(q)(e.created_on)),1)])]),_:2},1024))),128))]))]),_:1})])}}});var te=z(Z,[["__scopeId","data-v-543914f4"]]);export{te as default}; diff --git a/web/dist/assets/Anouncement.5f84f68f.css b/web/dist/assets/Anouncement.5f84f68f.css deleted file mode 100644 index a90a7257..00000000 --- a/web/dist/assets/Anouncement.5f84f68f.css +++ /dev/null @@ -1 +0,0 @@ -.balance-wrap[data-v-543914f4]{padding:16px}.balance-wrap .balance-line[data-v-543914f4]{display:flex;justify-content:space-between}.balance-wrap .balance-line .balance-opts[data-v-543914f4]{display:flex;flex-direction:column}.bill-line[data-v-543914f4]{padding:16px;display:flex;justify-content:space-between}.bill-line .income[data-v-543914f4],.bill-line .out[data-v-543914f4]{font-weight:700}.bill-line .income[data-v-543914f4]{color:#18a058}.pagination-wrap[data-v-543914f4]{padding:10px;display:flex;justify-content:center;overflow:hidden}.qrcode-wrap[data-v-543914f4]{display:flex;flex-direction:column;align-items:center;justify-content:center}.qrcode-wrap .pay-tips[data-v-543914f4]{margin-top:16px}.qrcode-wrap .pay-sub-tips[data-v-543914f4]{margin-top:4px;font-size:12px;opacity:.75;display:flex;align-items:center}.dark .income[data-v-543914f4]{color:#63e2b7} diff --git a/web/dist/assets/Collection-734ccce8.js b/web/dist/assets/Collection-734ccce8.js new file mode 100644 index 00000000..e260d199 --- /dev/null +++ b/web/dist/assets/Collection-734ccce8.js @@ -0,0 +1 @@ +import{_ as P,a as S}from"./post-item.vue_vue_type_style_index_0_lang-e2c8dabf.js";import{_ as V}from"./post-skeleton-ffa76165.js";import{_ as $}from"./main-nav.vue_vue_type_style_index_0_lang-be35896a.js";import{u as I}from"./vuex-473b3783.js";import{b as L}from"./vue-router-b8e3382f.js";import{L as N,_ as R}from"./index-347d1d96.js";import{d as j,r as s,j as q,c as o,V as e,a1 as c,_ as g,O as v,o as t,F as f,a4 as h,Q as k}from"./@vue-e0e89260.js";import{F as E,G,I as H,H as O}from"./naive-ui-62663ad7.js";import"./content-72d615e5.js";import"./@vicons-8f91201d.js";import"./paopao-video-player-aa5e8b3f.js";import"./formatTime-cdf4e6f1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Q={key:0,class:"skeleton-wrap"},T={key:1},U={key:0,class:"empty-wrap"},A={key:1},D={key:2},J={key:0,class:"pagination-wrap"},K=j({__name:"Collection",setup(W){const m=I(),y=L(),_=s(!1),i=s([]),p=s(+y.query.p||1),l=s(20),r=s(0),u=()=>{_.value=!0,N({page:p.value,page_size:l.value}).then(n=>{_.value=!1,i.value=n.list,r.value=Math.ceil(n.pager.total_rows/l.value),window.scrollTo(0,0)}).catch(n=>{_.value=!1})},w=n=>{p.value=n,u()};return q(()=>{u()}),(n,X)=>{const C=$,b=V,x=H,z=P,d=O,B=S,F=E,M=G;return t(),o("div",null,[e(C,{title:"收藏"}),e(F,{class:"main-content-wrap",bordered:""},{default:c(()=>[_.value?(t(),o("div",Q,[e(b,{num:l.value},null,8,["num"])])):(t(),o("div",T,[i.value.length===0?(t(),o("div",U,[e(x,{size:"large",description:"暂无数据"})])):v("",!0),g(m).state.desktopModelShow?(t(),o("div",A,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(z,{post:a},null,8,["post"])]),_:2},1024))),128))])):(t(),o("div",D,[(t(!0),o(f,null,h(i.value,a=>(t(),k(d,{key:a.id},{default:c(()=>[e(B,{post:a},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),r.value>0?(t(),o("div",J,[e(M,{page:p.value,"onUpdate:page":w,"page-slot":g(m).state.collapsedRight?5:8,"page-count":r.value},null,8,["page","page-slot","page-count"])])):v("",!0)])}}});const Mt=R(K,[["__scopeId","data-v-a5302c9b"]]);export{Mt as default}; diff --git a/web/dist/assets/Collection-b97b3cf7.css b/web/dist/assets/Collection-b97b3cf7.css new file mode 100644 index 00000000..82f9e2e5 --- /dev/null +++ b/web/dist/assets/Collection-b97b3cf7.css @@ -0,0 +1 @@ +.pagination-wrap[data-v-a5302c9b]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-a5302c9b],.dark .empty-wrap[data-v-a5302c9b],.dark .skeleton-wrap[data-v-a5302c9b]{background-color:#101014bf} diff --git a/web/dist/assets/Collection.d63a34f0.css b/web/dist/assets/Collection.d63a34f0.css deleted file mode 100644 index e940aec7..00000000 --- a/web/dist/assets/Collection.d63a34f0.css +++ /dev/null @@ -1 +0,0 @@ -.pagination-wrap[data-v-2f4c0166]{padding:10px;display:flex;justify-content:center;overflow:hidden} diff --git a/web/dist/assets/Collection.e823f1cf.js b/web/dist/assets/Collection.e823f1cf.js deleted file mode 100644 index b05ebee5..00000000 --- a/web/dist/assets/Collection.e823f1cf.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as z}from"./post-item.11c28084.js";import{_ as B}from"./post-skeleton.38f0f247.js";import{_ as E}from"./main-nav.3167f221.js";import{ai as P,d as R,r as n,a2 as $,Y as o,a4 as a,a5 as p,aj as b,cu as F,W as e,a3 as M,a7 as m,ab as N,ac as S,$ as V,al as j,a6 as q}from"./index.d4f5aad2.js";import{_ as I}from"./List.a66e9ae7.js";import{_ as L}from"./Pagination.c13c2d34.js";import{a as T,_ as U}from"./Skeleton.e1c16fcb.js";import"./content.ed80294a.js";import"./formatTime.e07969bb.js";import"./Thing.d394adea.js";const W={key:0,class:"pagination-wrap"},Y={key:0,class:"skeleton-wrap"},A={key:1},D={key:0,class:"empty-wrap"},G=R({__name:"Collection",setup(H){const d=V(),g=b();j();const s=n(!1),_=n([]),l=n(+g.query.p||1),c=n(20),u=n(0),r=()=>{s.value=!0,F({page:l.value,page_size:c.value}).then(t=>{s.value=!1,_.value=t.list,u.value=Math.ceil(t.pager.total_rows/c.value),window.scrollTo(0,0)}).catch(t=>{s.value=!1})},v=t=>{l.value=t,r()};return $(()=>{r()}),(t,J)=>{const f=E,h=L,k=B,y=T,w=z,C=U,x=I;return e(),o("div",null,[a(f,{title:"\u6536\u85CF"}),a(x,{class:"main-content-wrap",bordered:""},{footer:p(()=>[u.value>1?(e(),o("div",W,[a(h,{page:l.value,"onUpdate:page":v,"page-slot":M(d).state.collapsedRight?5:8,"page-count":u.value},null,8,["page","page-slot","page-count"])])):m("",!0)]),default:p(()=>[s.value?(e(),o("div",Y,[a(k,{num:c.value},null,8,["num"])])):(e(),o("div",A,[_.value.length===0?(e(),o("div",D,[a(y,{size:"large",description:"\u6682\u65E0\u6570\u636E"})])):m("",!0),(e(!0),o(N,null,S(_.value,i=>(e(),q(C,{key:i.id},{default:p(()=>[a(w,{post:i},null,8,["post"])]),_:2},1024))),128))]))]),_:1})])}}});var se=P(G,[["__scopeId","data-v-2f4c0166"]]);export{se as default}; diff --git a/web/dist/assets/Contacts-5e407299.js b/web/dist/assets/Contacts-5e407299.js new file mode 100644 index 00000000..0eb9b946 --- /dev/null +++ b/web/dist/assets/Contacts-5e407299.js @@ -0,0 +1 @@ +import{u as N,b as P}from"./vue-router-b8e3382f.js";import{d as k,o as e,c as n,a as s,V as a,M as d,r as c,j as R,a1 as f,_ as S,O as h,F as y,a4 as U,Q as q}from"./@vue-e0e89260.js";import{o as x,F as D,G as O,I as T,H as j}from"./naive-ui-62663ad7.js";import{_ as b,O as E}from"./index-347d1d96.js";import{_ as G}from"./post-skeleton-ffa76165.js";import{_ as H}from"./main-nav.vue_vue_type_style_index_0_lang-be35896a.js";import{u as L}from"./vuex-473b3783.js";import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./axios-4a70c6fc.js";import"./@vicons-8f91201d.js";/* empty css */const Q={class:"avatar"},A={class:"base-info"},J={class:"username"},K={class:"uid"},W=k({__name:"contact-item",props:{contact:{}},setup(C){const l=N(),u=t=>{l.push({name:"user",query:{username:t}})};return(t,o)=>{const _=x;return e(),n("div",{class:"contact-item",onClick:o[0]||(o[0]=r=>u(t.contact.username))},[s("div",Q,[a(_,{size:"large",src:t.contact.avatar},null,8,["src"])]),s("div",A,[s("div",J,[s("strong",null,d(t.contact.nickname),1),s("span",null," @"+d(t.contact.username),1)]),s("div",K,"UID. "+d(t.contact.user_id),1)])])}}});const X=b(W,[["__scopeId","data-v-08ee9b2e"]]),Y={key:0,class:"skeleton-wrap"},Z={key:1},tt={key:0,class:"empty-wrap"},et={key:0,class:"pagination-wrap"},ot=k({__name:"Contacts",setup(C){const l=L(),u=P(),t=c(!1),o=c([]),_=c(+u.query.p||1),r=c(20),m=c(0),w=i=>{_.value=i,v()};R(()=>{v()});const v=(i=!1)=>{o.value.length===0&&(t.value=!0),E({page:_.value,page_size:r.value}).then(p=>{t.value=!1,o.value=p.list,m.value=Math.ceil(p.pager.total_rows/r.value),i&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(p=>{t.value=!1})};return(i,p)=>{const $=H,I=G,z=T,B=X,V=j,F=D,M=O;return e(),n(y,null,[s("div",null,[a($,{title:"好友"}),a(F,{class:"main-content-wrap",bordered:""},{default:f(()=>[t.value?(e(),n("div",Y,[a(I,{num:r.value},null,8,["num"])])):(e(),n("div",Z,[o.value.length===0?(e(),n("div",tt,[a(z,{size:"large",description:"暂无数据"})])):h("",!0),(e(!0),n(y,null,U(o.value,g=>(e(),q(V,{key:g.user_id},{default:f(()=>[a(B,{contact:g},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})]),m.value>0?(e(),n("div",et,[a(M,{page:_.value,"onUpdate:page":w,"page-slot":S(l).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):h("",!0)],64)}}});const zt=b(ot,[["__scopeId","data-v-3b2bf978"]]);export{zt as default}; diff --git a/web/dist/assets/Contacts-b60e5e0d.css b/web/dist/assets/Contacts-b60e5e0d.css new file mode 100644 index 00000000..d101949f --- /dev/null +++ b/web/dist/assets/Contacts-b60e5e0d.css @@ -0,0 +1 @@ +.contact-item[data-v-08ee9b2e]{display:flex;width:100%;padding:12px 16px}.contact-item[data-v-08ee9b2e]:hover{background:#f7f9f9;cursor:pointer}.contact-item .avatar[data-v-08ee9b2e]{width:55px}.contact-item .base-info[data-v-08ee9b2e]{position:relative;width:calc(100% - 55px)}.contact-item .base-info .username[data-v-08ee9b2e]{line-height:16px;font-size:16px}.contact-item .base-info .uid[data-v-08ee9b2e]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.dark .contact-item[data-v-08ee9b2e]{background-color:#101014bf}.dark .contact-item[data-v-08ee9b2e]:hover{background:#18181c}.pagination-wrap[data-v-3b2bf978]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-3b2bf978],.dark .empty-wrap[data-v-3b2bf978],.dark .skeleton-wrap[data-v-3b2bf978]{background-color:#101014bf} diff --git a/web/dist/assets/Contacts.9d93fb1f.js b/web/dist/assets/Contacts.9d93fb1f.js deleted file mode 100644 index a2267b26..00000000 --- a/web/dist/assets/Contacts.9d93fb1f.js +++ /dev/null @@ -1 +0,0 @@ -import{ai as k,d as C,al as E,W as e,Y as n,Z as c,a4 as o,aa as v,ae as N,r as l,a2 as P,cv as R,a5 as g,aj as S,a3 as U,a7 as y,ab as V,ac as q,$ as M,a6 as T}from"./index.d4f5aad2.js";import{_ as j}from"./post-skeleton.38f0f247.js";import{_ as F}from"./main-nav.3167f221.js";import{_ as L}from"./List.a66e9ae7.js";import{_ as W}from"./Pagination.c13c2d34.js";import{a as Y,_ as Z}from"./Skeleton.e1c16fcb.js";const A={class:"avatar"},G={class:"base-info"},H={class:"username"},J={class:"uid"},K=C({__name:"contact-item",props:{contact:null},setup(s){const p=E(),m=t=>{p.push({name:"user",query:{username:t}})};return(t,a)=>{const _=N;return e(),n("div",{class:"contact-item",onClick:a[0]||(a[0]=u=>m(s.contact.username))},[c("div",A,[o(_,{size:"large",src:s.contact.avatar},null,8,["src"])]),c("div",G,[c("div",H,[c("strong",null,v(s.contact.nickname),1),c("span",null," @"+v(s.contact.username),1)]),c("div",J,"UID. "+v(s.contact.user_id),1)])])}}});var O=k(K,[["__scopeId","data-v-23bc18c8"]]);const Q={key:0,class:"pagination-wrap"},X={key:0,class:"skeleton-wrap"},ee={key:1},te={key:0,class:"empty-wrap"},ae=C({__name:"Contacts",setup(s){const p=M(),m=S(),t=l(!1),a=l([]),_=l(+m.query.p||1),u=l(20),d=l(0),w=r=>{_.value=r,f()};P(()=>{f()});const f=(r=!1)=>{a.value.length===0&&(t.value=!0),R({page:_.value,page_size:u.value}).then(i=>{t.value=!1,a.value=i.list,d.value=Math.ceil(i.pager.total_rows/u.value),r&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(i=>{t.value=!1})};return(r,i)=>{const $=F,x=W,B=j,b=Y,z=O,I=Z,D=L;return e(),n("div",null,[o($,{title:"\u597D\u53CB"}),o(D,{class:"main-content-wrap",bordered:""},{footer:g(()=>[d.value>1?(e(),n("div",Q,[o(x,{page:_.value,"onUpdate:page":w,"page-slot":U(p).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):y("",!0)]),default:g(()=>[t.value?(e(),n("div",X,[o(B,{num:u.value},null,8,["num"])])):(e(),n("div",ee,[a.value.length===0?(e(),n("div",te,[o(b,{size:"large",description:"\u6682\u65E0\u6570\u636E"})])):y("",!0),(e(!0),n(V,null,q(a.value,h=>(e(),T(I,{key:h.user_id},{default:g(()=>[o(z,{contact:h},null,8,["contact"])]),_:2},1024))),128))]))]),_:1})])}}});var ue=k(ae,[["__scopeId","data-v-e9de9e50"]]);export{ue as default}; diff --git a/web/dist/assets/Contacts.e16015c7.css b/web/dist/assets/Contacts.e16015c7.css deleted file mode 100644 index 9f1d49d7..00000000 --- a/web/dist/assets/Contacts.e16015c7.css +++ /dev/null @@ -1 +0,0 @@ -.contact-item[data-v-23bc18c8]{display:flex;width:100%;padding:12px 16px}.contact-item[data-v-23bc18c8]:hover{background:#f7f9f9;cursor:pointer}.contact-item .avatar[data-v-23bc18c8]{width:55px}.contact-item .base-info[data-v-23bc18c8]{position:relative;width:calc(100% - 55px)}.contact-item .base-info .username[data-v-23bc18c8]{line-height:16px;font-size:16px}.contact-item .base-info .uid[data-v-23bc18c8]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.dark .contact-item[data-v-23bc18c8]:hover{background:#18181c}.pagination-wrap[data-v-e9de9e50]{padding:10px;display:flex;justify-content:center;overflow:hidden} diff --git a/web/dist/assets/FiraCode-Regular.f13d1ece.woff2 b/web/dist/assets/FiraCode-Regular-f13d1ece.woff2 similarity index 100% rename from web/dist/assets/FiraCode-Regular.f13d1ece.woff2 rename to web/dist/assets/FiraCode-Regular-f13d1ece.woff2 diff --git a/web/dist/assets/Home-2052eeff.js b/web/dist/assets/Home-2052eeff.js new file mode 100644 index 00000000..b6d30271 --- /dev/null +++ b/web/dist/assets/Home-2052eeff.js @@ -0,0 +1 @@ +import{_ as Te,a as qe}from"./post-item.vue_vue_type_style_index_0_lang-e2c8dabf.js";import{_ as xe}from"./post-skeleton-ffa76165.js";import{d as Y,r as i,j as ee,o as c,c as v,_ as $,a as x,V as a,a1 as s,Q as L,O as T,a2 as Z,e as S,M as X,F as K,a4 as J,n as Ie,w as ze}from"./@vue-e0e89260.js";import{u as te}from"./vuex-473b3783.js";import{l as W}from"./lodash-94eb5868.js";import{g as Ue,a as Re,c as Ae,b as Ee,_ as Pe}from"./index-347d1d96.js";import{p as Se}from"./content-72d615e5.js";import{V as z,P as N}from"./IEnum-a180d93e.js";import{I as Le,V as Ve,A as Ne,d as Fe,E as Be}from"./@vicons-8f91201d.js";import{o as Me,v as Oe,j as je,e as De,w as He,x as Ge,y as Ke,z as Je,A as Qe,B as Ze,C as Xe,a as We,D as Ye,E as et,F as tt,G as at,H as ot,I as nt}from"./naive-ui-62663ad7.js";import{_ as st}from"./main-nav.vue_vue_type_style_index_0_lang-be35896a.js";import{b as lt,u as it}from"./vue-router-b8e3382f.js";import"./formatTime-cdf4e6f1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-aa5e8b3f.js";const rt=F=>{const q=new FileReader,r=_=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(_),I=()=>{const _=new Uint8Array(q.result).subarray(0,4);let d="";for(let p=0;p<_.length;p++)d+=_[p].toString(16);switch(d){case"504b0304":case"504b0506":case"504b0708":return r("application/zip");case"504b030414":return r("application/x-zip-compressed");case"504b0508":return r("application/x-zip");case"504b5370":return r("application/octet-stream");default:return!1}};return new Promise((_,d)=>{q.onloadend=()=>{const p=F.type;_(p===""||p==="application/octet-stream"?I():r(p))},q.readAsArrayBuffer(F.slice(0,4))})},ut={key:0,class:"compose-wrap"},ct={class:"compose-line"},pt={class:"compose-user"},_t={class:"compose-line compose-options"},dt={class:"attachment"},mt={class:"submit-wrap"},vt={class:"attachment-list-wrap"},gt={key:0,class:"attachment-price-wrap"},ft=x("span",null," 附件价格¥",-1),yt={key:0,class:"eye-wrap"},ht={key:1,class:"link-wrap"},wt={key:1,class:"compose-wrap"},bt=x("div",{class:"login-wrap"},[x("span",{class:"login-banner"}," 登录后,精彩更多")],-1),kt={key:0,class:"login-only-wrap"},Ct={key:1,class:"login-wrap"},$t=Y({__name:"compose",emits:["post-success"],setup(F,{emit:q}){const r=te(),I=i([]),_=i(!1),d=i(!1),p=i(!1),b=i(!1),w=i(""),U=i([]),E=i(),V=i(0),f=i("public/image"),u=i([]),h=i([]),k=i([]),y=i([]),C=i(z.FRIEND),R=i(z.FRIEND),M=[{value:z.PUBLIC,label:"公开"},{value:z.PRIVATE,label:"私密"},{value:z.FRIEND,label:"好友可见"}],P=+"400",B=i("true".toLowerCase()==="true"),O=i("true".toLowerCase()==="true"),j=i("true".toLowerCase()==="true"),A=i("false".toLowerCase()==="true"),ae=i("true".toLowerCase()==="true"),oe="/v1/attachment",Q=i(),ne=()=>{p.value=!p.value,p.value&&b.value&&(b.value=!1)},se=()=>{b.value=!b.value,b.value&&p.value&&(p.value=!1)},le=W.debounce(t=>{Ue({k:t}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),I.value=n,_.value=!1}).catch(e=>{_.value=!1})},200),ie=W.debounce(t=>{Re({k:t}).then(e=>{let n=[];e.suggest.map(o=>{n.push({label:o,value:o})}),I.value=n,_.value=!1}).catch(e=>{_.value=!1})},200),re=(t,e)=>{_.value||(_.value=!0,e==="@"?le(t):ie(t))},ue=t=>{t.length>P?w.value=t.substring(0,P):w.value=t},D=t=>{f.value=t},ce=t=>{for(let l=0;l30&&(t[l].name=n.substring(0,18)+"..."+n.substring(n.length-9)+"."+o)}u.value=t},pe=async t=>{var e,n,o,l,g;return f.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((e=t.file.file)==null?void 0:e.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):f.value==="image"&&((n=t.file.file)==null?void 0:n.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):f.value==="public/video"&&!["video/mp4","video/quicktime"].includes((o=t.file.file)==null?void 0:o.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):f.value==="public/video"&&((l=t.file.file)==null?void 0:l.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):f.value==="attachment"&&!await rt(t.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):f.value==="attachment"&&((g=t.file.file)==null?void 0:g.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},_e=({file:t,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);o.code===0&&(f.value==="public/image"&&h.value.push({id:t.id,content:o.data.content}),f.value==="public/video"&&k.value.push({id:t.id,content:o.data.content}),f.value==="attachment"&&y.value.push({id:t.id,content:o.data.content}))}catch{window.$message.error("上传失败")}},de=({file:t,event:e})=>{var n;try{let o=JSON.parse((n=e.target)==null?void 0:n.response);if(o.code!==0){let l=o.msg||"上传失败";o.details&&o.details.length>0&&o.details.map(g=>{l+=":"+g}),window.$message.error(l)}}catch{window.$message.error("上传失败")}},me=({file:t})=>{let e=h.value.findIndex(n=>n.id===t.id);e>-1&&h.value.splice(e,1),e=k.value.findIndex(n=>n.id===t.id),e>-1&&k.value.splice(e,1),e=y.value.findIndex(n=>n.id===t.id),e>-1&&y.value.splice(e,1)},ve=()=>{if(w.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:t,users:e}=Se(w.value);const n=[];let o=100;n.push({content:w.value,type:N.TEXT,sort:o}),h.value.map(l=>{o++,n.push({content:l.content,type:N.IMAGEURL,sort:o})}),k.value.map(l=>{o++,n.push({content:l.content,type:N.VIDEOURL,sort:o})}),y.value.map(l=>{o++,n.push({content:l.content,type:N.ATTACHMENT,sort:o})}),U.value.length>0&&U.value.map(l=>{o++,n.push({content:l,type:N.LINKURL,sort:o})}),d.value=!0,Ae({contents:n,tags:Array.from(new Set(t)),users:Array.from(new Set(e)),attachment_price:+V.value*100,visibility:C.value}).then(l=>{var g;window.$message.success("发布成功"),d.value=!1,q("post-success",l),p.value=!1,b.value=!1,(g=E.value)==null||g.clear(),u.value=[],w.value="",U.value=[],h.value=[],k.value=[],y.value=[],C.value=R.value}).catch(l=>{d.value=!1})},H=t=>{r.commit("triggerAuth",!0),r.commit("triggerAuthKey",t)};return ee(()=>{"friend".toLowerCase()==="friend"?R.value=z.FRIEND:"friend".toLowerCase()==="public"?R.value=z.PUBLIC:R.value=z.PRIVATE,C.value=R.value,Q.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(t,e)=>{const n=Me,o=Oe,l=je,g=De,G=He,ge=Ge,fe=Ke,ye=Je,he=Qe,we=Ze,be=Xe,ke=We,Ce=Ye,$e=et;return c(),v("div",null,[$(r).state.userInfo.id>0?(c(),v("div",ut,[x("div",ct,[x("div",pt,[a(n,{round:"",size:30,src:$(r).state.userInfo.avatar},null,8,["src"])]),a(o,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:_.value,value:w.value,prefix:["@","#"],options:I.value,onSearch:re,"onUpdate:value":ue,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(we,{ref_key:"uploadRef",ref:E,abstract:"","list-type":"image",multiple:!0,max:9,action:oe,headers:{Authorization:Q.value},data:{type:f.value},"file-list":u.value,onBeforeUpload:pe,onFinish:_e,onError:de,onRemove:me,"onUpdate:fileList":ce},{default:s(()=>[x("div",_t,[x("div",dt,[a(G,{abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value==="public/video"||u.value.length===9,onClick:()=>{D("public/image"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Le))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),O.value?(c(),L(G,{key:0,abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value!=="public/video"||u.value.length===9,onClick:()=>{D("public/video"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Ve))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):T("",!0),j.value?(c(),L(G,{key:1,abstract:""},{default:s(({handleClick:m})=>[a(g,{disabled:u.value.length>0&&f.value==="public/video"||u.value.length===9,onClick:()=>{D("attachment"),m()},quaternary:"",circle:"",type:"primary"},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Ne))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):T("",!0),a(g,{quaternary:"",circle:"",type:"primary",onClick:Z(ne,["stop"])},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Fe))]),_:1})]),_:1},8,["onClick"]),ae.value?(c(),L(g,{key:2,quaternary:"",circle:"",type:"primary",onClick:Z(se,["stop"])},{icon:s(()=>[a(l,{size:"20",color:"var(--primary-color)"},{default:s(()=>[a($(Be))]),_:1})]),_:1},8,["onClick"])):T("",!0)]),x("div",mt,[a(fe,{trigger:"hover",placement:"bottom"},{trigger:s(()=>[a(ge,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:w.value.length/$(P)*100},null,8,["percentage"])]),default:s(()=>[S(" "+X(w.value.length)+" / "+X($(P)),1)]),_:1}),a(g,{loading:d.value,onClick:ve,type:"primary",secondary:"",round:""},{default:s(()=>[S(" 发布 ")]),_:1},8,["loading"])])]),x("div",vt,[a(ye),y.value.length>0?(c(),v("div",gt,[A.value?(c(),L(he,{key:0,value:V.value,"onUpdate:value":e[0]||(e[0]=m=>V.value=m),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:s(()=>[ft]),_:1},8,["value"])):T("",!0)])):T("",!0)])]),_:1},8,["headers","data","file-list"]),b.value?(c(),v("div",yt,[a(Ce,{value:C.value,"onUpdate:value":e[1]||(e[1]=m=>C.value=m),name:"radiogroup"},{default:s(()=>[a(ke,null,{default:s(()=>[(c(),v(K,null,J(M,m=>a(be,{key:m.value,value:m.value,label:m.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):T("",!0),p.value?(c(),v("div",ht,[a($e,{value:U.value,"onUpdate:value":e[2]||(e[2]=m=>U.value=m),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":s(()=>[S(" 创建链接 ")]),_:1},8,["value"])])):T("",!0)])):(c(),v("div",wt,[bt,B.value?T("",!0):(c(),v("div",kt,[a(g,{strong:"",secondary:"",round:"",type:"primary",onClick:e[3]||(e[3]=m=>H("signin"))},{default:s(()=>[S(" 登录 ")]),_:1})])),B.value?(c(),v("div",Ct,[a(g,{strong:"",secondary:"",round:"",type:"primary",onClick:e[4]||(e[4]=m=>H("signin"))},{default:s(()=>[S(" 登录 ")]),_:1}),a(g,{strong:"",secondary:"",round:"",type:"info",onClick:e[5]||(e[5]=m=>H("signup"))},{default:s(()=>[S(" 注册 ")]),_:1})])):T("",!0)]))])}}});const Tt={key:0,class:"skeleton-wrap"},qt={key:1},xt={key:0,class:"empty-wrap"},It={key:1},zt={key:2},Ut={key:0,class:"pagination-wrap"},Rt=Y({__name:"Home",setup(F){const q=te(),r=lt(),I=it(),_=i(!1),d=i([]),p=i(+r.query.p||1),b=i(20),w=i(0),U=Ie(()=>{let u="泡泡广场";return r.query&&r.query.q&&(r.query.t&&r.query.t==="tag"?u="#"+decodeURIComponent(r.query.q):u="搜索: "+decodeURIComponent(r.query.q)),u}),E=()=>{_.value=!0,Ee({query:r.query.q?decodeURIComponent(r.query.q):null,type:r.query.t,page:p.value,page_size:b.value}).then(u=>{_.value=!1,d.value=u.list,w.value=Math.ceil(u.pager.total_rows/b.value),window.scrollTo(0,0)}).catch(u=>{_.value=!1})},V=u=>{if(p.value!=1){I.push({name:"post",query:{id:u.id}});return}let h=[],k=d.value.length;k==b.value&&k--;for(var y=0;y{I.push({name:"home",query:{...r.query,p:u}})};return ee(()=>{E()}),ze(()=>({path:r.path,query:r.query,refresh:q.state.refresh}),(u,h)=>{if(u.refresh!==h.refresh){p.value=+r.query.p||1,setTimeout(()=>{E()},0);return}h.path!=="/post"&&u.path==="/"&&(p.value=+r.query.p||1,setTimeout(()=>{E()},0))}),(u,h)=>{const k=st,y=$t,C=ot,R=xe,M=nt,P=Te,B=qe,O=tt,j=at;return c(),v("div",null,[a(k,{title:U.value},null,8,["title"]),a(O,{class:"main-content-wrap",bordered:""},{default:s(()=>[a(C,null,{default:s(()=>[a(y,{onPostSuccess:V})]),_:1}),_.value?(c(),v("div",Tt,[a(R,{num:b.value},null,8,["num"])])):(c(),v("div",qt,[d.value.length===0?(c(),v("div",xt,[a(M,{size:"large",description:"暂无数据"})])):T("",!0),$(q).state.desktopModelShow?(c(),v("div",It,[(c(!0),v(K,null,J(d.value,A=>(c(),L(C,{key:A.id},{default:s(()=>[a(P,{post:A},null,8,["post"])]),_:2},1024))),128))])):(c(),v("div",zt,[(c(!0),v(K,null,J(d.value,A=>(c(),L(C,{key:A.id},{default:s(()=>[a(B,{post:A},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),w.value>0?(c(),v("div",Ut,[a(j,{page:p.value,"onUpdate:page":f,"page-slot":$(q).state.collapsedRight?5:8,"page-count":w.value},null,8,["page","page-slot","page-count"])])):T("",!0)])}}});const ca=Pe(Rt,[["__scopeId","data-v-f42b0645"]]);export{ca as default}; diff --git a/web/dist/assets/Home-c075a37e.css b/web/dist/assets/Home-c075a37e.css new file mode 100644 index 00000000..92bf390d --- /dev/null +++ b/web/dist/assets/Home-c075a37e.css @@ -0,0 +1 @@ +.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button{margin:0 4px;width:50%}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.dark .compose-wrap{background-color:#101014bf}.pagination-wrap[data-v-f42b0645]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .main-content-wrap[data-v-f42b0645],.dark .pagination-wrap[data-v-f42b0645],.dark .empty-wrap[data-v-f42b0645],.dark .skeleton-wrap[data-v-f42b0645]{background-color:#101014bf} diff --git a/web/dist/assets/Home.07e73aab.css b/web/dist/assets/Home.07e73aab.css deleted file mode 100644 index 25a8e7e0..00000000 --- a/web/dist/assets/Home.07e73aab.css +++ /dev/null @@ -1 +0,0 @@ -.compose-wrap{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .text-statistic{margin-right:8px;width:20px;height:20px;transform:rotate(180deg)}.compose-wrap .link-wrap{margin-left:42px;margin-right:42px}.compose-wrap .eye-wrap{margin-left:64px}.compose-wrap .login-wrap{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button{margin:0 4px}.attachment-list-wrap{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail{overflow:hidden}.pagination-wrap[data-v-7e0dfc66]{padding:10px;display:flex;justify-content:center;overflow:hidden} diff --git a/web/dist/assets/Home.d77fc36a.js b/web/dist/assets/Home.d77fc36a.js deleted file mode 100644 index 8c867839..00000000 --- a/web/dist/assets/Home.d77fc36a.js +++ /dev/null @@ -1,217 +0,0 @@ -import{_ as It}from"./post-item.11c28084.js";import{_ as Vt}from"./post-skeleton.38f0f247.js";import{d as Q,h as i,c as q,a as $e,b as G,e as W,f as K,u as we,g as $t,p as Ze,i as St,j as Se,k as et,l as Bt,m as rt,n as ft,o as tt,r as $,q as Ae,t as ce,s as Ee,v as re,w as Z,x as fe,y as ne,z as Pe,A as nt,B as Qe,C as Ft,D as Pt,E as pt,F as mt,G as ht,H as Dt,_ as De,I as zt,J as vt,K as ye,L as ze,N as ve,M as Ye,O as At,P as Ge,Q as We,R as Et,S as gt,T as Tt,U as at,X as lt,V as Ut,W as M,Y as J,Z as X,$ as bt,a0 as Ot,a1 as Nt,a2 as _t,a3 as ae,a4 as I,a5 as D,a6 as Ve,a7 as le,a8 as it,a9 as Re,aa as Mt,ab as yt,ac as wt,ad as Lt,ae as jt,af as qt,ag as Ht,ah as Kt,ai as Gt,aj as Wt,ak as Jt,al as Xt}from"./index.d4f5aad2.js";import{V as de,l as st,I as Qt,P as Ie,_ as Yt}from"./IEnum.032938cf.js";import{p as Zt}from"./content.ed80294a.js";import{_ as en,a as tn,b as nn,c as on}from"./Upload.6bcec76c.js";import{_ as rn}from"./main-nav.3167f221.js";import{_ as an}from"./List.a66e9ae7.js";import{_ as ln}from"./Pagination.c13c2d34.js";import{_ as sn,a as un}from"./Skeleton.e1c16fcb.js";import"./formatTime.e07969bb.js";import"./Thing.d394adea.js";var dn=Q({name:"ArrowDown",render(){return i("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M23.7916,15.2664 C24.0788,14.9679 24.0696,14.4931 23.7711,14.206 C23.4726,13.9188 22.9978,13.928 22.7106,14.2265 L14.7511,22.5007 L14.7511,3.74792 C14.7511,3.33371 14.4153,2.99792 14.0011,2.99792 C13.5869,2.99792 13.2511,3.33371 13.2511,3.74793 L13.2511,22.4998 L5.29259,14.2265 C5.00543,13.928 4.53064,13.9188 4.23213,14.206 C3.93361,14.4931 3.9244,14.9679 4.21157,15.2664 L13.2809,24.6944 C13.6743,25.1034 14.3289,25.1034 14.7223,24.6944 L23.7916,15.2664 Z"}))))}}),cn=Q({name:"ArrowUp",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},i("g",{fill:"none"},i("path",{d:"M3.13 9.163a.5.5 0 1 0 .74.674L9.5 3.67V17.5a.5.5 0 0 0 1 0V3.672l5.63 6.165a.5.5 0 0 0 .738-.674l-6.315-6.916a.746.746 0 0 0-.632-.24a.746.746 0 0 0-.476.24L3.131 9.163z",fill:"currentColor"})))}}),xt=Q({name:"Remove",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},i("line",{x1:"400",y1:"256",x2:"112",y2:"256",style:` - fill: none; - stroke: currentColor; - stroke-linecap: round; - stroke-linejoin: round; - stroke-width: 32px; - `}))}});const N="0!important",Ct="-1px!important";function be(e){return W(e+"-type",[G("& +",[q("button",{},[W(e+"-type",[K("border",{borderLeftWidth:N}),K("state-border",{left:Ct})])])])])}function _e(e){return W(e+"-type",[G("& +",[q("button",[W(e+"-type",[K("border",{borderTopWidth:N}),K("state-border",{top:Ct})])])])])}var fn=q("button-group",` - flex-wrap: nowrap; - display: inline-flex; - position: relative; -`,[$e("vertical",{flexDirection:"row"},[$e("rtl",[q("button",[G("&:first-child:not(:last-child)",` - margin-right: ${N}; - border-top-right-radius: ${N}; - border-bottom-right-radius: ${N}; - `),G("&:last-child:not(:first-child)",` - margin-left: ${N}; - border-top-left-radius: ${N}; - border-bottom-left-radius: ${N}; - `),G("&:not(:first-child):not(:last-child)",` - margin-left: ${N}; - margin-right: ${N}; - border-radius: ${N}; - `),be("default"),W("ghost",[be("primary"),be("info"),be("success"),be("warning"),be("error")])])])]),W("vertical",{flexDirection:"column"},[q("button",[G("&:first-child:not(:last-child)",` - margin-bottom: ${N}; - margin-left: ${N}; - margin-right: ${N}; - border-bottom-left-radius: ${N}; - border-bottom-right-radius: ${N}; - `),G("&:last-child:not(:first-child)",` - margin-top: ${N}; - margin-left: ${N}; - margin-right: ${N}; - border-top-left-radius: ${N}; - border-top-right-radius: ${N}; - `),G("&:not(:first-child):not(:last-child)",` - margin: ${N}; - border-radius: ${N}; - `),_e("default"),W("ghost",[_e("primary"),_e("info"),_e("success"),_e("warning"),_e("error")])])])]);const pn={size:{type:String,default:void 0},vertical:Boolean};var mn=Q({name:"ButtonGroup",props:pn,setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:t}=we(e);return $t("-button-group",fn,o),Ze(St,e),{rtlEnabled:Se("ButtonGroup",t,o),mergedClsPrefix:o}},render(){const{mergedClsPrefix:e}=this;return i("div",{class:[`${e}-button-group`,this.rtlEnabled&&`${e}-button-group--rtl`,this.vertical&&`${e}-button-group--vertical`],role:"group"},this.$slots)}});const hn=e=>{const{borderColor:o,primaryColor:t,baseColor:s,textColorDisabled:a,inputColorDisabled:c,textColor2:l,opacityDisabled:k,borderRadius:g,fontSizeSmall:S,fontSizeMedium:p,fontSizeLarge:E,heightSmall:b,heightMedium:m,heightLarge:_,lineHeight:y}=e;return Object.assign(Object.assign({},Bt),{labelLineHeight:y,buttonHeightSmall:b,buttonHeightMedium:m,buttonHeightLarge:_,fontSizeSmall:S,fontSizeMedium:p,fontSizeLarge:E,boxShadow:`inset 0 0 0 1px ${o}`,boxShadowActive:`inset 0 0 0 1px ${t}`,boxShadowFocus:`inset 0 0 0 1px ${t}, 0 0 0 2px ${rt(t,{alpha:.2})}`,boxShadowHover:`inset 0 0 0 1px ${t}`,boxShadowDisabled:`inset 0 0 0 1px ${o}`,color:s,colorDisabled:c,colorActive:"#0000",textColor:l,textColorDisabled:a,dotColorActive:t,dotColorDisabled:o,buttonBorderColor:o,buttonBorderColorActive:t,buttonBorderColorHover:o,buttonColor:s,buttonColorActive:s,buttonTextColor:l,buttonTextColorActive:t,buttonTextColorHover:t,opacityDisabled:k,buttonBoxShadowFocus:`inset 0 0 0 1px ${t}, 0 0 0 2px ${rt(t,{alpha:.3})}`,buttonBoxShadowHover:"inset 0 0 0 1px #0000",buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:g})},vn={name:"Radio",common:et,self:hn};var kt=vn;const gn={name:String,value:{type:[String,Number,Boolean],default:"on"},checked:{type:Boolean,default:void 0},defaultChecked:Boolean,disabled:{type:Boolean,default:void 0},label:String,size:String,onUpdateChecked:[Function,Array],"onUpdate:checked":[Function,Array],checkedValue:{type:Boolean,default:void 0}},Rt=ft("n-radio-group");function bn(e){const o=tt(e,{mergedSize(u){const{size:z}=e;if(z!==void 0)return z;if(l){const{mergedSizeRef:{value:A}}=l;if(A!==void 0)return A}return u?u.mergedSize.value:"medium"},mergedDisabled(u){return!!(e.disabled||l!=null&&l.disabledRef.value||u!=null&&u.disabled.value)}}),{mergedSizeRef:t,mergedDisabledRef:s}=o,a=$(null),c=$(null),l=Ae(Rt,null),k=$(e.defaultChecked),g=ce(e,"checked"),S=Ee(g,k),p=re(()=>l?l.valueRef.value===e.value:S.value),E=re(()=>{const{name:u}=e;if(u!==void 0)return u;if(l)return l.nameRef.value}),b=$(!1);function m(){if(l){const{doUpdateValue:u}=l,{value:z}=e;Z(u,z)}else{const{onUpdateChecked:u,"onUpdate:checked":z}=e,{nTriggerFormInput:A,nTriggerFormChange:U}=o;u&&Z(u,!0),z&&Z(z,!0),A(),U(),k.value=!0}}function _(){s.value||p.value||m()}function y(){_()}function w(){b.value=!1}function P(){b.value=!0}return{mergedClsPrefix:l?l.mergedClsPrefixRef:we(e).mergedClsPrefixRef,inputRef:a,labelRef:c,mergedName:E,mergedDisabled:s,uncontrolledChecked:k,renderSafeChecked:p,focus:b,mergedSize:t,handleRadioInputChange:y,handleRadioInputBlur:w,handleRadioInputFocus:P}}var _n=q("radio",` - line-height: var(--n-label-line-height); - outline: none; - position: relative; - user-select: none; - -webkit-user-select: none; - display: inline-flex; - align-items: flex-start; - flex-wrap: nowrap; - font-size: var(--n-font-size); - word-break: break-word; -`,[W("checked",[K("dot",` - background-color: var(--n-color-active); - `)]),K("dot-wrapper",` - position: relative; - flex-shrink: 0; - flex-grow: 0; - width: var(--n-radio-size); - `),q("radio-input",` - position: absolute; - border: 0; - border-radius: inherit; - left: 0; - right: 0; - top: 0; - bottom: 0; - opacity: 0; - z-index: 1; - cursor: pointer; - `),K("dot",` - position: absolute; - top: 50%; - left: 0; - transform: translateY(-50%); - height: var(--n-radio-size); - width: var(--n-radio-size); - background: var(--n-color); - box-shadow: var(--n-box-shadow); - border-radius: 50%; - transition: - background-color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier); - `,[G("&::before",` - content: ""; - opacity: 0; - position: absolute; - left: 4px; - top: 4px; - height: calc(100% - 8px); - width: calc(100% - 8px); - border-radius: 50%; - transform: scale(.8); - background: var(--n-dot-color-active); - transition: - opacity .3s var(--n-bezier), - background-color .3s var(--n-bezier), - transform .3s var(--n-bezier); - `),W("checked",{boxShadow:"var(--n-box-shadow-active)"},[G("&::before",` - opacity: 1; - transform: scale(1); - `)])]),K("label",` - color: var(--n-text-color); - padding: var(--n-label-padding); - font-weight: var(--n-label-font-weight); - display: inline-block; - transition: color .3s var(--n-bezier); - `),$e("disabled",` - cursor: pointer; - `,[G("&:hover",[K("dot",{boxShadow:"var(--n-box-shadow-hover)"})]),W("focus",[G("&:not(:active)",[K("dot",{boxShadow:"var(--n-box-shadow-focus)"})])])]),W("disabled",` - cursor: not-allowed; - `,[K("dot",{boxShadow:"var(--n-box-shadow-disabled)",backgroundColor:"var(--n-color-disabled)"},[G("&::before",{backgroundColor:"var(--n-dot-color-disabled)"}),W("checked",` - opacity: 1; - `)]),K("label",{color:"var(--n-text-color-disabled)"}),q("radio-input",` - cursor: not-allowed; - `)])]),yn=Q({name:"Radio",props:Object.assign(Object.assign({},fe.props),gn),setup(e){const o=bn(e),t=fe("Radio","-radio",_n,kt,e,o.mergedClsPrefix),s=ne(()=>{const{mergedSize:{value:S}}=o,{common:{cubicBezierEaseInOut:p},self:{boxShadow:E,boxShadowActive:b,boxShadowDisabled:m,boxShadowFocus:_,boxShadowHover:y,color:w,colorDisabled:P,colorActive:u,textColor:z,textColorDisabled:A,dotColorActive:U,dotColorDisabled:L,labelPadding:H,labelLineHeight:O,labelFontWeight:r,[Pe("fontSize",S)]:d,[Pe("radioSize",S)]:B}}=t.value;return{"--n-bezier":p,"--n-label-line-height":O,"--n-label-font-weight":r,"--n-box-shadow":E,"--n-box-shadow-active":b,"--n-box-shadow-disabled":m,"--n-box-shadow-focus":_,"--n-box-shadow-hover":y,"--n-color":w,"--n-color-active":u,"--n-color-disabled":P,"--n-dot-color-active":U,"--n-dot-color-disabled":L,"--n-font-size":d,"--n-radio-size":B,"--n-text-color":z,"--n-text-color-disabled":A,"--n-label-padding":H}}),{inlineThemeDisabled:a,mergedClsPrefixRef:c,mergedRtlRef:l}=we(e),k=Se("Radio",l,c),g=a?nt("radio",ne(()=>o.mergedSize.value[0]),s,e):void 0;return Object.assign(o,{rtlEnabled:k,cssVars:a?void 0:s,themeClass:g==null?void 0:g.themeClass,onRender:g==null?void 0:g.onRender})},render(){const{$slots:e,mergedClsPrefix:o,onRender:t,label:s}=this;return t==null||t(),i("label",{class:[`${o}-radio`,this.themeClass,{[`${o}-radio--rtl`]:this.rtlEnabled,[`${o}-radio--disabled`]:this.mergedDisabled,[`${o}-radio--checked`]:this.renderSafeChecked,[`${o}-radio--focus`]:this.focus}],style:this.cssVars},i("input",{ref:"inputRef",type:"radio",class:`${o}-radio-input`,value:this.value,name:this.mergedName,checked:this.renderSafeChecked,disabled:this.mergedDisabled,onChange:this.handleRadioInputChange,onFocus:this.handleRadioInputFocus,onBlur:this.handleRadioInputBlur}),i("div",{class:`${o}-radio__dot-wrapper`},"\xA0",i("div",{class:[`${o}-radio__dot`,this.renderSafeChecked&&`${o}-radio__dot--checked`]})),Qe(e.default,a=>!a&&!s?null:i("div",{ref:"labelRef",class:`${o}-radio__label`},a||s)))}}),wn=q("radio-group",` - display: inline-block; - font-size: var(--n-font-size); -`,[K("splitor",` - display: inline-block; - vertical-align: bottom; - width: 1px; - transition: - background-color .3s var(--n-bezier), - opacity .3s var(--n-bezier); - background: var(--n-button-border-color); - `,[W("checked",{backgroundColor:"var(--n-button-border-color-active)"}),W("disabled",{opacity:"var(--n-opacity-disabled)"})]),W("button-group",` - white-space: nowrap; - height: var(--n-height); - line-height: var(--n-height); - `,[q("radio-button",{height:"var(--n-height)",lineHeight:"var(--n-height)"}),K("splitor",{height:"var(--n-height)"})]),q("radio-button",` - vertical-align: bottom; - outline: none; - position: relative; - user-select: none; - -webkit-user-select: none; - display: inline-block; - box-sizing: border-box; - padding-left: 14px; - padding-right: 14px; - white-space: nowrap; - transition: - background-color .3s var(--n-bezier), - opacity .3s var(--n-bezier), - border-color .3s var(--n-bezier), - color .3s var(--n-bezier); - color: var(--n-button-text-color); - border-top: 1px solid var(--n-button-border-color); - border-bottom: 1px solid var(--n-button-border-color); - `,[q("radio-input",` - pointer-events: none; - position: absolute; - border: 0; - border-radius: inherit; - left: 0; - right: 0; - top: 0; - bottom: 0; - opacity: 0; - z-index: 1; - `),K("state-border",` - z-index: 1; - pointer-events: none; - position: absolute; - box-shadow: var(--n-button-box-shadow); - transition: box-shadow .3s var(--n-bezier); - left: -1px; - bottom: -1px; - right: -1px; - top: -1px; - `),G("&:first-child",` - border-top-left-radius: var(--n-button-border-radius); - border-bottom-left-radius: var(--n-button-border-radius); - border-left: 1px solid var(--n-button-border-color); - `,[K("state-border",` - border-top-left-radius: var(--n-button-border-radius); - border-bottom-left-radius: var(--n-button-border-radius); - `)]),G("&:last-child",` - border-top-right-radius: var(--n-button-border-radius); - border-bottom-right-radius: var(--n-button-border-radius); - border-right: 1px solid var(--n-button-border-color); - `,[K("state-border",` - border-top-right-radius: var(--n-button-border-radius); - border-bottom-right-radius: var(--n-button-border-radius); - `)]),$e("disabled",` - cursor: pointer; - `,[G("&:hover",[K("state-border",` - transition: box-shadow .3s var(--n-bezier); - box-shadow: var(--n-button-box-shadow-hover); - `),$e("checked",{color:"var(--n-button-text-color-hover)"})]),W("focus",[G("&:not(:active)",[K("state-border",{boxShadow:"var(--n-button-box-shadow-focus)"})])])]),W("checked",` - background: var(--n-button-color-active); - color: var(--n-button-text-color-active); - border-color: var(--n-button-border-color-active); - `),W("disabled",` - cursor: not-allowed; - opacity: var(--n-opacity-disabled); - `)])]);function xn(e,o,t){var s;const a=[];let c=!1;for(let l=0;l{const{value:U}=t,{common:{cubicBezierEaseInOut:L},self:{buttonBorderColor:H,buttonBorderColorActive:O,buttonBorderRadius:r,buttonBoxShadow:d,buttonBoxShadowFocus:B,buttonBoxShadowHover:R,buttonColorActive:Y,buttonTextColor:pe,buttonTextColorActive:me,buttonTextColorHover:ee,opacityDisabled:he,[Pe("buttonHeight",U)]:xe,[Pe("fontSize",U)]:Ce}}=E.value;return{"--n-font-size":Ce,"--n-bezier":L,"--n-button-border-color":H,"--n-button-border-color-active":O,"--n-button-border-radius":r,"--n-button-box-shadow":d,"--n-button-box-shadow-focus":B,"--n-button-box-shadow-hover":R,"--n-button-color-active":Y,"--n-button-text-color":pe,"--n-button-text-color-hover":ee,"--n-button-text-color-active":me,"--n-height":xe,"--n-opacity-disabled":he}}),A=S?nt("radio-group",ne(()=>t.value[0]),z,e):void 0;return{selfElRef:o,rtlEnabled:u,mergedClsPrefix:g,mergedValue:_,handleFocusout:P,handleFocusin:w,cssVars:S?void 0:z,themeClass:A==null?void 0:A.themeClass,onRender:A==null?void 0:A.onRender}},render(){var e;const{mergedValue:o,mergedClsPrefix:t,handleFocusin:s,handleFocusout:a}=this,{children:c,isButtonGroup:l}=xn(Ft(Pt(this)),o,t);return(e=this.onRender)===null||e===void 0||e.call(this),i("div",{onFocusin:s,onFocusout:a,ref:"selfElRef",class:[`${t}-radio-group`,this.rtlEnabled&&`${t}-radio-group--rtl`,this.themeClass,l&&`${t}-radio-group--button-group`],style:this.cssVars},c)}});const Rn=()=>Dt,In=pt({name:"DynamicInput",common:et,peers:{Input:mt,Button:ht},self:Rn});var Vn=In;const ot=ft("n-dynamic-input");var $n=Q({name:"DynamicInputInputPreset",props:{clsPrefix:{type:String,required:!0},value:{type:String,default:""},parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(){const{mergedThemeRef:e,placeholderRef:o}=Ae(ot);return{mergedTheme:e,placeholder:o}},render(){const{mergedTheme:e,placeholder:o,value:t,clsPrefix:s,onUpdateValue:a}=this;return i("div",{class:`${s}-dynamic-input-preset-input`},i(De,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:t,placeholder:o,onUpdateValue:a}))}}),Sn=Q({name:"DynamicInputPairPreset",props:{clsPrefix:{type:String,required:!0},value:{type:Object,default:()=>({key:"",value:""})},parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(e){const{mergedThemeRef:o,keyPlaceholderRef:t,valuePlaceholderRef:s}=Ae(ot);return{mergedTheme:o,keyPlaceholder:t,valuePlaceholder:s,handleKeyInput(a){e.onUpdateValue({key:a,value:e.value.value})},handleValueInput(a){e.onUpdateValue({key:e.value.key,value:a})}}},render(){const{mergedTheme:e,keyPlaceholder:o,valuePlaceholder:t,value:s,clsPrefix:a}=this;return i("div",{class:`${a}-dynamic-input-preset-pair`},i(De,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:s.key,class:`${a}-dynamic-input-pair-input`,placeholder:o,onUpdateValue:this.handleKeyInput}),i(De,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:s.value,class:`${a}-dynamic-input-pair-input`,placeholder:t,onUpdateValue:this.handleValueInput}))}}),Bn=q("dynamic-input",{width:"100%"},[q("dynamic-input-item",` - margin-bottom: 10px; - display: flex; - flex-wrap: nowrap; - `,[q("dynamic-input-preset-input",{flex:1,alignItems:"center"}),q("dynamic-input-preset-pair",` - flex: 1; - display: flex; - align-items: center; - `,[q("dynamic-input-pair-input",[G("&:first-child",{"margin-right":"12px"})])]),K("action",` - align-self: flex-start; - display: flex; - justify-content: flex-end; - flex-shrink: 0; - flex-grow: 0; - margin: var(--action-margin); - `,[W("icon",{cursor:"pointer"})]),G("&:last-child",{marginBottom:0})]),q("form-item",` - padding-top: 0 !important; - margin-right: 0 !important; - `,[q("form-item-blank",{paddingTop:"0 !important"})])]);const Fe=new WeakMap,Fn=Object.assign(Object.assign({},fe.props),{max:Number,min:{type:Number,default:0},value:Array,defaultValue:{type:Array,default:()=>[]},preset:{type:String,default:"input"},keyField:String,itemStyle:[String,Object],keyPlaceholder:{type:String,default:""},valuePlaceholder:{type:String,default:""},placeholder:{type:String,default:""},showSortButton:Boolean,createButtonProps:Object,onCreate:Function,onRemove:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClear:Function,onInput:[Function,Array]});var Pn=Q({name:"DynamicInput",props:Fn,setup(e,{slots:o}){const{mergedComponentPropsRef:t,mergedClsPrefixRef:s,mergedRtlRef:a,inlineThemeDisabled:c}=we(),l=Ae(zt,null),k=$(e.defaultValue),g=ce(e,"value"),S=Ee(g,k),p=fe("DynamicInput","-dynamic-input",Bn,Vn,e,s),E=ne(()=>{const{value:r}=S;if(Array.isArray(r)){const{max:d}=e;return d!==void 0&&r.length>=d}return!1}),b=ne(()=>{const{value:r}=S;return Array.isArray(r)?r.length<=e.min:!0}),m=ne(()=>{var r,d;return(d=(r=t==null?void 0:t.value)===null||r===void 0?void 0:r.DynamicInput)===null||d===void 0?void 0:d.buttonSize});function _(r){const{onInput:d,"onUpdate:value":B,onUpdateValue:R}=e;d&&Z(d,r),B&&Z(B,r),R&&Z(R,r),k.value=r}function y(r,d){if(r==null||typeof r!="object")return d;const B=Ge(r)?We(r):r;let R=Fe.get(B);return R===void 0&&Fe.set(B,R=Et()),R}function w(r,d){const{value:B}=S,R=Array.from(B!=null?B:[]),Y=R[r];if(R[r]=d,Y&&d&&typeof Y=="object"&&typeof d=="object"){const pe=Ge(Y)?We(Y):Y,me=Ge(d)?We(d):d,ee=Fe.get(pe);ee!==void 0&&Fe.set(me,ee)}_(R)}function P(){u(0)}function u(r){const{value:d}=S,{onCreate:B}=e,R=Array.from(d!=null?d:[]);if(B)R.splice(r+1,0,B(r+1)),_(R);else if(o.default)R.splice(r+1,0,null),_(R);else switch(e.preset){case"input":R.splice(r+1,0,""),_(R);break;case"pair":R.splice(r+1,0,{key:"",value:""}),_(R);break}}function z(r){const{value:d}=S;if(!Array.isArray(d))return;const{min:B}=e;if(d.length<=B)return;const R=Array.from(d);R.splice(r,1),_(R);const{onRemove:Y}=e;Y&&Y(r)}function A(r,d,B){if(d<0||B<0||d>=r.length||B>=r.length||d===B)return;const R=r[d];r[d]=r[B],r[B]=R}function U(r,d){const{value:B}=S;if(!Array.isArray(B))return;const R=Array.from(B);r==="up"&&A(R,d,d-1),r==="down"&&A(R,d,d+1),_(R)}Ze(ot,{mergedThemeRef:p,keyPlaceholderRef:ce(e,"keyPlaceholder"),valuePlaceholderRef:ce(e,"valuePlaceholder"),placeholderRef:ce(e,"placeholder")});const L=Se("DynamicInput",a,s),H=ne(()=>{const{self:{actionMargin:r,actionMarginRtl:d}}=p.value;return{"--action-margin":r,"--action-margin-rtl":d}}),O=c?nt("dynamic-input",void 0,H,e):void 0;return{locale:vt("DynamicInput").localeRef,rtlEnabled:L,buttonSize:m,mergedClsPrefix:s,NFormItem:l,uncontrolledValue:k,mergedValue:S,insertionDisabled:E,removeDisabled:b,handleCreateClick:P,ensureKey:y,handleValueChange:w,remove:z,move:U,createItem:u,mergedTheme:p,cssVars:c?void 0:H,themeClass:O==null?void 0:O.themeClass,onRender:O==null?void 0:O.onRender}},render(){const{$slots:e,buttonSize:o,mergedClsPrefix:t,mergedValue:s,locale:a,mergedTheme:c,keyField:l,itemStyle:k,preset:g,showSortButton:S,NFormItem:p,ensureKey:E,handleValueChange:b,remove:m,createItem:_,move:y,onRender:w}=this;return w==null||w(),i("div",{class:[`${t}-dynamic-input`,this.rtlEnabled&&`${t}-dynamic-input--rtl`,this.themeClass],style:this.cssVars},!Array.isArray(s)||s.length===0?i(ye,Object.assign({block:!0,ghost:!0,dashed:!0,size:o},this.createButtonProps,{disabled:this.insertionDisabled,theme:c.peers.Button,themeOverrides:c.peerOverrides.Button,onClick:this.handleCreateClick}),{default:()=>ze(e["create-button-default"],()=>[a.create]),icon:()=>ze(e["create-button-icon"],()=>[i(ve,{clsPrefix:t},{default:()=>i(Ye,null)})])}):s.map((P,u)=>i("div",{key:l?P[l]:E(P,u),"data-key":l?P[l]:E(P,u),class:`${t}-dynamic-input-item`,style:k},At(e.default,{value:s[u],index:u},()=>[g==="input"?i($n,{clsPrefix:t,value:s[u],parentPath:p?p.path.value:void 0,path:p!=null&&p.path.value?`${p.path.value}[${u}]`:void 0,onUpdateValue:z=>b(u,z)}):g==="pair"?i(Sn,{clsPrefix:t,value:s[u],parentPath:p?p.path.value:void 0,path:p!=null&&p.path.value?`${p.path.value}[${u}]`:void 0,onUpdateValue:z=>b(u,z)}):null]),i("div",{class:`${t}-dynamic-input-item__action`},i(mn,{size:o},{default:()=>[i(ye,{disabled:this.removeDisabled,theme:c.peers.Button,themeOverrides:c.peerOverrides.Button,circle:!0,onClick:()=>m(u)},{icon:()=>i(ve,{clsPrefix:t},{default:()=>i(xt,null)})}),i(ye,{disabled:this.insertionDisabled,circle:!0,theme:c.peers.Button,themeOverrides:c.peerOverrides.Button,onClick:()=>_(u)},{icon:()=>i(ve,{clsPrefix:t},{default:()=>i(Ye,null)})}),S?i(ye,{disabled:u===0,circle:!0,theme:c.peers.Button,themeOverrides:c.peerOverrides.Button,onClick:()=>y("up",u)},{icon:()=>i(ve,{clsPrefix:t},{default:()=>i(cn,null)})}):null,S?i(ye,{disabled:u===s.length-1,circle:!0,theme:c.peers.Button,themeOverrides:c.peerOverrides.Button,onClick:()=>y("down",u)},{icon:()=>i(ve,{clsPrefix:t},{default:()=>i(dn,null)})}):null]})))))}});const Dn=e=>{const{textColorDisabled:o}=e;return{iconColorDisabled:o}},zn=pt({name:"InputNumber",common:et,peers:{Button:ht,Input:mt},self:Dn});var An=zn;function En(e){return e==null||typeof e=="string"&&e.trim()===""?null:Number(e)}function Tn(e){return e.includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^\.\d+$/.test(e))}function Je(e){return e==null?!0:!Number.isNaN(e)}function ut(e,o){return e==null?"":o===void 0?String(e):e.toFixed(o)}function Xe(e){if(e===null)return null;if(typeof e=="number")return e;{const o=Number(e);return Number.isNaN(o)?null:o}}var Un=G([q("input-number-suffix",` - display: inline-block; - margin-right: 10px; - `),q("input-number-prefix",` - display: inline-block; - margin-left: 10px; - `)]);const dt=800,ct=100,On=Object.assign(Object.assign({},fe.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:"right"},readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]});var Nn=Q({name:"InputNumber",props:On,setup(e){const{mergedBorderedRef:o,mergedClsPrefixRef:t,mergedRtlRef:s}=we(e),a=fe("InputNumber","-input-number",Un,An,e,t),{localeRef:c}=vt("InputNumber"),l=tt(e),{mergedSizeRef:k,mergedDisabledRef:g,mergedStatusRef:S}=l,p=$(null),E=$(null),b=$(null),m=$(e.defaultValue),_=ce(e,"value"),y=Ee(_,m),w=$(""),P=n=>{const f=String(n).split(".")[1];return f?f.length:0},u=n=>{const f=[e.min,e.max,e.step,n].map(V=>V===void 0?0:P(V));return Math.max(...f)},z=re(()=>{const{placeholder:n}=e;return n!==void 0?n:c.value.placeholder}),A=re(()=>{const n=Xe(e.step);return n!==null?n===0?1:Math.abs(n):1}),U=re(()=>{const n=Xe(e.min);return n!==null?n:null}),L=re(()=>{const n=Xe(e.max);return n!==null?n:null}),H=n=>{const{value:f}=y;if(n===f){r();return}const{"onUpdate:value":V,onUpdateValue:C,onChange:te}=e,{nTriggerFormInput:oe,nTriggerFormChange:ge}=l;te&&Z(te,n),C&&Z(C,n),V&&Z(V,n),m.value=n,oe(),ge()},O=({offset:n,doUpdateIfValid:f,fixPrecision:V,isInputing:C})=>{const{value:te}=w;if(C&&Tn(te))return!1;const oe=(e.parse||En)(te);if(oe===null)return f&&H(null),null;if(Je(oe)){const ge=P(oe),{precision:ke}=e;if(ke!==void 0&&keHe){if(!f||C)return!1;ue=He}if(Ke!==null&&ue{const{value:n}=y;if(Je(n)){const{format:f,precision:V}=e;f?w.value=f(n):n===null||V===void 0||P(n)>V?w.value=ut(n,void 0):w.value=ut(n,V)}else w.value=String(n)};r();const d=re(()=>O({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),B=re(()=>{const{value:n}=y;if(e.validator&&n===null)return!1;const{value:f}=A;return O({offset:-f,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),R=re(()=>{const{value:n}=y;if(e.validator&&n===null)return!1;const{value:f}=A;return O({offset:+f,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function Y(n){const{onFocus:f}=e,{nTriggerFormFocus:V}=l;f&&Z(f,n),V()}function pe(n){var f,V;if(n.target===((f=p.value)===null||f===void 0?void 0:f.wrapperElRef))return;const C=O({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(C!==!1){const ge=(V=p.value)===null||V===void 0?void 0:V.inputElRef;ge&&(ge.value=String(C||"")),y.value===C&&r()}else r();const{onBlur:te}=e,{nTriggerFormBlur:oe}=l;te&&Z(te,n),oe(),Ut(()=>{r()})}function me(n){const{onClear:f}=e;f&&Z(f,n)}function ee(){const{value:n}=R;if(!n){x();return}const{value:f}=y;if(f===null)e.validator||H(Be());else{const{value:V}=A;O({offset:V,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function he(){const{value:n}=B;if(!n){F();return}const{value:f}=y;if(f===null)e.validator||H(Be());else{const{value:V}=A;O({offset:-V,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const xe=Y,Ce=pe;function Be(){if(e.validator)return null;const{value:n}=U,{value:f}=L;return n!==null?Math.max(0,n):f!==null?Math.min(0,f):0}function Te(n){me(n),H(null)}function Ue(n){var f,V,C;!((f=b.value)===null||f===void 0)&&f.$el.contains(n.target)&&n.preventDefault(),!((V=E.value)===null||V===void 0)&&V.$el.contains(n.target)&&n.preventDefault(),(C=p.value)===null||C===void 0||C.activate()}let ie=null,v=null,h=null;function F(){h&&(window.clearTimeout(h),h=null),ie&&(window.clearInterval(ie),ie=null)}function x(){j&&(window.clearTimeout(j),j=null),v&&(window.clearInterval(v),v=null)}function T(){F(),h=window.setTimeout(()=>{ie=window.setInterval(()=>{he()},ct)},dt),at("mouseup",document,F,{once:!0})}let j=null;function se(){x(),j=window.setTimeout(()=>{v=window.setInterval(()=>{ee()},ct)},dt),at("mouseup",document,x,{once:!0})}const Oe=()=>{v||ee()},Ne=()=>{ie||he()};function Me(n){var f,V;if(n.key==="Enter"){if(n.target===((f=p.value)===null||f===void 0?void 0:f.wrapperElRef))return;O({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((V=p.value)===null||V===void 0||V.deactivate())}else if(n.key==="ArrowUp"){if(!R.value||e.keyboard.ArrowUp===!1)return;n.preventDefault(),O({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&ee()}else if(n.key==="ArrowDown"){if(!B.value||e.keyboard.ArrowDown===!1)return;n.preventDefault(),O({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&he()}}function Le(n){w.value=n,e.updateValueOnInput&&!e.format&&!e.parse&&e.precision===void 0&&O({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}gt(y,()=>{r()});const je={focus:()=>{var n;return(n=p.value)===null||n===void 0?void 0:n.focus()},blur:()=>{var n;return(n=p.value)===null||n===void 0?void 0:n.blur()}},qe=Se("InputNumber",s,t);return Object.assign(Object.assign({},je),{rtlEnabled:qe,inputInstRef:p,minusButtonInstRef:E,addButtonInstRef:b,mergedClsPrefix:t,mergedBordered:o,uncontrolledValue:m,mergedValue:y,mergedPlaceholder:z,displayedValueInvalid:d,mergedSize:k,mergedDisabled:g,displayedValue:w,addable:R,minusable:B,mergedStatus:S,handleFocus:xe,handleBlur:Ce,handleClear:Te,handleMouseDown:Ue,handleAddClick:Oe,handleMinusClick:Ne,handleAddMousedown:se,handleMinusMousedown:T,handleKeyDown:Me,handleUpdateDisplayedValue:Le,mergedTheme:a,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:ne(()=>{const{self:{iconColorDisabled:n}}=a.value,[f,V,C,te]=Tt(n);return{textColorTextDisabled:`rgb(${f}, ${V}, ${C})`,opacityDisabled:`${te}`}})})},render(){const{mergedClsPrefix:e,$slots:o}=this,t=()=>i(lt,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:"minusButtonInstRef"},{icon:()=>ze(o["minus-icon"],()=>[i(ve,{clsPrefix:e},{default:()=>i(xt,null)})])}),s=()=>i(lt,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:"addButtonInstRef"},{icon:()=>ze(o["add-icon"],()=>[i(ve,{clsPrefix:e},{default:()=>i(Ye,null)})])});return i("div",{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},i(De,{ref:"inputInstRef",autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,textDecoration:this.displayedValueInvalid?"line-through":void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,internalLoadingBeforeSuffix:!0},{prefix:()=>{var a;return this.showButton&&this.buttonPlacement==="both"?[t(),Qe(o.prefix,c=>c?i("span",{class:`${e}-input-number-prefix`},c):null)]:(a=o.prefix)===null||a===void 0?void 0:a.call(o)},suffix:()=>{var a;return this.showButton?[Qe(o.suffix,c=>c?i("span",{class:`${e}-input-number-suffix`},c):null),this.buttonPlacement==="right"?t():null,s()]:(a=o.suffix)===null||a===void 0?void 0:a.call(o)}}))}});const Mn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ln=X("path",{d:"M216.08 192v143.85a40.08 40.08 0 0 0 80.15 0l.13-188.55a67.94 67.94 0 1 0-135.87 0v189.82a95.51 95.51 0 1 0 191 0V159.74",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),jn=[Ln];var qn=Q({name:"AttachOutline",render:function(o,t){return M(),J("svg",Mn,jn)}});const Hn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Kn=X("path",{d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Gn=X("path",{d:"M350.67 150.93l-117.2 46.88a64 64 0 0 0-35.66 35.66l-46.88 117.2a8 8 0 0 0 10.4 10.4l117.2-46.88a64 64 0 0 0 35.66-35.66l46.88-117.2a8 8 0 0 0-10.4-10.4zM256 280a24 24 0 1 1 24-24a24 24 0 0 1-24 24z",fill:"currentColor"},null,-1),Wn=[Kn,Gn];var Jn=Q({name:"CompassOutline",render:function(o,t){return M(),J("svg",Hn,Wn)}});const Xn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Qn=X("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Yn=X("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),Zn=[Qn,Yn];var eo=Q({name:"EyeOutline",render:function(o,t){return M(),J("svg",Xn,Zn)}});const to={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},no=X("path",{d:"M374.79 308.78L457.5 367a16 16 0 0 0 22.5-14.62V159.62A16 16 0 0 0 457.5 145l-82.71 58.22A16 16 0 0 0 368 216.3v79.4a16 16 0 0 0 6.79 13.08z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),oo=X("path",{d:"M268 384H84a52.15 52.15 0 0 1-52-52V180a52.15 52.15 0 0 1 52-52h184.48A51.68 51.68 0 0 1 320 179.52V332a52.15 52.15 0 0 1-52 52z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),ro=[no,oo];var ao=Q({name:"VideocamOutline",render:function(o,t){return M(),J("svg",to,ro)}});const lo={key:0,class:"compose-wrap"},io={class:"compose-line"},so={class:"compose-user"},uo={class:"compose-line compose-options"},co={class:"attachment"},fo={class:"submit-wrap"},po={class:"attachment-list-wrap"},mo={key:0,class:"attachment-price-wrap"},ho=X("span",null," \u9644\u4EF6\u4EF7\u683C\uFFE5",-1),vo={key:0,class:"eye-wrap"},go={key:1,class:"link-wrap"},bo={key:1,class:"compose-wrap"},_o=X("div",{class:"login-wrap"},[X("span",{class:"login-banner"}," \u767B\u5F55\u540E\uFF0C\u7CBE\u5F69\u66F4\u591A")],-1),yo={class:"login-wrap"},wo=Q({__name:"compose",emits:["post-success"],setup(e,{emit:o}){const t=bt(),s=$([]),a=$(!1),c=$(!1),l=$(!1),k=$(!1),g=$(""),S=$([]),p=$(),E=$(0),b=$("public/image"),m=$([]),_=$([]),y=$([]),w=$([]),P=$(de.FRIEND),u=$(de.FRIEND),z=[{value:de.PUBLIC,label:"\u516C\u5F00"},{value:de.PRIVATE,label:"\u79C1\u5BC6"},{value:de.FRIEND,label:"\u597D\u53CB\u53EF\u89C1"}],A="true".toLocaleLowerCase()==="true",U="true".toLocaleLowerCase()==="true",L="false".toLocaleLowerCase()==="true",H="true".toLocaleLowerCase()==="true",O="/v1/attachment",r=$(),d=()=>{l.value=!l.value,l.value&&k.value&&(k.value=!1)},B=()=>{k.value=!k.value,k.value&&l.value&&(l.value=!1)},R=st.exports.debounce(v=>{Ot({k:v}).then(h=>{let F=[];h.suggest.map(x=>{F.push({label:x,value:x})}),s.value=F,a.value=!1}).catch(h=>{a.value=!1})},200),Y=st.exports.debounce(v=>{Nt({k:v}).then(h=>{let F=[];h.suggest.map(x=>{F.push({label:x,value:x})}),s.value=F,a.value=!1}).catch(h=>{a.value=!1})},200),pe=(v,h)=>{a.value||(a.value=!0,h==="@"?R(v):Y(v))},me=v=>{v.length>200||(g.value=v)},ee=v=>{b.value=v},he=v=>{m.value=v},xe=async v=>{var h,F,x,T,j,se;return b.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((h=v.file.file)==null?void 0:h.type)?(window.$message.warning("\u56FE\u7247\u4EC5\u5141\u8BB8 png/jpg/gif \u683C\u5F0F"),!1):b.value==="image"&&((F=v.file.file)==null?void 0:F.size)>10485760?(window.$message.warning("\u56FE\u7247\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC710MB"),!1):b.value==="public/video"&&!["video/mp4","video/quicktime"].includes((x=v.file.file)==null?void 0:x.type)?(window.$message.warning("\u89C6\u9891\u4EC5\u5141\u8BB8 mp4/mov \u683C\u5F0F"),!1):b.value==="public/video"&&((T=v.file.file)==null?void 0:T.size)>104857600?(window.$message.warning("\u89C6\u9891\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7100MB"),!1):b.value==="attachment"&&!["application/zip"].includes((j=v.file.file)==null?void 0:j.type)?(window.$message.warning("\u9644\u4EF6\u4EC5\u5141\u8BB8 zip \u683C\u5F0F"),!1):b.value==="attachment"&&((se=v.file.file)==null?void 0:se.size)>104857600?(window.$message.warning("\u9644\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7100MB"),!1):!0},Ce=({file:v,event:h})=>{var F;try{let x=JSON.parse((F=h.target)==null?void 0:F.response);x.code===0&&(b.value==="public/image"&&_.value.push({id:v.id,content:x.data.content}),b.value==="public/video"&&y.value.push({id:v.id,content:x.data.content}),b.value==="attachment"&&w.value.push({id:v.id,content:x.data.content}))}catch{window.$message.error("\u4E0A\u4F20\u5931\u8D25")}},Be=({file:v,event:h})=>{var F;try{let x=JSON.parse((F=h.target)==null?void 0:F.response);if(x.code!==0){let T=x.msg||"\u4E0A\u4F20\u5931\u8D25";x.details&&x.details.length>0&&x.details.map(j=>{T+=":"+j}),window.$message.error(T)}}catch{window.$message.error("\u4E0A\u4F20\u5931\u8D25")}},Te=({file:v})=>{let h=_.value.findIndex(F=>F.id===v.id);h>-1&&_.value.splice(h,1),h=y.value.findIndex(F=>F.id===v.id),h>-1&&y.value.splice(h,1),h=w.value.findIndex(F=>F.id===v.id),h>-1&&w.value.splice(h,1)},Ue=()=>{if(g.value.trim().length===0){window.$message.warning("\u8BF7\u8F93\u5165\u5185\u5BB9\u54E6");return}let{tags:v,users:h}=Zt(g.value);const F=[];let x=100;F.push({content:g.value,type:Ie.TEXT,sort:x}),_.value.map(T=>{x++,F.push({content:T.content,type:Ie.IMAGEURL,sort:x})}),y.value.map(T=>{x++,F.push({content:T.content,type:Ie.VIDEOURL,sort:x})}),w.value.map(T=>{x++,F.push({content:T.content,type:Ie.ATTACHMENT,sort:x})}),S.value.length>0&&S.value.map(T=>{x++,F.push({content:T,type:Ie.LINKURL,sort:x})}),c.value=!0,Lt({contents:F,tags:Array.from(new Set(v)),users:Array.from(new Set(h)),attachment_price:+E.value*100,visibility:P.value}).then(T=>{var j;window.$message.success("\u53D1\u5E03\u6210\u529F"),c.value=!1,o("post-success",T),l.value=!1,k.value=!1,(j=p.value)==null||j.clear(),m.value=[],g.value="",S.value=[],_.value=[],y.value=[],w.value=[],P.value=u.value}).catch(T=>{c.value=!1})},ie=v=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",v)};return _t(()=>{"friend".toLowerCase()==="friend"?u.value=de.FRIEND:"friend".toLowerCase()==="public"?u.value=de.PUBLIC:u.value=de.PRIVATE,P.value=u.value,r.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(v,h)=>{const F=jt,x=Yt,T=qt,j=ye,se=en,Oe=tn,Ne=Ht,Me=nn,Le=Nn,je=on,qe=yn,n=Kt,f=kn,V=Pn;return M(),J("div",null,[ae(t).state.userInfo.id>0?(M(),J("div",lo,[X("div",io,[X("div",so,[I(F,{round:"",size:30,src:ae(t).state.userInfo.avatar},null,8,["src"])]),I(x,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:a.value,value:g.value,prefix:["@","#"],options:s.value,onSearch:pe,"onUpdate:value":me,placeholder:"\u8BF4\u8BF4\u60A8\u7684\u65B0\u9C9C\u4E8B..."},null,8,["loading","value","options"])]),I(je,{ref_key:"uploadRef",ref:p,abstract:"","list-type":"image",multiple:!0,max:9,action:O,headers:{Authorization:r.value},data:{type:b.value},onBeforeUpload:xe,onFinish:Ce,onError:Be,onRemove:Te,"onUpdate:fileList":he},{default:D(()=>[X("div",uo,[X("div",co,[I(se,{abstract:""},{default:D(({handleClick:C})=>[I(j,{disabled:m.value.length>0&&b.value==="public/video"||m.value.length===9,onClick:()=>{ee("public/image"),C()},quaternary:"",circle:"",type:"primary"},{icon:D(()=>[I(T,{size:"20",color:"var(--primary-color)"},{default:D(()=>[I(ae(Qt))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),A?(M(),Ve(se,{key:0,abstract:""},{default:D(({handleClick:C})=>[I(j,{disabled:m.value.length>0&&b.value!=="public/video"||m.value.length===9,onClick:()=>{ee("public/video"),C()},quaternary:"",circle:"",type:"primary"},{icon:D(()=>[I(T,{size:"20",color:"var(--primary-color)"},{default:D(()=>[I(ae(ao))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):le("",!0),U?(M(),Ve(se,{key:1,abstract:""},{default:D(({handleClick:C})=>[I(j,{disabled:m.value.length>0&&b.value==="public/video"||m.value.length===9,onClick:()=>{ee("attachment"),C()},quaternary:"",circle:"",type:"primary"},{icon:D(()=>[I(T,{size:"20",color:"var(--primary-color)"},{default:D(()=>[I(ae(qn))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):le("",!0),I(j,{quaternary:"",circle:"",type:"primary",onClick:it(d,["stop"])},{icon:D(()=>[I(T,{size:"20",color:"var(--primary-color)"},{default:D(()=>[I(ae(Jn))]),_:1})]),_:1},8,["onClick"]),H?(M(),Ve(j,{key:2,quaternary:"",circle:"",type:"primary",onClick:it(B,["stop"])},{icon:D(()=>[I(T,{size:"20",color:"var(--primary-color)"},{default:D(()=>[I(ae(eo))]),_:1})]),_:1},8,["onClick"])):le("",!0)]),X("div",fo,[I(Ne,{trigger:"hover",placement:"bottom"},{trigger:D(()=>[I(Oe,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:g.value.length/200*100},null,8,["percentage"])]),default:D(()=>[Re(" "+Mt(g.value.length)+" / 200 ",1)]),_:1}),I(j,{loading:c.value,onClick:Ue,type:"primary",secondary:"",round:""},{default:D(()=>[Re(" \u53D1\u5E03 ")]),_:1},8,["loading"])])]),X("div",po,[I(Me),w.value.length>0?(M(),J("div",mo,[L?(M(),Ve(Le,{key:0,value:E.value,"onUpdate:value":h[0]||(h[0]=C=>E.value=C),min:0,max:1e5,placeholder:"\u8BF7\u8F93\u5165\u9644\u4EF6\u4EF7\u683C\uFF0C0\u4E3A\u514D\u8D39\u9644\u4EF6"},{prefix:D(()=>[ho]),_:1},8,["value"])):le("",!0)])):le("",!0)])]),_:1},8,["headers","data"]),k.value?(M(),J("div",vo,[I(f,{value:P.value,"onUpdate:value":h[1]||(h[1]=C=>P.value=C),name:"radiogroup"},{default:D(()=>[I(n,null,{default:D(()=>[(M(),J(yt,null,wt(z,C=>I(qe,{key:C.value,value:C.value,label:C.label},null,8,["value","label"])),64))]),_:1})]),_:1},8,["value"])])):le("",!0),l.value?(M(),J("div",go,[I(V,{value:S.value,"onUpdate:value":h[2]||(h[2]=C=>S.value=C),placeholder:"\u8BF7\u8F93\u5165\u4EE5http(s)://\u5F00\u5934\u7684\u94FE\u63A5",min:0,max:3},{"create-button-default":D(()=>[Re(" \u521B\u5EFA\u94FE\u63A5 ")]),_:1},8,["value"])])):le("",!0)])):(M(),J("div",bo,[_o,X("div",yo,[I(j,{strong:"",secondary:"",round:"",type:"primary",onClick:h[3]||(h[3]=C=>ie("signin"))},{default:D(()=>[Re(" \u767B\u5F55 ")]),_:1}),I(j,{strong:"",secondary:"",round:"",type:"info",onClick:h[4]||(h[4]=C=>ie("signup"))},{default:D(()=>[Re(" \u6CE8\u518C ")]),_:1})])]))])}}});const xo={key:0,class:"pagination-wrap"},Co={key:0,class:"skeleton-wrap"},ko={key:1},Ro={key:0,class:"empty-wrap"},Io=Q({__name:"Home",setup(e){const o=bt(),t=Wt(),s=Xt(),a=$(!1),c=$([]),l=$(+t.query.p||1),k=$(20),g=$(0),S=ne(()=>{let m="\u6CE1\u6CE1\u5E7F\u573A";return t.query&&t.query.q&&(t.query.t&&t.query.t==="tag"?m="#"+decodeURIComponent(t.query.q):m="\u641C\u7D22: "+decodeURIComponent(t.query.q)),m}),p=()=>{a.value=!0,Jt({query:t.query.q?decodeURIComponent(t.query.q):null,type:t.query.t,page:l.value,page_size:k.value}).then(m=>{a.value=!1,c.value=m.list,g.value=Math.ceil(m.pager.total_rows/k.value),window.scrollTo(0,0)}).catch(m=>{a.value=!1})},E=m=>{if(l.value!=1){s.push({name:"post",query:{id:m.id}});return}let _=[],y=c.value.length;y==k.value&&y--;for(var w=0;w{s.push({name:"home",query:{...t.query,p:m}})};return _t(()=>{p()}),gt(()=>({path:t.path,query:t.query,refresh:o.state.refresh}),(m,_)=>{if(m.refresh!==_.refresh){l.value=+t.query.p||1,setTimeout(()=>{p()},0);return}_.path!=="/post"&&m.path==="/"&&(l.value=+t.query.p||1,setTimeout(()=>{p()},0))}),(m,_)=>{const y=rn,w=ln,P=wo,u=sn,z=Vt,A=un,U=It,L=an;return M(),J("div",null,[I(y,{title:ae(S)},null,8,["title"]),I(L,{class:"main-content-wrap",bordered:""},{footer:D(()=>[g.value>1?(M(),J("div",xo,[I(w,{page:l.value,"onUpdate:page":b,"page-slot":ae(o).state.collapsedRight?5:8,"page-count":g.value},null,8,["page","page-slot","page-count"])])):le("",!0)]),default:D(()=>[I(u,null,{default:D(()=>[I(P,{onPostSuccess:E})]),_:1}),a.value?(M(),J("div",Co,[I(z,{num:k.value},null,8,["num"])])):(M(),J("div",ko,[c.value.length===0?(M(),J("div",Ro,[I(A,{size:"large",description:"\u6682\u65E0\u6570\u636E"})])):le("",!0),(M(!0),J(yt,null,wt(c.value,H=>(M(),Ve(u,{key:H.id},{default:D(()=>[I(U,{post:H},null,8,["post"])]),_:2},1024))),128))]))]),_:1})])}}});var Oo=Gt(Io,[["__scopeId","data-v-7e0dfc66"]]);export{Oo as default}; diff --git a/web/dist/assets/IEnum-a180d93e.js b/web/dist/assets/IEnum-a180d93e.js new file mode 100644 index 00000000..3364db40 --- /dev/null +++ b/web/dist/assets/IEnum-a180d93e.js @@ -0,0 +1 @@ +var L=(A=>(A[A.TITLE=1]="TITLE",A[A.TEXT=2]="TEXT",A[A.IMAGEURL=3]="IMAGEURL",A[A.VIDEOURL=4]="VIDEOURL",A[A.AUDIOURL=5]="AUDIOURL",A[A.LINKURL=6]="LINKURL",A[A.ATTACHMENT=7]="ATTACHMENT",A[A.CHARGEATTACHMENT=8]="CHARGEATTACHMENT",A))(L||{}),R=(A=>(A[A.PUBLIC=0]="PUBLIC",A[A.PRIVATE=1]="PRIVATE",A[A.FRIEND=2]="FRIEND",A))(R||{}),U=(A=>(A[A.NO=0]="NO",A[A.YES=1]="YES",A))(U||{});export{L as P,R as V,U as Y}; diff --git a/web/dist/assets/IEnum.032938cf.js b/web/dist/assets/IEnum.032938cf.js deleted file mode 100644 index 22d6ee94..00000000 --- a/web/dist/assets/IEnum.032938cf.js +++ /dev/null @@ -1,30 +0,0 @@ -import{E as gp,k as dp,bk as pp,F as _p,ba as vp,b as wp,c as yo,aX as xp,d as Lo,u as Ap,x as Eo,o as Sp,r as Ne,y as Ki,aQ as mp,t as Rp,s as Ip,A as yp,a$ as qi,a_ as Tp,h as Ce,b0 as Cp,b1 as Lp,b2 as Ep,b3 as bp,_ as Op,bC as Mp,V as To,w as pr,W as Bp,Y as Wp,Z as _r}from"./index.d4f5aad2.js";import{N as Up}from"./Skeleton.e1c16fcb.js";var Rt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};const Fp=v=>{const{boxShadow2:Q}=v;return{menuBoxShadow:Q}},Pp=gp({name:"Mention",common:dp,peers:{InternalSelectMenu:pp,Input:_p},self:Fp});var Dp=Pp;function Np(v,Q={debug:!1,useSelectionEnd:!1,checkWidthOverflow:!0}){const l=v.selectionStart!==null?v.selectionStart:0,te=v.selectionEnd!==null?v.selectionEnd:0,mn=Q.useSelectionEnd?te:l,He=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],Z=navigator.userAgent.toLowerCase().includes("firefox");if(!vp)throw new Error("textarea-caret-position#getCaretPosition should only be called in a browser");const Rn=Q==null?void 0:Q.debug;if(Rn){const j=document.querySelector("#input-textarea-caret-position-mirror-div");j!=null&&j.parentNode&&j.parentNode.removeChild(j)}const on=document.createElement("div");on.id="input-textarea-caret-position-mirror-div",document.body.appendChild(on);const ln=on.style,z=window.getComputedStyle?window.getComputedStyle(v):v.currentStyle,k=v.nodeName==="INPUT";ln.whiteSpace=k?"nowrap":"pre-wrap",k||(ln.wordWrap="break-word"),ln.position="absolute",Rn||(ln.visibility="hidden"),He.forEach(j=>{if(k&&j==="lineHeight")if(z.boxSizing==="border-box"){const Jn=parseInt(z.height),nn=parseInt(z.paddingTop)+parseInt(z.paddingBottom)+parseInt(z.borderTopWidth)+parseInt(z.borderBottomWidth),hn=nn+parseInt(z.lineHeight);Jn>hn?ln.lineHeight=`${Jn-nn}px`:Jn===hn?ln.lineHeight=z.lineHeight:ln.lineHeight="0"}else ln.lineHeight=z.height;else ln[j]=z[j]}),Z?v.scrollHeight>parseInt(z.height)&&(ln.overflowY="scroll"):ln.overflow="hidden",on.textContent=v.value.substring(0,mn),k&&on.textContent&&(on.textContent=on.textContent.replace(/\s/g,"\xA0"));const tn=document.createElement("span");tn.textContent=v.value.substring(mn)||".",tn.style.position="relative",tn.style.left=`${-v.scrollLeft}px`,tn.style.top=`${-v.scrollTop}px`,on.appendChild(tn);const cn={top:tn.offsetTop+parseInt(z.borderTopWidth),left:tn.offsetLeft+parseInt(z.borderLeftWidth),absolute:!1,height:parseInt(z.fontSize)*1.5};return Rn?tn.style.backgroundColor="#aaa":document.body.removeChild(on),cn.left>=v.clientWidth&&Q.checkWidthOverflow&&(cn.left=v.clientWidth),cn}var Hp=wp([yo("mention","width: 100%; z-index: auto; position: relative;"),yo("mention-menu",` - box-shadow: var(--n-menu-box-shadow); - `,[xp({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);const Gp=Object.assign(Object.assign({},Eo.props),{to:qi.propTo,autosize:[Boolean,Object],options:{type:Array,default:[]},type:{type:String,default:"text"},separator:{type:String,validator:v=>v.length!==1?(Mp("mention","`separator`'s length must be 1."),!1):!0,default:" "},bordered:{type:Boolean,default:void 0},disabled:Boolean,value:String,defaultValue:{type:String,default:""},loading:Boolean,prefix:{type:[String,Array],default:"@"},placeholder:{type:String,default:""},placement:{type:String,default:"bottom-start"},size:String,renderLabel:Function,status:String,"onUpdate:show":[Array,Function],onUpdateShow:[Array,Function],"onUpdate:value":[Array,Function],onUpdateValue:[Array,Function],onSearch:Function,onSelect:Function,onFocus:Function,onBlur:Function,internalDebug:Boolean});var kp=Lo({name:"Mention",props:Gp,setup(v){const{namespaceRef:Q,mergedClsPrefixRef:l,mergedBorderedRef:te,inlineThemeDisabled:mn}=Ap(v),He=Eo("Mention","-mention",Hp,Dp,v,l),Z=Sp(v),Rn=Ne(null),on=Ne(null),ln=Ne(null),z=Ne("");let k=null,tn=null,cn=null;const j=Ki(()=>{const{value:S}=z;return v.options.filter(M=>S?typeof M.label=="string"?M.label.startsWith(S):typeof M.value=="string"?M.value.startsWith(S):!1:!0)}),Jn=Ki(()=>mp(j.value,{getKey:S=>S.value})),nn=Ne(null),hn=Ne(!1),tt=Ne(v.defaultValue),Mn=Rp(v,"value"),de=Ip(Mn,tt),In=Ki(()=>{const{self:{menuBoxShadow:S}}=He.value;return{"--n-menu-box-shadow":S}}),yn=mn?yp("mention",void 0,In,v):void 0;function rn(S){if(v.disabled)return;const{onUpdateShow:M,"onUpdate:show":P}=v;M&&pr(M,S),P&&pr(P,S),S||(k=null,tn=null,cn=null),hn.value=S}function pe(S){const{onUpdateValue:M,"onUpdate:value":P}=v,{nTriggerFormChange:X,nTriggerFormInput:_n}=Z;P&&pr(P,S),M&&pr(M,S),_n(),X(),tt.value=S}function Le(){return v.type==="text"?Rn.value.inputElRef:Rn.value.textareaElRef}function It(){var S;const M=Le();if(document.activeElement!==M){rn(!1);return}const{selectionEnd:P}=M;if(P===null){rn(!1);return}const X=M.value,{separator:_n}=v,{prefix:ve}=v,Qn=typeof ve=="string"?[ve]:ve;for(let vn=P-1;vn>=0;--vn){const $n=X[vn];if($n===_n||$n===` -`||$n==="\r"){rn(!1);return}if(Qn.includes($n)){const kn=X.slice(vn+1,P);rn(!0),(S=v.onSearch)===null||S===void 0||S.call(v,kn,$n),z.value=kn,k=$n,tn=vn+1,cn=P;return}}rn(!1)}function vr(){const{value:S}=on;if(!S)return;const M=Le(),P=Np(M);P.left+=M.parentElement.offsetLeft,S.style.left=`${P.left}px`,S.style.top=`${P.top+P.height}px`}function wr(){var S;!hn.value||(S=ln.value)===null||S===void 0||S.syncPosition()}function xr(S){pe(S),_e()}function _e(){setTimeout(()=>{vr(),It(),To().then(wr)},0)}function Ar(S){var M,P;if(S.key==="ArrowLeft"||S.key==="ArrowRight"){if(!((M=Rn.value)===null||M===void 0)&&M.isCompositing)return;_e()}else if(S.key==="ArrowUp"||S.key==="ArrowDown"||S.key==="Enter"){if(!((P=Rn.value)===null||P===void 0)&&P.isCompositing)return;const{value:X}=nn;if(hn.value){if(X)if(S.preventDefault(),S.key==="ArrowUp")X.prev();else if(S.key==="ArrowDown")X.next();else{const _n=X.getPendingTmNode();_n?Ee(_n):rn(!1)}}else _e()}}function Sr(S){const{onFocus:M}=v;M==null||M(S);const{nTriggerFormFocus:P}=Z;P(),_e()}function re(){var S;(S=Rn.value)===null||S===void 0||S.focus()}function Vn(){var S;(S=Rn.value)===null||S===void 0||S.blur()}function mr(S){const{onBlur:M}=v;M==null||M(S);const{nTriggerFormBlur:P}=Z;P(),rn(!1)}function Ee(S){var M;if(k===null||tn===null||cn===null)return;const{rawNode:{value:P=""}}=S,X=Le(),_n=X.value,{separator:ve}=v,Qn=_n.slice(cn),vn=Qn.startsWith(ve),$n=`${P}${vn?"":ve}`;pe(_n.slice(0,tn)+$n+Qn),(M=v.onSelect)===null||M===void 0||M.call(v,S.rawNode,k);const kn=tn+$n.length+(vn?1:0);To().then(()=>{X.selectionStart=kn,X.selectionEnd=kn,It()})}function Bn(){v.disabled||_e()}return{namespace:Q,mergedClsPrefix:l,mergedBordered:te,mergedSize:Z.mergedSizeRef,mergedStatus:Z.mergedStatusRef,mergedTheme:He,treeMate:Jn,selectMenuInstRef:nn,inputInstRef:Rn,cursorRef:on,followerRef:ln,showMenu:hn,adjustedTo:qi(v),isMounted:Tp(),mergedValue:de,handleInputFocus:Sr,handleInputBlur:mr,handleInputUpdateValue:xr,handleInputKeyDown:Ar,handleSelect:Ee,handleInputMouseDown:Bn,focus:re,blur:Vn,cssVars:mn?void 0:In,themeClass:yn==null?void 0:yn.themeClass,onRender:yn==null?void 0:yn.onRender}},render(){const{mergedTheme:v,mergedClsPrefix:Q,$slots:l}=this;return Ce("div",{class:`${Q}-mention`},Ce(Op,{status:this.mergedStatus,themeOverrides:v.peerOverrides.Input,theme:v.peers.Input,size:this.mergedSize,autosize:this.autosize,type:this.type,ref:"inputInstRef",placeholder:this.placeholder,onMousedown:this.handleInputMouseDown,onUpdateValue:this.handleInputUpdateValue,onKeydown:this.handleInputKeyDown,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,bordered:this.mergedBordered,disabled:this.disabled,value:this.mergedValue}),Ce(Cp,null,{default:()=>[Ce(Lp,null,{default:()=>Ce("div",{style:{position:"absolute",width:0,height:0},ref:"cursorRef"})}),Ce(Ep,{ref:"followerRef",placement:this.placement,show:this.showMenu,containerClass:this.namespace,to:this.adjustedTo,teleportDisabled:this.adjustedTo===qi.tdkey},{default:()=>Ce(bp,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>{const{mergedTheme:te,onRender:mn}=this;return mn==null||mn(),this.showMenu?Ce(Up,{clsPrefix:Q,theme:te.peers.InternalSelectMenu,themeOverrides:te.peerOverrides.InternalSelectMenu,autoPending:!0,ref:"selectMenuInstRef",class:[`${Q}-mention-menu`,this.themeClass],loading:this.loading,treeMate:this.treeMate,virtualScroll:!1,style:this.cssVars,onToggle:this.handleSelect,renderLabel:this.renderLabel},l):null}})})]}))}});const $p={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},zp=_r("rect",{x:"48",y:"80",width:"416",height:"352",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),Kp=_r("circle",{cx:"336",cy:"176",r:"32",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),qp=_r("path",{d:"M304 335.79l-90.66-90.49a32 32 0 0 0-43.87-1.3L48 352",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Yp=_r("path",{d:"M224 432l123.34-123.34a32 32 0 0 1 43.11-2L464 368",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Zp=[zp,Kp,qp,Yp];var jp=Lo({name:"ImageOutline",render:function(Q,l){return Bp(),Wp("svg",$p,Zp)}}),Co={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */(function(v,Q){(function(){var l,te="4.17.21",mn=200,He="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",Z="Expected a function",Rn="Invalid `variable` option passed into `_.template`",on="__lodash_hash_undefined__",ln=500,z="__lodash_placeholder__",k=1,tn=2,cn=4,j=1,Jn=2,nn=1,hn=2,tt=4,Mn=8,de=16,In=32,yn=64,rn=128,pe=256,Le=512,It=30,vr="...",wr=800,xr=16,_e=1,Ar=2,Sr=3,re=1/0,Vn=9007199254740991,mr=17976931348623157e292,Ee=0/0,Bn=4294967295,S=Bn-1,M=Bn>>>1,P=[["ary",rn],["bind",nn],["bindKey",hn],["curry",Mn],["curryRight",de],["flip",Le],["partial",In],["partialRight",yn],["rearg",pe]],X="[object Arguments]",_n="[object Array]",ve="[object AsyncFunction]",Qn="[object Boolean]",vn="[object Date]",$n="[object DOMException]",kn="[object Error]",yt="[object Function]",Yi="[object GeneratorFunction]",zn="[object Map]",rt="[object Number]",bo="[object Null]",ie="[object Object]",Zi="[object Promise]",Oo="[object Proxy]",it="[object RegExp]",Kn="[object Set]",ut="[object String]",Tt="[object Symbol]",Mo="[object Undefined]",ft="[object WeakMap]",Bo="[object WeakSet]",ot="[object ArrayBuffer]",Ge="[object DataView]",Rr="[object Float32Array]",Ir="[object Float64Array]",yr="[object Int8Array]",Tr="[object Int16Array]",Cr="[object Int32Array]",Lr="[object Uint8Array]",Er="[object Uint8ClampedArray]",br="[object Uint16Array]",Or="[object Uint32Array]",Wo=/\b__p \+= '';/g,Uo=/\b(__p \+=) '' \+/g,Fo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xi=/&(?:amp|lt|gt|quot|#39);/g,Ji=/[&<>"']/g,Po=RegExp(Xi.source),Do=RegExp(Ji.source),No=/<%-([\s\S]+?)%>/g,Ho=/<%([\s\S]+?)%>/g,Vi=/<%=([\s\S]+?)%>/g,Go=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$o=/^\w*$/,zo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mr=/[\\^$.*+?()[\]{}|]/g,Ko=RegExp(Mr.source),Br=/^\s+/,qo=/\s/,Yo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Zo=/\{\n\/\* \[wrapped with (.+)\] \*/,Xo=/,? & /,Jo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vo=/[()=,{}\[\]\/\s]/,Qo=/\\(\\)?/g,ko=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Qi=/\w*$/,jo=/^[-+]0x[0-9a-f]+$/i,nl=/^0b[01]+$/i,el=/^\[object .+?Constructor\]$/,tl=/^0o[0-7]+$/i,rl=/^(?:0|[1-9]\d*)$/,il=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ct=/($^)/,ul=/['\n\r\u2028\u2029\\]/g,Lt="\\ud800-\\udfff",fl="\\u0300-\\u036f",ol="\\ufe20-\\ufe2f",ll="\\u20d0-\\u20ff",ki=fl+ol+ll,ji="\\u2700-\\u27bf",nu="a-z\\xdf-\\xf6\\xf8-\\xff",sl="\\xac\\xb1\\xd7\\xf7",al="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",cl="\\u2000-\\u206f",hl=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",eu="A-Z\\xc0-\\xd6\\xd8-\\xde",tu="\\ufe0e\\ufe0f",ru=sl+al+cl+hl,Wr="['\u2019]",gl="["+Lt+"]",iu="["+ru+"]",Et="["+ki+"]",uu="\\d+",dl="["+ji+"]",fu="["+nu+"]",ou="[^"+Lt+ru+uu+ji+nu+eu+"]",Ur="\\ud83c[\\udffb-\\udfff]",pl="(?:"+Et+"|"+Ur+")",lu="[^"+Lt+"]",Fr="(?:\\ud83c[\\udde6-\\uddff]){2}",Pr="[\\ud800-\\udbff][\\udc00-\\udfff]",$e="["+eu+"]",su="\\u200d",au="(?:"+fu+"|"+ou+")",_l="(?:"+$e+"|"+ou+")",cu="(?:"+Wr+"(?:d|ll|m|re|s|t|ve))?",hu="(?:"+Wr+"(?:D|LL|M|RE|S|T|VE))?",gu=pl+"?",du="["+tu+"]?",vl="(?:"+su+"(?:"+[lu,Fr,Pr].join("|")+")"+du+gu+")*",wl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",pu=du+gu+vl,Al="(?:"+[dl,Fr,Pr].join("|")+")"+pu,Sl="(?:"+[lu+Et+"?",Et,Fr,Pr,gl].join("|")+")",ml=RegExp(Wr,"g"),Rl=RegExp(Et,"g"),Dr=RegExp(Ur+"(?="+Ur+")|"+Sl+pu,"g"),Il=RegExp([$e+"?"+fu+"+"+cu+"(?="+[iu,$e,"$"].join("|")+")",_l+"+"+hu+"(?="+[iu,$e+au,"$"].join("|")+")",$e+"?"+au+"+"+cu,$e+"+"+hu,xl,wl,uu,Al].join("|"),"g"),yl=RegExp("["+su+Lt+ki+tu+"]"),Tl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Cl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ll=-1,H={};H[Rr]=H[Ir]=H[yr]=H[Tr]=H[Cr]=H[Lr]=H[Er]=H[br]=H[Or]=!0,H[X]=H[_n]=H[ot]=H[Qn]=H[Ge]=H[vn]=H[kn]=H[yt]=H[zn]=H[rt]=H[ie]=H[it]=H[Kn]=H[ut]=H[ft]=!1;var N={};N[X]=N[_n]=N[ot]=N[Ge]=N[Qn]=N[vn]=N[Rr]=N[Ir]=N[yr]=N[Tr]=N[Cr]=N[zn]=N[rt]=N[ie]=N[it]=N[Kn]=N[ut]=N[Tt]=N[Lr]=N[Er]=N[br]=N[Or]=!0,N[kn]=N[yt]=N[ft]=!1;var El={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},bl={"&":"&","<":"<",">":">",'"':""","'":"'"},Ol={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ml={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Bl=parseFloat,Wl=parseInt,_u=typeof Rt=="object"&&Rt&&Rt.Object===Object&&Rt,Ul=typeof self=="object"&&self&&self.Object===Object&&self,un=_u||Ul||Function("return this")(),Nr=Q&&!Q.nodeType&&Q,be=Nr&&!0&&v&&!v.nodeType&&v,vu=be&&be.exports===Nr,Hr=vu&&_u.process,Wn=function(){try{var a=be&&be.require&&be.require("util").types;return a||Hr&&Hr.binding&&Hr.binding("util")}catch{}}(),wu=Wn&&Wn.isArrayBuffer,xu=Wn&&Wn.isDate,Au=Wn&&Wn.isMap,Su=Wn&&Wn.isRegExp,mu=Wn&&Wn.isSet,Ru=Wn&&Wn.isTypedArray;function Tn(a,g,h){switch(h.length){case 0:return a.call(g);case 1:return a.call(g,h[0]);case 2:return a.call(g,h[0],h[1]);case 3:return a.call(g,h[0],h[1],h[2])}return a.apply(g,h)}function Fl(a,g,h,x){for(var y=-1,W=a==null?0:a.length;++y-1}function Gr(a,g,h){for(var x=-1,y=a==null?0:a.length;++x-1;);return h}function Ou(a,g){for(var h=a.length;h--&&ze(g,a[h],0)>-1;);return h}function ql(a,g){for(var h=a.length,x=0;h--;)a[h]===g&&++x;return x}var Yl=qr(El),Zl=qr(bl);function Xl(a){return"\\"+Ml[a]}function Jl(a,g){return a==null?l:a[g]}function Ke(a){return yl.test(a)}function Vl(a){return Tl.test(a)}function Ql(a){for(var g,h=[];!(g=a.next()).done;)h.push(g.value);return h}function Jr(a){var g=-1,h=Array(a.size);return a.forEach(function(x,y){h[++g]=[y,x]}),h}function Mu(a,g){return function(h){return a(g(h))}}function Ae(a,g){for(var h=-1,x=a.length,y=0,W=[];++h-1}function Ds(n,e){var t=this.__data__,r=Zt(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}ue.prototype.clear=Ws,ue.prototype.delete=Us,ue.prototype.get=Fs,ue.prototype.has=Ps,ue.prototype.set=Ds;function fe(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Dn(n,e,t,r,i,f){var o,s=e&k,c=e&tn,d=e&cn;if(t&&(o=i?t(n,r,i,f):t(n)),o!==l)return o;if(!$(n))return n;var p=T(n);if(p){if(o=$a(n),!s)return wn(n,o)}else{var _=an(n),w=_==yt||_==Yi;if(Te(n))return pf(n,s);if(_==ie||_==X||w&&!i){if(o=c||w?{}:Wf(n),!s)return c?Oa(n,na(o,n)):ba(n,Ku(o,n))}else{if(!N[_])return i?n:{};o=za(n,_,s)}}f||(f=new Yn);var A=f.get(n);if(A)return A;f.set(n,o),so(n)?n.forEach(function(I){o.add(Dn(I,e,t,I,n,f))}):oo(n)&&n.forEach(function(I,b){o.set(b,Dn(I,e,t,b,n,f))});var R=d?c?Si:Ai:c?An:en,L=p?l:R(n);return Un(L||n,function(I,b){L&&(b=I,I=n[b]),dt(o,b,Dn(I,e,t,b,n,f))}),o}function ea(n){var e=en(n);return function(t){return qu(t,n,e)}}function qu(n,e,t){var r=t.length;if(n==null)return!r;for(n=D(n);r--;){var i=t[r],f=e[i],o=n[i];if(o===l&&!(i in n)||!f(o))return!1}return!0}function Yu(n,e,t){if(typeof n!="function")throw new Fn(Z);return St(function(){n.apply(l,t)},e)}function pt(n,e,t,r){var i=-1,f=bt,o=!0,s=n.length,c=[],d=e.length;if(!s)return c;t&&(e=G(e,Cn(t))),r?(f=Gr,o=!1):e.length>=mn&&(f=lt,o=!1,e=new Be(e));n:for(;++ii?0:i+t),r=r===l||r>i?i:C(r),r<0&&(r+=i),r=t>r?0:co(r);t0&&t(s)?e>1?fn(s,e-1,t,r,i):xe(i,s):r||(i[i.length]=s)}return i}var ti=Sf(),Ju=Sf(!0);function jn(n,e){return n&&ti(n,e,en)}function ri(n,e){return n&&Ju(n,e,en)}function Jt(n,e){return we(e,function(t){return ce(n[t])})}function Ue(n,e){e=Ie(e,n);for(var t=0,r=e.length;n!=null&&te}function ia(n,e){return n!=null&&F.call(n,e)}function ua(n,e){return n!=null&&e in D(n)}function fa(n,e,t){return n>=sn(e,t)&&n=120&&p.length>=120)?new Be(o&&p):l}p=n[0];var _=-1,w=s[0];n:for(;++_-1;)s!==n&&Ht.call(s,c,1),Ht.call(n,c,1);return n}function of(n,e){for(var t=n?e.length:0,r=t-1;t--;){var i=e[t];if(t==r||i!==f){var f=i;ae(i)?Ht.call(n,i,1):gi(n,i)}}return n}function ai(n,e){return n+zt(Hu()*(e-n+1))}function xa(n,e,t,r){for(var i=-1,f=V($t((e-n)/(t||1)),0),o=h(f);f--;)o[r?f:++i]=n,n+=t;return o}function ci(n,e){var t="";if(!n||e<1||e>Vn)return t;do e%2&&(t+=n),e=zt(e/2),e&&(n+=n);while(e);return t}function E(n,e){return Li(Pf(n,e,Sn),n+"")}function Aa(n){return zu(et(n))}function Sa(n,e){var t=et(n);return fr(t,We(e,0,t.length))}function wt(n,e,t,r){if(!$(n))return n;e=Ie(e,n);for(var i=-1,f=e.length,o=f-1,s=n;s!=null&&++ii?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var f=h(i);++r>>1,o=n[f];o!==null&&!En(o)&&(t?o<=e:o=mn){var d=e?null:Ua(n);if(d)return Mt(d);o=!1,i=lt,c=new Be}else c=e?[]:s;n:for(;++r=r?n:Nn(n,e,t)}var df=hs||function(n){return un.clearTimeout(n)};function pf(n,e){if(e)return n.slice();var t=n.length,r=Uu?Uu(t):new n.constructor(t);return n.copy(r),r}function vi(n){var e=new n.constructor(n.byteLength);return new Dt(e).set(new Dt(n)),e}function Ta(n,e){var t=e?vi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}function Ca(n){var e=new n.constructor(n.source,Qi.exec(n));return e.lastIndex=n.lastIndex,e}function La(n){return gt?D(gt.call(n)):{}}function _f(n,e){var t=e?vi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function vf(n,e){if(n!==e){var t=n!==l,r=n===null,i=n===n,f=En(n),o=e!==l,s=e===null,c=e===e,d=En(e);if(!s&&!d&&!f&&n>e||f&&o&&c&&!s&&!d||r&&o&&c||!t&&c||!i)return 1;if(!r&&!f&&!d&&n=s)return c;var d=t[r];return c*(d=="desc"?-1:1)}}return n.index-e.index}function wf(n,e,t,r){for(var i=-1,f=n.length,o=t.length,s=-1,c=e.length,d=V(f-o,0),p=h(c+d),_=!r;++s1?t[i-1]:l,o=i>2?t[2]:l;for(f=n.length>3&&typeof f=="function"?(i--,f):l,o&&dn(t[0],t[1],o)&&(f=i<3?l:f,i=1),e=D(e);++r-1?i[f?e[o]:o]:l}}function If(n){return se(function(e){var t=e.length,r=t,i=Pn.prototype.thru;for(n&&e.reverse();r--;){var f=e[r];if(typeof f!="function")throw new Fn(Z);if(i&&!o&&ir(f)=="wrapper")var o=new Pn([],!0)}for(r=o?r:t;++r1&&B.reverse(),p&&cs))return!1;var d=f.get(n),p=f.get(e);if(d&&p)return d==e&&p==n;var _=-1,w=!0,A=t&Jn?new Be:l;for(f.set(n,e),f.set(e,n);++_1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(Yo,`{ -/* [wrapped with `+e+`] */ -`)}function qa(n){return T(n)||De(n)||!!(Du&&n&&n[Du])}function ae(n,e){var t=typeof n;return e=e==null?Vn:e,!!e&&(t=="number"||t!="symbol"&&rl.test(n))&&n>-1&&n%1==0&&n0){if(++e>=wr)return arguments[0]}else e=0;return n.apply(l,arguments)}}function fr(n,e){var t=-1,r=n.length,i=r-1;for(e=e===l?r:e;++t1?n[e-1]:l;return t=typeof t=="function"?(n.pop(),t):l,Jf(n,t)});function Vf(n){var e=u(n);return e.__chain__=!0,e}function th(n,e){return e(n),n}function or(n,e){return e(n)}var rh=se(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,i=function(f){return ei(f,n)};return e>1||this.__actions__.length||!(r instanceof O)||!ae(t)?this.thru(i):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:or,args:[i],thisArg:l}),new Pn(r,this.__chain__).thru(function(f){return e&&!f.length&&f.push(l),f}))});function ih(){return Vf(this)}function uh(){return new Pn(this.value(),this.__chain__)}function fh(){this.__values__===l&&(this.__values__=ao(this.value()));var n=this.__index__>=this.__values__.length,e=n?l:this.__values__[this.__index__++];return{done:n,value:e}}function oh(){return this}function lh(n){for(var e,t=this;t instanceof Yt;){var r=zf(t);r.__index__=0,r.__values__=l,e?i.__wrapped__=r:e=r;var i=r;t=t.__wrapped__}return i.__wrapped__=n,e}function sh(){var n=this.__wrapped__;if(n instanceof O){var e=n;return this.__actions__.length&&(e=new O(this)),e=e.reverse(),e.__actions__.push({func:or,args:[Ei],thisArg:l}),new Pn(e,this.__chain__)}return this.thru(Ei)}function ah(){return hf(this.__wrapped__,this.__actions__)}var ch=jt(function(n,e,t){F.call(n,t)?++n[t]:oe(n,t,1)});function hh(n,e,t){var r=T(n)?Iu:ta;return t&&dn(n,e,t)&&(e=l),r(n,m(e,3))}function gh(n,e){var t=T(n)?we:Xu;return t(n,m(e,3))}var dh=Rf(Kf),ph=Rf(qf);function _h(n,e){return fn(lr(n,e),1)}function vh(n,e){return fn(lr(n,e),re)}function wh(n,e,t){return t=t===l?1:C(t),fn(lr(n,e),t)}function Qf(n,e){var t=T(n)?Un:me;return t(n,m(e,3))}function kf(n,e){var t=T(n)?Pl:Zu;return t(n,m(e,3))}var xh=jt(function(n,e,t){F.call(n,t)?n[t].push(e):oe(n,t,[e])});function Ah(n,e,t,r){n=xn(n)?n:et(n),t=t&&!r?C(t):0;var i=n.length;return t<0&&(t=V(i+t,0)),gr(n)?t<=i&&n.indexOf(e,t)>-1:!!i&&ze(n,e,t)>-1}var Sh=E(function(n,e,t){var r=-1,i=typeof e=="function",f=xn(n)?h(n.length):[];return me(n,function(o){f[++r]=i?Tn(e,o,t):_t(o,e,t)}),f}),mh=jt(function(n,e,t){oe(n,t,e)});function lr(n,e){var t=T(n)?G:nf;return t(n,m(e,3))}function Rh(n,e,t,r){return n==null?[]:(T(e)||(e=e==null?[]:[e]),t=r?l:t,T(t)||(t=t==null?[]:[t]),uf(n,e,t))}var Ih=jt(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function yh(n,e,t){var r=T(n)?$r:Lu,i=arguments.length<3;return r(n,m(e,4),t,i,me)}function Th(n,e,t){var r=T(n)?Dl:Lu,i=arguments.length<3;return r(n,m(e,4),t,i,Zu)}function Ch(n,e){var t=T(n)?we:Xu;return t(n,cr(m(e,3)))}function Lh(n){var e=T(n)?zu:Aa;return e(n)}function Eh(n,e,t){(t?dn(n,e,t):e===l)?e=1:e=C(e);var r=T(n)?Qs:Sa;return r(n,e)}function bh(n){var e=T(n)?ks:Ra;return e(n)}function Oh(n){if(n==null)return 0;if(xn(n))return gr(n)?qe(n):n.length;var e=an(n);return e==zn||e==Kn?n.size:oi(n).length}function Mh(n,e,t){var r=T(n)?zr:Ia;return t&&dn(n,e,t)&&(e=l),r(n,m(e,3))}var Bh=E(function(n,e){if(n==null)return[];var t=e.length;return t>1&&dn(n,e[0],e[1])?e=[]:t>2&&dn(e[0],e[1],e[2])&&(e=[e[0]]),uf(n,fn(e,1),[])}),sr=gs||function(){return un.Date.now()};function Wh(n,e){if(typeof e!="function")throw new Fn(Z);return n=C(n),function(){if(--n<1)return e.apply(this,arguments)}}function jf(n,e,t){return e=t?l:e,e=n&&e==null?n.length:e,le(n,rn,l,l,l,l,e)}function no(n,e){var t;if(typeof e!="function")throw new Fn(Z);return n=C(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=l),t}}var Oi=E(function(n,e,t){var r=nn;if(t.length){var i=Ae(t,je(Oi));r|=In}return le(n,r,e,t,i)}),eo=E(function(n,e,t){var r=nn|hn;if(t.length){var i=Ae(t,je(eo));r|=In}return le(e,r,n,t,i)});function to(n,e,t){e=t?l:e;var r=le(n,Mn,l,l,l,l,l,e);return r.placeholder=to.placeholder,r}function ro(n,e,t){e=t?l:e;var r=le(n,de,l,l,l,l,l,e);return r.placeholder=ro.placeholder,r}function io(n,e,t){var r,i,f,o,s,c,d=0,p=!1,_=!1,w=!0;if(typeof n!="function")throw new Fn(Z);e=Gn(e)||0,$(t)&&(p=!!t.leading,_="maxWait"in t,f=_?V(Gn(t.maxWait)||0,e):f,w="trailing"in t?!!t.trailing:w);function A(Y){var Xn=r,ge=i;return r=i=l,d=Y,o=n.apply(ge,Xn),o}function R(Y){return d=Y,s=St(b,e),p?A(Y):o}function L(Y){var Xn=Y-c,ge=Y-d,Io=e-Xn;return _?sn(Io,f-ge):Io}function I(Y){var Xn=Y-c,ge=Y-d;return c===l||Xn>=e||Xn<0||_&&ge>=f}function b(){var Y=sr();if(I(Y))return B(Y);s=St(b,L(Y))}function B(Y){return s=l,w&&r?A(Y):(r=i=l,o)}function bn(){s!==l&&df(s),d=0,r=c=i=s=l}function pn(){return s===l?o:B(sr())}function On(){var Y=sr(),Xn=I(Y);if(r=arguments,i=this,c=Y,Xn){if(s===l)return R(c);if(_)return df(s),s=St(b,e),A(c)}return s===l&&(s=St(b,e)),o}return On.cancel=bn,On.flush=pn,On}var Uh=E(function(n,e){return Yu(n,1,e)}),Fh=E(function(n,e,t){return Yu(n,Gn(e)||0,t)});function Ph(n){return le(n,Le)}function ar(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Fn(Z);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],f=t.cache;if(f.has(i))return f.get(i);var o=n.apply(this,r);return t.cache=f.set(i,o)||f,o};return t.cache=new(ar.Cache||fe),t}ar.Cache=fe;function cr(n){if(typeof n!="function")throw new Fn(Z);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function Dh(n){return no(2,n)}var Nh=ya(function(n,e){e=e.length==1&&T(e[0])?G(e[0],Cn(m())):G(fn(e,1),Cn(m()));var t=e.length;return E(function(r){for(var i=-1,f=sn(r.length,t);++i=e}),De=Qu(function(){return arguments}())?Qu:function(n){return K(n)&&F.call(n,"callee")&&!Pu.call(n,"callee")},T=h.isArray,ng=wu?Cn(wu):la;function xn(n){return n!=null&&hr(n.length)&&!ce(n)}function q(n){return K(n)&&xn(n)}function eg(n){return n===!0||n===!1||K(n)&&gn(n)==Qn}var Te=ps||zi,tg=xu?Cn(xu):sa;function rg(n){return K(n)&&n.nodeType===1&&!mt(n)}function ig(n){if(n==null)return!0;if(xn(n)&&(T(n)||typeof n=="string"||typeof n.splice=="function"||Te(n)||nt(n)||De(n)))return!n.length;var e=an(n);if(e==zn||e==Kn)return!n.size;if(At(n))return!oi(n).length;for(var t in n)if(F.call(n,t))return!1;return!0}function ug(n,e){return vt(n,e)}function fg(n,e,t){t=typeof t=="function"?t:l;var r=t?t(n,e):l;return r===l?vt(n,e,l,t):!!r}function Bi(n){if(!K(n))return!1;var e=gn(n);return e==kn||e==$n||typeof n.message=="string"&&typeof n.name=="string"&&!mt(n)}function og(n){return typeof n=="number"&&Nu(n)}function ce(n){if(!$(n))return!1;var e=gn(n);return e==yt||e==Yi||e==ve||e==Oo}function fo(n){return typeof n=="number"&&n==C(n)}function hr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Vn}function $(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function K(n){return n!=null&&typeof n=="object"}var oo=Au?Cn(Au):ca;function lg(n,e){return n===e||fi(n,e,Ri(e))}function sg(n,e,t){return t=typeof t=="function"?t:l,fi(n,e,Ri(e),t)}function ag(n){return lo(n)&&n!=+n}function cg(n){if(Xa(n))throw new y(He);return ku(n)}function hg(n){return n===null}function gg(n){return n==null}function lo(n){return typeof n=="number"||K(n)&&gn(n)==rt}function mt(n){if(!K(n)||gn(n)!=ie)return!1;var e=Nt(n);if(e===null)return!0;var t=F.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Ut.call(t)==ss}var Wi=Su?Cn(Su):ha;function dg(n){return fo(n)&&n>=-Vn&&n<=Vn}var so=mu?Cn(mu):ga;function gr(n){return typeof n=="string"||!T(n)&&K(n)&&gn(n)==ut}function En(n){return typeof n=="symbol"||K(n)&&gn(n)==Tt}var nt=Ru?Cn(Ru):da;function pg(n){return n===l}function _g(n){return K(n)&&an(n)==ft}function vg(n){return K(n)&&gn(n)==Bo}var wg=rr(li),xg=rr(function(n,e){return n<=e});function ao(n){if(!n)return[];if(xn(n))return gr(n)?qn(n):wn(n);if(st&&n[st])return Ql(n[st]());var e=an(n),t=e==zn?Jr:e==Kn?Mt:et;return t(n)}function he(n){if(!n)return n===0?n:0;if(n=Gn(n),n===re||n===-re){var e=n<0?-1:1;return e*mr}return n===n?n:0}function C(n){var e=he(n),t=e%1;return e===e?t?e-t:e:0}function co(n){return n?We(C(n),0,Bn):0}function Gn(n){if(typeof n=="number")return n;if(En(n))return Ee;if($(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=$(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Eu(n);var t=nl.test(n);return t||tl.test(n)?Wl(n.slice(2),t?2:8):jo.test(n)?Ee:+n}function ho(n){return ne(n,An(n))}function Ag(n){return n?We(C(n),-Vn,Vn):n===0?n:0}function U(n){return n==null?"":Ln(n)}var Sg=Qe(function(n,e){if(At(e)||xn(e)){ne(e,en(e),n);return}for(var t in e)F.call(e,t)&&dt(n,t,e[t])}),go=Qe(function(n,e){ne(e,An(e),n)}),dr=Qe(function(n,e,t,r){ne(e,An(e),n,r)}),mg=Qe(function(n,e,t,r){ne(e,en(e),n,r)}),Rg=se(ei);function Ig(n,e){var t=Ve(n);return e==null?t:Ku(t,e)}var yg=E(function(n,e){n=D(n);var t=-1,r=e.length,i=r>2?e[2]:l;for(i&&dn(e[0],e[1],i)&&(r=1);++t1),f}),ne(n,Si(n),t),r&&(t=Dn(t,k|tn|cn,Fa));for(var i=e.length;i--;)gi(t,e[i]);return t});function zg(n,e){return _o(n,cr(m(e)))}var Kg=se(function(n,e){return n==null?{}:va(n,e)});function _o(n,e){if(n==null)return{};var t=G(Si(n),function(r){return[r]});return e=m(e),ff(n,t,function(r,i){return e(r,i[0])})}function qg(n,e,t){e=Ie(e,n);var r=-1,i=e.length;for(i||(i=1,n=l);++re){var r=n;n=e,e=r}if(t||n%1||e%1){var i=Hu();return sn(n+i*(e-n+Bl("1e-"+((i+"").length-1))),e)}return ai(n,e)}var td=ke(function(n,e,t){return e=e.toLowerCase(),n+(t?xo(e):e)});function xo(n){return Pi(U(n).toLowerCase())}function Ao(n){return n=U(n),n&&n.replace(il,Yl).replace(Rl,"")}function rd(n,e,t){n=U(n),e=Ln(e);var r=n.length;t=t===l?r:We(C(t),0,r);var i=t;return t-=e.length,t>=0&&n.slice(t,i)==e}function id(n){return n=U(n),n&&Do.test(n)?n.replace(Ji,Zl):n}function ud(n){return n=U(n),n&&Ko.test(n)?n.replace(Mr,"\\$&"):n}var fd=ke(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),od=ke(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),ld=mf("toLowerCase");function sd(n,e,t){n=U(n),e=C(e);var r=e?qe(n):0;if(!e||r>=e)return n;var i=(e-r)/2;return tr(zt(i),t)+n+tr($t(i),t)}function ad(n,e,t){n=U(n),e=C(e);var r=e?qe(n):0;return e&&r>>0,t?(n=U(n),n&&(typeof e=="string"||e!=null&&!Wi(e))&&(e=Ln(e),!e&&Ke(n))?ye(qn(n),0,t):n.split(e,t)):[]}var vd=ke(function(n,e,t){return n+(t?" ":"")+Pi(e)});function wd(n,e,t){return n=U(n),t=t==null?0:We(C(t),0,n.length),e=Ln(e),n.slice(t,t+e.length)==e}function xd(n,e,t){var r=u.templateSettings;t&&dn(n,e,t)&&(e=l),n=U(n),e=dr({},e,r,Ef);var i=dr({},e.imports,r.imports,Ef),f=en(i),o=Xr(i,f),s,c,d=0,p=e.interpolate||Ct,_="__p += '",w=Vr((e.escape||Ct).source+"|"+p.source+"|"+(p===Vi?ko:Ct).source+"|"+(e.evaluate||Ct).source+"|$","g"),A="//# sourceURL="+(F.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ll+"]")+` -`;n.replace(w,function(I,b,B,bn,pn,On){return B||(B=bn),_+=n.slice(d,On).replace(ul,Xl),b&&(s=!0,_+=`' + -__e(`+b+`) + -'`),pn&&(c=!0,_+=`'; -`+pn+`; -__p += '`),B&&(_+=`' + -((__t = (`+B+`)) == null ? '' : __t) + -'`),d=On+I.length,I}),_+=`'; -`;var R=F.call(e,"variable")&&e.variable;if(!R)_=`with (obj) { -`+_+` -} -`;else if(Vo.test(R))throw new y(Rn);_=(c?_.replace(Wo,""):_).replace(Uo,"$1").replace(Fo,"$1;"),_="function("+(R||"obj")+`) { -`+(R?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+_+`return __p -}`;var L=mo(function(){return W(f,A+"return "+_).apply(l,o)});if(L.source=_,Bi(L))throw L;return L}function Ad(n){return U(n).toLowerCase()}function Sd(n){return U(n).toUpperCase()}function md(n,e,t){if(n=U(n),n&&(t||e===l))return Eu(n);if(!n||!(e=Ln(e)))return n;var r=qn(n),i=qn(e),f=bu(r,i),o=Ou(r,i)+1;return ye(r,f,o).join("")}function Rd(n,e,t){if(n=U(n),n&&(t||e===l))return n.slice(0,Bu(n)+1);if(!n||!(e=Ln(e)))return n;var r=qn(n),i=Ou(r,qn(e))+1;return ye(r,0,i).join("")}function Id(n,e,t){if(n=U(n),n&&(t||e===l))return n.replace(Br,"");if(!n||!(e=Ln(e)))return n;var r=qn(n),i=bu(r,qn(e));return ye(r,i).join("")}function yd(n,e){var t=It,r=vr;if($(e)){var i="separator"in e?e.separator:i;t="length"in e?C(e.length):t,r="omission"in e?Ln(e.omission):r}n=U(n);var f=n.length;if(Ke(n)){var o=qn(n);f=o.length}if(t>=f)return n;var s=t-qe(r);if(s<1)return r;var c=o?ye(o,0,s).join(""):n.slice(0,s);if(i===l)return c+r;if(o&&(s+=c.length-s),Wi(i)){if(n.slice(s).search(i)){var d,p=c;for(i.global||(i=Vr(i.source,U(Qi.exec(i))+"g")),i.lastIndex=0;d=i.exec(p);)var _=d.index;c=c.slice(0,_===l?s:_)}}else if(n.indexOf(Ln(i),s)!=s){var w=c.lastIndexOf(i);w>-1&&(c=c.slice(0,w))}return c+r}function Td(n){return n=U(n),n&&Po.test(n)?n.replace(Xi,es):n}var Cd=ke(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),Pi=mf("toUpperCase");function So(n,e,t){return n=U(n),e=t?l:e,e===l?Vl(n)?is(n):Gl(n):n.match(e)||[]}var mo=E(function(n,e){try{return Tn(n,l,e)}catch(t){return Bi(t)?t:new y(t)}}),Ld=se(function(n,e){return Un(e,function(t){t=ee(t),oe(n,t,Oi(n[t],n))}),n});function Ed(n){var e=n==null?0:n.length,t=m();return n=e?G(n,function(r){if(typeof r[1]!="function")throw new Fn(Z);return[t(r[0]),r[1]]}):[],E(function(r){for(var i=-1;++iVn)return[];var t=Bn,r=sn(n,Bn);e=m(e),n-=Bn;for(var i=Zr(r,e);++t0||e<0)?new O(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==l&&(e=C(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},O.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},O.prototype.toArray=function(){return this.take(Bn)},jn(O.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=u[r?"take"+(e=="last"?"Right":""):e],f=r||/^find/.test(e);!i||(u.prototype[e]=function(){var o=this.__wrapped__,s=r?[1]:arguments,c=o instanceof O,d=s[0],p=c||T(o),_=function(b){var B=i.apply(u,xe([b],s));return r&&w?B[0]:B};p&&t&&typeof d=="function"&&d.length!=1&&(c=p=!1);var w=this.__chain__,A=!!this.__actions__.length,R=f&&!w,L=c&&!A;if(!f&&p){o=L?o:new O(this);var I=n.apply(o,s);return I.__actions__.push({func:or,args:[_],thisArg:l}),new Pn(I,w)}return R&&L?n.apply(this,s):(I=this.thru(_),R?r?I.value()[0]:I.value():I)})}),Un(["pop","push","shift","sort","splice","unshift"],function(n){var e=Bt[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var f=this.value();return e.apply(T(f)?f:[],i)}return this[t](function(o){return e.apply(T(o)?o:[],i)})}}),jn(O.prototype,function(n,e){var t=u[e];if(t){var r=t.name+"";F.call(Je,r)||(Je[r]=[]),Je[r].push({name:e,func:t})}}),Je[nr(l,hn).name]=[{name:"wrapper",func:l}],O.prototype.clone=Ts,O.prototype.reverse=Cs,O.prototype.value=Ls,u.prototype.at=rh,u.prototype.chain=ih,u.prototype.commit=uh,u.prototype.next=fh,u.prototype.plant=lh,u.prototype.reverse=sh,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=ah,u.prototype.first=u.prototype.head,st&&(u.prototype[st]=oh),u},Ye=us();be?((be.exports=Ye)._=Ye,Nr._=Ye):un._=Ye}).call(Rt)})(Co,Co.exports);var Xp=(v=>(v[v.TITLE=1]="TITLE",v[v.TEXT=2]="TEXT",v[v.IMAGEURL=3]="IMAGEURL",v[v.VIDEOURL=4]="VIDEOURL",v[v.AUDIOURL=5]="AUDIOURL",v[v.LINKURL=6]="LINKURL",v[v.ATTACHMENT=7]="ATTACHMENT",v[v.CHARGEATTACHMENT=8]="CHARGEATTACHMENT",v))(Xp||{}),Jp=(v=>(v[v.PUBLIC=0]="PUBLIC",v[v.PRIVATE=1]="PRIVATE",v[v.FRIEND=2]="FRIEND",v))(Jp||{});export{jp as I,Xp as P,Jp as V,kp as _,Co as l}; diff --git a/web/dist/assets/InputGroup.73d38f63.js b/web/dist/assets/InputGroup.73d38f63.js deleted file mode 100644 index ecffc6f2..00000000 --- a/web/dist/assets/InputGroup.73d38f63.js +++ /dev/null @@ -1,56 +0,0 @@ -import{c as t,b as r,f as o,d as a,u as d,g as s,h as p}from"./index.d4f5aad2.js";var n=t("input-group",` - display: inline-flex; - width: 100%; - flex-wrap: nowrap; - vertical-align: bottom; -`,[r(">",[t("input",[r("&:not(:last-child)",` - border-top-right-radius: 0!important; - border-bottom-right-radius: 0!important; - `),r("&:not(:first-child)",` - border-top-left-radius: 0!important; - border-bottom-left-radius: 0!important; - margin-left: -1px!important; - `)]),t("button",[r("&:not(:last-child)",` - border-top-right-radius: 0!important; - border-bottom-right-radius: 0!important; - `,[o("state-border, border",` - border-top-right-radius: 0!important; - border-bottom-right-radius: 0!important; - `)]),r("&:not(:first-child)",` - border-top-left-radius: 0!important; - border-bottom-left-radius: 0!important; - `,[o("state-border, border",` - border-top-left-radius: 0!important; - border-bottom-left-radius: 0!important; - `)])]),r("*",[r("&:not(:last-child)",` - border-top-right-radius: 0!important; - border-bottom-right-radius: 0!important; - `,[r(">",[t("input",` - border-top-right-radius: 0!important; - border-bottom-right-radius: 0!important; - `),t("base-selection",[t("base-selection-label",` - border-top-right-radius: 0!important; - border-bottom-right-radius: 0!important; - `),t("base-selection-tags",` - border-top-right-radius: 0!important; - border-bottom-right-radius: 0!important; - `),o("box-shadow, border, state-border",` - border-top-right-radius: 0!important; - border-bottom-right-radius: 0!important; - `)])])]),r("&:not(:first-child)",` - margin-left: -1px!important; - border-top-left-radius: 0!important; - border-bottom-left-radius: 0!important; - `,[r(">",[t("input",` - border-top-left-radius: 0!important; - border-bottom-left-radius: 0!important; - `),t("base-selection",[t("base-selection-label",` - border-top-left-radius: 0!important; - border-bottom-left-radius: 0!important; - `),t("base-selection-tags",` - border-top-left-radius: 0!important; - border-bottom-left-radius: 0!important; - `),o("box-shadow, border, state-border",` - border-top-left-radius: 0!important; - border-bottom-left-radius: 0!important; - `)])])])])])]);const b={};var u=a({name:"InputGroup",props:b,setup(i){const{mergedClsPrefixRef:e}=d(i);return s("-input-group",n,e),{mergedClsPrefix:e}},render(){const{mergedClsPrefix:i}=this;return p("div",{class:`${i}-input-group`},this.$slots)}});export{u as _}; diff --git a/web/dist/assets/LatoLatin-Regular.ddd4ef7f.woff2 b/web/dist/assets/LatoLatin-Regular-ddd4ef7f.woff2 similarity index 100% rename from web/dist/assets/LatoLatin-Regular.ddd4ef7f.woff2 rename to web/dist/assets/LatoLatin-Regular-ddd4ef7f.woff2 diff --git a/web/dist/assets/LatoLatin-Semibold.267eef30.woff2 b/web/dist/assets/LatoLatin-Semibold-267eef30.woff2 similarity index 100% rename from web/dist/assets/LatoLatin-Semibold.267eef30.woff2 rename to web/dist/assets/LatoLatin-Semibold-267eef30.woff2 diff --git a/web/dist/assets/List.a66e9ae7.js b/web/dist/assets/List.a66e9ae7.js deleted file mode 100644 index b982bf97..00000000 --- a/web/dist/assets/List.a66e9ae7.js +++ /dev/null @@ -1,73 +0,0 @@ -import{b as a,c as l,e as d,f as n,aB as w,aC as P,d as B,u as D,j,x as v,p as E,t as M,y as H,A as L,h as t,n as I,aD as O}from"./index.d4f5aad2.js";var T=a([l("list",` - --n-merged-border-color: var(--n-border-color); - --n-merged-color: var(--n-color); - --n-merged-color-hover: var(--n-color-hover); - margin: 0; - font-size: var(--n-font-size); - transition: - background-color .3s var(--n-bezier), - color .3s var(--n-bezier), - border-color .3s var(--n-bezier); - padding: 0; - list-style-type: none; - color: var(--n-text-color); - background-color: var(--n-merged-color); - `,[d("show-divider",[l("list-item",[a("&:not(:last-child)",[n("divider",` - background-color: var(--n-merged-border-color); - `)])])]),d("clickable",[l("list-item",` - cursor: pointer; - `)]),d("bordered",` - border: 1px solid var(--n-merged-border-color); - border-radius: var(--n-border-radius); - `),d("hoverable",[l("list-item",` - border-radius: var(--n-border-radius); - `,[a("&:hover",` - background-color: var(--n-merged-color-hover); - `,[n("divider",` - background-color: transparent; - `)])])]),d("bordered, hoverable",[l("list-item",` - padding: 12px 20px; - `),n("header, footer",` - padding: 12px 20px; - `)]),n("header, footer",` - padding: 12px 0; - box-sizing: border-box; - transition: border-color .3s var(--n-bezier); - `,[a("&:not(:last-child)",` - border-bottom: 1px solid var(--n-merged-border-color); - `)]),l("list-item",` - position: relative; - padding: 12px 0; - box-sizing: border-box; - display: flex; - flex-wrap: nowrap; - align-items: center; - transition: - background-color .3s var(--n-bezier), - border-color .3s var(--n-bezier); - `,[n("prefix",` - margin-right: 20px; - flex: 0; - `),n("suffix",` - margin-left: 20px; - flex: 0; - `),n("main",` - flex: 1; - `),n("divider",` - height: 1px; - position: absolute; - bottom: 0; - left: 0; - right: 0; - background-color: transparent; - transition: background-color .3s var(--n-bezier); - pointer-events: none; - `)])]),w(l("list",` - --n-merged-color-hover: var(--n-color-hover-modal); - --n-merged-color: var(--n-color-modal); - --n-merged-border-color: var(--n-border-color-modal); - `)),P(l("list",` - --n-merged-color-hover: var(--n-color-hover-popover); - --n-merged-color: var(--n-color-popover); - --n-merged-border-color: var(--n-border-color-popover); - `))]);const V=Object.assign(Object.assign({},v.props),{size:{type:String,default:"medium"},bordered:Boolean,clickable:Boolean,hoverable:Boolean,showDivider:{type:Boolean,default:!0}}),K=I("n-list");var A=B({name:"List",props:V,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:r,mergedRtlRef:s}=D(e),b=j("List",s,o),m=v("List","-list",T,O,e,o);E(K,{showDividerRef:M(e,"showDivider"),mergedClsPrefixRef:o});const c=H(()=>{const{common:{cubicBezierEaseInOut:p},self:{fontSize:h,textColor:u,color:g,colorModal:f,colorPopover:x,borderColor:z,borderColorModal:C,borderColorPopover:R,borderRadius:k,colorHover:y,colorHoverModal:_,colorHoverPopover:$}}=m.value;return{"--n-font-size":h,"--n-bezier":p,"--n-text-color":u,"--n-color":g,"--n-border-radius":k,"--n-border-color":z,"--n-border-color-modal":C,"--n-border-color-popover":R,"--n-color-modal":f,"--n-color-popover":x,"--n-color-hover":y,"--n-color-hover-modal":_,"--n-color-hover-popover":$}}),i=r?L("list",void 0,c,e):void 0;return{mergedClsPrefix:o,rtlEnabled:b,cssVars:r?void 0:c,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;const{$slots:o,mergedClsPrefix:r,onRender:s}=this;return s==null||s(),t("ul",{class:[`${r}-list`,this.rtlEnabled&&`${r}-list--rtl`,this.bordered&&`${r}-list--bordered`,this.showDivider&&`${r}-list--show-divider`,this.hoverable&&`${r}-list--hoverable`,this.clickable&&`${r}-list--clickable`,this.themeClass],style:this.cssVars},o.header?t("div",{class:`${r}-list__header`},o.header()):null,(e=o.default)===null||e===void 0?void 0:e.call(o),o.footer?t("div",{class:`${r}-list__footer`},o.footer()):null)}});export{A as _,K as l}; diff --git a/web/dist/assets/Messages-7ed31ecd.css b/web/dist/assets/Messages-7ed31ecd.css new file mode 100644 index 00000000..a7a5a921 --- /dev/null +++ b/web/dist/assets/Messages-7ed31ecd.css @@ -0,0 +1 @@ +.message-item[data-v-4a0e27fa]{padding:16px}.message-item.unread[data-v-4a0e27fa]{background:#fcfffc}.message-item .sender-wrap[data-v-4a0e27fa]{display:flex;align-items:center}.message-item .sender-wrap .username[data-v-4a0e27fa]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-4a0e27fa]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-4a0e27fa]{margin-left:6px}.message-item .brief-wrap[data-v-4a0e27fa]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-4a0e27fa],.message-item .brief-wrap .whisper-content-wrap[data-v-4a0e27fa],.message-item .brief-wrap .requesting-friend-wrap[data-v-4a0e27fa]{display:flex;width:100%}.message-item .view-link[data-v-4a0e27fa]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-4a0e27fa]{margin-left:8px;align-items:center}.dark .message-item[data-v-4a0e27fa]{background-color:#101014bf}.dark .message-item.unread[data-v-4a0e27fa]{background:#0f180b}.dark .message-item .brief-wrap[data-v-4a0e27fa]{background-color:#18181c}.skeleton-item[data-v-01d2e871]{padding:12px;display:flex}.skeleton-item .content[data-v-01d2e871]{width:100%}.dark .skeleton-item[data-v-01d2e871]{background-color:#101014bf}.pagination-wrap[data-v-4e7b1342]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .empty-wrap[data-v-4e7b1342],.dark .messages-wrap[data-v-4e7b1342],.dark .pagination-wrap[data-v-4e7b1342]{background-color:#101014bf} diff --git a/web/dist/assets/Messages-a4e3044c.js b/web/dist/assets/Messages-a4e3044c.js new file mode 100644 index 00000000..5937766a --- /dev/null +++ b/web/dist/assets/Messages-a4e3044c.js @@ -0,0 +1 @@ +import{d as b,a3 as D,o as t,c as a,V as n,a1 as o,a as y,a2 as w,e as p,M as m,Q as N,O as r,_ as c,L as A,a4 as O,F as R,r as f,j as G}from"./@vue-e0e89260.js";import{u as H,b as J}from"./vue-router-b8e3382f.js";import{H as K,I as L,J as P,_ as F,K as T}from"./index-347d1d96.js";import{a as U}from"./formatTime-cdf4e6f1.js";import{D as E,G as Q,J as z,K as W}from"./@vicons-8f91201d.js";import{o as X,l as Y,j as Z,S as x,M as ee,U as se,F as ne,G as te,I as ae,H as oe}from"./naive-ui-62663ad7.js";import{_ as re}from"./main-nav.vue_vue_type_style_index_0_lang-be35896a.js";import{u as ie}from"./vuex-473b3783.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const _e={class:"sender-wrap"},le={key:0,class:"nickname"},pe={class:"username"},ue={key:1,class:"nickname"},ce={class:"timestamp"},de={class:"timestamp-txt"},me={key:0,class:"brief-content"},ge={key:1,class:"whisper-content-wrap"},ve={key:2,class:"requesting-friend-wrap"},fe={key:2,class:"status-info"},ye={key:3,class:"status-info"},ke="https://assets.paopao.info/public/avatar/default/admin.png",he=b({__name:"message-item",props:{message:{}},setup(I){const g=H(),k=e=>{_(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?g.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},i=e=>{_(e),K({user_id:e.sender_user_id}).then(s=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(s=>{console.log(s)})},u=e=>{_(e),L({user_id:e.sender_user_id}).then(s=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(s=>{console.log(s)})},_=e=>{e.is_read===0&&P({id:e.id}).then(s=>{e.is_read=1}).catch(s=>{console.log(s)})};return(e,s)=>{const h=X,$=D("router-link"),l=Y,d=Z,C=x,M=ee;return t(),a("div",{class:A(["message-item",{unread:e.message.is_read===0}]),onClick:s[4]||(s[4]=v=>_(e.message))},[n(M,{"content-indented":""},{avatar:o(()=>[n(h,{round:"",size:30,src:e.message.sender_user.id>0?e.message.sender_user.avatar:ke},null,8,["src"])]),header:o(()=>[y("div",_e,[e.message.sender_user.id>0?(t(),a("span",le,[n($,{onClick:s[0]||(s[0]=w(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.message.sender_user.username}}},{default:o(()=>[p(m(e.message.sender_user.nickname),1)]),_:1},8,["to"]),y("span",pe," @"+m(e.message.sender_user.username),1)])):(t(),a("span",ue," 系统 "))])]),"header-extra":o(()=>[y("span",ce,[e.message.is_read===0?(t(),N(l,{key:0,dot:"",processing:""})):r("",!0),y("span",de,m(c(U)(e.message.created_on)),1)])]),description:o(()=>[n(C,{"show-icon":!1,class:"brief-wrap",type:e.message.is_read>0?"default":"success"},{default:o(()=>[e.message.type!=4?(t(),a("div",me,[p(m(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(t(),a("span",{key:0,onClick:s[1]||(s[1]=w(v=>k(e.message),["stop"])),class:"hash-link view-link"},[n(d,null,{default:o(()=>[n(c(E))]),_:1}),p(" 查看详情 ")])):r("",!0)])):r("",!0),e.message.type===4?(t(),a("div",ge,m(e.message.content),1)):r("",!0),e.message.type===5?(t(),a("div",ve,[p(m(e.message.content)+" ",1),e.message.reply_id===1?(t(),a("span",{key:0,onClick:s[2]||(s[2]=w(v=>i(e.message),["stop"])),class:"hash-link view-link"},[n(d,null,{default:o(()=>[n(c(Q))]),_:1}),p(" 同意 ")])):r("",!0),e.message.reply_id===1?(t(),a("span",{key:1,onClick:s[3]||(s[3]=w(v=>u(e.message),["stop"])),class:"hash-link view-link"},[n(d,null,{default:o(()=>[n(c(z))]),_:1}),p(" 拒绝 ")])):r("",!0),e.message.reply_id===2?(t(),a("span",fe,[n(d,null,{default:o(()=>[n(c(W))]),_:1}),p(" 已同意 ")])):r("",!0),e.message.reply_id===3?(t(),a("span",ye,[n(d,null,{default:o(()=>[n(c(z))]),_:1}),p(" 已拒绝 ")])):r("",!0)])):r("",!0)]),_:1},8,["type"])]),_:1})],2)}}});const we=F(he,[["__scopeId","data-v-4a0e27fa"]]),$e={class:"content"},Ce=b({__name:"message-skeleton",props:{num:{default:1}},setup(I){return(g,k)=>{const i=se;return t(!0),a(R,null,O(new Array(g.num),u=>(t(),a("div",{class:"skeleton-item",key:u},[y("div",$e,[n(i,{text:"",repeat:2}),n(i,{text:"",style:{width:"60%"}})])]))),128)}}});const Me=F(Ce,[["__scopeId","data-v-01d2e871"]]),be={key:0,class:"skeleton-wrap"},Fe={key:1},Ie={key:0,class:"empty-wrap"},Se={key:0,class:"pagination-wrap"},ze=b({__name:"Messages",setup(I){const g=J(),k=ie(),i=f(!1),u=f(+g.query.p||1),_=f(10),e=f(0),s=f([]),h=()=>{i.value=!0,T({page:u.value,page_size:_.value}).then(l=>{i.value=!1,s.value=l.list,e.value=Math.ceil(l.pager.total_rows/_.value)}).catch(l=>{i.value=!1})},$=l=>{u.value=l,h()};return G(()=>{h()}),(l,d)=>{const C=re,M=Me,v=ae,V=we,j=oe,q=ne,B=te;return t(),a("div",null,[n(C,{title:"消息"}),n(q,{class:"main-content-wrap messages-wrap",bordered:""},{default:o(()=>[i.value?(t(),a("div",be,[n(M,{num:_.value},null,8,["num"])])):(t(),a("div",Fe,[s.value.length===0?(t(),a("div",Ie,[n(v,{size:"large",description:"暂无数据"})])):r("",!0),(t(!0),a(R,null,O(s.value,S=>(t(),N(j,{key:S.id},{default:o(()=>[n(V,{message:S},null,8,["message"])]),_:2},1024))),128))]))]),_:1}),e.value>0?(t(),a("div",Se,[n(B,{page:u.value,"onUpdate:page":$,"page-slot":c(k).state.collapsedRight?5:8,"page-count":e.value},null,8,["page","page-slot","page-count"])])):r("",!0)])}}});const es=F(ze,[["__scopeId","data-v-4e7b1342"]]);export{es as default}; diff --git a/web/dist/assets/Messages.23db49c3.js b/web/dist/assets/Messages.23db49c3.js deleted file mode 100644 index 18b3b9ce..00000000 --- a/web/dist/assets/Messages.23db49c3.js +++ /dev/null @@ -1 +0,0 @@ -import{d as v,W as n,Y as t,Z as l,ai as F,al as q,am as z,a4 as a,a5 as r,a8 as $,a9 as p,aa as w,a6 as E,a7 as i,a3 as h,cb as I,cp as N,cq as R,cr as P,ae as T,cs as H,af as U,ac as O,ab as A,r as x,a2 as W,aj as Y,ct as Z,$ as G}from"./index.d4f5aad2.js";import{f as J}from"./formatTime.e07969bb.js";import{_ as K}from"./Alert.6cb9deb6.js";import{_ as Q}from"./Thing.d394adea.js";import{b as X,a as ee,_ as ne}from"./Skeleton.e1c16fcb.js";import{_ as se}from"./main-nav.3167f221.js";import{_ as te}from"./List.a66e9ae7.js";import{_ as oe}from"./Pagination.c13c2d34.js";const ae={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},re=l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M464 128L240 384l-96-96"},null,-1),le=l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M144 384l-96-96"},null,-1),ie=l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128L232 284"},null,-1),ue=[re,le,ie];var ce=v({name:"CheckmarkDoneOutline",render:function(c,_){return n(),t("svg",ae,ue)}});const _e={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},de=l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"},null,-1),me=[de];var pe=v({name:"CheckmarkOutline",render:function(c,_){return n(),t("svg",_e,me)}});const ge={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},ke=l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 368L144 144"},null,-1),he=l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 144L144 368"},null,-1),ve=[ke,he];var b=v({name:"CloseOutline",render:function(c,_){return n(),t("svg",ge,ve)}});const we={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},fe=l("path",{d:"M336 192h40a40 40 0 0 1 40 40v192a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V232a40 40 0 0 1 40-40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),ye=l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 128l-80-80l-80 80"},null,-1),xe=l("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 321V48"},null,-1),$e=[fe,ye,xe];var Ce=v({name:"ShareOutline",render:function(c,_){return n(),t("svg",we,$e)}});const De={class:"sender-wrap"},Me={key:0,class:"nickname"},Fe={class:"username"},Be={key:1,class:"nickname"},je={class:"timestamp"},be={class:"timestamp-txt"},Ee={key:0,class:"brief-content"},Oe={key:1,class:"whisper-content-wrap"},Ae={key:2,class:"requesting-friend-wrap"},Le={key:2,class:"status-info"},Se={key:3,class:"status-info"},Ve=v({__name:"message-item",props:{message:null},setup(e){const c="https://assets.paopao.info/public/avatar/default/admin.png",_=q(),u=s=>{d(s),(s.type===1||s.type===2||s.type===3)&&(s.post&&s.post.id>0?_.push({name:"post",query:{id:s.post_id}}):window.$message.error("\u8BE5\u52A8\u6001\u5DF2\u88AB\u5220\u9664"))},g=s=>{d(s),N({user_id:s.sender_user_id}).then(o=>{s.reply_id=2,window.$message.success("\u5DF2\u540C\u610F\u6DFB\u52A0\u597D\u53CB")}).catch(o=>{console.log(o)})},f=s=>{d(s),R({user_id:s.sender_user_id}).then(o=>{s.reply_id=3,window.$message.success("\u5DF2\u62D2\u7EDD\u6DFB\u52A0\u597D\u53CB")}).catch(o=>{console.log(o)})},d=s=>{s.is_read===0&&P({id:s.id}).then(o=>{s.is_read=1}).catch(o=>{console.log(o)})};return(s,o)=>{const C=T,m=z("router-link"),B=H,k=U,D=K,M=Q;return n(),t("div",{class:I(["message-item",{unread:e.message.is_read===0}]),onClick:o[4]||(o[4]=y=>d(e.message))},[a(M,{"content-indented":""},{avatar:r(()=>[a(C,{round:"",size:30,src:e.message.sender_user.id>0?e.message.sender_user.avatar:c},null,8,["src"])]),header:r(()=>[l("div",De,[e.message.sender_user.id>0?(n(),t("span",Me,[a(m,{onClick:o[0]||(o[0]=$(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.message.sender_user.username}}},{default:r(()=>[p(w(e.message.sender_user.nickname),1)]),_:1},8,["to"]),l("span",Fe," @"+w(e.message.sender_user.username),1)])):(n(),t("span",Be," \u7CFB\u7EDF "))])]),"header-extra":r(()=>[l("span",je,[e.message.is_read===0?(n(),E(B,{key:0,dot:"",processing:""})):i("",!0),l("span",be,w(h(J)(e.message.created_on)),1)])]),description:r(()=>[a(D,{"show-icon":!1,class:"brief-wrap",type:e.message.is_read>0?"default":"success"},{default:r(()=>[e.message.type!=4?(n(),t("div",Ee,[p(w(e.message.brief)+" ",1),e.message.type===1||e.message.type===2||e.message.type===3?(n(),t("span",{key:0,onClick:o[1]||(o[1]=$(y=>u(e.message),["stop"])),class:"hash-link view-link"},[a(k,null,{default:r(()=>[a(h(Ce))]),_:1}),p(" \u67E5\u770B\u8BE6\u60C5 ")])):i("",!0)])):i("",!0),e.message.type===4?(n(),t("div",Oe,w(e.message.content),1)):i("",!0),e.message.type===5?(n(),t("div",Ae,[p(w(e.message.content)+" ",1),e.message.reply_id===1?(n(),t("span",{key:0,onClick:o[2]||(o[2]=$(y=>g(e.message),["stop"])),class:"hash-link view-link"},[a(k,null,{default:r(()=>[a(h(pe))]),_:1}),p(" \u540C\u610F ")])):i("",!0),e.message.reply_id===1?(n(),t("span",{key:1,onClick:o[3]||(o[3]=$(y=>f(e.message),["stop"])),class:"hash-link view-link"},[a(k,null,{default:r(()=>[a(h(b))]),_:1}),p(" \u62D2\u7EDD ")])):i("",!0),e.message.reply_id===2?(n(),t("span",Le,[a(k,null,{default:r(()=>[a(h(ce))]),_:1}),p(" \u5DF2\u540C\u610F ")])):i("",!0),e.message.reply_id===3?(n(),t("span",Se,[a(k,null,{default:r(()=>[a(h(b))]),_:1}),p(" \u5DF2\u62D2\u7EDD ")])):i("",!0)])):i("",!0)]),_:1},8,["type"])]),_:1})],2)}}});var qe=F(Ve,[["__scopeId","data-v-44920a13"]]);const ze={class:"content"},Ie=v({__name:"message-skeleton",props:{num:{default:1}},setup(e){return(c,_)=>{const u=X;return n(!0),t(A,null,O(new Array(e.num),g=>(n(),t("div",{class:"skeleton-item",key:g},[l("div",ze,[a(u,{text:"",repeat:2}),a(u,{text:"",style:{width:"60%"}})])]))),128)}}});var Ne=F(Ie,[["__scopeId","data-v-d0b0628c"]]);const Re={key:0,class:"skeleton-wrap"},Pe={key:1},Te={key:0,class:"empty-wrap"},He={key:0,class:"pagination-wrap"},Ue=v({__name:"Messages",setup(e){const c=Y(),_=G(),u=x(!1),g=x(+c.query.p||1),f=x(10),d=x(0),s=x([]),o=()=>{u.value=!0,Z({page:g.value,page_size:f.value}).then(m=>{u.value=!1,s.value=m.list,d.value=Math.ceil(m.pager.total_rows/f.value)}).catch(m=>{u.value=!1})},C=m=>{g.value=m,o()};return W(()=>{o()}),(m,B)=>{const k=se,D=Ne,M=ee,y=qe,L=ne,S=oe,V=te;return n(),t("div",null,[a(k,{title:"\u6D88\u606F"}),a(V,{class:"main-content-wrap messages-wrap",bordered:""},{footer:r(()=>[d.value>1?(n(),t("div",He,[a(S,{page:g.value,"onUpdate:page":C,"page-slot":h(_).state.collapsedRight?5:8,"page-count":d.value},null,8,["page","page-slot","page-count"])])):i("",!0)]),default:r(()=>[u.value?(n(),t("div",Re,[a(D,{num:f.value},null,8,["num"])])):(n(),t("div",Pe,[s.value.length===0?(n(),t("div",Te,[a(M,{size:"large",description:"\u6682\u65E0\u6570\u636E"})])):i("",!0),(n(!0),t(A,null,O(s.value,j=>(n(),E(L,{key:j.id},{default:r(()=>[a(y,{message:j},null,8,["message"])]),_:2},1024))),128))]))]),_:1})])}}});var en=F(Ue,[["__scopeId","data-v-532e9e3c"]]);export{en as default}; diff --git a/web/dist/assets/Messages.db382f03.css b/web/dist/assets/Messages.db382f03.css deleted file mode 100644 index f40012b0..00000000 --- a/web/dist/assets/Messages.db382f03.css +++ /dev/null @@ -1 +0,0 @@ -.message-item[data-v-44920a13]{padding:16px}.message-item.unread[data-v-44920a13]{background:#fcfffc}.message-item .sender-wrap[data-v-44920a13]{display:flex;align-items:center}.message-item .sender-wrap .username[data-v-44920a13]{opacity:.75;font-size:14px}.message-item .timestamp[data-v-44920a13]{opacity:.75;font-size:12px;display:flex;align-items:center}.message-item .timestamp .timestamp-txt[data-v-44920a13]{margin-left:6px}.message-item .brief-wrap[data-v-44920a13]{margin-top:10px}.message-item .brief-wrap .brief-content[data-v-44920a13],.message-item .brief-wrap .whisper-content-wrap[data-v-44920a13],.message-item .brief-wrap .requesting-friend-wrap[data-v-44920a13]{display:flex;width:100%}.message-item .view-link[data-v-44920a13]{margin-left:8px;display:flex;align-items:center}.message-item .status-info[data-v-44920a13]{margin-left:8px;align-items:center}.dark .message-item.unread[data-v-44920a13]{background:#0f180b}.skeleton-item[data-v-d0b0628c]{padding:12px;display:flex}.skeleton-item .content[data-v-d0b0628c]{width:100%}.pagination-wrap[data-v-532e9e3c]{padding:10px;display:flex;justify-content:center;overflow:hidden} diff --git a/web/dist/assets/MoreHorizFilled.b0eea69d.js b/web/dist/assets/MoreHorizFilled.b0eea69d.js deleted file mode 100644 index fc945843..00000000 --- a/web/dist/assets/MoreHorizFilled.b0eea69d.js +++ /dev/null @@ -1 +0,0 @@ -import{d as e,W as o,Y as s,Z as r}from"./index.d4f5aad2.js";const t={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},n=r("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z",fill:"currentColor"},null,-1),l=[n];var m=e({name:"MoreHorizFilled",render:function(i,a){return o(),s("svg",t,l)}});export{m as M}; diff --git a/web/dist/assets/Pagination.c13c2d34.js b/web/dist/assets/Pagination.c13c2d34.js deleted file mode 100644 index 901e5501..00000000 --- a/web/dist/assets/Pagination.c13c2d34.js +++ /dev/null @@ -1,303 +0,0 @@ -import{d as le,r as P,aE as Zt,aF as Qt,a2 as kt,V as Ue,h as n,aG as Yt,aH as Gt,b as ce,c as k,f as U,a as it,e as X,x as Ce,t as we,aI as Xt,y as I,aJ as We,S as Ne,aK as He,z as Q,A as Ze,aL as en,aM as tn,ao as at,aN as Pt,ab as lt,aO as nn,n as on,q as an,u as dt,aP as Ot,aQ as Bt,aR as rn,aS as st,w as E,p as ln,aT as sn,aU as dn,aV as zt,aW as ct,aX as un,aY as cn,s as Ke,J as Rt,aZ as fn,o as hn,a_ as vn,a$ as qe,b0 as gn,b1 as bn,b2 as pn,b3 as mn,b4 as wn,b5 as Cn,b6 as ft,b7 as xn,b8 as yn,b9 as Fn,j as Mn,L as Sn,_ as ht,N as Re}from"./index.d4f5aad2.js";import{u as kn,N as Tt,m as vt}from"./Skeleton.e1c16fcb.js";function gt(e){switch(e){case"tiny":return"mini";case"small":return"tiny";case"medium":return"small";case"large":return"medium";case"huge":return"large"}throw Error(`${e} has no smaller size.`)}const ye="v-hidden",Pn=Gt("[v-hidden]",{display:"none!important"});var bt=le({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateOverflow:Function},setup(e,{slots:o}){const s=P(null),d=P(null);function f(){const{value:C}=s,{getCounter:i,getTail:g}=e;let h;if(i!==void 0?h=i():h=d.value,!C||!h)return;h.hasAttribute(ye)&&h.removeAttribute(ye);const{children:F}=C,y=C.offsetWidth,v=[],b=o.tail?g==null?void 0:g():null;let c=b?b.offsetWidth:0,p=!1;const z=C.children.length-(o.tail?1:0);for(let R=0;Ry){const{updateCounter:H}=e;for(let _=R;_>=0;--_){const L=z-1-_;H!==void 0?H(L):h.textContent=`${L}`;const N=h.offsetWidth;if(c-=v[_],c+N<=y||_===0){p=!0,R=_-1,b&&(R===-1?(b.style.maxWidth=`${y-N}px`,b.style.boxSizing="border-box"):b.style.maxWidth="");break}}}}const{onUpdateOverflow:T}=e;p?T!==void 0&&T(!0):(T!==void 0&&T(!1),h.setAttribute(ye,""))}const x=Zt();return Pn.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Qt,ssr:x}),kt(f),{selfRef:s,counterRef:d,sync:f}},render(){const{$slots:e}=this;return Ue(this.sync),n("div",{class:"v-overflow",ref:"selfRef"},[Yt(e,"default"),e.counter?e.counter():n("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}}),pt=le({name:"Backward",render(){return n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M12.2674 15.793C11.9675 16.0787 11.4927 16.0672 11.2071 15.7673L6.20572 10.5168C5.9298 10.2271 5.9298 9.7719 6.20572 9.48223L11.2071 4.23177C11.4927 3.93184 11.9675 3.92031 12.2674 4.206C12.5673 4.49169 12.5789 4.96642 12.2932 5.26634L7.78458 9.99952L12.2932 14.7327C12.5789 15.0326 12.5673 15.5074 12.2674 15.793Z",fill:"currentColor"}))}}),mt=le({name:"FastBackward",render(){return n("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("path",{d:"M8.73171,16.7949 C9.03264,17.0795 9.50733,17.0663 9.79196,16.7654 C10.0766,16.4644 10.0634,15.9897 9.76243,15.7051 L4.52339,10.75 L17.2471,10.75 C17.6613,10.75 17.9971,10.4142 17.9971,10 C17.9971,9.58579 17.6613,9.25 17.2471,9.25 L4.52112,9.25 L9.76243,4.29275 C10.0634,4.00812 10.0766,3.53343 9.79196,3.2325 C9.50733,2.93156 9.03264,2.91834 8.73171,3.20297 L2.31449,9.27241 C2.14819,9.4297 2.04819,9.62981 2.01448,9.8386 C2.00308,9.89058 1.99707,9.94459 1.99707,10 C1.99707,10.0576 2.00356,10.1137 2.01585,10.1675 C2.05084,10.3733 2.15039,10.5702 2.31449,10.7254 L8.73171,16.7949 Z"}))))}}),wt=le({name:"FastForward",render(){return n("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("path",{d:"M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z"}))))}}),Ct=le({name:"Forward",render(){return n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M7.73271 4.20694C8.03263 3.92125 8.50737 3.93279 8.79306 4.23271L13.7944 9.48318C14.0703 9.77285 14.0703 10.2281 13.7944 10.5178L8.79306 15.7682C8.50737 16.0681 8.03263 16.0797 7.73271 15.794C7.43279 15.5083 7.42125 15.0336 7.70694 14.7336L12.2155 10.0005L7.70694 5.26729C7.42125 4.96737 7.43279 4.49264 7.73271 4.20694Z",fill:"currentColor"}))}}),xt=le({name:"More",render(){return n("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("path",{d:"M4,7 C4.55228,7 5,7.44772 5,8 C5,8.55229 4.55228,9 4,9 C3.44772,9 3,8.55229 3,8 C3,7.44772 3.44772,7 4,7 Z M8,7 C8.55229,7 9,7.44772 9,8 C9,8.55229 8.55229,9 8,9 C7.44772,9 7,8.55229 7,8 C7,7.44772 7.44772,7 8,7 Z M12,7 C12.5523,7 13,7.44772 13,8 C13,8.55229 12.5523,9 12,9 C11.4477,9 11,8.55229 11,8 C11,7.44772 11.4477,7 12,7 Z"}))))}}),On=ce([k("base-selection",` - position: relative; - z-index: auto; - box-shadow: none; - width: 100%; - max-width: 100%; - display: inline-block; - vertical-align: bottom; - border-radius: var(--n-border-radius); - min-height: var(--n-height); - line-height: 1.5; - font-size: var(--n-font-size); - `,[k("base-loading",` - color: var(--n-loading-color); - `),k("base-selection-tags","min-height: var(--n-height);"),U("border, state-border",` - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - pointer-events: none; - border: var(--n-border); - border-radius: inherit; - transition: - box-shadow .3s var(--n-bezier), - border-color .3s var(--n-bezier); - `),U("state-border",` - z-index: 1; - border-color: #0000; - `),k("base-suffix",` - cursor: pointer; - position: absolute; - top: 50%; - transform: translateY(-50%); - right: 10px; - `,[U("arrow",` - font-size: var(--n-arrow-size); - color: var(--n-arrow-color); - transition: color .3s var(--n-bezier); - `)]),k("base-selection-overlay",` - display: flex; - align-items: center; - white-space: nowrap; - pointer-events: none; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - padding: var(--n-padding-single); - transition: color .3s var(--n-bezier); - `,[U("wrapper",` - flex-basis: 0; - flex-grow: 1; - overflow: hidden; - text-overflow: ellipsis; - `)]),k("base-selection-placeholder",` - color: var(--n-placeholder-color); - `,[U("inner",` - max-width: 100%; - overflow: hidden; - `)]),k("base-selection-tags",` - cursor: pointer; - outline: none; - box-sizing: border-box; - position: relative; - z-index: auto; - display: flex; - padding: var(--n-padding-multiple); - flex-wrap: wrap; - align-items: center; - width: 100%; - vertical-align: bottom; - background-color: var(--n-color); - border-radius: inherit; - transition: - color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier); - `),k("base-selection-label",` - height: var(--n-height); - display: inline-flex; - width: 100%; - vertical-align: bottom; - cursor: pointer; - outline: none; - z-index: auto; - box-sizing: border-box; - position: relative; - transition: - color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier); - border-radius: inherit; - background-color: var(--n-color); - align-items: center; - `,[k("base-selection-input",` - font-size: inherit; - line-height: inherit; - outline: none; - cursor: pointer; - box-sizing: border-box; - border:none; - width: 100%; - padding: var(--n-padding-single); - background-color: #0000; - color: var(--n-text-color); - transition: color .3s var(--n-bezier); - caret-color: var(--n-caret-color); - `,[U("content",` - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - `)]),U("render-label",` - color: var(--n-text-color); - `)]),it("disabled",[ce("&:hover",[U("state-border",` - box-shadow: var(--n-box-shadow-hover); - border: var(--n-border-hover); - `)]),X("focus",[U("state-border",` - box-shadow: var(--n-box-shadow-focus); - border: var(--n-border-focus); - `)]),X("active",[U("state-border",` - box-shadow: var(--n-box-shadow-active); - border: var(--n-border-active); - `),k("base-selection-label","background-color: var(--n-color-active);"),k("base-selection-tags","background-color: var(--n-color-active);")])]),X("disabled","cursor: not-allowed;",[U("arrow",` - color: var(--n-arrow-color-disabled); - `),k("base-selection-label",` - cursor: not-allowed; - background-color: var(--n-color-disabled); - `,[k("base-selection-input",` - cursor: not-allowed; - color: var(--n-text-color-disabled); - `),U("render-label",` - color: var(--n-text-color-disabled); - `)]),k("base-selection-tags",` - cursor: not-allowed; - background-color: var(--n-color-disabled); - `),k("base-selection-placeholder",` - cursor: not-allowed; - color: var(--n-placeholder-color-disabled); - `)]),k("base-selection-input-tag",` - height: calc(var(--n-height) - 6px); - line-height: calc(var(--n-height) - 6px); - outline: none; - display: none; - position: relative; - margin-bottom: 3px; - max-width: 100%; - vertical-align: bottom; - `,[U("input",` - font-size: inherit; - font-family: inherit; - min-width: 1px; - padding: 0; - background-color: #0000; - outline: none; - border: none; - max-width: 100%; - overflow: hidden; - width: 1em; - line-height: inherit; - cursor: pointer; - color: var(--n-text-color); - caret-color: var(--n-caret-color); - `),U("mirror",` - position: absolute; - left: 0; - top: 0; - white-space: pre; - visibility: hidden; - user-select: none; - -webkit-user-select: none; - opacity: 0; - `)]),["warning","error"].map(e=>X(`${e}-status`,[U("state-border",`border: var(--n-border-${e});`),it("disabled",[ce("&:hover",[U("state-border",` - box-shadow: var(--n-box-shadow-hover-${e}); - border: var(--n-border-hover-${e}); - `)]),X("active",[U("state-border",` - box-shadow: var(--n-box-shadow-active-${e}); - border: var(--n-border-active-${e}); - `),k("base-selection-label",`background-color: var(--n-color-active-${e});`),k("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),X("focus",[U("state-border",` - box-shadow: var(--n-box-shadow-focus-${e}); - border: var(--n-border-focus-${e}); - `)])])]))]),k("base-selection-popover",` - margin-bottom: -3px; - display: flex; - flex-wrap: wrap; - margin-right: -8px; - `),k("base-selection-tag-wrapper",` - max-width: 100%; - display: inline-flex; - padding: 0 7px 3px 0; - `,[ce("&:last-child","padding-right: 0;"),k("tag",` - font-size: 14px; - max-width: 100%; - `,[U("content",` - line-height: 1.25; - text-overflow: ellipsis; - overflow: hidden; - `)])])]),Bn=le({name:"InternalSelection",props:Object.assign(Object.assign({},Ce.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const o=P(null),s=P(null),d=P(null),f=P(null),x=P(null),C=P(null),i=P(null),g=P(null),h=P(null),F=P(null),y=P(!1),v=P(!1),b=P(!1),c=Ce("InternalSelection","-internal-selection",On,Xt,e,we(e,"clsPrefix")),p=I(()=>e.clearable&&!e.disabled&&(b.value||e.active)),z=I(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):We(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),T=I(()=>{const r=e.selectedOption;if(!!r)return r[e.labelField]}),R=I(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function W(){var r;const{value:u}=o;if(u){const{value:$}=s;$&&($.style.width=`${u.offsetWidth}px`,e.maxTagCount!=="responsive"&&((r=h.value)===null||r===void 0||r.sync()))}}function Y(){const{value:r}=F;r&&(r.style.display="none")}function H(){const{value:r}=F;r&&(r.style.display="inline-block")}Ne(we(e,"active"),r=>{r||Y()}),Ne(we(e,"pattern"),()=>{e.multiple&&Ue(W)});function _(r){const{onFocus:u}=e;u&&u(r)}function L(r){const{onBlur:u}=e;u&&u(r)}function N(r){const{onDeleteOption:u}=e;u&&u(r)}function fe(r){const{onClear:u}=e;u&&u(r)}function ne(r){const{onPatternInput:u}=e;u&&u(r)}function se(r){var u;(!r.relatedTarget||!(!((u=d.value)===null||u===void 0)&&u.contains(r.relatedTarget)))&&_(r)}function V(r){var u;!((u=d.value)===null||u===void 0)&&u.contains(r.relatedTarget)||L(r)}function oe(r){fe(r)}function he(){b.value=!0}function ve(){b.value=!1}function J(r){!e.active||!e.filterable||r.target!==s.value&&r.preventDefault()}function K(r){N(r)}function G(r){if(r.key==="Backspace"&&!ae.value&&!e.pattern.length){const{selectedOptions:u}=e;u!=null&&u.length&&K(u[u.length-1])}}const ae=P(!1);let A=null;function xe(r){const{value:u}=o;if(u){const $=r.target.value;u.textContent=$,W()}e.ignoreComposition&&ae.value?A=r:ne(r)}function ee(){ae.value=!0}function ge(){ae.value=!1,e.ignoreComposition&&ne(A),A=null}function be(r){var u;v.value=!0,(u=e.onPatternFocus)===null||u===void 0||u.call(e,r)}function Z(r){var u;v.value=!1,(u=e.onPatternBlur)===null||u===void 0||u.call(e,r)}function pe(){var r,u;if(e.filterable)v.value=!1,(r=C.value)===null||r===void 0||r.blur(),(u=s.value)===null||u===void 0||u.blur();else if(e.multiple){const{value:$}=f;$==null||$.blur()}else{const{value:$}=x;$==null||$.blur()}}function re(){var r,u,$;e.filterable?(v.value=!1,(r=C.value)===null||r===void 0||r.focus()):e.multiple?(u=f.value)===null||u===void 0||u.focus():($=x.value)===null||$===void 0||$.focus()}function q(){const{value:r}=s;r&&(H(),r.focus())}function j(){const{value:r}=s;r&&r.blur()}function a(r){const{value:u}=i;u&&u.setTextContent(`+${r}`)}function m(){const{value:r}=g;return r}function ie(){return s.value}let te=null;function me(){te!==null&&window.clearTimeout(te)}function Te(){e.disabled||e.active||(me(),te=window.setTimeout(()=>{R.value&&(y.value=!0)},100))}function Ie(){me()}function _e(r){r||(me(),y.value=!1)}Ne(R,r=>{r||(y.value=!1)}),kt(()=>{He(()=>{const r=C.value;!r||(r.tabIndex=e.disabled||v.value?-1:0)})}),kn(d,e.onResize);const{inlineThemeDisabled:Fe}=e,Me=I(()=>{const{size:r}=e,{common:{cubicBezierEaseInOut:u},self:{borderRadius:$,color:Se,placeholderColor:$e,textColor:Ae,paddingSingle:je,paddingMultiple:Ee,caretColor:ke,colorDisabled:Pe,textColorDisabled:Oe,placeholderColorDisabled:Le,colorActive:Ve,boxShadowFocus:Be,boxShadowActive:ue,boxShadowHover:t,border:l,borderFocus:w,borderHover:B,borderActive:M,arrowColor:O,arrowColorDisabled:S,loadingColor:D,colorActiveWarning:ze,boxShadowFocusWarning:De,boxShadowActiveWarning:Qe,boxShadowHoverWarning:Ye,borderWarning:Ge,borderFocusWarning:Xe,borderHoverWarning:et,borderActiveWarning:tt,colorActiveError:nt,boxShadowFocusError:ot,boxShadowActiveError:At,boxShadowHoverError:jt,borderError:Et,borderFocusError:Lt,borderHoverError:Vt,borderActiveError:Dt,clearColor:Nt,clearColorHover:Ut,clearColorPressed:Wt,clearSize:Ht,arrowSize:Kt,[Q("height",r)]:qt,[Q("fontSize",r)]:Jt}}=c.value;return{"--n-bezier":u,"--n-border":l,"--n-border-active":M,"--n-border-focus":w,"--n-border-hover":B,"--n-border-radius":$,"--n-box-shadow-active":ue,"--n-box-shadow-focus":Be,"--n-box-shadow-hover":t,"--n-caret-color":ke,"--n-color":Se,"--n-color-active":Ve,"--n-color-disabled":Pe,"--n-font-size":Jt,"--n-height":qt,"--n-padding-single":je,"--n-padding-multiple":Ee,"--n-placeholder-color":$e,"--n-placeholder-color-disabled":Le,"--n-text-color":Ae,"--n-text-color-disabled":Oe,"--n-arrow-color":O,"--n-arrow-color-disabled":S,"--n-loading-color":D,"--n-color-active-warning":ze,"--n-box-shadow-focus-warning":De,"--n-box-shadow-active-warning":Qe,"--n-box-shadow-hover-warning":Ye,"--n-border-warning":Ge,"--n-border-focus-warning":Xe,"--n-border-hover-warning":et,"--n-border-active-warning":tt,"--n-color-active-error":nt,"--n-box-shadow-focus-error":ot,"--n-box-shadow-active-error":At,"--n-box-shadow-hover-error":jt,"--n-border-error":Et,"--n-border-focus-error":Lt,"--n-border-hover-error":Vt,"--n-border-active-error":Dt,"--n-clear-size":Ht,"--n-clear-color":Nt,"--n-clear-color-hover":Ut,"--n-clear-color-pressed":Wt,"--n-arrow-size":Kt}}),de=Fe?Ze("internal-selection",I(()=>e.size[0]),Me,e):void 0;return{mergedTheme:c,mergedClearable:p,patternInputFocused:v,filterablePlaceholder:z,label:T,selected:R,showTagsPanel:y,isComposing:ae,counterRef:i,counterWrapperRef:g,patternInputMirrorRef:o,patternInputRef:s,selfRef:d,multipleElRef:f,singleElRef:x,patternInputWrapperRef:C,overflowRef:h,inputTagElRef:F,handleMouseDown:J,handleFocusin:se,handleClear:oe,handleMouseEnter:he,handleMouseLeave:ve,handleDeleteOption:K,handlePatternKeyDown:G,handlePatternInputInput:xe,handlePatternInputBlur:Z,handlePatternInputFocus:be,handleMouseEnterCounter:Te,handleMouseLeaveCounter:Ie,handleFocusout:V,handleCompositionEnd:ge,handleCompositionStart:ee,onPopoverUpdateShow:_e,focus:re,focusInput:q,blur:pe,blurInput:j,updateCounter:a,getCounter:m,getTail:ie,renderLabel:e.renderLabel,cssVars:Fe?void 0:Me,themeClass:de==null?void 0:de.themeClass,onRender:de==null?void 0:de.onRender}},render(){const{status:e,multiple:o,size:s,disabled:d,filterable:f,maxTagCount:x,bordered:C,clsPrefix:i,onRender:g,renderTag:h,renderLabel:F}=this;g==null||g();const y=x==="responsive",v=typeof x=="number",b=y||v,c=n(tn,null,{default:()=>n(en,{clsPrefix:i,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var z,T;return(T=(z=this.$slots).arrow)===null||T===void 0?void 0:T.call(z)}})});let p;if(o){const{labelField:z}=this,T=V=>n("div",{class:`${i}-base-selection-tag-wrapper`,key:V.value},h?h({option:V,handleClose:()=>this.handleDeleteOption(V)}):n(at,{size:s,closable:!V.disabled,disabled:d,onClose:()=>this.handleDeleteOption(V),internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>F?F(V,!0):We(V[z],V,!0)})),R=()=>(v?this.selectedOptions.slice(0,x):this.selectedOptions).map(T),W=f?n("div",{class:`${i}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},n("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:d,value:this.pattern,autofocus:this.autofocus,class:`${i}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),n("span",{ref:"patternInputMirrorRef",class:`${i}-base-selection-input-tag__mirror`},this.pattern)):null,Y=y?()=>n("div",{class:`${i}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},n(at,{size:s,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:d})):void 0;let H;if(v){const V=this.selectedOptions.length-x;V>0&&(H=n("div",{class:`${i}-base-selection-tag-wrapper`,key:"__counter__"},n(at,{size:s,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:d},{default:()=>`+${V}`})))}const _=y?f?n(bt,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:R,counter:Y,tail:()=>W}):n(bt,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:R,counter:Y}):v?R().concat(H):R(),L=b?()=>n("div",{class:`${i}-base-selection-popover`},y?R():this.selectedOptions.map(T)):void 0,N=b?{show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover}:null,ne=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?n("div",{class:`${i}-base-selection-placeholder ${i}-base-selection-overlay`},n("div",{class:`${i}-base-selection-placeholder__inner`},this.placeholder)):null,se=f?n("div",{ref:"patternInputWrapperRef",class:`${i}-base-selection-tags`},_,y?null:W,c):n("div",{ref:"multipleElRef",class:`${i}-base-selection-tags`,tabindex:d?void 0:0},_,c);p=n(lt,null,b?n(Pt,Object.assign({},N,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>se,default:L}):se,ne)}else if(f){const z=this.pattern||this.isComposing,T=this.active?!z:!this.selected,R=this.active?!1:this.selected;p=n("div",{ref:"patternInputWrapperRef",class:`${i}-base-selection-label`},n("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${i}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:d,disabled:d,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),R?n("div",{class:`${i}-base-selection-label__render-label ${i}-base-selection-overlay`,key:"input"},n("div",{class:`${i}-base-selection-overlay__wrapper`},h?h({option:this.selectedOption,handleClose:()=>{}}):F?F(this.selectedOption,!0):We(this.label,this.selectedOption,!0))):null,T?n("div",{class:`${i}-base-selection-placeholder ${i}-base-selection-overlay`,key:"placeholder"},n("div",{class:`${i}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,c)}else p=n("div",{ref:"singleElRef",class:`${i}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?n("div",{class:`${i}-base-selection-input`,title:nn(this.label),key:"input"},n("div",{class:`${i}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):F?F(this.selectedOption,!0):We(this.label,this.selectedOption,!0))):n("div",{class:`${i}-base-selection-placeholder ${i}-base-selection-overlay`,key:"placeholder"},n("div",{class:`${i}-base-selection-placeholder__inner`},this.placeholder)),c);return n("div",{ref:"selfRef",class:[`${i}-base-selection`,this.themeClass,e&&`${i}-base-selection--${e}-status`,{[`${i}-base-selection--active`]:this.active,[`${i}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${i}-base-selection--disabled`]:this.disabled,[`${i}-base-selection--multiple`]:this.multiple,[`${i}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},p,C?n("div",{class:`${i}-base-selection__border`}):null,C?n("div",{class:`${i}-base-selection__state-border`}):null)}});function Je(e){return e.type==="group"}function It(e){return e.type==="ignored"}function rt(e,o){try{return!!(1+o.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function _t(e,o){return{getIsGroup:Je,getIgnored:It,getKey(d){return Je(d)?d.name||d.key||"key-required":d[e]},getChildren(d){return d[o]}}}function zn(e,o,s,d){if(!o)return e;function f(x){if(!Array.isArray(x))return[];const C=[];for(const i of x)if(Je(i)){const g=f(i[d]);g.length&&C.push(Object.assign({},i,{[d]:g}))}else{if(It(i))continue;o(s,i)&&C.push(i)}return C}return f(e)}function Rn(e,o,s){const d=new Map;return e.forEach(f=>{Je(f)?f[s].forEach(x=>{d.set(x[o],x)}):d.set(f[o],f)}),d}const $t=on("n-popselect");var Tn=k("popselect-menu",` - box-shadow: var(--n-menu-box-shadow); -`);const ut={multiple:Boolean,value:{type:[String,Number,Array],default:null},cancelable:Boolean,options:{type:Array,default:()=>[]},size:{type:String,default:"medium"},scrollable:Boolean,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onMouseenter:Function,onMouseleave:Function,renderLabel:Function,showCheckmark:{type:Boolean,default:void 0},nodeProps:Function,virtualScroll:Boolean,onChange:[Function,Array]},yt=rn(ut);var In=le({name:"PopselectPanel",props:ut,setup(e){const o=an($t),{mergedClsPrefixRef:s,inlineThemeDisabled:d}=dt(e),f=Ce("Popselect","-pop-select",Tn,Ot,o.props,s),x=I(()=>Bt(e.options,_t("value","children")));function C(v,b){const{onUpdateValue:c,"onUpdate:value":p,onChange:z}=e;c&&E(c,v,b),p&&E(p,v,b),z&&E(z,v,b)}function i(v){h(v.key)}function g(v){st(v,"action")||v.preventDefault()}function h(v){const{value:{getNode:b}}=x;if(e.multiple)if(Array.isArray(e.value)){const c=[],p=[];let z=!0;e.value.forEach(T=>{if(T===v){z=!1;return}const R=b(T);R&&(c.push(R.key),p.push(R.rawNode))}),z&&(c.push(v),p.push(b(v).rawNode)),C(c,p)}else{const c=b(v);c&&C([v],[c.rawNode])}else if(e.value===v&&e.cancelable)C(null,null);else{const c=b(v);c&&C(v,c.rawNode);const{"onUpdate:show":p,onUpdateShow:z}=o.props;p&&E(p,!1),z&&E(z,!1),o.setShow(!1)}Ue(()=>{o.syncPosition()})}Ne(we(e,"options"),()=>{Ue(()=>{o.syncPosition()})});const F=I(()=>{const{self:{menuBoxShadow:v}}=f.value;return{"--n-menu-box-shadow":v}}),y=d?Ze("select",void 0,F,o.props):void 0;return{mergedTheme:o.mergedThemeRef,mergedClsPrefix:s,treeMate:x,handleToggle:i,handleMenuMousedown:g,cssVars:d?void 0:F,themeClass:y==null?void 0:y.themeClass,onRender:y==null?void 0:y.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),n(Tt,{clsPrefix:this.mergedClsPrefix,focusable:!0,nodeProps:this.nodeProps,class:[`${this.mergedClsPrefix}-popselect-menu`,this.themeClass],style:this.cssVars,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,multiple:this.multiple,treeMate:this.treeMate,size:this.size,value:this.value,virtualScroll:this.virtualScroll,scrollable:this.scrollable,renderLabel:this.renderLabel,onToggle:this.handleToggle,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseenter,onMousedown:this.handleMenuMousedown,showCheckmark:this.showCheckmark},{action:()=>{var o,s;return((s=(o=this.$slots).action)===null||s===void 0?void 0:s.call(o))||[]},empty:()=>{var o,s;return((s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o))||[]}})}});const _n=Object.assign(Object.assign(Object.assign(Object.assign({},Ce.props),zt(ct,["showArrow","arrow"])),{placement:Object.assign(Object.assign({},ct.placement),{default:"bottom"}),trigger:{type:String,default:"hover"}}),ut);var $n=le({name:"Popselect",props:_n,inheritAttrs:!1,__popover__:!0,setup(e){const o=Ce("Popselect","-popselect",void 0,Ot,e),s=P(null);function d(){var C;(C=s.value)===null||C===void 0||C.syncPosition()}function f(C){var i;(i=s.value)===null||i===void 0||i.setShow(C)}return ln($t,{props:e,mergedThemeRef:o,syncPosition:d,setShow:f}),Object.assign(Object.assign({},{syncPosition:d,setShow:f}),{popoverInstRef:s,mergedTheme:o})},render(){const{mergedTheme:e}=this,o={theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:{padding:"0"},ref:"popoverInstRef",internalRenderBody:(s,d,f,x,C)=>{const{$attrs:i}=this;return n(In,Object.assign({},i,{class:[i.class,s],style:[i.style,f]},sn(this.$props,yt),{ref:dn(d),onMouseenter:vt([x,i.onMouseenter]),onMouseleave:vt([C,i.onMouseleave])}),{action:()=>{var g,h;return(h=(g=this.$slots).action)===null||h===void 0?void 0:h.call(g)},empty:()=>{var g,h;return(h=(g=this.$slots).empty)===null||h===void 0?void 0:h.call(g)}})}};return n(Pt,Object.assign({},zt(this.$props,yt),o,{internalDeactivateImmediately:!0}),{trigger:()=>{var s,d;return(d=(s=this.$slots).default)===null||d===void 0?void 0:d.call(s)}})}}),An=ce([k("select",` - z-index: auto; - outline: none; - width: 100%; - position: relative; - `),k("select-menu",` - margin: 4px 0; - box-shadow: var(--n-menu-box-shadow); - `,[un({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);const jn=Object.assign(Object.assign({},Ce.props),{to:qe.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array});var En=le({name:"Select",props:jn,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:s,namespaceRef:d,inlineThemeDisabled:f}=dt(e),x=Ce("Select","-select",An,cn,e,o),C=P(e.defaultValue),i=we(e,"value"),g=Ke(i,C),h=P(!1),F=P(""),y=I(()=>{const{valueField:t,childrenField:l}=e,w=_t(t,l);return Bt(V.value,w)}),v=I(()=>Rn(ne.value,e.valueField,e.childrenField)),b=P(!1),c=Ke(we(e,"show"),b),p=P(null),z=P(null),T=P(null),{localeRef:R}=Rt("Select"),W=I(()=>{var t;return(t=e.placeholder)!==null&&t!==void 0?t:R.value.placeholder}),Y=fn(e,["items","options"]),H=[],_=P([]),L=P([]),N=P(new Map),fe=I(()=>{const{fallbackOption:t}=e;if(t===void 0){const{labelField:l,valueField:w}=e;return B=>({[l]:String(B),[w]:B})}return t===!1?!1:l=>Object.assign(t(l),{value:l})}),ne=I(()=>L.value.concat(_.value).concat(Y.value)),se=I(()=>{const{filter:t}=e;if(t)return t;const{labelField:l,valueField:w}=e;return(B,M)=>{if(!M)return!1;const O=M[l];if(typeof O=="string")return rt(B,O);const S=M[w];return typeof S=="string"?rt(B,S):typeof S=="number"?rt(B,String(S)):!1}}),V=I(()=>{if(e.remote)return Y.value;{const{value:t}=ne,{value:l}=F;return!l.length||!e.filterable?t:zn(t,se.value,l,e.childrenField)}});function oe(t){const l=e.remote,{value:w}=N,{value:B}=v,{value:M}=fe,O=[];return t.forEach(S=>{if(B.has(S))O.push(B.get(S));else if(l&&w.has(S))O.push(w.get(S));else if(M){const D=M(S);D&&O.push(D)}}),O}const he=I(()=>{if(e.multiple){const{value:t}=g;return Array.isArray(t)?oe(t):[]}return null}),ve=I(()=>{const{value:t}=g;return!e.multiple&&!Array.isArray(t)?t===null?null:oe([t])[0]||null:null}),J=hn(e),{mergedSizeRef:K,mergedDisabledRef:G,mergedStatusRef:ae}=J;function A(t,l){const{onChange:w,"onUpdate:value":B,onUpdateValue:M}=e,{nTriggerFormChange:O,nTriggerFormInput:S}=J;w&&E(w,t,l),M&&E(M,t,l),B&&E(B,t,l),C.value=t,O(),S()}function xe(t){const{onBlur:l}=e,{nTriggerFormBlur:w}=J;l&&E(l,t),w()}function ee(){const{onClear:t}=e;t&&E(t)}function ge(t){const{onFocus:l,showOnFocus:w}=e,{nTriggerFormFocus:B}=J;l&&E(l,t),B(),w&&q()}function be(t){const{onSearch:l}=e;l&&E(l,t)}function Z(t){const{onScroll:l}=e;l&&E(l,t)}function pe(){var t;const{remote:l,multiple:w}=e;if(l){const{value:B}=N;if(w){const{valueField:M}=e;(t=he.value)===null||t===void 0||t.forEach(O=>{B.set(O[M],O)})}else{const M=ve.value;M&&B.set(M[e.valueField],M)}}}function re(t){const{onUpdateShow:l,"onUpdate:show":w}=e;l&&E(l,t),w&&E(w,t),b.value=t}function q(){G.value||(re(!0),b.value=!0,e.filterable&&Oe())}function j(){re(!1)}function a(){F.value="",L.value=H}const m=P(!1);function ie(){e.filterable&&(m.value=!0)}function te(){e.filterable&&(m.value=!1,c.value||a())}function me(){G.value||(c.value?e.filterable?Oe():j():q())}function Te(t){var l,w;!((w=(l=T.value)===null||l===void 0?void 0:l.selfRef)===null||w===void 0)&&w.contains(t.relatedTarget)||(h.value=!1,xe(t),j())}function Ie(t){ge(t),h.value=!0}function _e(t){h.value=!0}function Fe(t){var l;!((l=p.value)===null||l===void 0)&&l.$el.contains(t.relatedTarget)||(h.value=!1,xe(t),j())}function Me(){var t;(t=p.value)===null||t===void 0||t.focus(),j()}function de(t){var l;c.value&&(!((l=p.value)===null||l===void 0)&&l.$el.contains(xn(t))||j())}function r(t){if(!Array.isArray(t))return[];if(fe.value)return Array.from(t);{const{remote:l}=e,{value:w}=v;if(l){const{value:B}=N;return t.filter(M=>w.has(M)||B.has(M))}else return t.filter(B=>w.has(B))}}function u(t){$(t.rawNode)}function $(t){if(G.value)return;const{tag:l,remote:w,clearFilterAfterSelect:B,valueField:M}=e;if(l&&!w){const{value:O}=L,S=O[0]||null;if(S){const D=_.value;D.length?D.push(S):_.value=[S],L.value=H}}if(w&&N.value.set(t[M],t),e.multiple){const O=r(g.value),S=O.findIndex(D=>D===t[M]);if(~S){if(O.splice(S,1),l&&!w){const D=Se(t[M]);~D&&(_.value.splice(D,1),B&&(F.value=""))}}else O.push(t[M]),B&&(F.value="");A(O,oe(O))}else{if(l&&!w){const O=Se(t[M]);~O?_.value=[_.value[O]]:_.value=H}Pe(),j(),A(t[M],t)}}function Se(t){return _.value.findIndex(w=>w[e.valueField]===t)}function $e(t){c.value||q();const{value:l}=t.target;F.value=l;const{tag:w,remote:B}=e;if(be(l),w&&!B){if(!l){L.value=H;return}const{onCreate:M}=e,O=M?M(l):{[e.labelField]:l,[e.valueField]:l},{valueField:S}=e;Y.value.some(D=>D[S]===O[S])||_.value.some(D=>D[S]===O[S])?L.value=H:L.value=[O]}}function Ae(t){t.stopPropagation();const{multiple:l}=e;!l&&e.filterable&&j(),ee(),l?A([],[]):A(null,null)}function je(t){!st(t,"action")&&!st(t,"empty")&&t.preventDefault()}function Ee(t){Z(t)}function ke(t){var l,w,B,M,O;switch(t.key){case" ":if(e.filterable)break;t.preventDefault();case"Enter":if(!(!((l=p.value)===null||l===void 0)&&l.isComposing)){if(c.value){const S=(w=T.value)===null||w===void 0?void 0:w.getPendingTmNode();S?u(S):e.filterable||(j(),Pe())}else if(q(),e.tag&&m.value){const S=L.value[0];if(S){const D=S[e.valueField],{value:ze}=g;e.multiple&&Array.isArray(ze)&&ze.some(De=>De===D)||$(S)}}}t.preventDefault();break;case"ArrowUp":if(t.preventDefault(),e.loading)return;c.value&&((B=T.value)===null||B===void 0||B.prev());break;case"ArrowDown":if(t.preventDefault(),e.loading)return;c.value?(M=T.value)===null||M===void 0||M.next():q();break;case"Escape":c.value&&(yn(t),j()),(O=p.value)===null||O===void 0||O.focus();break}}function Pe(){var t;(t=p.value)===null||t===void 0||t.focus()}function Oe(){var t;(t=p.value)===null||t===void 0||t.focusInput()}function Le(){var t;!c.value||(t=z.value)===null||t===void 0||t.syncPosition()}pe(),Ne(we(e,"options"),pe);const Ve={focus:()=>{var t;(t=p.value)===null||t===void 0||t.focus()},blur:()=>{var t;(t=p.value)===null||t===void 0||t.blur()}},Be=I(()=>{const{self:{menuBoxShadow:t}}=x.value;return{"--n-menu-box-shadow":t}}),ue=f?Ze("select",void 0,Be,e):void 0;return Object.assign(Object.assign({},Ve),{mergedStatus:ae,mergedClsPrefix:o,mergedBordered:s,namespace:d,treeMate:y,isMounted:vn(),triggerRef:p,menuRef:T,pattern:F,uncontrolledShow:b,mergedShow:c,adjustedTo:qe(e),uncontrolledValue:C,mergedValue:g,followerRef:z,localizedPlaceholder:W,selectedOption:ve,selectedOptions:he,mergedSize:K,mergedDisabled:G,focused:h,activeWithoutMenuOpen:m,inlineThemeDisabled:f,onTriggerInputFocus:ie,onTriggerInputBlur:te,handleTriggerOrMenuResize:Le,handleMenuFocus:_e,handleMenuBlur:Fe,handleMenuTabOut:Me,handleTriggerClick:me,handleToggle:u,handleDeleteOption:$,handlePatternInput:$e,handleClear:Ae,handleTriggerBlur:Te,handleTriggerFocus:Ie,handleKeydown:ke,handleMenuAfterLeave:a,handleMenuClickOutside:de,handleMenuScroll:Ee,handleMenuKeydown:ke,handleMenuMousedown:je,mergedTheme:x,cssVars:f?void 0:Be,themeClass:ue==null?void 0:ue.themeClass,onRender:ue==null?void 0:ue.onRender})},render(){return n("div",{class:`${this.mergedClsPrefix}-select`},n(gn,null,{default:()=>[n(bn,null,{default:()=>n(Bn,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,o;return[(o=(e=this.$slots).arrow)===null||o===void 0?void 0:o.call(e)]}})}),n(pn,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===qe.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>n(mn,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,o,s;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),wn(n(Tt,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(o=this.menuProps)===null||o===void 0?void 0:o.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:"medium",renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(s=this.menuProps)===null||s===void 0?void 0:s.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var d,f;return[(f=(d=this.$slots).empty)===null||f===void 0?void 0:f.call(d)]},action:()=>{var d,f;return[(f=(d=this.$slots).action)===null||f===void 0?void 0:f.call(d)]}}),this.displayDirective==="show"?[[Cn,this.mergedShow],[ft,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[ft,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}});function Ln(e,o,s){let d=!1,f=!1,x=1,C=o;if(o===1)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:C,fastBackwardTo:x,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}]};if(o===2)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:C,fastBackwardTo:x,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1},{type:"page",label:2,active:e===2,mayBeFastBackward:!0,mayBeFastForward:!1}]};const i=1,g=o;let h=e,F=e;const y=(s-5)/2;F+=Math.ceil(y),F=Math.min(Math.max(F,i+s-3),g-2),h-=Math.floor(y),h=Math.max(Math.min(h,g-s+3),i+2);let v=!1,b=!1;h>i+2&&(v=!0),F=i+1&&c.push({type:"page",label:i+1,mayBeFastBackward:!0,mayBeFastForward:!1,active:e===i+1});for(let p=h;p<=F;++p)c.push({type:"page",label:p,mayBeFastBackward:!1,mayBeFastForward:!1,active:e===p});return b?(f=!0,C=F+1,c.push({type:"fast-forward",active:!1,label:void 0,options:Ft(F+1,g-1)})):F===g-2&&c[c.length-1].label!==g-1&&c.push({type:"page",mayBeFastForward:!0,mayBeFastBackward:!1,label:g-1,active:e===g-1}),c[c.length-1].label!==g&&c.push({type:"page",mayBeFastForward:!1,mayBeFastBackward:!1,label:g,active:e===g}),{hasFastBackward:d,hasFastForward:f,fastBackwardTo:x,fastForwardTo:C,items:c}}function Ft(e,o){const s=[];for(let d=e;d<=o;++d)s.push({label:`${d}`,value:d});return s}const Mt=` - background: var(--n-item-color-hover); - color: var(--n-item-text-color-hover); - border: var(--n-item-border-hover); -`,St=[X("button",` - background: var(--n-button-color-hover); - border: var(--n-button-border-hover); - color: var(--n-button-icon-color-hover); - `)];var Vn=k("pagination",` - display: flex; - vertical-align: middle; - font-size: var(--n-item-font-size); - flex-wrap: nowrap; -`,[k("pagination-prefix",` - display: flex; - align-items: center; - margin: var(--n-prefix-margin); - `),k("pagination-suffix",` - display: flex; - align-items: center; - margin: var(--n-suffix-margin); - `),ce("> *:not(:first-child)",` - margin: var(--n-item-margin); - `),k("select",` - width: var(--n-select-width); - `),ce("&.transition-disabled",[k("pagination-item","transition: none!important;")]),k("pagination-quick-jumper",` - white-space: nowrap; - display: flex; - color: var(--n-jumper-text-color); - transition: color .3s var(--n-bezier); - align-items: center; - font-size: var(--n-jumper-font-size); - `,[k("input",` - margin: var(--n-input-margin); - width: var(--n-input-width); - `)]),k("pagination-item",` - position: relative; - cursor: pointer; - user-select: none; - -webkit-user-select: none; - display: flex; - align-items: center; - justify-content: center; - box-sizing: border-box; - min-width: var(--n-item-size); - height: var(--n-item-size); - padding: var(--n-item-padding); - background-color: var(--n-item-color); - color: var(--n-item-text-color); - border-radius: var(--n-item-border-radius); - border: var(--n-item-border); - fill: var(--n-button-icon-color); - transition: - color .3s var(--n-bezier), - border-color .3s var(--n-bezier), - background-color .3s var(--n-bezier), - fill .3s var(--n-bezier); - `,[X("button",` - background: var(--n-button-color); - color: var(--n-button-icon-color); - border: var(--n-button-border); - padding: 0; - `,[k("base-icon",` - font-size: var(--n-button-icon-size); - `)]),it("disabled",[X("hover",Mt,St),ce("&:hover",Mt,St),ce("&:active",` - background: var(--n-item-color-pressed); - color: var(--n-item-text-color-pressed); - border: var(--n-item-border-pressed); - `,[X("button",` - background: var(--n-button-color-pressed); - border: var(--n-button-border-pressed); - color: var(--n-button-icon-color-pressed); - `)]),X("active",` - background: var(--n-item-color-active); - color: var(--n-item-text-color-active); - border: var(--n-item-border-active); - `,[ce("&:hover",` - background: var(--n-item-color-active-hover); - `)])]),X("disabled",` - cursor: not-allowed; - color: var(--n-item-text-color-disabled); - `,[X("active, button",` - background-color: var(--n-item-color-disabled); - border: var(--n-item-border-disabled); - `)])]),X("disabled",` - cursor: not-allowed; - `,[k("pagination-quick-jumper",` - color: var(--n-jumper-text-color-disabled); - `)]),X("simple",` - display: flex; - align-items: center; - flex-wrap: nowrap; - `,[k("pagination-quick-jumper",[k("input",` - margin: 0; - `)])])]);const Dn=Object.assign(Object.assign({},Ce.props),{simple:Boolean,page:Number,defaultPage:{type:Number,default:1},itemCount:Number,pageCount:Number,defaultPageCount:{type:Number,default:1},showSizePicker:Boolean,pageSize:Number,defaultPageSize:Number,pageSizes:{type:Array,default(){return[10]}},showQuickJumper:Boolean,size:{type:String,default:"medium"},disabled:Boolean,pageSlot:{type:Number,default:9},selectProps:Object,prev:Function,next:Function,goto:Function,prefix:Function,suffix:Function,label:Function,displayOrder:{type:Array,default:["pages","size-picker","quick-jumper"]},to:qe.propTo,"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],onPageSizeChange:[Function,Array],onChange:[Function,Array]});var Wn=le({name:"Pagination",props:Dn,setup(e){const{mergedComponentPropsRef:o,mergedClsPrefixRef:s,inlineThemeDisabled:d,mergedRtlRef:f}=dt(e),x=Ce("Pagination","-pagination",Vn,Fn,e,s),{localeRef:C}=Rt("Pagination"),i=P(null),g=P(e.defaultPage),F=P((()=>{const{defaultPageSize:a}=e;if(a!==void 0)return a;const m=e.pageSizes[0];return typeof m=="number"?m:m.value||10})()),y=Ke(we(e,"page"),g),v=Ke(we(e,"pageSize"),F),b=I(()=>{const{itemCount:a}=e;if(a!==void 0)return Math.max(1,Math.ceil(a/v.value));const{pageCount:m}=e;return m!==void 0?Math.max(m,1):1}),c=P("");He(()=>{e.simple,c.value=String(y.value)});const p=P(!1),z=P(!1),T=P(!1),R=P(!1),W=()=>{e.disabled||(p.value=!0,J())},Y=()=>{e.disabled||(p.value=!1,J())},H=()=>{z.value=!0,J()},_=()=>{z.value=!1,J()},L=a=>{K(a)},N=I(()=>Ln(y.value,b.value,e.pageSlot));He(()=>{N.value.hasFastBackward?N.value.hasFastForward||(p.value=!1,T.value=!1):(z.value=!1,R.value=!1)});const fe=I(()=>{const a=C.value.selectionSuffix;return e.pageSizes.map(m=>typeof m=="number"?{label:`${m} / ${a}`,value:m}:m)}),ne=I(()=>{var a,m;return((m=(a=o==null?void 0:o.value)===null||a===void 0?void 0:a.Pagination)===null||m===void 0?void 0:m.inputSize)||gt(e.size)}),se=I(()=>{var a,m;return((m=(a=o==null?void 0:o.value)===null||a===void 0?void 0:a.Pagination)===null||m===void 0?void 0:m.selectSize)||gt(e.size)}),V=I(()=>(y.value-1)*v.value),oe=I(()=>{const a=y.value*v.value-1,{itemCount:m}=e;return m!==void 0&&a>m-1?m-1:a}),he=I(()=>{const{itemCount:a}=e;return a!==void 0?a:(e.pageCount||1)*v.value}),ve=Mn("Pagination",f,s),J=()=>{Ue(()=>{var a;const{value:m}=i;!m||(m.classList.add("transition-disabled"),(a=i.value)===null||a===void 0||a.offsetWidth,m.classList.remove("transition-disabled"))})};function K(a){if(a===y.value)return;const{"onUpdate:page":m,onUpdatePage:ie,onChange:te,simple:me}=e;m&&E(m,a),ie&&E(ie,a),te&&E(te,a),g.value=a,me&&(c.value=String(a))}function G(a){if(a===v.value)return;const{"onUpdate:pageSize":m,onUpdatePageSize:ie,onPageSizeChange:te}=e;m&&E(m,a),ie&&E(ie,a),te&&E(te,a),F.value=a,b.value{y.value,v.value,J()});const q=I(()=>{const{size:a}=e,{self:{buttonBorder:m,buttonBorderHover:ie,buttonBorderPressed:te,buttonIconColor:me,buttonIconColorHover:Te,buttonIconColorPressed:Ie,itemTextColor:_e,itemTextColorHover:Fe,itemTextColorPressed:Me,itemTextColorActive:de,itemTextColorDisabled:r,itemColor:u,itemColorHover:$,itemColorPressed:Se,itemColorActive:$e,itemColorActiveHover:Ae,itemColorDisabled:je,itemBorder:Ee,itemBorderHover:ke,itemBorderPressed:Pe,itemBorderActive:Oe,itemBorderDisabled:Le,itemBorderRadius:Ve,jumperTextColor:Be,jumperTextColorDisabled:ue,buttonColor:t,buttonColorHover:l,buttonColorPressed:w,[Q("itemPadding",a)]:B,[Q("itemMargin",a)]:M,[Q("inputWidth",a)]:O,[Q("selectWidth",a)]:S,[Q("inputMargin",a)]:D,[Q("selectMargin",a)]:ze,[Q("jumperFontSize",a)]:De,[Q("prefixMargin",a)]:Qe,[Q("suffixMargin",a)]:Ye,[Q("itemSize",a)]:Ge,[Q("buttonIconSize",a)]:Xe,[Q("itemFontSize",a)]:et,[`${Q("itemMargin",a)}Rtl`]:tt,[`${Q("inputMargin",a)}Rtl`]:nt},common:{cubicBezierEaseInOut:ot}}=x.value;return{"--n-prefix-margin":Qe,"--n-suffix-margin":Ye,"--n-item-font-size":et,"--n-select-width":S,"--n-select-margin":ze,"--n-input-width":O,"--n-input-margin":D,"--n-input-margin-rtl":nt,"--n-item-size":Ge,"--n-item-text-color":_e,"--n-item-text-color-disabled":r,"--n-item-text-color-hover":Fe,"--n-item-text-color-active":de,"--n-item-text-color-pressed":Me,"--n-item-color":u,"--n-item-color-hover":$,"--n-item-color-disabled":je,"--n-item-color-active":$e,"--n-item-color-active-hover":Ae,"--n-item-color-pressed":Se,"--n-item-border":Ee,"--n-item-border-hover":ke,"--n-item-border-disabled":Le,"--n-item-border-active":Oe,"--n-item-border-pressed":Pe,"--n-item-padding":B,"--n-item-border-radius":Ve,"--n-bezier":ot,"--n-jumper-font-size":De,"--n-jumper-text-color":Be,"--n-jumper-text-color-disabled":ue,"--n-item-margin":M,"--n-item-margin-rtl":tt,"--n-button-icon-size":Xe,"--n-button-icon-color":me,"--n-button-icon-color-hover":Te,"--n-button-icon-color-pressed":Ie,"--n-button-color-hover":l,"--n-button-color":t,"--n-button-color-pressed":w,"--n-button-border":m,"--n-button-border-hover":ie,"--n-button-border-pressed":te}}),j=d?Ze("pagination",I(()=>{let a="";const{size:m}=e;return a+=m[0],a}),q,e):void 0;return{rtlEnabled:ve,mergedClsPrefix:s,locale:C,selfRef:i,mergedPage:y,pageItems:I(()=>N.value.items),mergedItemCount:he,jumperValue:c,pageSizeOptions:fe,mergedPageSize:v,inputSize:ne,selectSize:se,mergedTheme:x,mergedPageCount:b,startIndex:V,endIndex:oe,showFastForwardMenu:T,showFastBackwardMenu:R,fastForwardActive:p,fastBackwardActive:z,handleMenuSelect:L,handleFastForwardMouseenter:W,handleFastForwardMouseleave:Y,handleFastBackwardMouseenter:H,handleFastBackwardMouseleave:_,handleJumperInput:re,handleBackwardClick:A,handleForwardClick:ae,handlePageItemClick:pe,handleSizePickerChange:ge,handleQuickJumperChange:Z,cssVars:d?void 0:q,themeClass:j==null?void 0:j.themeClass,onRender:j==null?void 0:j.onRender}},render(){const{$slots:e,mergedClsPrefix:o,disabled:s,cssVars:d,mergedPage:f,mergedPageCount:x,pageItems:C,showSizePicker:i,showQuickJumper:g,mergedTheme:h,locale:F,inputSize:y,selectSize:v,mergedPageSize:b,pageSizeOptions:c,jumperValue:p,simple:z,prev:T,next:R,prefix:W,suffix:Y,label:H,goto:_,handleJumperInput:L,handleSizePickerChange:N,handleBackwardClick:fe,handlePageItemClick:ne,handleForwardClick:se,handleQuickJumperChange:V,onRender:oe}=this;oe==null||oe();const he=e.prefix||W,ve=e.suffix||Y,J=T||e.prev,K=R||e.next,G=H||e.label;return n("div",{ref:"selfRef",class:[`${o}-pagination`,this.themeClass,this.rtlEnabled&&`${o}-pagination--rtl`,s&&`${o}-pagination--disabled`,z&&`${o}-pagination--simple`],style:d},he?n("div",{class:`${o}-pagination-prefix`},he({page:f,pageSize:b,pageCount:x,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null,this.displayOrder.map(ae=>{switch(ae){case"pages":return n(lt,null,n("div",{class:[`${o}-pagination-item`,!J&&`${o}-pagination-item--button`,(f<=1||f>x||s)&&`${o}-pagination-item--disabled`],onClick:fe},J?J({page:f,pageSize:b,pageCount:x,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount}):n(Re,{clsPrefix:o},{default:()=>this.rtlEnabled?n(Ct,null):n(pt,null)})),z?n(lt,null,n("div",{class:`${o}-pagination-quick-jumper`},n(ht,{value:p,onUpdateValue:L,size:y,placeholder:"",disabled:s,theme:h.peers.Input,themeOverrides:h.peerOverrides.Input,onChange:V})),"\xA0/ ",x):C.map((A,xe)=>{let ee,ge,be;const{type:Z}=A;switch(Z){case"page":const re=A.label;G?ee=G({type:"page",node:re,active:A.active}):ee=re;break;case"fast-forward":const q=this.fastForwardActive?n(Re,{clsPrefix:o},{default:()=>this.rtlEnabled?n(mt,null):n(wt,null)}):n(Re,{clsPrefix:o},{default:()=>n(xt,null)});G?ee=G({type:"fast-forward",node:q,active:this.fastForwardActive||this.showFastForwardMenu}):ee=q,ge=this.handleFastForwardMouseenter,be=this.handleFastForwardMouseleave;break;case"fast-backward":const j=this.fastBackwardActive?n(Re,{clsPrefix:o},{default:()=>this.rtlEnabled?n(wt,null):n(mt,null)}):n(Re,{clsPrefix:o},{default:()=>n(xt,null)});G?ee=G({type:"fast-backward",node:j,active:this.fastBackwardActive||this.showFastBackwardMenu}):ee=j,ge=this.handleFastBackwardMouseenter,be=this.handleFastBackwardMouseleave;break}const pe=n("div",{key:xe,class:[`${o}-pagination-item`,A.active&&`${o}-pagination-item--active`,Z!=="page"&&(Z==="fast-backward"&&this.showFastBackwardMenu||Z==="fast-forward"&&this.showFastForwardMenu)&&`${o}-pagination-item--hover`,s&&`${o}-pagination-item--disabled`,Z==="page"&&`${o}-pagination-item--clickable`],onClick:()=>ne(A),onMouseenter:ge,onMouseleave:be},ee);if(Z==="page"&&!A.mayBeFastBackward&&!A.mayBeFastForward)return pe;{const re=A.type==="page"?A.mayBeFastBackward?"fast-backward":"fast-forward":A.type;return n($n,{to:this.to,key:re,disabled:s,trigger:"hover",virtualScroll:!0,style:{width:"60px"},theme:h.peers.Popselect,themeOverrides:h.peerOverrides.Popselect,builtinThemeOverrides:{peers:{InternalSelectMenu:{height:"calc(var(--n-option-height) * 4.6)"}}},nodeProps:()=>({style:{justifyContent:"center"}}),show:Z==="page"?!1:Z==="fast-backward"?this.showFastBackwardMenu:this.showFastForwardMenu,onUpdateShow:q=>{Z!=="page"&&(q?Z==="fast-backward"?this.showFastBackwardMenu=q:this.showFastForwardMenu=q:(this.showFastBackwardMenu=!1,this.showFastForwardMenu=!1))},options:A.type!=="page"?A.options:[],onUpdateValue:this.handleMenuSelect,scrollable:!0,showCheckmark:!1},{default:()=>pe})}}),n("div",{class:[`${o}-pagination-item`,!K&&`${o}-pagination-item--button`,{[`${o}-pagination-item--disabled`]:f<1||f>=x||s}],onClick:se},K?K({page:f,pageSize:b,pageCount:x,itemCount:this.mergedItemCount,startIndex:this.startIndex,endIndex:this.endIndex}):n(Re,{clsPrefix:o},{default:()=>this.rtlEnabled?n(pt,null):n(Ct,null)})));case"size-picker":return!z&&i?n(En,Object.assign({consistentMenuWidth:!1,placeholder:"",showCheckmark:!1,to:this.to},this.selectProps,{size:v,options:c,value:b,disabled:s,theme:h.peers.Select,themeOverrides:h.peerOverrides.Select,onUpdateValue:N})):null;case"quick-jumper":return!z&&g?n("div",{class:`${o}-pagination-quick-jumper`},_?_():Sn(this.$slots.goto,()=>[F.goto]),n(ht,{value:p,onUpdateValue:L,size:y,placeholder:"",disabled:s,theme:h.peers.Input,themeOverrides:h.peerOverrides.Input,onChange:V})):null;default:return null}}),ve?n("div",{class:`${o}-pagination-suffix`},ve({page:f,pageSize:b,pageCount:x,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null)}});export{Wn as _}; diff --git a/web/dist/assets/Post-00695942.css b/web/dist/assets/Post-00695942.css new file mode 100644 index 00000000..45e52a75 --- /dev/null +++ b/web/dist/assets/Post-00695942.css @@ -0,0 +1 @@ +.reply-item[data-v-0fa8b923]{display:flex;flex-direction:column;font-size:12px;padding:8px;border-bottom:1px solid #f3f3f3}.reply-item .header-wrap[data-v-0fa8b923]{display:flex;align-items:center;justify-content:space-between}.reply-item .header-wrap .username[data-v-0fa8b923]{max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .header-wrap .username .reply-name[data-v-0fa8b923]{margin:0 3px;opacity:.75}.reply-item .header-wrap .timestamp[data-v-0fa8b923]{opacity:.75;text-align:right;max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .base-wrap[data-v-0fa8b923]{display:block}.reply-item .base-wrap .content[data-v-0fa8b923]{width:100%;margin-top:4px;font-size:12px;text-align:justify;line-height:2}.reply-item .base-wrap .reply-switch[data-v-0fa8b923]{display:flex;align-items:center;justify-content:space-between;font-size:12px}.reply-item .base-wrap .reply-switch .actions[data-v-0fa8b923]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-item .base-wrap .reply-switch .time-item[data-v-0fa8b923]{font-size:12px;opacity:.75;margin-right:18px}.reply-item .base-wrap .reply-switch .action-item[data-v-0fa8b923]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-item .base-wrap .reply-switch .action-item .upvote-count[data-v-0fa8b923]{margin-left:4px;font-size:12px}.reply-item .base-wrap .reply-switch .action-item.hover[data-v-0fa8b923]{cursor:pointer}.reply-item .base-wrap .reply-switch .opacity-item[data-v-0fa8b923]{opacity:.75}.reply-item .base-wrap .reply-switch .reply-btn[data-v-0fa8b923]{margin-left:18px}.reply-item .base-wrap .reply-switch .show[data-v-0fa8b923]{color:#18a058;cursor:pointer}.reply-item .base-wrap .reply-switch .hide[data-v-0fa8b923]{opacity:.75;cursor:pointer}.dark .reply-item[data-v-0fa8b923]{border-bottom:1px solid #262628;background-color:#101014bf}.dark .reply-item .base-wrap .reply-switch .show[data-v-0fa8b923]{color:#63e2b7}.reply-compose-wrap .reply-switch[data-v-f9af7a93]{display:flex;align-items:center;justify-content:space-between;text-align:right;font-size:12px}.reply-compose-wrap .reply-switch .actions[data-v-f9af7a93]{display:flex;align-items:center;text-align:right;font-size:12px;margin:10px 0}.reply-compose-wrap .reply-switch .time-item[data-v-f9af7a93]{font-size:12px;opacity:.65;margin-right:18px}.reply-compose-wrap .reply-switch .action-item[data-v-f9af7a93]{display:flex;align-items:center;margin-left:18px;opacity:.65}.reply-compose-wrap .reply-switch .action-item .upvote-count[data-v-f9af7a93]{margin-left:4px;font-size:12px}.reply-compose-wrap .reply-switch .action-item.hover[data-v-f9af7a93]{cursor:pointer}.reply-compose-wrap .reply-switch .reply-btn[data-v-f9af7a93]{margin-left:18px}.reply-compose-wrap .reply-switch .show[data-v-f9af7a93]{color:#18a058;cursor:pointer;opacity:.75}.reply-compose-wrap .reply-switch .hide[data-v-f9af7a93]{opacity:.75;cursor:pointer}.dark .reply-compose-wrap[data-v-f9af7a93]{background-color:#101014bf}.dark .reply-compose-wrap .reply-switch .show[data-v-f9af7a93]{color:#63e2b7}.comment-item[data-v-e5cb084f]{width:100%;padding:16px;box-sizing:border-box}.comment-item .nickname-wrap[data-v-e5cb084f]{font-size:14px}.comment-item .username-wrap[data-v-e5cb084f]{font-size:14px;opacity:.75}.comment-item .opt-wrap[data-v-e5cb084f]{display:flex;align-items:center}.comment-item .opt-wrap .timestamp[data-v-e5cb084f]{opacity:.75;font-size:12px}.comment-item .opt-wrap .del-btn[data-v-e5cb084f]{margin-left:4px}.comment-item .comment-text[data-v-e5cb084f]{display:block;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.comment-item .opt-item[data-v-e5cb084f]{display:flex;align-items:center;opacity:.7}.comment-item .opt-item .opt-item-icon[data-v-e5cb084f]{margin-right:10px}.reply-wrap[data-v-e5cb084f]{margin-top:10px;border-radius:5px;background:#fafafc}.reply-wrap .reply-item[data-v-e5cb084f]:last-child{border-bottom:none}.dark .reply-wrap[data-v-e5cb084f]{background:#18181c}.dark .comment-item[data-v-e5cb084f]{background-color:#101014bf}.compose-wrap[data-v-634e6bfd]{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line[data-v-634e6bfd]{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user[data-v-634e6bfd]{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options[data-v-634e6bfd]{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap[data-v-634e6bfd]{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .cancel-btn[data-v-634e6bfd]{margin-right:8px}.compose-wrap .login-only-wrap[data-v-634e6bfd]{display:flex;justify-content:center;width:100%}.compose-wrap .login-only-wrap button[data-v-634e6bfd]{margin:0 4px;width:50%}.compose-wrap .login-wrap[data-v-634e6bfd]{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner[data-v-634e6bfd]{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button[data-v-634e6bfd]{margin:0 4px}.attachment[data-v-634e6bfd]{display:flex;align-items:center}.attachment .text-statistic[data-v-634e6bfd]{margin-left:8px;width:18px;height:18px;transform:rotate(180deg)}.attachment-list-wrap[data-v-634e6bfd]{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail[data-v-634e6bfd]{overflow:hidden}.dark .compose-mention[data-v-634e6bfd],.dark .compose-wrap[data-v-634e6bfd]{background-color:#101014bf}.detail-item{width:100%;padding:16px;box-sizing:border-box;background:#f7f9f9}.detail-item .nickname-wrap{font-size:14px}.detail-item .username-wrap{font-size:14px;opacity:.75}.detail-item .top-tag{transform:scale(.75)}.detail-item .options{opacity:.75}.detail-item .post-text{font-size:16px;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.detail-item .opts-wrap{margin-top:20px}.detail-item .opts-wrap .opt-item{display:flex;align-items:center;opacity:.7}.detail-item .opts-wrap .opt-item .opt-item-icon{margin-right:10px}.detail-item .opts-wrap .opt-item.hover{cursor:pointer}.detail-item .n-thing .n-thing-avatar-header-wrapper{align-items:center}.detail-item .timestamp{opacity:.75;font-size:12px;margin-top:10px}.dark .detail-item{background:#18181c}.detail-wrap[data-v-0d01659f]{min-height:100px}.comment-opts-wrap[data-v-0d01659f]{padding-top:6px;padding-left:16px;padding-right:16px;opacity:.75}.comment-opts-wrap .comment-title-item[data-v-0d01659f]{padding-top:4px;font-size:16px;text-align:center}.main-content-wrap .load-more[data-v-0d01659f]{margin-bottom:8px}.main-content-wrap .load-more .load-more-spinner[data-v-0d01659f]{font-size:14px;opacity:.65}.dark .main-content-wrap[data-v-0d01659f],.dark .skeleton-wrap[data-v-0d01659f]{background-color:#101014bf} diff --git a/web/dist/assets/Post-655e33bb.js b/web/dist/assets/Post-655e33bb.js new file mode 100644 index 00000000..0cac67eb --- /dev/null +++ b/web/dist/assets/Post-655e33bb.js @@ -0,0 +1 @@ +import{d as X,r as c,a3 as ge,o,c as u,a as v,V as t,a1 as n,e as x,M as I,Q as P,O as i,_ as a,a2 as H,n as ae,a7 as qe,F as le,a4 as ie,j as ye,W as Ie,X as Te,s as be,w as Ee}from"./@vue-e0e89260.js";import{u as te}from"./vuex-473b3783.js";import{f as ue}from"./formatTime-cdf4e6f1.js";import{t as Ne,d as je,e as Be,_ as se,f as He,h as Fe,i as Ve,j as Ye,g as Je,k as Ke,l as Qe,m as We,n as Ge,o as Xe,s as Ze,p as et,v as tt,q as st,r as ot,u as nt,w as $e}from"./index-347d1d96.js";import{Y as ce,V as Z}from"./IEnum-a180d93e.js";import{T as Pe,e as re,f as ze,g as _e,h as Ue,I as at,i as lt,j as it,k as ut,l as ct,m as rt,n as _t,o as pt,p as dt,q as mt,r as vt,s as Ce,F as xe,E as ve,t as he,u as fe}from"./@vicons-8f91201d.js";import{j as Y,e as oe,J as Re,K as ht,b as ft,L as gt,o as ke,M as Se,v as yt,w as kt,x as wt,y as bt,z as $t,B as Ct,O as xt,P as It,i as Tt,Q as Pt,a as Le,F as zt,I as Ut,k as Rt,H as St,f as Lt,g as Ot}from"./naive-ui-62663ad7.js";import{p as we,_ as Oe,a as Mt,b as At,c as Dt}from"./content-72d615e5.js";import{u as Me,b as qt}from"./vue-router-b8e3382f.js";import{_ as Et}from"./post-skeleton-ffa76165.js";import{l as Nt}from"./lodash-94eb5868.js";import{a as jt}from"./copy-to-clipboard-1dd3075d.js";import{_ as Bt}from"./main-nav.vue_vue_type_style_index_0_lang-be35896a.js";import{W as Ht}from"./v3-infinite-loading-e5c2e8bf.js";import"./moment-2ab8298d.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-aa5e8b3f.js";import"./toggle-selection-93f4ad84.js";const Ft={class:"reply-item"},Vt={class:"header-wrap"},Yt={class:"username"},Jt={class:"reply-name"},Kt={class:"timestamp"},Qt={class:"base-wrap"},Wt={class:"content"},Gt={class:"reply-switch"},Xt={class:"time-item"},Zt={class:"actions"},es={class:"upvote-count"},ts=["onClick"],ss={class:"upvote-count"},os={key:2,class:"action-item"},ns=["onClick"],as=X({__name:"reply-item",props:{tweetId:{},reply:{}},emits:["focusReply","reload"],setup(A,{emit:q}){const l=A,p=te(),f=c(l.reply.is_thumbs_up==ce.YES),y=c(l.reply.is_thumbs_down==ce.YES),k=c(l.reply.thumbs_up_count),L=()=>{Ne({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(h=>{f.value=!f.value,f.value?(k.value++,y.value=!1):k.value--}).catch(h=>{console.log(h)})},r=()=>{je({tweet_id:l.tweetId,comment_id:l.reply.comment_id,reply_id:l.reply.id}).then(h=>{y.value=!y.value,y.value&&f.value&&(k.value--,f.value=!1)}).catch(h=>{console.log(h)})},U=()=>{q("focusReply",l.reply)},T=()=>{Be({id:l.reply.id}).then(h=>{window.$message.success("删除成功"),setTimeout(()=>{q("reload")},50)}).catch(h=>{console.log(h)})};return(h,$)=>{const R=ge("router-link"),e=Y,_=oe,O=Re,w=ht;return o(),u("div",Ft,[v("div",Vt,[v("div",Yt,[t(R,{class:"user-link",to:{name:"user",query:{username:l.reply.user.username}}},{default:n(()=>[x(I(l.reply.user.username),1)]),_:1},8,["to"]),v("span",Jt,I(l.reply.at_user_id>0?"回复":":"),1),l.reply.at_user_id>0?(o(),P(R,{key:0,class:"user-link",to:{name:"user",query:{username:l.reply.at_user.username}}},{default:n(()=>[x(I(l.reply.at_user.username),1)]),_:1},8,["to"])):i("",!0)]),v("div",Kt,[x(I(l.reply.ip_loc)+" ",1),a(p).state.userInfo.is_admin||a(p).state.userInfo.id===l.reply.user.id?(o(),P(O,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:T},{trigger:n(()=>[t(_,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(e,null,{default:n(()=>[t(a(Pe))]),_:1})]),_:1})]),default:n(()=>[x(" 是否确认删除? ")]),_:1})):i("",!0)])]),v("div",Qt,[v("div",Wt,[t(w,{"expand-trigger":"click","line-clamp":"5",tooltip:!1},{default:n(()=>[x(I(l.reply.content),1)]),_:1})]),v("div",Gt,[v("span",Xt,I(a(ue)(l.reply.created_on)),1),v("div",Zt,[a(p).state.userLogined?i("",!0):(o(),u("div",{key:0,class:"action-item",onClick:$[0]||($[0]=H(()=>{},["stop"]))},[t(e,{size:"medium"},{default:n(()=>[t(a(re))]),_:1}),v("span",es,I(k.value),1)])),a(p).state.userLogined?(o(),u("div",{key:1,class:"action-item hover",onClick:H(L,["stop"])},[t(e,{size:"medium"},{default:n(()=>[f.value?i("",!0):(o(),P(a(re),{key:0})),f.value?(o(),P(a(ze),{key:1,class:"show"})):i("",!0)]),_:1}),v("span",ss,I(k.value>0?k.value:"赞"),1)],8,ts)):i("",!0),a(p).state.userLogined?i("",!0):(o(),u("div",os,[t(e,{size:"medium"},{default:n(()=>[t(a(_e))]),_:1})])),a(p).state.userLogined?(o(),u("div",{key:3,class:"action-item hover",onClick:H(r,["stop"])},[t(e,{size:"medium"},{default:n(()=>[y.value?i("",!0):(o(),P(a(_e),{key:0})),y.value?(o(),P(a(Ue),{key:1,class:"show"})):i("",!0)]),_:1})],8,ns)):i("",!0),a(p).state.userLogined?(o(),u("span",{key:4,class:"show opacity-item reply-btn",onClick:U}," 回复 ")):i("",!0)])])])])}}});const ls=se(as,[["__scopeId","data-v-0fa8b923"]]),is={class:"reply-compose-wrap"},us={class:"reply-switch"},cs={class:"time-item"},rs={class:"actions"},_s={key:0,class:"action-item"},ps={class:"upvote-count"},ds=["onClick"],ms={class:"upvote-count"},vs={key:2,class:"action-item"},hs=["onClick"],fs={key:0,class:"reply-input-wrap"},gs=X({__name:"compose-reply",props:{comment:{},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(A,{expose:q,emit:l}){const p=A,f=te(),y=c(),k=c(!1),L=c(""),r=c(!1),U=+"300",T=c(p.comment.is_thumbs_up==ce.YES),h=c(p.comment.is_thumbs_down==ce.YES),$=c(p.comment.thumbs_up_count),R=()=>{He({tweet_id:p.comment.post_id,comment_id:p.comment.id}).then(w=>{T.value=!T.value,T.value?($.value++,h.value=!1):$.value--}).catch(w=>{console.log(w)})},e=()=>{Fe({tweet_id:p.comment.post_id,comment_id:p.comment.id}).then(w=>{h.value=!h.value,h.value&&T.value&&($.value--,T.value=!1)}).catch(w=>{console.log(w)})},_=w=>{k.value=w,w?setTimeout(()=>{var M;(M=y.value)==null||M.focus()},10):(r.value=!1,L.value="",l("reset"))},O=()=>{r.value=!0,Ve({comment_id:p.comment.id,at_user_id:p.atUserid,content:L.value}).then(w=>{_(!1),window.$message.success("评论成功"),l("reload")}).catch(w=>{r.value=!1})};return q({switchReply:_}),(w,M)=>{const j=Y,B=ft,V=oe,z=gt;return o(),u("div",is,[v("div",us,[v("span",cs,I(a(ue)(w.comment.created_on)),1),v("div",rs,[a(f).state.userLogined?i("",!0):(o(),u("div",_s,[t(j,{size:"medium"},{default:n(()=>[t(a(re))]),_:1}),v("span",ps,I($.value),1)])),a(f).state.userLogined?(o(),u("div",{key:1,class:"action-item hover",onClick:H(R,["stop"])},[t(j,{size:"medium"},{default:n(()=>[T.value?i("",!0):(o(),P(a(re),{key:0})),T.value?(o(),P(a(ze),{key:1,class:"show"})):i("",!0)]),_:1}),v("span",ms,I($.value>0?$.value:"赞"),1)],8,ds)):i("",!0),a(f).state.userLogined?i("",!0):(o(),u("div",vs,[t(j,{size:"medium"},{default:n(()=>[t(a(_e))]),_:1})])),a(f).state.userLogined?(o(),u("div",{key:3,class:"action-item hover",onClick:H(e,["stop"])},[t(j,{size:"medium"},{default:n(()=>[h.value?i("",!0):(o(),P(a(_e),{key:0})),h.value?(o(),P(a(Ue),{key:1,class:"show"})):i("",!0)]),_:1})],8,hs)):i("",!0),a(f).state.userLogined&&!k.value?(o(),u("span",{key:4,class:"show reply-btn",onClick:M[0]||(M[0]=S=>_(!0))}," 回复 ")):i("",!0),a(f).state.userLogined&&k.value?(o(),u("span",{key:5,class:"hide reply-btn",onClick:M[1]||(M[1]=S=>_(!1))}," 取消 ")):i("",!0)])]),k.value?(o(),u("div",fs,[t(z,null,{default:n(()=>[t(B,{ref_key:"inputInstRef",ref:y,size:"small",placeholder:p.atUsername?"@"+p.atUsername:"请输入回复内容..",maxlength:a(U),value:L.value,"onUpdate:value":M[2]||(M[2]=S=>L.value=S),"show-count":"",clearable:""},null,8,["placeholder","maxlength","value"]),t(V,{type:"primary",size:"small",ghost:"",loading:r.value,onClick:O},{default:n(()=>[x(" 回复 ")]),_:1},8,["loading"])]),_:1})])):i("",!0)])}}});const ys=se(gs,[["__scopeId","data-v-f9af7a93"]]),ks={class:"comment-item"},ws={class:"nickname-wrap"},bs={class:"username-wrap"},$s={class:"opt-wrap"},Cs={class:"timestamp"},xs=["innerHTML"],Is={class:"reply-wrap"},Ts=X({__name:"comment-item",props:{comment:{}},emits:["reload"],setup(A,{emit:q}){const l=A,p=te(),f=Me(),y=c(0),k=c(""),L=c(),r=ae(()=>{let e=Object.assign({texts:[],imgs:[]},l.comment);return e.contents.map(_=>{(+_.type==1||+_.type==2)&&e.texts.push(_),+_.type==3&&e.imgs.push(_)}),e}),U=(e,_)=>{let O=e.target;if(O.dataset.detail){const w=O.dataset.detail.split(":");w.length===2&&(p.commit("refresh"),w[0]==="tag"?window.$message.warning("评论内的无效话题"):f.push({name:"user",query:{username:w[1]}}))}},T=e=>{var _,O;y.value=e.user_id,k.value=((_=e.user)==null?void 0:_.username)||"",(O=L.value)==null||O.switchReply(!0)},h=()=>{q("reload")},$=()=>{y.value=0,k.value=""},R=()=>{Ye({id:r.value.id}).then(e=>{window.$message.success("删除成功"),setTimeout(()=>{h()},50)}).catch(e=>{})};return(e,_)=>{const O=ke,w=ge("router-link"),M=Y,j=oe,B=Re,V=Oe,z=ys,S=ls,K=Se;return o(),u("div",ks,[t(K,{"content-indented":""},qe({avatar:n(()=>[t(O,{round:"",size:30,src:r.value.user.avatar},null,8,["src"])]),header:n(()=>[v("span",ws,[t(w,{onClick:_[0]||(_[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:r.value.user.username}}},{default:n(()=>[x(I(r.value.user.nickname),1)]),_:1},8,["to"])]),v("span",bs," @"+I(r.value.user.username),1)]),"header-extra":n(()=>[v("div",$s,[v("span",Cs,I(r.value.ip_loc),1),a(p).state.userInfo.is_admin||a(p).state.userInfo.id===r.value.user.id?(o(),P(B,{key:0,"negative-text":"取消","positive-text":"确认",onPositiveClick:R},{trigger:n(()=>[t(j,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:n(()=>[t(M,null,{default:n(()=>[t(a(Pe))]),_:1})]),_:1})]),default:n(()=>[x(" 是否确认删除? ")]),_:1})):i("",!0)])]),footer:n(()=>[r.value.imgs.length>0?(o(),P(V,{key:0,imgs:r.value.imgs},null,8,["imgs"])):i("",!0),t(z,{ref_key:"replyComposeRef",ref:L,comment:r.value,"at-userid":y.value,"at-username":k.value,onReload:h,onReset:$},null,8,["comment","at-userid","at-username"]),v("div",Is,[(o(!0),u(le,null,ie(r.value.replies,F=>(o(),P(S,{key:F.id,reply:F,"tweet-id":r.value.post_id,onFocusReply:T,onReload:h},null,8,["reply","tweet-id"]))),128))])]),_:2},[r.value.texts.length>0?{name:"description",fn:n(()=>[(o(!0),u(le,null,ie(r.value.texts,F=>(o(),u("span",{key:F.id,class:"comment-text",onClick:_[1]||(_[1]=H(J=>U(J,r.value.id),["stop"])),innerHTML:a(we)(F.content).content},null,8,xs))),128))]),key:"0"}:void 0]),1024)])}}});const Ps=se(Ts,[["__scopeId","data-v-e5cb084f"]]),zs=A=>(Ie("data-v-634e6bfd"),A=A(),Te(),A),Us={key:0,class:"compose-wrap"},Rs={class:"compose-line"},Ss={class:"compose-user"},Ls={class:"compose-line compose-options"},Os={class:"attachment"},Ms={class:"submit-wrap"},As={class:"attachment-list-wrap"},Ds={key:1,class:"compose-wrap"},qs=zs(()=>v("div",{class:"login-wrap"},[v("span",{class:"login-banner"}," 登录后,精彩更多")],-1)),Es={key:0,class:"login-only-wrap"},Ns={key:1,class:"login-wrap"},js=X({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(A,{emit:q}){const l=A,p=te(),f=c([]),y=c(!1),k=c(!1),L=c(!1),r=c(""),U=c(),T=c("public/image"),h=c([]),$=c([]),R=c("true".toLowerCase()==="true"),e=+"300",_="/v1/attachment",O=c(),w=Nt.debounce(m=>{Je({k:m}).then(g=>{let b=[];g.suggest.map(C=>{b.push({label:C,value:C})}),f.value=b,k.value=!1}).catch(g=>{k.value=!1})},200),M=(m,g)=>{k.value||(k.value=!0,g==="@"&&w(m))},j=m=>{m.length>e?r.value=m.substring(0,e):r.value=m},B=m=>{T.value=m},V=m=>{for(let E=0;E30&&(m[E].name=b.substring(0,18)+"..."+b.substring(b.length-9)+"."+C)}h.value=m},z=async m=>{var g,b;return T.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((g=m.file.file)==null?void 0:g.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):T.value==="image"&&((b=m.file.file)==null?void 0:b.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):!0},S=({file:m,event:g})=>{var b;try{let C=JSON.parse((b=g.target)==null?void 0:b.response);C.code===0&&T.value==="public/image"&&$.value.push({id:m.id,content:C.data.content})}catch{window.$message.error("上传失败")}},K=({file:m,event:g})=>{var b;try{let C=JSON.parse((b=g.target)==null?void 0:b.response);if(C.code!==0){let E=C.msg||"上传失败";C.details&&C.details.length>0&&C.details.map(D=>{E+=":"+D}),window.$message.error(E)}}catch{window.$message.error("上传失败")}},F=({file:m})=>{let g=$.value.findIndex(b=>b.id===m.id);g>-1&&$.value.splice(g,1)},J=()=>{y.value=!0},W=()=>{var m;y.value=!1,(m=U.value)==null||m.clear(),h.value=[],r.value="",$.value=[]},s=()=>{if(r.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{users:m}=we(r.value);const g=[];let b=100;g.push({content:r.value,type:2,sort:b}),$.value.map(C=>{b++,g.push({content:C.content,type:3,sort:b})}),L.value=!0,Ke({contents:g,post_id:l.postId,users:Array.from(new Set(m))}).then(C=>{window.$message.success("发布成功"),L.value=!1,q("post-success"),W()}).catch(C=>{L.value=!1})},d=m=>{p.commit("triggerAuth",!0),p.commit("triggerAuthKey",m)};return ye(()=>{O.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(m,g)=>{const b=ke,C=yt,E=Y,D=oe,Q=kt,pe=wt,de=bt,me=$t,ne=Ct;return o(),u("div",null,[a(p).state.userInfo.id>0?(o(),u("div",Us,[v("div",Rs,[v("div",Ss,[t(b,{round:"",size:30,src:a(p).state.userInfo.avatar},null,8,["src"])]),t(C,{type:"textarea",size:"large",autosize:"",bordered:!1,options:f.value,prefix:["@"],loading:k.value,value:r.value,disabled:l.lock===1,"onUpdate:value":j,onSearch:M,onFocus:J,placeholder:l.lock===1?"泡泡已被锁定,回复功能已关闭":"快来评论两句吧..."},null,8,["options","loading","value","disabled","placeholder"])]),y.value?(o(),P(ne,{key:0,ref_key:"uploadRef",ref:U,abstract:"","list-type":"image",multiple:!0,max:9,action:_,headers:{Authorization:O.value},data:{type:T.value},"file-list":h.value,onBeforeUpload:z,onFinish:S,onError:K,onRemove:F,"onUpdate:fileList":V},{default:n(()=>[v("div",Ls,[v("div",Os,[t(Q,{abstract:""},{default:n(({handleClick:G})=>[t(D,{disabled:h.value.length>0&&T.value==="public/video"||h.value.length===9,onClick:()=>{B("public/image"),G()},quaternary:"",circle:"",type:"primary"},{icon:n(()=>[t(E,{size:"20",color:"var(--primary-color)"},{default:n(()=>[t(a(at))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),t(de,{trigger:"hover",placement:"bottom"},{trigger:n(()=>[t(pe,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:r.value.length/a(e)*100},null,8,["percentage"])]),default:n(()=>[x(" "+I(r.value.length)+" / "+I(a(e)),1)]),_:1})]),v("div",Ms,[t(D,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:W},{default:n(()=>[x(" 取消 ")]),_:1}),t(D,{loading:L.value,onClick:s,type:"primary",secondary:"",size:"small",round:""},{default:n(()=>[x(" 发布 ")]),_:1},8,["loading"])])]),v("div",As,[t(me)])]),_:1},8,["headers","data","file-list"])):i("",!0)])):(o(),u("div",Ds,[qs,R.value?i("",!0):(o(),u("div",Es,[t(D,{strong:"",secondary:"",round:"",type:"primary",onClick:g[0]||(g[0]=G=>d("signin"))},{default:n(()=>[x(" 登录 ")]),_:1})])),R.value?(o(),u("div",Ns,[t(D,{strong:"",secondary:"",round:"",type:"primary",onClick:g[1]||(g[1]=G=>d("signin"))},{default:n(()=>[x(" 登录 ")]),_:1}),t(D,{strong:"",secondary:"",round:"",type:"info",onClick:g[2]||(g[2]=G=>d("signup"))},{default:n(()=>[x(" 注册 ")]),_:1})])):i("",!0)]))])}}});const Bs=se(js,[["__scopeId","data-v-634e6bfd"]]),Hs={class:"username-wrap"},Fs={key:0,class:"options"},Vs={key:0},Ys=["innerHTML"],Js={class:"timestamp"},Ks={key:0},Qs={key:1},Ws={class:"opts-wrap"},Gs=["onClick"],Xs={class:"opt-item"},Zs=["onClick"],eo=["onClick"],to=X({__name:"post-detail",props:{post:{}},emits:["reload"],setup(A,{emit:q}){const l=A,p=te(),f=Me(),y=c(!1),k=c(!1),L=c(!1),r=c(!1),U=c(!1),T=c(!1),h=c(!1),$=c(!1),R=c(Z.PUBLIC),e=ae({get:()=>{let s=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},l.post);return s.contents.map(d=>{(+d.type==1||+d.type==2)&&s.texts.push(d),+d.type==3&&s.imgs.push(d),+d.type==4&&s.videos.push(d),+d.type==6&&s.links.push(d),+d.type==7&&s.attachments.push(d),+d.type==8&&s.charge_attachments.push(d)}),s},set:s=>{l.post.upvote_count=s.upvote_count,l.post.comment_count=s.comment_count,l.post.collection_count=s.collection_count,l.post.is_essence=s.is_essence}}),_=s=>()=>be(Y,null,{default:()=>be(s)}),O=ae(()=>{let s=[{label:"删除",key:"delete",icon:_(dt)}];return e.value.is_lock===0?s.push({label:"锁定",key:"lock",icon:_(mt)}):s.push({label:"解锁",key:"unlock",icon:_(vt)}),p.state.userInfo.is_admin&&(e.value.is_top===0?s.push({label:"置顶",key:"stick",icon:_(Ce)}):s.push({label:"取消置顶",key:"unstick",icon:_(Ce)})),e.value.is_essence===0?s.push({label:"设为亮点",key:"highlight",icon:_(xe)}):s.push({label:"取消亮点",key:"unhighlight",icon:_(xe)}),e.value.visibility===Z.PUBLIC?s.push({label:"公开",key:"vpublic",icon:_(ve),children:[{label:"私密",key:"vprivate",icon:_(he)},{label:"好友可见",key:"vfriend",icon:_(fe)}]}):e.value.visibility===Z.PRIVATE?s.push({label:"私密",key:"vprivate",icon:_(he),children:[{label:"公开",key:"vpublic",icon:_(ve)},{label:"好友可见",key:"vfriend",icon:_(fe)}]}):s.push({label:"好友可见",key:"vfriend",icon:_(fe),children:[{label:"公开",key:"vpublic",icon:_(ve)},{label:"私密",key:"vprivate",icon:_(he)}]}),s}),w=s=>{f.push({name:"post",query:{id:s}})},M=(s,d)=>{if(s.target.dataset.detail){const m=s.target.dataset.detail.split(":");if(m.length===2){p.commit("refresh"),m[0]==="tag"?f.push({name:"home",query:{q:m[1],t:"tag"}}):f.push({name:"user",query:{username:m[1]}});return}}w(d)},j=s=>{switch(s){case"delete":L.value=!0;break;case"lock":case"unlock":r.value=!0;break;case"stick":case"unstick":U.value=!0;break;case"highlight":case"unhighlight":T.value=!0;break;case"vpublic":R.value=0,h.value=!0;break;case"vprivate":R.value=1,h.value=!0;break;case"vfriend":R.value=2,h.value=!0;break}},B=()=>{Ge({id:e.value.id}).then(s=>{window.$message.success("删除成功"),f.replace("/"),setTimeout(()=>{p.commit("refresh")},50)}).catch(s=>{$.value=!1})},V=()=>{Xe({id:e.value.id}).then(s=>{q("reload"),s.lock_status===1?window.$message.success("锁定成功"):window.$message.success("解锁成功")}).catch(s=>{$.value=!1})},z=()=>{Ze({id:e.value.id}).then(s=>{q("reload"),s.top_status===1?window.$message.success("置顶成功"):window.$message.success("取消置顶成功")}).catch(s=>{$.value=!1})},S=()=>{et({id:e.value.id}).then(s=>{e.value={...e.value,is_essence:s.highlight_status},s.highlight_status===1?window.$message.success("设为亮点成功"):window.$message.success("取消亮点成功")}).catch(s=>{$.value=!1})},K=()=>{tt({id:e.value.id,visibility:R.value}).then(s=>{q("reload"),window.$message.success("修改可见性成功")}).catch(s=>{$.value=!1})},F=()=>{st({id:e.value.id}).then(s=>{y.value=s.status,s.status?e.value={...e.value,upvote_count:e.value.upvote_count+1}:e.value={...e.value,upvote_count:e.value.upvote_count-1}}).catch(s=>{console.log(s)})},J=()=>{ot({id:e.value.id}).then(s=>{k.value=s.status,s.status?e.value={...e.value,collection_count:e.value.collection_count+1}:e.value={...e.value,collection_count:e.value.collection_count-1}}).catch(s=>{console.log(s)})},W=()=>{jt(`${window.location.origin}/#/post?id=${e.value.id}`),window.$message.success("链接已复制到剪贴板")};return ye(()=>{p.state.userInfo.id>0&&(Qe({id:e.value.id}).then(s=>{y.value=s.status}).catch(s=>{console.log(s)}),We({id:e.value.id}).then(s=>{k.value=s.status}).catch(s=>{console.log(s)}))}),(s,d)=>{const m=ke,g=ge("router-link"),b=xt,C=oe,E=It,D=Tt,Q=Mt,pe=Oe,de=At,me=Dt,ne=Pt,G=Le,Ae=Se;return o(),u("div",{class:"detail-item",onClick:d[7]||(d[7]=N=>w(e.value.id))},[t(Ae,null,{avatar:n(()=>[t(m,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:n(()=>[t(g,{onClick:d[0]||(d[0]=H(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.value.user.username}}},{default:n(()=>[x(I(e.value.user.nickname),1)]),_:1},8,["to"]),v("span",Hs," @"+I(e.value.user.username),1),e.value.is_top?(o(),P(b,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[x(" 置顶 ")]),_:1})):i("",!0),e.value.visibility==a(Z).PRIVATE?(o(),P(b,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[x(" 私密 ")]),_:1})):i("",!0),e.value.visibility==a(Z).FRIEND?(o(),P(b,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[x(" 好友可见 ")]),_:1})):i("",!0)]),"header-extra":n(()=>[a(p).state.userInfo.is_admin||a(p).state.userInfo.id===e.value.user.id?(o(),u("div",Fs,[t(E,{placement:"bottom-end",trigger:"click",size:"small",options:O.value,onSelect:j},{default:n(()=>[t(C,{quaternary:"",circle:""},{icon:n(()=>[t(a(Y),null,{default:n(()=>[t(a(lt))]),_:1})]),_:1})]),_:1},8,["options"])])):i("",!0),t(D,{show:L.value,"onUpdate:show":d[1]||(d[1]=N=>L.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定删除该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:B},null,8,["show"]),t(D,{show:r.value,"onUpdate:show":d[2]||(d[2]=N=>r.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e.value.is_lock?"解锁":"锁定")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:V},null,8,["show","content"]),t(D,{show:U.value,"onUpdate:show":d[3]||(d[3]=N=>U.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定"+(e.value.is_top?"取消置顶":"置顶")+"该泡泡动态吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:z},null,8,["show","content"]),t(D,{show:T.value,"onUpdate:show":d[4]||(d[4]=N=>T.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态"+(e.value.is_essence?"取消亮点":"设为亮点")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:S},null,8,["show","content"]),t(D,{show:h.value,"onUpdate:show":d[5]||(d[5]=N=>h.value=N),"mask-closable":!1,preset:"dialog",title:"提示",content:"确定将该泡泡动态可见度修改为"+(R.value==0?"公开":R.value==1?"私密":"好友可见")+"吗?","positive-text":"确认","negative-text":"取消",onPositiveClick:K},null,8,["show","content"])]),footer:n(()=>[t(Q,{attachments:e.value.attachments},null,8,["attachments"]),t(Q,{attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"]),t(pe,{imgs:e.value.imgs},null,8,["imgs"]),t(de,{videos:e.value.videos,full:!0},null,8,["videos"]),t(me,{links:e.value.links},null,8,["links"]),v("div",Js,[x(" 发布于 "+I(a(ue)(e.value.created_on))+" ",1),e.value.ip_loc?(o(),u("span",Ks,[t(ne,{vertical:""}),x(" "+I(e.value.ip_loc),1)])):i("",!0),!a(p).state.collapsedLeft&&e.value.created_on!=e.value.latest_replied_on?(o(),u("span",Qs,[t(ne,{vertical:""}),x(" 最后回复 "+I(a(ue)(e.value.latest_replied_on)),1)])):i("",!0)])]),action:n(()=>[v("div",Ws,[t(G,{justify:"space-between"},{default:n(()=>[v("div",{class:"opt-item hover",onClick:H(F,["stop"])},[t(a(Y),{size:"20",class:"opt-item-icon"},{default:n(()=>[y.value?i("",!0):(o(),P(a(it),{key:0})),y.value?(o(),P(a(ut),{key:1,color:"red"})):i("",!0)]),_:1}),x(" "+I(e.value.upvote_count),1)],8,Gs),v("div",Xs,[t(a(Y),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(ct))]),_:1}),x(" "+I(e.value.comment_count),1)]),v("div",{class:"opt-item hover",onClick:H(J,["stop"])},[t(a(Y),{size:"20",class:"opt-item-icon"},{default:n(()=>[k.value?i("",!0):(o(),P(a(rt),{key:0})),k.value?(o(),P(a(_t),{key:1,color:"#ff7600"})):i("",!0)]),_:1}),x(" "+I(e.value.collection_count),1)],8,Zs),v("div",{class:"opt-item hover",onClick:H(W,["stop"])},[t(a(Y),{size:"20",class:"opt-item-icon"},{default:n(()=>[t(a(pt))]),_:1}),x(" "+I(e.value.share_count),1)],8,eo)]),_:1})])]),default:n(()=>[e.value.texts.length>0?(o(),u("div",Vs,[(o(!0),u(le,null,ie(e.value.texts,N=>(o(),u("span",{key:N.id,class:"post-text",onClick:d[6]||(d[6]=H(De=>M(De,e.value.id),["stop"])),innerHTML:a(we)(N.content).content},null,8,Ys))),128))])):i("",!0)]),_:1})])}}});const so=A=>(Ie("data-v-0d01659f"),A=A(),Te(),A),oo={key:0,class:"detail-wrap"},no={key:1,class:"empty-wrap"},ao={key:0,class:"comment-opts-wrap"},lo=so(()=>v("span",{class:"comment-title-item"},"评论",-1)),io={key:2},uo={key:0,class:"skeleton-wrap"},co={key:1},ro={key:0,class:"empty-wrap"},_o={key:0,class:"load-more-spinner"},po={key:1,class:"load-more-spinner"},mo={key:2,class:"load-more-spinner"},vo={key:3,class:"load-more-spinner"},ee=20,ho=X({__name:"Post",setup(A){const q=qt(),l=c({}),p=c(!1),f=c(!1),y=c([]),k=ae(()=>+q.query.id),L=c("default"),r=c(!0);let U={loading(){},loaded(){},complete(){},error(){}};const T=z=>{L.value=z,z==="default"&&(r.value=!0),B(U)},h=()=>{l.value={id:0},p.value=!0,nt({id:k.value}).then(z=>{p.value=!1,l.value=z,B(U)}).catch(z=>{p.value=!1})};let $=1;const R=c(!1),e=c([]),_=z=>{R.value||$e({id:l.value.id,sort_strategy:"default",page:$,page_size:ee}).then(S=>{z!==null&&(U=z),S.list.length0&&($===1?e.value=S.list:e.value.push(...S.list),y.value=e.value),U.loaded(),f.value=!1}).catch(S=>{f.value=!1,U.error()})};let O=1,w=c(!1);const M=c([]),j=z=>{w.value||$e({id:l.value.id,sort_strategy:"newest",page:O,page_size:ee}).then(S=>{z!==null&&(U=z),S.list.length0&&(O===1?M.value=S.list:M.value.push(...S.list),y.value=M.value),U.loaded(),f.value=!1}).catch(S=>{f.value=!1,U.error()})},B=z=>{k.value<1||(y.value.length===0&&(f.value=!0),L.value==="default"?(y.value=e.value,_(z)):(y.value=M.value,j(z)),f.value=!1)},V=()=>{$=1,R.value=!1,e.value=[],O=1,w.value=!1,M.value=[],B(U)};return ye(()=>{h()}),Ee(k,()=>{k.value>0&&q.name==="post"&&h()}),(z,S)=>{const K=Bt,F=to,J=Ut,W=Rt,s=St,d=Lt,m=Ot,g=Bs,b=Et,C=Ps,E=Le,D=zt;return o(),u("div",null,[t(K,{title:"泡泡详情",back:!0}),t(D,{class:"main-content-wrap",bordered:""},{default:n(()=>[t(s,null,{default:n(()=>[t(W,{show:p.value},{default:n(()=>[l.value.id>1?(o(),u("div",oo,[t(F,{post:l.value,onReload:h},null,8,["post"])])):(o(),u("div",no,[t(J,{size:"large",description:"暂无数据"})]))]),_:1},8,["show"])]),_:1}),l.value.id>0?(o(),u("div",ao,[t(m,{type:"bar","justify-content":"end",size:"small",animated:"","onUpdate:value":T},{prefix:n(()=>[lo]),default:n(()=>[t(d,{name:"default",tab:"默认"}),t(d,{name:"newest",tab:"最新"})]),_:1})])):i("",!0),l.value.id>0?(o(),P(s,{key:1},{default:n(()=>[t(g,{lock:l.value.is_lock,"post-id":l.value.id,onPostSuccess:V},null,8,["lock","post-id"])]),_:1})):i("",!0),l.value.id>0?(o(),u("div",io,[f.value?(o(),u("div",uo,[t(b,{num:5})])):(o(),u("div",co,[y.value.length===0?(o(),u("div",ro,[t(J,{size:"large",description:"暂无评论,快来抢沙发"})])):i("",!0),(o(!0),u(le,null,ie(y.value,Q=>(o(),P(s,{key:Q.id},{default:n(()=>[t(C,{comment:Q,onReload:V},null,8,["comment"])]),_:2},1024))),128))]))])):i("",!0),y.value.length>=ee?(o(),P(E,{key:3,justify:"center"},{default:n(()=>[t(a(Ht),{class:"load-more",slots:{complete:"没有更多数据了",error:"加载出错"},onInfinite:B},{spinner:n(()=>[r.value&&R.value?(o(),u("span",_o)):i("",!0),!r.value&&a(w)?(o(),u("span",po)):i("",!0),r.value&&!R.value?(o(),u("span",mo,"加载评论")):i("",!0),!r.value&&!a(w)?(o(),u("span",vo,"加载评论")):i("",!0)]),_:1})]),_:1})):i("",!0)]),_:1})])}}});const Qo=se(ho,[["__scopeId","data-v-0d01659f"]]);export{Qo as default}; diff --git a/web/dist/assets/Post.3f5c561f.js b/web/dist/assets/Post.3f5c561f.js deleted file mode 100644 index 250ea1ce..00000000 --- a/web/dist/assets/Post.3f5c561f.js +++ /dev/null @@ -1,57 +0,0 @@ -import{c as me,a as _e,f as j,e as q,d as T,u as ve,x as ie,bP as Te,y as L,A as Ee,h as z,ab as ee,n as Se,J as ke,q as Oe,t as Ce,L as we,K as W,B as Ue,N as Ne,bH as je,aR as Me,b as be,bQ as Ve,r as k,p as qe,aT as Le,aV as He,aN as Ke,aW as We,w as xe,W as u,Y as g,Z as C,bR as Je,ai as te,a7 as $,a4 as a,a5 as l,a9 as E,bS as Qe,_ as Ye,$ as le,am as he,aa as D,a6 as R,a3 as e,bT as Ze,af as ue,al as Be,an as Ge,ac as ne,a8 as J,bU as Xe,ae as fe,a0 as et,a2 as ge,bV as tt,ag as st,bW as ot,bX as nt,bY as at,bZ as it,b_ as lt,b$ as ut,c0 as rt,c1 as ct,c2 as pt,c3 as dt,ao as _t,c4 as mt,bA as vt,ah as ht,S as ft,c5 as gt,c6 as yt,aj as kt,c7 as Ct}from"./index.d4f5aad2.js";import{_ as wt}from"./InputGroup.73d38f63.js";import{f as ae}from"./formatTime.e07969bb.js";import{p as ye,a as Fe,H as bt,C as xt,B as $t,_ as Et,b as Bt,c as Ft}from"./content.ed80294a.js";import{_ as Pe}from"./Thing.d394adea.js";import{_ as Pt}from"./post-skeleton.38f0f247.js";import{l as Dt,I as At,_ as Rt,V as X}from"./IEnum.032938cf.js";import{_ as zt,a as It,b as Tt,c as St}from"./Upload.6bcec76c.js";import{M as Ot}from"./MoreHorizFilled.b0eea69d.js";import{_ as Ut}from"./main-nav.3167f221.js";import{_ as Nt}from"./List.a66e9ae7.js";import{a as jt,_ as Mt}from"./Skeleton.e1c16fcb.js";var Vt=me("divider",` - position: relative; - display: flex; - width: 100%; - box-sizing: border-box; - font-size: 16px; - color: var(--n-text-color); - transition: - color .3s var(--n-bezier), - background-color .3s var(--n-bezier); -`,[_e("vertical",` - margin-top: 24px; - margin-bottom: 24px; - `,[_e("no-title",` - display: flex; - align-items: center; - `)]),j("title",` - display: flex; - align-items: center; - margin-left: 12px; - margin-right: 12px; - white-space: nowrap; - font-weight: var(--n-font-weight); - `),q("title-position-left",[j("line",[q("left",{width:"28px"})])]),q("title-position-right",[j("line",[q("right",{width:"28px"})])]),q("dashed",[j("line",` - background-color: #0000; - height: 0px; - width: 100%; - border-style: dashed; - border-width: 1px 0 0; - `)]),q("vertical",` - display: inline-block; - height: 1em; - margin: 0 8px; - vertical-align: middle; - width: 1px; - `),j("line",` - border: none; - transition: background-color .3s var(--n-bezier), border-color .3s var(--n-bezier); - height: 1px; - width: 100%; - margin: 0; - `),_e("dashed",[j("line",{backgroundColor:"var(--n-color)"})]),q("dashed",[j("line",{borderColor:"var(--n-color)"})]),q("vertical",{backgroundColor:"var(--n-color)"})]);const qt=Object.assign(Object.assign({},ie.props),{titlePlacement:{type:String,default:"center"},dashed:Boolean,vertical:Boolean});var Lt=T({name:"Divider",props:qt,setup(c){const{mergedClsPrefixRef:d,inlineThemeDisabled:n}=ve(c),i=ie("Divider","-divider",Vt,Te,c,d),f=L(()=>{const{common:{cubicBezierEaseInOut:r},self:{color:_,textColor:o,fontWeight:w}}=i.value;return{"--n-bezier":r,"--n-color":_,"--n-text-color":o,"--n-font-weight":w}}),p=n?Ee("divider",void 0,f,c):void 0;return{mergedClsPrefix:d,cssVars:n?void 0:f,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender}},render(){var c;const{$slots:d,titlePlacement:n,vertical:i,dashed:f,cssVars:p,mergedClsPrefix:r}=this;return(c=this.onRender)===null||c===void 0||c.call(this),z("div",{role:"separator",class:[`${r}-divider`,this.themeClass,{[`${r}-divider--vertical`]:i,[`${r}-divider--no-title`]:!d.default,[`${r}-divider--dashed`]:f,[`${r}-divider--title-position-${n}`]:d.default&&n}],style:p},i?null:z("div",{class:`${r}-divider__line ${r}-divider__line--left`}),!i&&d.default?z(ee,null,z("div",{class:`${r}-divider__title`},this.$slots),z("div",{class:`${r}-divider__line ${r}-divider__line--right`})):null)}});const De=Se("n-popconfirm"),Ae={positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0}},$e=Me(Ae);var Ht=T({name:"NPopconfirmPanel",props:Ae,setup(c){const{localeRef:d}=ke("Popconfirm"),{inlineThemeDisabled:n}=ve(),{mergedClsPrefixRef:i,mergedThemeRef:f,props:p}=Oe(De),r=L(()=>{const{common:{cubicBezierEaseInOut:o},self:{fontSize:w,iconSize:h,iconColor:v}}=f.value;return{"--n-bezier":o,"--n-font-size":w,"--n-icon-size":h,"--n-icon-color":v}}),_=n?Ee("popconfirm-panel",void 0,r,p):void 0;return Object.assign(Object.assign({},ke("Popconfirm")),{mergedClsPrefix:i,cssVars:n?void 0:r,localizedPositiveText:L(()=>c.positiveText||d.value.positiveText),localizedNegativeText:L(()=>c.negativeText||d.value.negativeText),positiveButtonProps:Ce(p,"positiveButtonProps"),negativeButtonProps:Ce(p,"negativeButtonProps"),handlePositiveClick(o){c.onPositiveClick(o)},handleNegativeClick(o){c.onNegativeClick(o)},themeClass:_==null?void 0:_.themeClass,onRender:_==null?void 0:_.onRender})},render(){var c;const{mergedClsPrefix:d,showIcon:n,$slots:i}=this,f=we(i.action,()=>this.negativeText===null&&this.positiveText===null?[]:[this.negativeText!==null&&z(W,Object.assign({size:"small",onClick:this.handleNegativeClick},this.negativeButtonProps),{default:()=>this.localizedNegativeText}),this.positiveText!==null&&z(W,Object.assign({size:"small",type:"primary",onClick:this.handlePositiveClick},this.positiveButtonProps),{default:()=>this.localizedPositiveText})]);return(c=this.onRender)===null||c===void 0||c.call(this),z("div",{class:[`${d}-popconfirm__panel`,this.themeClass],style:this.cssVars},Ue(i.default,p=>n||p?z("div",{class:`${d}-popconfirm__body`},n?z("div",{class:`${d}-popconfirm__icon`},we(i.icon,()=>[z(Ne,{clsPrefix:d},{default:()=>z(je,null)})])):null,p):null),f?z("div",{class:[`${d}-popconfirm__action`]},f):null)}}),Kt=me("popconfirm",[j("body",` - font-size: var(--n-font-size); - display: flex; - align-items: center; - flex-wrap: nowrap; - position: relative; - `,[j("icon",` - display: flex; - font-size: var(--n-icon-size); - color: var(--n-icon-color); - transition: color .3s var(--n-bezier); - margin: 0 8px 0 0; - `)]),j("action",` - display: flex; - justify-content: flex-end; - `,[be("&:not(:first-child)","margin-top: 8px"),me("button",[be("&:not(:last-child)","margin-right: 8px;")])])]);const Wt=Object.assign(Object.assign(Object.assign({},ie.props),We),{positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},trigger:{type:String,default:"click"},positiveButtonProps:Object,negativeButtonProps:Object,onPositiveClick:Function,onNegativeClick:Function});var Re=T({name:"Popconfirm",props:Wt,__popover__:!0,setup(c){const{mergedClsPrefixRef:d}=ve(),n=ie("Popconfirm","-popconfirm",Kt,Ve,c,d),i=k(null);function f(_){const{onPositiveClick:o,"onUpdate:show":w}=c;Promise.resolve(o?o(_):!0).then(h=>{var v;h!==!1&&((v=i.value)===null||v===void 0||v.setShow(!1),w&&xe(w,!1))})}function p(_){const{onNegativeClick:o,"onUpdate:show":w}=c;Promise.resolve(o?o(_):!0).then(h=>{var v;h!==!1&&((v=i.value)===null||v===void 0||v.setShow(!1),w&&xe(w,!1))})}return qe(De,{mergedThemeRef:n,mergedClsPrefixRef:d,props:c}),Object.assign(Object.assign({},{setShow(_){var o;(o=i.value)===null||o===void 0||o.setShow(_)},syncPosition(){var _;(_=i.value)===null||_===void 0||_.syncPosition()}}),{mergedTheme:n,popoverInstRef:i,handlePositiveClick:f,handleNegativeClick:p})},render(){const{$slots:c,$props:d,mergedTheme:n}=this;return z(Ke,He(d,$e,{theme:n.peers.Popover,themeOverrides:n.peerOverrides.Popover,internalExtraClass:["popconfirm"],ref:"popoverInstRef"}),{trigger:c.activator||c.trigger,default:()=>{const i=Le(d,$e);return z(Ht,Object.assign(Object.assign({},i),{onPositiveClick:this.handlePositiveClick,onNegativeClick:this.handleNegativeClick}),c)}})}});const Jt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Qt=C("path",{d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16z",fill:"currentColor"},null,-1),Yt=[Qt];var Zt=T({name:"Bookmark",render:function(d,n){return u(),g("svg",Jt,Yt)}});const Gt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Xt=C("path",{d:"M256 448a32 32 0 0 1-18-5.57c-78.59-53.35-112.62-89.93-131.39-112.8c-40-48.75-59.15-98.8-58.61-153C48.63 114.52 98.46 64 159.08 64c44.08 0 74.61 24.83 92.39 45.51a6 6 0 0 0 9.06 0C278.31 88.81 308.84 64 352.92 64c60.62 0 110.45 50.52 111.08 112.64c.54 54.21-18.63 104.26-58.61 153c-18.77 22.87-52.8 59.45-131.39 112.8a32 32 0 0 1-18 5.56z",fill:"currentColor"},null,-1),es=[Xt];var ts=T({name:"Heart",render:function(d,n){return u(),g("svg",Gt,es)}});const ss={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},os=Je('',1),ns=[os];var ze=T({name:"Trash",render:function(d,n){return u(),g("svg",ss,ns)}});const as={class:"reply-compose-wrap"},is={class:"reply-switch"},ls={key:0,class:"reply-input-wrap"},us=T({__name:"compose-reply",props:{commentId:{default:0},atUserid:{default:0},atUsername:{default:""}},emits:["reload","reset"],setup(c,{expose:d,emit:n}){const i=c,f=k(),p=k(!1),r=k(""),_=k(!1),o=h=>{p.value=h,h?setTimeout(()=>{var v;(v=f.value)==null||v.focus()},10):(_.value=!1,r.value="",n("reset"))},w=()=>{_.value=!0,Qe({comment_id:i.commentId,at_user_id:i.atUserid,content:r.value}).then(h=>{o(!1),window.$message.success("\u8BC4\u8BBA\u6210\u529F"),n("reload")}).catch(h=>{_.value=!1})};return d({switchReply:o}),(h,v)=>{const A=Ye,t=W,B=wt;return u(),g("div",as,[C("div",is,[p.value?$("",!0):(u(),g("span",{key:0,class:"show",onClick:v[0]||(v[0]=x=>o(!0))}," \u56DE\u590D ")),p.value?(u(),g("span",{key:1,class:"hide",onClick:v[1]||(v[1]=x=>o(!1))}," \u53D6\u6D88 ")):$("",!0)]),p.value?(u(),g("div",ls,[a(B,null,{default:l(()=>[a(A,{ref_key:"inputInstRef",ref:f,size:"small",placeholder:i.atUsername?"@"+i.atUsername:"\u8BF7\u8F93\u5165\u56DE\u590D\u5185\u5BB9..",maxlength:"100",value:r.value,"onUpdate:value":v[2]||(v[2]=x=>r.value=x),"show-count":"",clearable:""},null,8,["placeholder","value"]),a(t,{type:"primary",size:"small",ghost:"",loading:_.value,onClick:w},{default:l(()=>[E(" \u56DE\u590D ")]),_:1},8,["loading"])]),_:1})])):$("",!0)])}}});var rs=te(us,[["__scopeId","data-v-3616e66c"]]);const cs={class:"reply-item"},ps={class:"header-wrap"},ds={class:"username"},_s={class:"reply-name"},ms={class:"timestamp"},vs={class:"base-wrap"},hs={class:"content"},fs={key:0,class:"reply-switch"},gs=T({__name:"reply-item",props:{reply:null},emits:["focusReply","reload"],setup(c,{emit:d}){const n=c,i=le(),f=()=>{d("focusReply",n.reply)},p=()=>{Ze({id:n.reply.id}).then(r=>{window.$message.success("\u5220\u9664\u6210\u529F"),setTimeout(()=>{d("reload")},50)}).catch(r=>{console.log(r)})};return(r,_)=>{const o=he("router-link"),w=ue,h=W,v=Re;return u(),g("div",cs,[C("div",ps,[C("div",ds,[a(o,{class:"user-link",to:{name:"user",query:{username:n.reply.user.username}}},{default:l(()=>[E(D(n.reply.user.username),1)]),_:1},8,["to"]),C("span",_s,D(n.reply.at_user_id>0?"\u56DE\u590D":":"),1),n.reply.at_user_id>0?(u(),R(o,{key:0,class:"user-link",to:{name:"user",query:{username:n.reply.at_user.username}}},{default:l(()=>[E(D(n.reply.at_user.username),1)]),_:1},8,["to"])):$("",!0)]),C("div",ms,[E(D(n.reply.ip_loc?n.reply.ip_loc+" \xB7 ":n.reply.ip_loc)+" "+D(e(ae)(n.reply.created_on))+" ",1),e(i).state.userInfo.is_admin||e(i).state.userInfo.id===n.reply.user.id?(u(),R(v,{key:0,"negative-text":"\u53D6\u6D88","positive-text":"\u786E\u8BA4",onPositiveClick:p},{trigger:l(()=>[a(h,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:l(()=>[a(w,null,{default:l(()=>[a(e(ze))]),_:1})]),_:1})]),default:l(()=>[E(" \u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F ")]),_:1})):$("",!0)])]),C("div",vs,[C("div",hs,D(n.reply.content),1),e(i).state.userInfo.id>0?(u(),g("div",fs,[C("span",{class:"show",onClick:f}," \u56DE\u590D ")])):$("",!0)])])}}});var ys=te(gs,[["__scopeId","data-v-1e3df20d"]]);const ks={class:"comment-item"},Cs={class:"nickname-wrap"},ws={class:"username-wrap"},bs={class:"opt-wrap"},xs={class:"timestamp"},$s=["innerHTML"],Es={class:"reply-wrap"},Bs=T({__name:"comment-item",props:{comment:null},emits:["reload"],setup(c,{emit:d}){const n=c,i=le(),f=Be(),p=k(0),r=k(""),_=k(),o=L(()=>{let B=Object.assign({texts:[],imgs:[]},n.comment);return B.contents.map(x=>{(+x.type==1||+x.type==2)&&B.texts.push(x),+x.type==3&&B.imgs.push(x)}),B}),w=(B,x)=>{let I=B.target;if(I.dataset.detail){const S=I.dataset.detail.split(":");S.length===2&&(i.commit("refresh"),S[0]==="tag"?window.$message.warning("\u8BC4\u8BBA\u5185\u7684\u65E0\u6548\u8BDD\u9898"):f.push({name:"user",query:{username:S[1]}}))}},h=B=>{var x,I;p.value=B.user_id,r.value=((x=B.user)==null?void 0:x.username)||"",(I=_.value)==null||I.switchReply(!0)},v=()=>{d("reload")},A=()=>{p.value=0,r.value=""},t=()=>{Xe({id:o.value.id}).then(B=>{window.$message.success("\u5220\u9664\u6210\u529F"),setTimeout(()=>{v()},50)}).catch(B=>{})};return(B,x)=>{const I=fe,S=he("router-link"),H=ue,K=W,M=Re,Q=Fe,Y=ys,Z=rs,s=Pe;return u(),g("div",ks,[a(s,{"content-indented":""},Ge({avatar:l(()=>[a(I,{round:"",size:30,src:e(o).user.avatar},null,8,["src"])]),header:l(()=>[C("span",Cs,[a(S,{onClick:x[0]||(x[0]=J(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(o).user.username}}},{default:l(()=>[E(D(e(o).user.nickname),1)]),_:1},8,["to"])]),C("span",ws," @"+D(e(o).user.username),1)]),"header-extra":l(()=>[C("div",bs,[C("span",xs,D(e(o).ip_loc?e(o).ip_loc+" \xB7 ":e(o).ip_loc)+" "+D(e(ae)(e(o).created_on)),1),e(i).state.userInfo.is_admin||e(i).state.userInfo.id===e(o).user.id?(u(),R(M,{key:0,"negative-text":"\u53D6\u6D88","positive-text":"\u786E\u8BA4",onPositiveClick:t},{trigger:l(()=>[a(K,{quaternary:"",circle:"",size:"tiny",class:"del-btn"},{icon:l(()=>[a(H,null,{default:l(()=>[a(e(ze))]),_:1})]),_:1})]),default:l(()=>[E(" \u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F ")]),_:1})):$("",!0)])]),footer:l(()=>[e(o).imgs.length>0?(u(),R(Q,{key:0,imgs:e(o).imgs},null,8,["imgs"])):$("",!0),C("div",Es,[(u(!0),g(ee,null,ne(e(o).replies,m=>(u(),R(Y,{key:m.id,reply:m,onFocusReply:h,onReload:v},null,8,["reply"]))),128))]),e(i).state.userInfo.id>0?(u(),R(Z,{key:1,ref_key:"replyComposeRef",ref:_,"comment-id":e(o).id,"at-userid":p.value,"at-username":r.value,onReload:v,onReset:A},null,8,["comment-id","at-userid","at-username"])):$("",!0)]),_:2},[e(o).texts.length>0?{name:"description",fn:l(()=>[(u(!0),g(ee,null,ne(e(o).texts,m=>(u(),g("span",{key:m.id,class:"comment-text",onClick:x[1]||(x[1]=J(U=>w(U,e(o).id),["stop"])),innerHTML:e(ye)(m.content).content},null,8,$s))),128))]),key:"0"}:void 0]),1024)])}}});var Fs=te(Bs,[["__scopeId","data-v-6b2cb186"]]);const Ps=c=>(ot("data-v-b1d2e9fe"),c=c(),nt(),c),Ds={key:0,class:"compose-wrap"},As={class:"compose-line"},Rs={class:"compose-user"},zs={class:"compose-line compose-options"},Is={class:"attachment"},Ts={class:"submit-wrap"},Ss={class:"attachment-list-wrap"},Os={key:1,class:"compose-wrap"},Us=Ps(()=>C("div",{class:"login-wrap"},[C("span",{class:"login-banner"}," \u767B\u5F55\u540E\uFF0C\u7CBE\u5F69\u66F4\u591A")],-1)),Ns={class:"login-wrap"},js=T({__name:"compose-comment",props:{lock:{default:0},postId:{default:0}},emits:["post-success"],setup(c,{emit:d}){const n=c,i=le(),f=k([]),p=k(!1),r=k(!1),_=k(!1),o=k(""),w=k(),h=k("public/image"),v=k([]),A=k([]),t="/v1/attachment",B=k(),x=Dt.exports.debounce(y=>{et({k:y}).then(b=>{let F=[];b.suggest.map(P=>{F.push({label:P,value:P})}),f.value=F,r.value=!1}).catch(b=>{r.value=!1})},200),I=(y,b)=>{r.value||(r.value=!0,b==="@"&&x(y))},S=y=>{y.length>200||(o.value=y)},H=y=>{h.value=y},K=y=>{v.value=y},M=async y=>{var b,F;return h.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((b=y.file.file)==null?void 0:b.type)?(window.$message.warning("\u56FE\u7247\u4EC5\u5141\u8BB8 png/jpg/gif \u683C\u5F0F"),!1):h.value==="image"&&((F=y.file.file)==null?void 0:F.size)>10485760?(window.$message.warning("\u56FE\u7247\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC710MB"),!1):!0},Q=({file:y,event:b})=>{var F;try{let P=JSON.parse((F=b.target)==null?void 0:F.response);P.code===0&&h.value==="public/image"&&A.value.push({id:y.id,content:P.data.content})}catch{window.$message.error("\u4E0A\u4F20\u5931\u8D25")}},Y=({file:y,event:b})=>{var F;try{let P=JSON.parse((F=b.target)==null?void 0:F.response);if(P.code!==0){let V=P.msg||"\u4E0A\u4F20\u5931\u8D25";P.details&&P.details.length>0&&P.details.map(N=>{V+=":"+N}),window.$message.error(V)}}catch{window.$message.error("\u4E0A\u4F20\u5931\u8D25")}},Z=({file:y})=>{let b=A.value.findIndex(F=>F.id===y.id);b>-1&&A.value.splice(b,1)},s=()=>{p.value=!0},m=()=>{var y;p.value=!1,(y=w.value)==null||y.clear(),v.value=[],o.value="",A.value=[]},U=()=>{if(o.value.trim().length===0){window.$message.warning("\u8BF7\u8F93\u5165\u5185\u5BB9\u54E6");return}let{users:y}=ye(o.value);const b=[];let F=100;b.push({content:o.value,type:2,sort:F}),A.value.map(P=>{F++,b.push({content:P.content,type:3,sort:F})}),_.value=!0,tt({contents:b,post_id:n.postId,users:Array.from(new Set(y))}).then(P=>{window.$message.success("\u53D1\u5E03\u6210\u529F"),_.value=!1,d("post-success"),m()}).catch(P=>{_.value=!1})},se=y=>{i.commit("triggerAuth",!0),i.commit("triggerAuthKey",y)};return ge(()=>{B.value="Bearer "+localStorage.getItem("PAOPAO_TOKEN")}),(y,b)=>{const F=fe,P=Rt,V=ue,N=W,re=zt,ce=It,pe=st,oe=Tt,de=St;return u(),g("div",null,[e(i).state.userInfo.id>0?(u(),g("div",Ds,[C("div",As,[C("div",Rs,[a(F,{round:"",size:30,src:e(i).state.userInfo.avatar},null,8,["src"])]),a(P,{type:"textarea",size:"large",autosize:"",bordered:!1,options:f.value,prefix:["@"],loading:r.value,value:o.value,disabled:n.lock===1,"onUpdate:value":S,onSearch:I,onFocus:s,placeholder:n.lock===1?"\u6CE1\u6CE1\u5DF2\u88AB\u9501\u5B9A\uFF0C\u56DE\u590D\u529F\u80FD\u5DF2\u5173\u95ED":"\u5FEB\u6765\u8BC4\u8BBA\u4E24\u53E5\u5427..."},null,8,["options","loading","value","disabled","placeholder"])]),p.value?(u(),R(de,{key:0,ref_key:"uploadRef",ref:w,abstract:"","list-type":"image",multiple:!0,max:9,action:t,headers:{Authorization:B.value},data:{type:h.value},onBeforeUpload:M,onFinish:Q,onError:Y,onRemove:Z,"onUpdate:fileList":K},{default:l(()=>[C("div",zs,[C("div",Is,[a(re,{abstract:""},{default:l(({handleClick:G})=>[a(N,{disabled:v.value.length>0&&h.value==="public/video"||v.value.length===9,onClick:()=>{H("public/image"),G()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(V,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(e(At))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),a(pe,{trigger:"hover",placement:"bottom"},{trigger:l(()=>[a(ce,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:o.value.length/200*100},null,8,["percentage"])]),default:l(()=>[E(" "+D(o.value.length)+" / 200 ",1)]),_:1})]),C("div",Ts,[a(N,{quaternary:"",round:"",type:"tertiary",class:"cancel-btn",size:"small",onClick:m},{default:l(()=>[E(" \u53D6\u6D88 ")]),_:1}),a(N,{loading:_.value,onClick:U,type:"primary",secondary:"",size:"small",round:""},{default:l(()=>[E(" \u53D1\u5E03 ")]),_:1},8,["loading"])])]),C("div",Ss,[a(oe)])]),_:1},8,["headers","data"])):$("",!0)])):(u(),g("div",Os,[Us,C("div",Ns,[a(N,{strong:"",secondary:"",round:"",type:"primary",onClick:b[0]||(b[0]=G=>se("signin"))},{default:l(()=>[E(" \u767B\u5F55 ")]),_:1}),a(N,{strong:"",secondary:"",round:"",type:"info",onClick:b[1]||(b[1]=G=>se("signup"))},{default:l(()=>[E(" \u6CE8\u518C ")]),_:1})])]))])}}});var Ms=te(js,[["__scopeId","data-v-b1d2e9fe"]]);const Vs={class:"username-wrap"},qs={key:0,class:"options"},Ls={key:0},Hs=["innerHTML"],Ks={class:"timestamp"},Ws={key:0},Js={key:1},Qs={class:"opts-wrap"},Ys=["onClick"],Zs={class:"opt-item"},Gs=["onClick"],Xs=T({__name:"post-detail",props:{post:null},emits:["reload"],setup(c,{emit:d}){const n=c,i=le(),f=Be(),p=k(!1),r=k(!1),_=k(!1),o=k(!1),w=k(!1),h=k(!1),v=k(!1),A=k(X.PUBLIC),t=L({get:()=>{let s=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},n.post);return s.contents.map(m=>{(+m.type==1||+m.type==2)&&s.texts.push(m),+m.type==3&&s.imgs.push(m),+m.type==4&&s.videos.push(m),+m.type==6&&s.links.push(m),+m.type==7&&s.attachments.push(m),+m.type==8&&s.charge_attachments.push(m)}),s},set:s=>{n.post.upvote_count=s.upvote_count,n.post.comment_count=s.comment_count,n.post.collection_count=s.collection_count}}),B=L(()=>{let s=[{label:"\u5220\u9664",key:"delete"}];return t.value.is_lock===0?s.push({label:"\u9501\u5B9A",key:"lock"}):s.push({label:"\u89E3\u9501",key:"unlock"}),i.state.userInfo.is_admin&&(t.value.is_top===0?s.push({label:"\u7F6E\u9876",key:"stick"}):s.push({label:"\u53D6\u6D88\u7F6E\u9876",key:"unstick"})),t.value.visibility===X.PUBLIC?s.push({label:"\u516C\u5F00",key:"vpublic",children:[{label:"\u79C1\u5BC6",key:"vprivate"},{label:"\u597D\u53CB\u53EF\u89C1",key:"vfriend"}]}):t.value.visibility===X.PRIVATE?s.push({label:"\u79C1\u5BC6",key:"vprivate",children:[{label:"\u516C\u5F00",key:"vpublic"},{label:"\u597D\u53CB\u53EF\u89C1",key:"vfriend"}]}):s.push({label:"\u597D\u53CB\u53EF\u89C1",key:"vfriend",children:[{label:"\u516C\u5F00",key:"vpublic"},{label:"\u79C1\u5BC6",key:"vprivate"}]}),s}),x=s=>{f.push({name:"post",query:{id:s}})},I=(s,m)=>{if(s.target.dataset.detail){const U=s.target.dataset.detail.split(":");if(U.length===2){i.commit("refresh"),U[0]==="tag"?f.push({name:"home",query:{q:U[1],t:"tag"}}):f.push({name:"user",query:{username:U[1]}});return}}x(m)},S=s=>{switch(s){case"delete":_.value=!0;break;case"lock":case"unlock":o.value=!0;break;case"stick":case"unstick":w.value=!0;break;case"vpublic":A.value=0,h.value=!0;break;case"vprivate":A.value=1,h.value=!0;break;case"vfriend":A.value=2,h.value=!0;break}},H=()=>{lt({id:t.value.id}).then(s=>{window.$message.success("\u5220\u9664\u6210\u529F"),f.replace("/"),setTimeout(()=>{i.commit("refresh")},50)}).catch(s=>{v.value=!1})},K=()=>{ut({id:t.value.id}).then(s=>{d("reload"),s.lock_status===1?window.$message.success("\u9501\u5B9A\u6210\u529F"):window.$message.success("\u89E3\u9501\u6210\u529F")}).catch(s=>{v.value=!1})},M=()=>{rt({id:t.value.id}).then(s=>{d("reload"),s.top_status===1?window.$message.success("\u7F6E\u9876\u6210\u529F"):window.$message.success("\u53D6\u6D88\u7F6E\u9876\u6210\u529F")}).catch(s=>{v.value=!1})},Q=()=>{ct({id:t.value.id,visibility:A.value}).then(s=>{d("reload"),window.$message.success("\u4FEE\u6539\u53EF\u89C1\u6027\u6210\u529F")}).catch(s=>{v.value=!1})},Y=()=>{pt({id:t.value.id}).then(s=>{p.value=s.status,s.status?t.value={...t.value,upvote_count:t.value.upvote_count+1}:t.value={...t.value,upvote_count:t.value.upvote_count-1}}).catch(s=>{console.log(s)})},Z=()=>{dt({id:t.value.id}).then(s=>{r.value=s.status,s.status?t.value={...t.value,collection_count:t.value.collection_count+1}:t.value={...t.value,collection_count:t.value.collection_count-1}}).catch(s=>{console.log(s)})};return ge(()=>{i.state.userInfo.id>0&&(at({id:t.value.id}).then(s=>{p.value=s.status}).catch(s=>{console.log(s)}),it({id:t.value.id}).then(s=>{r.value=s.status}).catch(s=>{console.log(s)}))}),(s,m)=>{const U=fe,se=he("router-link"),y=_t,b=ue,F=W,P=mt,V=vt,N=Et,re=Fe,ce=Bt,pe=Ft,oe=Lt,de=ht,G=Pe;return u(),g("div",{class:"detail-item",onClick:m[6]||(m[6]=O=>x(e(t).id))},[a(G,null,{avatar:l(()=>[a(U,{round:"",size:30,src:e(t).user.avatar},null,8,["src"])]),header:l(()=>[a(se,{onClick:m[0]||(m[0]=J(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e(t).user.username}}},{default:l(()=>[E(D(e(t).user.nickname),1)]),_:1},8,["to"]),C("span",Vs," @"+D(e(t).user.username),1),e(t).is_top?(u(),R(y,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:l(()=>[E(" \u7F6E\u9876 ")]),_:1})):$("",!0),e(t).visibility==e(X).PRIVATE?(u(),R(y,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:l(()=>[E(" \u79C1\u5BC6 ")]),_:1})):$("",!0),e(t).visibility==e(X).FRIEND?(u(),R(y,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:l(()=>[E(" \u597D\u53CB\u53EF\u89C1 ")]),_:1})):$("",!0)]),"header-extra":l(()=>[e(i).state.userInfo.is_admin||e(i).state.userInfo.id===e(t).user.id?(u(),g("div",qs,[a(P,{placement:"bottom-end",trigger:"click",size:"small",options:e(B),onSelect:S},{default:l(()=>[a(F,{quaternary:"",circle:""},{icon:l(()=>[a(b,null,{default:l(()=>[a(e(Ot))]),_:1})]),_:1})]),_:1},8,["options"])])):$("",!0),a(V,{show:_.value,"onUpdate:show":m[1]||(m[1]=O=>_.value=O),"mask-closable":!1,preset:"dialog",title:"\u63D0\u793A",content:"\u786E\u5B9A\u5220\u9664\u8BE5\u6CE1\u6CE1\u52A8\u6001\u5417\uFF1F","positive-text":"\u786E\u8BA4","negative-text":"\u53D6\u6D88",onPositiveClick:H},null,8,["show"]),a(V,{show:o.value,"onUpdate:show":m[2]||(m[2]=O=>o.value=O),"mask-closable":!1,preset:"dialog",title:"\u63D0\u793A",content:"\u786E\u5B9A"+(e(t).is_lock?"\u89E3\u9501":"\u9501\u5B9A")+"\u8BE5\u6CE1\u6CE1\u52A8\u6001\u5417\uFF1F","positive-text":"\u786E\u8BA4","negative-text":"\u53D6\u6D88",onPositiveClick:K},null,8,["show","content"]),a(V,{show:w.value,"onUpdate:show":m[3]||(m[3]=O=>w.value=O),"mask-closable":!1,preset:"dialog",title:"\u63D0\u793A",content:"\u786E\u5B9A"+(e(t).is_top?"\u53D6\u6D88\u7F6E\u9876":"\u7F6E\u9876")+"\u8BE5\u6CE1\u6CE1\u52A8\u6001\u5417\uFF1F","positive-text":"\u786E\u8BA4","negative-text":"\u53D6\u6D88",onPositiveClick:M},null,8,["show","content"]),a(V,{show:h.value,"onUpdate:show":m[4]||(m[4]=O=>h.value=O),"mask-closable":!1,preset:"dialog",title:"\u63D0\u793A",content:"\u786E\u5B9A\u5C06\u8BE5\u6CE1\u6CE1\u52A8\u6001\u53EF\u89C1\u5EA6\u4FEE\u6539\u4E3A"+(A.value==0?"\u516C\u5F00":A.value==1?"\u79C1\u5BC6":"\u597D\u53CB\u53EF\u89C1")+"\u5417\uFF1F","positive-text":"\u786E\u8BA4","negative-text":"\u53D6\u6D88",onPositiveClick:Q},null,8,["show","content"])]),footer:l(()=>[a(N,{attachments:e(t).attachments},null,8,["attachments"]),a(N,{attachments:e(t).charge_attachments,price:e(t).attachment_price},null,8,["attachments","price"]),a(re,{imgs:e(t).imgs},null,8,["imgs"]),a(ce,{videos:e(t).videos,full:!0},null,8,["videos"]),a(pe,{links:e(t).links},null,8,["links"]),C("div",Ks,[E(" \u53D1\u5E03\u4E8E "+D(e(ae)(e(t).created_on))+" ",1),e(t).ip_loc?(u(),g("span",Ws,[a(oe,{vertical:""}),E(" "+D(e(t).ip_loc),1)])):$("",!0),e(t).created_on!=e(t).latest_replied_on?(u(),g("span",Js,[a(oe,{vertical:""}),E(" \u6700\u540E\u56DE\u590D "+D(e(ae)(e(t).latest_replied_on)),1)])):$("",!0)])]),action:l(()=>[C("div",Qs,[a(de,{justify:"space-between"},{default:l(()=>[C("div",{class:"opt-item hover",onClick:J(Y,["stop"])},[a(b,{size:"20",class:"opt-item-icon"},{default:l(()=>[p.value?$("",!0):(u(),R(e(bt),{key:0})),p.value?(u(),R(e(ts),{key:1,color:"red"})):$("",!0)]),_:1}),E(" "+D(e(t).upvote_count),1)],8,Ys),C("div",Zs,[a(b,{size:"20",class:"opt-item-icon"},{default:l(()=>[a(e(xt))]),_:1}),E(" "+D(e(t).comment_count),1)]),C("div",{class:"opt-item hover",onClick:J(Z,["stop"])},[a(b,{size:"20",class:"opt-item-icon"},{default:l(()=>[r.value?$("",!0):(u(),R(e($t),{key:0})),r.value?(u(),R(e(Zt),{key:1,color:"#ff7600"})):$("",!0)]),_:1}),E(" "+D(e(t).collection_count),1)],8,Gs)]),_:1})])]),default:l(()=>[e(t).texts.length>0?(u(),g("div",Ls,[(u(!0),g(ee,null,ne(e(t).texts,O=>(u(),g("span",{key:O.id,class:"post-text",onClick:m[5]||(m[5]=J(Ie=>I(Ie,e(t).id),["stop"])),innerHTML:e(ye)(O.content).content},null,8,Hs))),128))])):$("",!0)]),_:1})])}}});const eo={key:0,class:"detail-wrap"},to={key:1,class:"empty-wrap"},so={key:1},oo={key:0,class:"skeleton-wrap"},no={key:1},ao={key:0,class:"empty-wrap"},io=T({__name:"Post",setup(c){const d=kt(),n=k({}),i=k(!1),f=k(!1),p=k([]),r=L(()=>+d.query.id),_=()=>{n.value={id:0},i.value=!0,gt({id:r.value}).then(w=>{i.value=!1,n.value=w,o()}).catch(w=>{i.value=!1})},o=(w=!1)=>{p.value.length===0&&(f.value=!0),yt({id:n.value.id}).then(h=>{p.value=h.list,f.value=!1,w&&setTimeout(()=>{window.scrollTo(0,99999)},50)}).catch(h=>{f.value=!1})};return ge(()=>{_()}),ft(r,()=>{r.value>0&&d.name==="post"&&_()}),(w,h)=>{const v=Ut,A=Xs,t=jt,B=Ct,x=Mt,I=Ms,S=Pt,H=Fs,K=Nt;return u(),g("div",null,[a(v,{title:"\u6CE1\u6CE1\u8BE6\u60C5",back:!0}),a(K,{class:"main-content-wrap",bordered:""},{default:l(()=>[a(x,null,{default:l(()=>[a(B,{show:i.value},{default:l(()=>[n.value.id>1?(u(),g("div",eo,[a(A,{post:n.value,onReload:_},null,8,["post"])])):(u(),g("div",to,[a(t,{size:"large",description:"\u6682\u65E0\u6570\u636E"})]))]),_:1},8,["show"])]),_:1}),n.value.id>0?(u(),R(x,{key:0},{default:l(()=>[a(I,{lock:n.value.is_lock,"post-id":n.value.id,onPostSuccess:h[0]||(h[0]=M=>o(!0))},null,8,["lock","post-id"])]),_:1})):$("",!0),n.value.id>0?(u(),g("div",so,[f.value?(u(),g("div",oo,[a(S,{num:5})])):(u(),g("div",no,[p.value.length===0?(u(),g("div",ao,[a(t,{size:"large",description:"\u6682\u65E0\u8BC4\u8BBA\uFF0C\u5FEB\u6765\u62A2\u6C99\u53D1"})])):$("",!0),(u(!0),g(ee,null,ne(p.value,M=>(u(),R(x,{key:M.id},{default:l(()=>[a(H,{comment:M,onReload:o},null,8,["comment"])]),_:2},1024))),128))]))])):$("",!0)]),_:1})])}}});var ko=te(io,[["__scopeId","data-v-41747510"]]);export{ko as default}; diff --git a/web/dist/assets/Post.4d9d6f83.css b/web/dist/assets/Post.4d9d6f83.css deleted file mode 100644 index 7514e1d9..00000000 --- a/web/dist/assets/Post.4d9d6f83.css +++ /dev/null @@ -1 +0,0 @@ -.reply-compose-wrap .reply-switch[data-v-3616e66c]{text-align:right;font-size:12px;margin:10px 0}.reply-compose-wrap .reply-switch .show[data-v-3616e66c]{color:#18a058;cursor:pointer}.reply-compose-wrap .reply-switch .hide[data-v-3616e66c]{opacity:.75;cursor:pointer}.reply-item[data-v-1e3df20d]{display:flex;flex-direction:column;font-size:12px;padding:8px;border-bottom:1px solid #f3f3f3}.reply-item .header-wrap[data-v-1e3df20d]{display:flex;align-items:center;justify-content:space-between}.reply-item .header-wrap .username[data-v-1e3df20d]{max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .header-wrap .username .reply-name[data-v-1e3df20d]{margin:0 3px;opacity:.75}.reply-item .header-wrap .timestamp[data-v-1e3df20d]{opacity:.75;text-align:right;display:flex;align-items:center;max-width:50%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-item .base-wrap[data-v-1e3df20d]{display:flex}.reply-item .base-wrap .content[data-v-1e3df20d]{width:calc(100% - 40px);margin-top:4px;font-size:12px;text-align:justify;line-height:2}.reply-item .base-wrap .reply-switch[data-v-1e3df20d]{width:40px;text-align:right;font-size:12px;margin:10px 0 0}.reply-item .base-wrap .reply-switch .show[data-v-1e3df20d]{color:#18a058;cursor:pointer}.reply-item .base-wrap .reply-switch .hide[data-v-1e3df20d]{opacity:.75;cursor:pointer}.dark .reply-item[data-v-1e3df20d]{border-bottom:1px solid #262628}.comment-item[data-v-6b2cb186]{width:100%;padding:16px;box-sizing:border-box}.comment-item .nickname-wrap[data-v-6b2cb186]{font-size:14px}.comment-item .username-wrap[data-v-6b2cb186]{font-size:14px;opacity:.75}.comment-item .opt-wrap[data-v-6b2cb186]{display:flex;align-items:center}.comment-item .opt-wrap .timestamp[data-v-6b2cb186]{opacity:.75;font-size:12px}.comment-item .opt-wrap .del-btn[data-v-6b2cb186]{margin-left:4px}.comment-item .comment-text[data-v-6b2cb186]{display:block;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.comment-item .opt-item[data-v-6b2cb186]{display:flex;align-items:center;opacity:.7}.comment-item .opt-item .opt-item-icon[data-v-6b2cb186]{margin-right:10px}.reply-wrap[data-v-6b2cb186]{margin-top:10px;border-radius:5px;background:#fafafc}.reply-wrap .reply-item[data-v-6b2cb186]:last-child{border-bottom:none}.dark .reply-wrap[data-v-6b2cb186]{background:#18181c}.compose-wrap[data-v-b1d2e9fe]{width:100%;padding:16px;box-sizing:border-box}.compose-wrap .compose-line[data-v-b1d2e9fe]{display:flex;flex-direction:row}.compose-wrap .compose-line .compose-user[data-v-b1d2e9fe]{width:42px;height:42px;display:flex;align-items:center}.compose-wrap .compose-line.compose-options[data-v-b1d2e9fe]{margin-top:6px;padding-left:42px;display:flex;justify-content:space-between}.compose-wrap .compose-line.compose-options .submit-wrap[data-v-b1d2e9fe]{display:flex;align-items:center}.compose-wrap .compose-line.compose-options .submit-wrap .cancel-btn[data-v-b1d2e9fe]{margin-right:8px}.compose-wrap .login-wrap[data-v-b1d2e9fe]{display:flex;justify-content:center;width:100%}.compose-wrap .login-wrap .login-banner[data-v-b1d2e9fe]{margin-bottom:12px;opacity:.8}.compose-wrap .login-wrap button[data-v-b1d2e9fe]{margin:0 4px}.attachment[data-v-b1d2e9fe]{display:flex;align-items:center}.attachment .text-statistic[data-v-b1d2e9fe]{margin-left:8px;width:18px;height:18px;transform:rotate(180deg)}.attachment-list-wrap[data-v-b1d2e9fe]{margin-top:12px;margin-left:42px}.attachment-list-wrap .n-upload-file-info__thumbnail[data-v-b1d2e9fe]{overflow:hidden}.detail-item{width:100%;padding:16px;box-sizing:border-box;background:#f7f9f9}.detail-item .nickname-wrap{font-size:14px}.detail-item .username-wrap{font-size:14px;opacity:.75}.detail-item .top-tag{transform:scale(.75)}.detail-item .options{opacity:.75}.detail-item .post-text{font-size:16px;text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.detail-item .opts-wrap{margin-top:20px}.detail-item .opts-wrap .opt-item{display:flex;align-items:center;opacity:.7}.detail-item .opts-wrap .opt-item .opt-item-icon{margin-right:10px}.detail-item .opts-wrap .opt-item.hover{cursor:pointer}.detail-item .n-thing .n-thing-avatar-header-wrapper{align-items:center}.detail-item .timestamp{opacity:.75;font-size:12px;margin-top:10px}.dark .detail-item{background:#18181c}.detail-wrap[data-v-41747510]{min-height:100px} diff --git a/web/dist/assets/Profile-38be829d.js b/web/dist/assets/Profile-38be829d.js new file mode 100644 index 00000000..0bbdf13e --- /dev/null +++ b/web/dist/assets/Profile-38be829d.js @@ -0,0 +1 @@ +import{_ as J,a as K}from"./post-item.vue_vue_type_style_index_0_lang-e2c8dabf.js";import{_ as W}from"./post-skeleton-ffa76165.js";import{_ as X}from"./main-nav.vue_vue_type_style_index_0_lang-be35896a.js";import{u as Y}from"./vuex-473b3783.js";import{b as Z}from"./vue-router-b8e3382f.js";import{B as g,_ as ee}from"./index-347d1d96.js";import{d as ae,r as u,j as te,w as se,c as i,V as n,_,Q as T,a1 as f,O as z,o as l,a as p,M as q,F as V,a4 as F}from"./@vue-e0e89260.js";import{F as oe,G as ne,o as le,f as re,g as ue,I as ie,H as ce}from"./naive-ui-62663ad7.js";import"./content-72d615e5.js";import"./@vicons-8f91201d.js";import"./paopao-video-player-aa5e8b3f.js";import"./formatTime-cdf4e6f1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const _e={class:"profile-baseinfo"},pe={class:"avatar"},me={class:"base-info"},ve={class:"username"},de={class:"uid"},ge={key:0,class:"skeleton-wrap"},he={key:1},fe={key:0,class:"empty-wrap"},ke={key:1},be={key:2},we={key:1,class:"pagination-wrap"},ye=ae({__name:"Profile",setup(Pe){const s=Y(),m=Z(),t=u(!1),o=u([]),h=u("post"),x=u(+m.query.p||1),B=u(1),S=u(1),$=u(1),C=u(1),a=u(+m.query.p||1),r=u(20),c=u(0),k=()=>{switch(h.value){case"post":b();break;case"comment":w();break;case"highlight":y();break;case"media":P();break;case"star":I();break}},b=()=>{t.value=!0,g({username:s.state.userInfo.username,style:"post",page:a.value,page_size:r.value}).then(e=>{t.value=!1,o.value=e.list||[],c.value=Math.ceil(e.pager.total_rows/r.value),window.scrollTo(0,0)}).catch(e=>{o.value=[],t.value=!1})},w=()=>{t.value=!0,g({username:s.state.userInfo.username,style:"comment",page:a.value,page_size:r.value}).then(e=>{t.value=!1,o.value=e.list||[],c.value=Math.ceil(e.pager.total_rows/r.value),window.scrollTo(0,0)}).catch(e=>{o.value=[],t.value=!1})},y=()=>{t.value=!0,g({username:s.state.userInfo.username,style:"highlight",page:a.value,page_size:r.value}).then(e=>{t.value=!1,o.value=e.list||[],c.value=Math.ceil(e.pager.total_rows/r.value),window.scrollTo(0,0)}).catch(e=>{o.value=[],t.value=!1})},P=()=>{t.value=!0,g({username:s.state.userInfo.username,style:"media",page:a.value,page_size:r.value}).then(e=>{t.value=!1,o.value=e.list||[],c.value=Math.ceil(e.pager.total_rows/r.value),window.scrollTo(0,0)}).catch(e=>{o.value=[],t.value=!1})},I=()=>{t.value=!0,g({username:s.state.userInfo.username,style:"star",page:a.value,page_size:r.value}).then(e=>{t.value=!1,o.value=e.list||[],c.value=Math.ceil(e.pager.total_rows/r.value),window.scrollTo(0,0)}).catch(e=>{o.value=[],t.value=!1})},N=e=>{switch(h.value=e,h.value){case"post":a.value=x.value,b();break;case"comment":a.value=B.value,w();break;case"highlight":a.value=S.value,y();break;case"media":a.value=$.value,P();break;case"star":a.value=C.value,I();break}},D=e=>{switch(a.value=e,h.value){case"post":x.value=e,b();break;case"comment":B.value=a.value,w();break;case"highlight":S.value=a.value,y();break;case"media":$.value=a.value,P();break;case"star":C.value=a.value,I();break}};return te(()=>{k()}),se(()=>({path:m.path,query:m.query,refresh:s.state.refresh}),(e,M)=>{if(e.refresh!==M.refresh){a.value=+m.query.p||1,setTimeout(()=>{k()},0);return}M.path!=="/post"&&e.path==="/profile"&&(a.value=+m.query.p||1,setTimeout(()=>{k()},0))}),(e,M)=>{const H=X,R=le,v=re,j=ue,E=W,G=ie,L=J,U=ce,O=K,Q=oe,A=ne;return l(),i("div",null,[n(H,{title:"主页"}),_(s).state.userInfo.id>0?(l(),T(Q,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{default:f(()=>[p("div",_e,[p("div",pe,[n(R,{size:"large",src:_(s).state.userInfo.avatar},null,8,["src"])]),p("div",me,[p("div",ve,[p("strong",null,q(_(s).state.userInfo.nickname),1),p("span",null," @"+q(_(s).state.userInfo.username),1)]),p("div",de,"UID. "+q(_(s).state.userInfo.id),1)])]),n(j,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":N},{default:f(()=>[n(v,{name:"post",tab:"泡泡"}),n(v,{name:"comment",tab:"评论"}),n(v,{name:"highlight",tab:"亮点"}),n(v,{name:"media",tab:"图文"}),n(v,{name:"star",tab:"喜欢"})]),_:1}),t.value?(l(),i("div",ge,[n(E,{num:r.value},null,8,["num"])])):(l(),i("div",he,[o.value.length===0?(l(),i("div",fe,[n(G,{size:"large",description:"暂无数据"})])):z("",!0),_(s).state.desktopModelShow?(l(),i("div",ke,[(l(!0),i(V,null,F(o.value,d=>(l(),T(U,{key:d.id},{default:f(()=>[n(L,{post:d},null,8,["post"])]),_:2},1024))),128))])):(l(),i("div",be,[(l(!0),i(V,null,F(o.value,d=>(l(),T(U,{key:d.id},{default:f(()=>[n(O,{post:d},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1})):z("",!0),c.value>0?(l(),i("div",we,[n(A,{page:a.value,"onUpdate:page":D,"page-slot":_(s).state.collapsedRight?5:8,"page-count":c.value},null,8,["page","page-slot","page-count"])])):z("",!0)])}}});const ea=ee(ye,[["__scopeId","data-v-08661398"]]);export{ea as default}; diff --git a/web/dist/assets/Profile-cc270bed.css b/web/dist/assets/Profile-cc270bed.css new file mode 100644 index 00000000..5ed80845 --- /dev/null +++ b/web/dist/assets/Profile-cc270bed.css @@ -0,0 +1 @@ +.profile-baseinfo[data-v-08661398]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-08661398]{width:55px}.profile-baseinfo .base-info[data-v-08661398]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-08661398]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-08661398]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-tabs-wrap[data-v-08661398]{padding:0 16px}.pagination-wrap[data-v-08661398]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-baseinfo[data-v-08661398]{background-color:#18181c}.dark .profile-wrap[data-v-08661398],.dark .pagination-wrap[data-v-08661398]{background-color:#101014bf} diff --git a/web/dist/assets/Profile.df0a7049.css b/web/dist/assets/Profile.df0a7049.css deleted file mode 100644 index df9fda0c..00000000 --- a/web/dist/assets/Profile.df0a7049.css +++ /dev/null @@ -1 +0,0 @@ -.profile-baseinfo[data-v-2fe5c266]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-2fe5c266]{width:55px}.profile-baseinfo .base-info[data-v-2fe5c266]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-2fe5c266]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-2fe5c266]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-tabs-wrap[data-v-2fe5c266]{padding:0 16px}.pagination-wrap[data-v-2fe5c266]{padding:10px;display:flex;justify-content:center;overflow:hidden} diff --git a/web/dist/assets/Profile.f583a607.js b/web/dist/assets/Profile.f583a607.js deleted file mode 100644 index 64c7a49b..00000000 --- a/web/dist/assets/Profile.f583a607.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as S}from"./post-item.11c28084.js";import{_ as U}from"./post-skeleton.38f0f247.js";import{_ as V}from"./main-nav.3167f221.js";import{ai as $,d as D,r as c,a2 as M,Y as o,a4 as e,a3 as _,a6 as h,a5 as r,a7 as d,aj as R,cc as j,W as t,Z as s,aa as f,ab as q,ac as F,$ as L,ae as T,c9 as W,ca as Y}from"./index.d4f5aad2.js";import{_ as Z}from"./List.a66e9ae7.js";import{_ as A}from"./Pagination.c13c2d34.js";import{a as G,_ as H}from"./Skeleton.e1c16fcb.js";import"./content.ed80294a.js";import"./formatTime.e07969bb.js";import"./Thing.d394adea.js";const J={class:"profile-baseinfo"},K={class:"avatar"},O={class:"base-info"},Q={class:"username"},X={class:"uid"},ee={key:0,class:"pagination-wrap"},te={key:0,class:"skeleton-wrap"},ae={key:1},se={key:0,class:"empty-wrap"},ne=D({__name:"Profile",setup(oe){const a=L(),k=R(),l=c(!1),u=c([]),i=c(+k.query.p||1),p=c(20),m=c(0),v=()=>{l.value=!0,j({username:a.state.userInfo.username,page:i.value,page_size:p.value}).then(n=>{l.value=!1,u.value=n.list,m.value=Math.ceil(n.pager.total_rows/p.value),window.scrollTo(0,0)}).catch(n=>{l.value=!1})},y=n=>{i.value=n,v()};return M(()=>{v()}),(n,_e)=>{const w=V,b=T,I=A,P=W,E=Y,x=U,B=G,C=S,z=H,N=Z;return t(),o("div",null,[e(w,{title:"\u4E3B\u9875"}),_(a).state.userInfo.id>0?(t(),h(N,{key:0,class:"main-content-wrap profile-wrap",bordered:""},{footer:r(()=>[m.value>1?(t(),o("div",ee,[e(I,{page:i.value,"onUpdate:page":y,"page-slot":_(a).state.collapsedRight?5:8,"page-count":m.value},null,8,["page","page-slot","page-count"])])):d("",!0)]),default:r(()=>[s("div",J,[s("div",K,[e(b,{size:"large",src:_(a).state.userInfo.avatar},null,8,["src"])]),s("div",O,[s("div",Q,[s("strong",null,f(_(a).state.userInfo.nickname),1),s("span",null," @"+f(_(a).state.userInfo.username),1)]),s("div",X,"UID. "+f(_(a).state.userInfo.id),1)])]),e(E,{class:"profile-tabs-wrap",animated:""},{default:r(()=>[e(P,{name:"post",tab:"\u6CE1\u6CE1"})]),_:1}),l.value?(t(),o("div",te,[e(x,{num:p.value},null,8,["num"])])):(t(),o("div",ae,[u.value.length===0?(t(),o("div",se,[e(B,{size:"large",description:"\u6682\u65E0\u6570\u636E"})])):d("",!0),(t(!0),o(q,null,F(u.value,g=>(t(),h(z,{key:g.id},{default:r(()=>[e(C,{post:g},null,8,["post"])]),_:2},1024))),128))]))]),_:1})):d("",!0)])}}});var ge=$(ne,[["__scopeId","data-v-2fe5c266"]]);export{ge as default}; diff --git a/web/dist/assets/Setting-31b9ee2e.js b/web/dist/assets/Setting-31b9ee2e.js new file mode 100644 index 00000000..b249f260 --- /dev/null +++ b/web/dist/assets/Setting-31b9ee2e.js @@ -0,0 +1 @@ +import{_ as we}from"./main-nav.vue_vue_type_style_index_0_lang-be35896a.js";import{d as ye,r as d,E as Z,j as ke,c as g,V as t,a1 as s,Q as b,O as _,o as r,a as m,_ as u,e as c,M as R,z as be,v as Ce,P as q,a2 as B,W as Ie,X as $e}from"./@vue-e0e89260.js";import{u as Pe}from"./vuex-473b3783.js";import{T as H,U as Ue,V as Se,W as Re,X as qe,Y as Be,Z as Ae,_ as ze}from"./index-347d1d96.js";import{R as Ne}from"./@vicons-8f91201d.js";import{h as Ke,o as xe,e as De,B as Fe,b as Ve,j as Te,S as je,$ as Ee,L as Oe,a0 as Le,a1 as Me,d as We}from"./naive-ui-62663ad7.js";import"./vue-router-b8e3382f.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const V=A=>(Ie("data-v-a681720e"),A=A(),$e(),A),Xe={class:"base-line avatar"},Ge={class:"base-line"},Je=V(()=>m("span",{class:"base-label"},"昵称",-1)),Qe={key:0},Ye={class:"base-line"},Ze=V(()=>m("span",{class:"base-label"},"用户名",-1)),He={key:0},et={key:1},tt=V(()=>m("br",null,null,-1)),at={key:2,class:"phone-bind-wrap"},st={class:"captcha-img-wrap"},nt={class:"captcha-img"},ot=["src"],lt={class:"form-submit-wrap"},rt={key:0},it={key:1},ut=V(()=>m("br",null,null,-1)),dt={key:2,class:"phone-bind-wrap"},ct={class:"captcha-img-wrap"},pt={class:"captcha-img"},_t=["src"],mt={class:"form-submit-wrap"},vt={key:1,class:"phone-bind-wrap"},ft={class:"form-submit-wrap"},gt=ye({__name:"Setting",setup(A){const ee="/v1/attachment",te="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),z=d("public/avatar"),$="true".toLowerCase()==="true",ae="false".toLowerCase()==="true",o=Pe(),P=d(!1),N=d(!1),K=d(!1),M=d(),W=d(),C=d(!1),x=d(!1),U=d(!1),S=d(!1),I=d(60),y=d(!1),k=d(!1),X=d(),G=d(),J=d(),Q=d(),a=Z({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),i=Z({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async n=>{var e,v;return z.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=n.file.file)==null?void 0:e.type)?(window.$message.warning("头像仅允许 png/jpg 格式"),!1):z.value==="image"&&((v=n.file.file)==null?void 0:v.size)>1048576?(window.$message.warning("头像大小不能超过1MB"),!1):!0},ne=({file:n,event:e})=>{var v;try{let f=JSON.parse((v=e.target)==null?void 0:v.response);f.code===0&&z.value==="public/avatar"&&Ue({avatar:f.data.content}).then(p=>{var D;window.$message.success("头像更新成功"),(D=M.value)==null||D.clear(),o.commit("updateUserinfo",{...o.state.userInfo,avatar:f.data.content})}).catch(p=>{console.log(p)})}catch{window.$message.error("上传失败")}},oe=(n,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,le=(n,e)=>e===a.password,re=()=>{var n;a.reenteredPassword&&((n=Q.value)==null||n.validate({trigger:"password-input"}))},ie=n=>{var e;n.preventDefault(),(e=J.value)==null||e.validate(v=>{v||(x.value=!0,Se({password:a.password,old_password:a.old_password}).then(f=>{x.value=!1,U.value=!1,window.$message.success("密码重置成功"),o.commit("userLogout"),o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")}).catch(f=>{x.value=!1}))})},ue=n=>{var e;n.preventDefault(),(e=X.value)==null||e.validate(v=>{v||(N.value=!0,Re({phone:a.phone,captcha:a.phone_captcha}).then(f=>{N.value=!1,y.value=!1,window.$message.success("绑定成功"),o.commit("updateUserinfo",{...o.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(f=>{N.value=!1}))})},de=n=>{var e;n.preventDefault(),(e=G.value)==null||e.validate(v=>{if(i.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,v||(K.value=!0,qe({activate_code:i.activate_code,captcha_id:i.id,imgCaptcha:i.imgCaptcha}).then(f=>{K.value=!1,k.value=!1,window.$message.success("激活成功"),o.commit("updateUserinfo",{...o.state.userInfo,activation:i.activate_code}),i.id="",i.b64s="",i.imgCaptcha="",i.activate_code=""}).catch(f=>{K.value=!1,f.code===20012&&j()}))})},T=()=>{H().then(n=>{a.id=n.id,a.b64s=n.b64s}).catch(n=>{console.log(n)})},j=()=>{H().then(n=>{i.id=n.id,i.b64s=n.b64s}).catch(n=>{console.log(n)})},ce=()=>{Be({nickname:o.state.userInfo.nickname||""}).then(n=>{C.value=!1,window.$message.success("昵称修改成功")}).catch(n=>{C.value=!0})},pe=()=>{if(!(I.value>0&&S.value)){if(a.imgCaptcha===""){window.$message.warning("请输入图片验证码");return}P.value=!0,Ae({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(n=>{S.value=!0,P.value=!1,window.$message.success("发送成功");let e=setInterval(()=>{I.value--,I.value===0&&(clearInterval(e),I.value=60,S.value=!1)},1e3)}).catch(n=>{P.value=!1,n.code===20012&&T(),console.log(n)})}},_e={phone:[{required:!0,message:"请输入手机号",trigger:["input"],validator:(n,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"请输入手机验证码"}]},me={activate_code:[{required:!0,message:"请输入激活码",trigger:["input"],validator:(n,e)=>/\d{6}$/.test(e)}]},ve={password:[{required:!0,message:"请输入新密码"}],old_password:[{required:!0,message:"请输入旧密码"}],reenteredPassword:[{required:!0,message:"请再次输入密码",trigger:["input","blur"]},{validator:oe,message:"两次密码输入不一致",trigger:"input"},{validator:le,message:"两次密码输入不一致",trigger:["blur","password-input"]}]},fe=()=>{C.value=!0,setTimeout(()=>{var n;(n=W.value)==null||n.focus()},30)};return ke(()=>{o.state.userInfo.id===0&&(o.commit("triggerAuth",!0),o.commit("triggerAuthKey","signin")),T(),j()}),(n,e)=>{const v=we,f=xe,p=De,D=Fe,h=Ve,ge=Te,F=Ke,Y=je,w=Ee,he=Oe,E=Le,O=Me,L=We;return r(),g("div",null,[t(v,{title:"设置",theme:""}),t(F,{title:"基本信息",size:"small",class:"setting-card"},{default:s(()=>[m("div",Xe,[t(f,{class:"avatar-img",size:80,src:u(o).state.userInfo.avatar},null,8,["src"]),!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),b(D,{key:0,ref_key:"avatarRef",ref:M,action:ee,headers:{Authorization:te},data:{type:z.value},onBeforeUpload:se,onFinish:ne},{default:s(()=>[t(p,{size:"small"},{default:s(()=>[c("更改头像")]),_:1})]),_:1},8,["headers","data"])):_("",!0)]),m("div",Ge,[Je,C.value?_("",!0):(r(),g("div",Qe,R(u(o).state.userInfo.nickname),1)),be(t(h,{ref_key:"inputInstRef",ref:W,class:"nickname-input",value:u(o).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=l=>u(o).state.userInfo.nickname=l),type:"text",size:"small",placeholder:"请输入昵称",onBlur:ce,maxlength:16},null,8,["value"]),[[Ce,C.value]]),!C.value&&(!$||$&&u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0&&u(o).state.userInfo.status==1)?(r(),b(p,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:fe},{icon:s(()=>[t(ge,null,{default:s(()=>[t(u(Ne))]),_:1})]),_:1})):_("",!0)]),m("div",Ye,[Ze,c(" @"+R(u(o).state.userInfo.username),1)])]),_:1}),$?(r(),b(F,{key:0,title:"手机号",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.phone&&u(o).state.userInfo.phone.length>0?(r(),g("div",He,[c(R(u(o).state.userInfo.phone)+" ",1),!y.value&&u(o).state.userInfo.status==1?(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=l=>y.value=!0)},{default:s(()=>[c(" 换绑手机 ")]),_:1})):_("",!0)])):(r(),g("div",et,[t(Y,{title:"手机绑定提示",type:"warning"},{default:s(()=>[c(" 成功绑定手机后,才能进行换头像、发动态、回复等交互~"),tt,y.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=l=>y.value=!0)}," 立即绑定 "))]),_:1})])),y.value?(r(),g("div",at,[t(L,{ref_key:"phoneFormRef",ref:X,model:a,rules:_e},{default:s(()=>[t(w,{path:"phone",label:"手机号"},{default:s(()=>[t(h,{value:a.phone,"onUpdate:value":e[3]||(e[3]=l=>a.phone=l.trim()),placeholder:"请输入中国大陆手机号",onKeydown:e[4]||(e[4]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",st,[t(h,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=l=>a.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",nt,[a.b64s?(r(),g("img",{key:0,src:a.b64s,onClick:T},null,8,ot)):_("",!0)])])]),_:1}),t(w,{path:"phone_captcha",label:"短信验证码"},{default:s(()=>[t(he,null,{default:s(()=>[t(h,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=l=>a.phone_captcha=l),placeholder:"请输入收到的短信验证码"},null,8,["value"]),t(p,{type:"primary",ghost:"",disabled:S.value,loading:P.value,onClick:pe},{default:s(()=>[c(R(I.value>0&&S.value?I.value+"s后重新发送":"发送验证码"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),t(O,{gutter:[0,24]},{default:s(()=>[t(E,{span:24},{default:s(()=>[m("div",lt,[t(p,{quaternary:"",round:"",onClick:e[7]||(e[7]=l=>y.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:N.value,onClick:ue},{default:s(()=>[c(" 绑定 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),ae?(r(),b(F,{key:1,title:"激活码",size:"small",class:"setting-card"},{default:s(()=>[u(o).state.userInfo.activation&&u(o).state.userInfo.activation.length>0?(r(),g("div",rt,[c(R(u(o).state.userInfo.activation)+" ",1),k.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=l=>k.value=!0)},{default:s(()=>[c(" 重新激活 ")]),_:1}))])):(r(),g("div",it,[t(Y,{title:"激活码激活提示",type:"warning"},{default:s(()=>[c(" 成功激活后后,才能发(公开/好友可见)动态、回复~"),ut,k.value?_("",!0):(r(),g("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=l=>k.value=!0)}," 立即激活 "))]),_:1})])),k.value?(r(),g("div",dt,[t(L,{ref_key:"activateFormRef",ref:G,model:i,rules:me},{default:s(()=>[t(w,{path:"activate_code",label:"激活码"},{default:s(()=>[t(h,{value:i.activate_code,"onUpdate:value":e[10]||(e[10]=l=>i.activate_code=l.trim()),placeholder:"请输入激活码",onKeydown:e[11]||(e[11]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"img_captcha",label:"图形验证码"},{default:s(()=>[m("div",ct,[t(h,{value:i.imgCaptcha,"onUpdate:value":e[12]||(e[12]=l=>i.imgCaptcha=l),placeholder:"请输入图形验证码后获取验证码"},null,8,["value"]),m("div",pt,[i.b64s?(r(),g("img",{key:0,src:i.b64s,onClick:j},null,8,_t)):_("",!0)])])]),_:1}),t(O,{gutter:[0,24]},{default:s(()=>[t(E,{span:24},{default:s(()=>[m("div",mt,[t(p,{quaternary:"",round:"",onClick:e[13]||(e[13]=l=>k.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:K.value,onClick:de},{default:s(()=>[c(" 激活 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})):_("",!0),t(F,{title:"账户安全",size:"small",class:"setting-card"},{default:s(()=>[c(" 您已设置密码 "),U.value?_("",!0):(r(),b(p,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=l=>U.value=!0)},{default:s(()=>[c(" 重置密码 ")]),_:1})),U.value?(r(),g("div",vt,[t(L,{ref_key:"formRef",ref:J,model:a,rules:ve},{default:s(()=>[t(w,{path:"old_password",label:"旧密码"},{default:s(()=>[t(h,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=l=>a.old_password=l),type:"password",placeholder:"请输入当前密码",onKeydown:e[16]||(e[16]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{path:"password",label:"新密码"},{default:s(()=>[t(h,{value:a.password,"onUpdate:value":e[17]||(e[17]=l=>a.password=l),type:"password",placeholder:"请输入新密码",onInput:re,onKeydown:e[18]||(e[18]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),t(w,{ref_key:"rPasswordFormItemRef",ref:Q,first:"",path:"reenteredPassword",label:"重复密码"},{default:s(()=>[t(h,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=l=>a.reenteredPassword=l),disabled:!a.password,type:"password",placeholder:"请再次输入密码",onKeydown:e[20]||(e[20]=q(B(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),t(O,{gutter:[0,24]},{default:s(()=>[t(E,{span:24},{default:s(()=>[m("div",ft,[t(p,{quaternary:"",round:"",onClick:e[21]||(e[21]=l=>U.value=!1)},{default:s(()=>[c(" 取消 ")]),_:1}),t(p,{secondary:"",round:"",type:"primary",loading:x.value,onClick:ie},{default:s(()=>[c(" 更新 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):_("",!0)]),_:1})])}}});const Tt=ze(gt,[["__scopeId","data-v-a681720e"]]);export{Tt as default}; diff --git a/web/dist/assets/Setting-bfd24152.css b/web/dist/assets/Setting-bfd24152.css new file mode 100644 index 00000000..04dbe4f6 --- /dev/null +++ b/web/dist/assets/Setting-bfd24152.css @@ -0,0 +1 @@ +.setting-card[data-v-a681720e]{margin-top:-1px;border-radius:0}.setting-card .form-submit-wrap[data-v-a681720e]{display:flex;justify-content:flex-end}.setting-card .base-line[data-v-a681720e]{line-height:2;display:flex;align-items:center}.setting-card .base-line .base-label[data-v-a681720e]{opacity:.75;margin-right:12px}.setting-card .base-line .nickname-input[data-v-a681720e]{margin-right:10px;width:120px}.setting-card .avatar[data-v-a681720e]{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:20px}.setting-card .avatar .avatar-img[data-v-a681720e]{margin-bottom:10px}.setting-card .hash-link[data-v-a681720e]{margin-left:12px}.setting-card .phone-bind-wrap[data-v-a681720e]{margin-top:20px}.setting-card .phone-bind-wrap .captcha-img-wrap[data-v-a681720e]{width:100%;display:flex;align-items:center}.setting-card .phone-bind-wrap .captcha-img[data-v-a681720e]{width:125px;height:34px;border-radius:3px;margin-left:10px;overflow:hidden;cursor:pointer}.setting-card .phone-bind-wrap .captcha-img img[data-v-a681720e]{width:100%;height:100%}.dark .setting-card[data-v-a681720e]{background-color:#101014bf} diff --git a/web/dist/assets/Setting.67d59ade.js b/web/dist/assets/Setting.67d59ade.js deleted file mode 100644 index 4f2495b4..00000000 --- a/web/dist/assets/Setting.67d59ade.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as Ce}from"./main-nav.3167f221.js";import{d as ae,W as l,Y as m,Z as d,ai as we,r as c,ci as ee,a2 as Be,af as De,a4 as u,a5 as t,a6 as B,a7 as v,$ as ye,cE as ue,aA as ke,a3 as i,a9 as p,aa as $,b4 as be,b5 as Ee,bu as P,cF as Ae,cG as Ie,cH as $e,cI as Pe,cJ as Ue,cK as Se,ae as Re,K as xe,_ as qe,cL as Ne,cM as Ke,cN as ze,cO as Me,a8 as U,bW as Le,bX as Oe}from"./index.d4f5aad2.js";import{c as Te}from"./Upload.6bcec76c.js";import{_ as Ve}from"./Alert.6cb9deb6.js";import{_ as je}from"./InputGroup.73d38f63.js";const We={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ge=d("g",{fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[d("path",{d:"M9 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-3"}),d("path",{d:"M9 15h3l8.5-8.5a1.5 1.5 0 0 0-3-3L9 12v3"}),d("path",{d:"M16 5l3 3"})],-1),He=[Ge];var Je=ae({name:"Edit",render:function(j,W){return l(),m("svg",We,He)}});const z=k=>(Le("data-v-6eb93a4d"),k=k(),Oe(),k),Xe={class:"base-line avatar"},Ye={class:"base-line"},Ze=z(()=>d("span",{class:"base-label"},"\u6635\u79F0",-1)),Qe={key:0},eu={class:"base-line"},uu=z(()=>d("span",{class:"base-label"},"\u7528\u6237\u540D",-1)),au={key:0},tu={key:1},su=z(()=>d("br",null,null,-1)),nu={key:2,class:"phone-bind-wrap"},ou={class:"captcha-img-wrap"},lu={class:"captcha-img"},ru=["src"],iu={class:"form-submit-wrap"},du={key:0},cu={key:1},pu=z(()=>d("br",null,null,-1)),_u={key:2,class:"phone-bind-wrap"},vu={class:"captcha-img-wrap"},mu={class:"captcha-img"},fu=["src"],hu={class:"form-submit-wrap"},gu={key:1,class:"phone-bind-wrap"},Fu={class:"form-submit-wrap"},Cu=ae({__name:"Setting",setup(k){const j="/v1/attachment",W="Bearer "+localStorage.getItem("PAOPAO_TOKEN"),S=c("public/avatar"),b="true".toLowerCase()==="true",te="false".toLowerCase()==="true",n=ye(),E=c(!1),R=c(!1),x=c(!1),G=c(),H=c(),D=c(!1),q=c(!1),A=c(!1),I=c(!1),y=c(60),C=c(!1),w=c(!1),J=c(),X=c(),Y=c(),Z=c(),a=ee({id:"",b64s:"",imgCaptcha:"",phone:"",phone_captcha:"",password:"",old_password:"",reenteredPassword:""}),r=ee({id:"",b64s:"",imgCaptcha:"",activate_code:""}),se=async s=>{var e,f;return S.value==="public/avatar"&&!["image/png","image/jpg","image/jpeg"].includes((e=s.file.file)==null?void 0:e.type)?(window.$message.warning("\u5934\u50CF\u4EC5\u5141\u8BB8 png/jpg \u683C\u5F0F"),!1):S.value==="image"&&((f=s.file.file)==null?void 0:f.size)>1048576?(window.$message.warning("\u5934\u50CF\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC71MB"),!1):!0},ne=({file:s,event:e})=>{var f;try{let h=JSON.parse((f=e.target)==null?void 0:f.response);h.code===0&&S.value==="public/avatar"&&Ae({avatar:h.data.content}).then(_=>{var N;window.$message.success("\u5934\u50CF\u66F4\u65B0\u6210\u529F"),(N=G.value)==null||N.clear(),n.commit("updateUserinfo",{...n.state.userInfo,avatar:h.data.content})}).catch(_=>{console.log(_)})}catch{window.$message.error("\u4E0A\u4F20\u5931\u8D25")}},oe=(s,e)=>!!a.password&&a.password.startsWith(e)&&a.password.length>=e.length,le=(s,e)=>e===a.password,re=()=>{var s;a.reenteredPassword&&((s=Z.value)==null||s.validate({trigger:"password-input"}))},ie=s=>{var e;s.preventDefault(),(e=Y.value)==null||e.validate(f=>{f||(q.value=!0,Ie({password:a.password,old_password:a.old_password}).then(h=>{q.value=!1,A.value=!1,window.$message.success("\u5BC6\u7801\u91CD\u7F6E\u6210\u529F"),n.commit("userLogout"),n.commit("triggerAuth",!0),n.commit("triggerAuthKey","signin")}).catch(h=>{q.value=!1}))})},de=s=>{var e;s.preventDefault(),(e=J.value)==null||e.validate(f=>{f||(R.value=!0,$e({phone:a.phone,captcha:a.phone_captcha}).then(h=>{R.value=!1,C.value=!1,window.$message.success("\u7ED1\u5B9A\u6210\u529F"),n.commit("updateUserinfo",{...n.state.userInfo,phone:a.phone}),a.id="",a.b64s="",a.imgCaptcha="",a.phone="",a.phone_captcha=""}).catch(h=>{R.value=!1}))})},ce=s=>{var e;s.preventDefault(),(e=X.value)==null||e.validate(f=>{if(r.imgCaptcha===""){window.$message.warning("\u8BF7\u8F93\u5165\u56FE\u7247\u9A8C\u8BC1\u7801");return}E.value=!0,f||(x.value=!0,Pe({activate_code:r.activate_code,captcha_id:r.id,imgCaptcha:r.imgCaptcha}).then(h=>{x.value=!1,w.value=!1,window.$message.success("\u6FC0\u6D3B\u6210\u529F"),n.commit("updateUserinfo",{...n.state.userInfo,activation:r.activate_code}),r.id="",r.b64s="",r.imgCaptcha="",r.activate_code=""}).catch(h=>{x.value=!1,h.code===20012&&L()}))})},M=()=>{ue().then(s=>{a.id=s.id,a.b64s=s.b64s}).catch(s=>{console.log(s)})},L=()=>{ue().then(s=>{r.id=s.id,r.b64s=s.b64s}).catch(s=>{console.log(s)})},pe=()=>{Ue({nickname:n.state.userInfo.nickname||""}).then(s=>{D.value=!1,window.$message.success("\u6635\u79F0\u4FEE\u6539\u6210\u529F")}).catch(s=>{D.value=!0})},_e=()=>{if(!(y.value>0&&I.value)){if(a.imgCaptcha===""){window.$message.warning("\u8BF7\u8F93\u5165\u56FE\u7247\u9A8C\u8BC1\u7801");return}E.value=!0,Se({phone:a.phone,img_captcha:a.imgCaptcha,img_captcha_id:a.id}).then(s=>{I.value=!0,E.value=!1,window.$message.success("\u53D1\u9001\u6210\u529F");let e=setInterval(()=>{y.value--,y.value===0&&(clearInterval(e),y.value=60,I.value=!1)},1e3)}).catch(s=>{E.value=!1,s.code===20012&&M(),console.log(s)})}},ve={phone:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",trigger:["input"],validator:(s,e)=>/^[1]+[3-9]{1}\d{9}$/.test(e)}],phone_captcha:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u9A8C\u8BC1\u7801"}]},me={activate_code:[{required:!0,message:"\u8BF7\u8F93\u5165\u6FC0\u6D3B\u7801",trigger:["input"],validator:(s,e)=>/\d{6}$/.test(e)}]},fe={password:[{required:!0,message:"\u8BF7\u8F93\u5165\u65B0\u5BC6\u7801"}],old_password:[{required:!0,message:"\u8BF7\u8F93\u5165\u65E7\u5BC6\u7801"}],reenteredPassword:[{required:!0,message:"\u8BF7\u518D\u6B21\u8F93\u5165\u5BC6\u7801",trigger:["input","blur"]},{validator:oe,message:"\u4E24\u6B21\u5BC6\u7801\u8F93\u5165\u4E0D\u4E00\u81F4",trigger:"input"},{validator:le,message:"\u4E24\u6B21\u5BC6\u7801\u8F93\u5165\u4E0D\u4E00\u81F4",trigger:["blur","password-input"]}]},he=()=>{D.value=!0,setTimeout(()=>{var s;(s=H.value)==null||s.focus()},30)};return Be(()=>{n.state.userInfo.id===0&&(n.commit("triggerAuth",!0),n.commit("triggerAuthKey","signin")),M(),L()}),(s,e)=>{const f=Ce,h=Re,_=xe,N=Te,g=qe,ge=De,K=ke,Q=Ve,F=Ne,Fe=je,O=Ke,T=ze,V=Me;return l(),m("div",null,[u(f,{title:"\u8BBE\u7F6E",theme:""}),u(K,{title:"\u57FA\u672C\u4FE1\u606F",size:"small",class:"setting-card"},{default:t(()=>[d("div",Xe,[u(h,{class:"avatar-img",size:80,src:i(n).state.userInfo.avatar},null,8,["src"]),!b||b&&i(n).state.userInfo.phone&&i(n).state.userInfo.phone.length>0?(l(),B(N,{key:0,ref_key:"avatarRef",ref:G,action:j,headers:{Authorization:W},data:{type:S.value},onBeforeUpload:se,onFinish:ne},{default:t(()=>[u(_,{size:"small"},{default:t(()=>[p("\u66F4\u6539\u5934\u50CF")]),_:1})]),_:1},8,["headers","data"])):v("",!0)]),d("div",Ye,[Ze,D.value?v("",!0):(l(),m("div",Qe,$(i(n).state.userInfo.nickname),1)),be(u(g,{ref_key:"inputInstRef",ref:H,class:"nickname-input",value:i(n).state.userInfo.nickname,"onUpdate:value":e[0]||(e[0]=o=>i(n).state.userInfo.nickname=o),type:"text",size:"small",placeholder:"\u8BF7\u8F93\u5165\u6635\u79F0",onBlur:pe,maxlength:16},null,8,["value"]),[[Ee,D.value]]),!D.value&&(!b||b&&i(n).state.userInfo.phone&&i(n).state.userInfo.phone.length>0&&i(n).state.userInfo.status==1)?(l(),B(_,{key:1,quaternary:"",round:"",type:"success",size:"small",onClick:he},{icon:t(()=>[u(ge,null,{default:t(()=>[u(i(Je))]),_:1})]),_:1})):v("",!0)]),d("div",eu,[uu,p(" @"+$(i(n).state.userInfo.username),1)])]),_:1}),b?(l(),B(K,{key:0,title:"\u624B\u673A\u53F7",size:"small",class:"setting-card"},{default:t(()=>[i(n).state.userInfo.phone&&i(n).state.userInfo.phone.length>0?(l(),m("div",au,[p($(i(n).state.userInfo.phone)+" ",1),!C.value&&i(n).state.userInfo.status==1?(l(),B(_,{key:0,quaternary:"",round:"",type:"success",onClick:e[1]||(e[1]=o=>C.value=!0)},{default:t(()=>[p(" \u6362\u7ED1\u624B\u673A ")]),_:1})):v("",!0)])):(l(),m("div",tu,[u(Q,{title:"\u624B\u673A\u7ED1\u5B9A\u63D0\u793A",type:"warning"},{default:t(()=>[p(" \u6210\u529F\u7ED1\u5B9A\u624B\u673A\u540E\uFF0C\u624D\u80FD\u8FDB\u884C\u6362\u5934\u50CF\u3001\u53D1\u52A8\u6001\u3001\u56DE\u590D\u7B49\u4EA4\u4E92~"),su,C.value?v("",!0):(l(),m("a",{key:0,class:"hash-link",onClick:e[2]||(e[2]=o=>C.value=!0)}," \u7ACB\u5373\u7ED1\u5B9A "))]),_:1})])),C.value?(l(),m("div",nu,[u(V,{ref_key:"phoneFormRef",ref:J,model:a,rules:ve},{default:t(()=>[u(F,{path:"phone",label:"\u624B\u673A\u53F7"},{default:t(()=>[u(g,{value:a.phone,"onUpdate:value":e[3]||(e[3]=o=>a.phone=o.trim()),placeholder:"\u8BF7\u8F93\u5165\u4E2D\u56FD\u5927\u9646\u624B\u673A\u53F7",onKeydown:e[4]||(e[4]=P(U(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),u(F,{path:"img_captcha",label:"\u56FE\u5F62\u9A8C\u8BC1\u7801"},{default:t(()=>[d("div",ou,[u(g,{value:a.imgCaptcha,"onUpdate:value":e[5]||(e[5]=o=>a.imgCaptcha=o),placeholder:"\u8BF7\u8F93\u5165\u56FE\u5F62\u9A8C\u8BC1\u7801\u540E\u83B7\u53D6\u9A8C\u8BC1\u7801"},null,8,["value"]),d("div",lu,[a.b64s?(l(),m("img",{key:0,src:a.b64s,onClick:M},null,8,ru)):v("",!0)])])]),_:1}),u(F,{path:"phone_captcha",label:"\u77ED\u4FE1\u9A8C\u8BC1\u7801"},{default:t(()=>[u(Fe,null,{default:t(()=>[u(g,{value:a.phone_captcha,"onUpdate:value":e[6]||(e[6]=o=>a.phone_captcha=o),placeholder:"\u8BF7\u8F93\u5165\u6536\u5230\u7684\u77ED\u4FE1\u9A8C\u8BC1\u7801"},null,8,["value"]),u(_,{type:"primary",ghost:"",disabled:I.value,loading:E.value,onClick:_e},{default:t(()=>[p($(y.value>0&&I.value?y.value+"s\u540E\u91CD\u65B0\u53D1\u9001":"\u53D1\u9001\u9A8C\u8BC1\u7801"),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1}),u(T,{gutter:[0,24]},{default:t(()=>[u(O,{span:24},{default:t(()=>[d("div",iu,[u(_,{quaternary:"",round:"",onClick:e[7]||(e[7]=o=>C.value=!1)},{default:t(()=>[p(" \u53D6\u6D88 ")]),_:1}),u(_,{secondary:"",round:"",type:"primary",loading:R.value,onClick:de},{default:t(()=>[p(" \u7ED1\u5B9A ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):v("",!0)]),_:1})):v("",!0),te?(l(),B(K,{key:1,title:"\u6FC0\u6D3B\u7801",size:"small",class:"setting-card"},{default:t(()=>[i(n).state.userInfo.activation&&i(n).state.userInfo.activation.length>0?(l(),m("div",du,[p($(i(n).state.userInfo.activation)+" ",1),w.value?v("",!0):(l(),B(_,{key:0,quaternary:"",round:"",type:"success",onClick:e[8]||(e[8]=o=>w.value=!0)},{default:t(()=>[p(" \u91CD\u65B0\u6FC0\u6D3B ")]),_:1}))])):(l(),m("div",cu,[u(Q,{title:"\u6FC0\u6D3B\u7801\u6FC0\u6D3B\u63D0\u793A",type:"warning"},{default:t(()=>[p(" \u6210\u529F\u6FC0\u6D3B\u540E\u540E\uFF0C\u624D\u80FD\u53D1\uFF08\u516C\u5F00/\u597D\u53CB\u53EF\u89C1\uFF09\u52A8\u6001\u3001\u56DE\u590D~"),pu,w.value?v("",!0):(l(),m("a",{key:0,class:"hash-link",onClick:e[9]||(e[9]=o=>w.value=!0)}," \u7ACB\u5373\u6FC0\u6D3B "))]),_:1})])),w.value?(l(),m("div",_u,[u(V,{ref_key:"activateFormRef",ref:X,model:r,rules:me},{default:t(()=>[u(F,{path:"activate_code",label:"\u6FC0\u6D3B\u7801"},{default:t(()=>[u(g,{value:r.activate_code,"onUpdate:value":e[10]||(e[10]=o=>r.activate_code=o.trim()),placeholder:"\u8BF7\u8F93\u5165\u6FC0\u6D3B\u7801",onKeydown:e[11]||(e[11]=P(U(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),u(F,{path:"img_captcha",label:"\u56FE\u5F62\u9A8C\u8BC1\u7801"},{default:t(()=>[d("div",vu,[u(g,{value:r.imgCaptcha,"onUpdate:value":e[12]||(e[12]=o=>r.imgCaptcha=o),placeholder:"\u8BF7\u8F93\u5165\u56FE\u5F62\u9A8C\u8BC1\u7801\u540E\u83B7\u53D6\u9A8C\u8BC1\u7801"},null,8,["value"]),d("div",mu,[r.b64s?(l(),m("img",{key:0,src:r.b64s,onClick:L},null,8,fu)):v("",!0)])])]),_:1}),u(T,{gutter:[0,24]},{default:t(()=>[u(O,{span:24},{default:t(()=>[d("div",hu,[u(_,{quaternary:"",round:"",onClick:e[13]||(e[13]=o=>w.value=!1)},{default:t(()=>[p(" \u53D6\u6D88 ")]),_:1}),u(_,{secondary:"",round:"",type:"primary",loading:x.value,onClick:ce},{default:t(()=>[p(" \u6FC0\u6D3B ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):v("",!0)]),_:1})):v("",!0),u(K,{title:"\u8D26\u6237\u5B89\u5168",size:"small",class:"setting-card"},{default:t(()=>[p(" \u60A8\u5DF2\u8BBE\u7F6E\u5BC6\u7801 "),A.value?v("",!0):(l(),B(_,{key:0,quaternary:"",round:"",type:"success",onClick:e[14]||(e[14]=o=>A.value=!0)},{default:t(()=>[p(" \u91CD\u7F6E\u5BC6\u7801 ")]),_:1})),A.value?(l(),m("div",gu,[u(V,{ref_key:"formRef",ref:Y,model:a,rules:fe},{default:t(()=>[u(F,{path:"old_password",label:"\u65E7\u5BC6\u7801"},{default:t(()=>[u(g,{value:a.old_password,"onUpdate:value":e[15]||(e[15]=o=>a.old_password=o),type:"password",placeholder:"\u8BF7\u8F93\u5165\u5F53\u524D\u5BC6\u7801",onKeydown:e[16]||(e[16]=P(U(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),u(F,{path:"password",label:"\u65B0\u5BC6\u7801"},{default:t(()=>[u(g,{value:a.password,"onUpdate:value":e[17]||(e[17]=o=>a.password=o),type:"password",placeholder:"\u8BF7\u8F93\u5165\u65B0\u5BC6\u7801",onInput:re,onKeydown:e[18]||(e[18]=P(U(()=>{},["prevent"]),["enter"]))},null,8,["value"])]),_:1}),u(F,{ref_key:"rPasswordFormItemRef",ref:Z,first:"",path:"reenteredPassword",label:"\u91CD\u590D\u5BC6\u7801"},{default:t(()=>[u(g,{value:a.reenteredPassword,"onUpdate:value":e[19]||(e[19]=o=>a.reenteredPassword=o),disabled:!a.password,type:"password",placeholder:"\u8BF7\u518D\u6B21\u8F93\u5165\u5BC6\u7801",onKeydown:e[20]||(e[20]=P(U(()=>{},["prevent"]),["enter"]))},null,8,["value","disabled"])]),_:1},512),u(T,{gutter:[0,24]},{default:t(()=>[u(O,{span:24},{default:t(()=>[d("div",Fu,[u(_,{quaternary:"",round:"",onClick:e[21]||(e[21]=o=>A.value=!1)},{default:t(()=>[p(" \u53D6\u6D88 ")]),_:1}),u(_,{secondary:"",round:"",type:"primary",loading:q.value,onClick:ie},{default:t(()=>[p(" \u66F4\u65B0 ")]),_:1},8,["loading"])])]),_:1})]),_:1})]),_:1},8,["model"])])):v("",!0)]),_:1})])}}});var bu=we(Cu,[["__scopeId","data-v-6eb93a4d"]]);export{bu as default}; diff --git a/web/dist/assets/Setting.a66de7b5.css b/web/dist/assets/Setting.a66de7b5.css deleted file mode 100644 index f13fdbc0..00000000 --- a/web/dist/assets/Setting.a66de7b5.css +++ /dev/null @@ -1 +0,0 @@ -.setting-card[data-v-6eb93a4d]{margin-top:-1px;border-radius:0}.setting-card .form-submit-wrap[data-v-6eb93a4d]{display:flex;justify-content:flex-end}.setting-card .base-line[data-v-6eb93a4d]{line-height:2;display:flex;align-items:center}.setting-card .base-line .base-label[data-v-6eb93a4d]{opacity:.75;margin-right:12px}.setting-card .base-line .nickname-input[data-v-6eb93a4d]{margin-right:10px;width:120px}.setting-card .avatar[data-v-6eb93a4d]{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:20px}.setting-card .avatar .avatar-img[data-v-6eb93a4d]{margin-bottom:10px}.setting-card .hash-link[data-v-6eb93a4d]{margin-left:12px}.setting-card .phone-bind-wrap[data-v-6eb93a4d]{margin-top:20px}.setting-card .phone-bind-wrap .captcha-img-wrap[data-v-6eb93a4d]{width:100%;display:flex;align-items:center}.setting-card .phone-bind-wrap .captcha-img[data-v-6eb93a4d]{width:125px;height:34px;border-radius:3px;margin-left:10px;overflow:hidden;cursor:pointer}.setting-card .phone-bind-wrap .captcha-img img[data-v-6eb93a4d]{width:100%;height:100%} diff --git a/web/dist/assets/Skeleton.e1c16fcb.js b/web/dist/assets/Skeleton.e1c16fcb.js deleted file mode 100644 index 3be1dbc2..00000000 --- a/web/dist/assets/Skeleton.e1c16fcb.js +++ /dev/null @@ -1,147 +0,0 @@ -import{ba as je,d as O,aE as De,aF as Ae,a2 as se,bb as Ke,bc as We,y as T,r as $,v as Y,aw as re,av as K,h as d,bd as ye,be as de,aH as ne,bf as Ge,bg as ce,as as xe,c as L,f as V,b as j,u as we,x as W,bh as qe,J as Ue,q as Z,bi as Xe,z as D,A as Se,N as ze,bj as ae,aJ as Re,b3 as Ye,e as A,a as Ze,aX as Je,t as H,bk as Qe,bl as et,S as ue,V as tt,bm as oe,p as fe,bn as nt,B as ot,az as it,bo as lt,L as rt,aS as ve,bp as st,k as at,ab as dt}from"./index.d4f5aad2.js";import{l as ct}from"./List.a66e9ae7.js";function ie(e){const t=e.filter(o=>o!==void 0);if(t.length!==0)return t.length===1?t[0]:o=>{e.forEach(s=>{s&&s(o)})}}let he=!1;function ut(){if(!!je&&!!window.CSS&&!he&&(he=!0,"registerProperty"in(window==null?void 0:window.CSS)))try{CSS.registerProperty({name:"--n-color-start",syntax:"",inherits:!1,initialValue:"#0000"}),CSS.registerProperty({name:"--n-color-end",syntax:"",inherits:!1,initialValue:"#0000"})}catch{}}function me(e){return e&-e}class ft{constructor(t,o){this.l=t,this.min=o;const s=new Array(t+1);for(let r=0;rr)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let a=t*s;for(;t>0;)a+=o[t],t-=me(t);return a}getBound(t){let o=0,s=this.l;for(;s>o;){const r=Math.floor((o+s)/2),a=this.sum(r);if(a>t){s=r;continue}else if(a[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const t=De();ht.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Ae,ssr:t}),se(()=>{const{defaultScrollIndex:i,defaultScrollKey:c}=e;i!=null?h({index:i}):c!=null&&h({key:c})});let o=!1,s=!1;Ke(()=>{if(o=!1,!s){s=!0;return}h({top:m.value,left:f})}),We(()=>{o=!0,s||(s=!0)});const r=T(()=>{const i=new Map,{keyField:c}=e;return e.items.forEach((g,k)=>{i.set(g[c],k)}),i}),a=$(null),u=$(void 0),v=new Map,R=T(()=>{const{items:i,itemSize:c,keyField:g}=e,k=new ft(i.length,c);return i.forEach((C,P)=>{const p=C[g],_=v.get(p);_!==void 0&&k.add(P,_)}),k}),b=$(0);let f=0;const m=$(0),z=Y(()=>Math.max(R.value.getBound(m.value-re(e.paddingTop))-1,0)),F=T(()=>{const{value:i}=u;if(i===void 0)return[];const{items:c,itemSize:g}=e,k=z.value,C=Math.min(k+Math.ceil(i/g+1),c.length-1),P=[];for(let p=k;p<=C;++p)P.push(c[p]);return P}),h=(i,c)=>{if(typeof i=="number"){x(i,c,"auto");return}const{left:g,top:k,index:C,key:P,position:p,behavior:_,debounce:n=!0}=i;if(g!==void 0||k!==void 0)x(g,k,_);else if(C!==void 0)S(C,_,n);else if(P!==void 0){const l=r.value.get(P);l!==void 0&&S(l,_,n)}else p==="bottom"?x(0,Number.MAX_SAFE_INTEGER,_):p==="top"&&x(0,0,_)};let y,M=null;function S(i,c,g){const{value:k}=R,C=k.sum(i)+re(e.paddingTop);if(!g)a.value.scrollTo({left:0,top:C,behavior:c});else{y=i,M!==null&&window.clearTimeout(M),M=window.setTimeout(()=>{y=void 0,M=null},16);const{scrollTop:P,offsetHeight:p}=a.value;if(C>P){const _=k.get(i);C+_<=P+p||a.value.scrollTo({left:0,top:C+_-p,behavior:c})}else a.value.scrollTo({left:0,top:C,behavior:c})}}function x(i,c,g){a.value.scrollTo({left:i,top:c,behavior:g})}function I(i,c){var g,k,C;if(o||e.ignoreItemResize||U(c.target))return;const{value:P}=R,p=r.value.get(i),_=P.get(p),n=(C=(k=(g=c.borderBoxSize)===null||g===void 0?void 0:g[0])===null||k===void 0?void 0:k.blockSize)!==null&&C!==void 0?C:c.contentRect.height;if(n===_)return;n-e.itemSize===0?v.delete(i):v.set(i,n-e.itemSize);const w=n-_;if(w===0)return;P.add(p,w);const N=a.value;if(N!=null){if(y===void 0){const q=P.sum(p);N.scrollTop>q&&N.scrollBy(0,w)}else if(pN.scrollTop+N.offsetHeight&&N.scrollBy(0,w)}G()}b.value++}const B=!vt();let E=!1;function J(i){var c;(c=e.onScroll)===null||c===void 0||c.call(e,i),(!B||!E)&&G()}function Q(i){var c;if((c=e.onWheel)===null||c===void 0||c.call(e,i),B){const g=a.value;if(g!=null){if(i.deltaX===0&&(g.scrollTop===0&&i.deltaY<=0||g.scrollTop+g.offsetHeight>=g.scrollHeight&&i.deltaY>=0))return;i.preventDefault(),g.scrollTop+=i.deltaY/ge(),g.scrollLeft+=i.deltaX/ge(),G(),E=!0,Ge(()=>{E=!1})}}}function ee(i){if(o||U(i.target)||i.contentRect.height===u.value)return;u.value=i.contentRect.height;const{onResize:c}=e;c!==void 0&&c(i)}function G(){const{value:i}=a;i!=null&&(m.value=i.scrollTop,f=i.scrollLeft)}function U(i){let c=i;for(;c!==null;){if(c.style.display==="none")return!0;c=c.parentElement}return!1}return{listHeight:u,listStyle:{overflow:"auto"},keyToIndex:r,itemsStyle:T(()=>{const{itemResizable:i}=e,c=K(R.value.sum());return b.value,[e.itemsStyle,{boxSizing:"content-box",height:i?"":c,minHeight:i?c:"",paddingTop:K(e.paddingTop),paddingBottom:K(e.paddingBottom)}]}),visibleItemsStyle:T(()=>(b.value,{transform:`translateY(${K(R.value.sum(z.value))})`})),viewportItems:F,listElRef:a,itemsElRef:$(null),scrollTo:h,handleListResize:ee,handleListScroll:J,handleListWheel:Q,handleItemResize:I}},render(){const{itemResizable:e,keyField:t,keyToIndex:o,visibleItemsTag:s}=this;return d(de,{onResize:this.handleListResize},{default:()=>{var r,a;return d("div",ye(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?d("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[d(s,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>this.viewportItems.map(u=>{const v=u[t],R=o.get(v),b=this.$slots.default({item:u,index:R})[0];return e?d(de,{key:v,onResize:f=>this.handleItemResize(v,f)},{default:()=>b}):(b.key=v,b)})})]):(a=(r=this.$slots).empty)===null||a===void 0?void 0:a.call(r)])}})}});function gt(e,t){t&&(se(()=>{const{value:o}=e;o&&ce.registerHandler(o,t)}),xe(()=>{const{value:o}=e;o&&ce.unregisterHandler(o)}))}var pt=O({name:"Checkmark",render(){return d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},d("g",{fill:"none"},d("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),bt=O({name:"Empty",render(){return d("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),d("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),yt=O({props:{onFocus:Function,onBlur:Function},setup(e){return()=>d("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}}),xt=L("empty",` - display: flex; - flex-direction: column; - align-items: center; - font-size: var(--n-font-size); -`,[V("icon",` - width: var(--n-icon-size); - height: var(--n-icon-size); - font-size: var(--n-icon-size); - line-height: var(--n-icon-size); - color: var(--n-icon-color); - transition: - color .3s var(--n-bezier); - `,[j("+",[V("description",` - margin-top: 8px; - `)])]),V("description",` - transition: color .3s var(--n-bezier); - color: var(--n-text-color); - `),V("extra",` - text-align: center; - transition: color .3s var(--n-bezier); - margin-top: 12px; - color: var(--n-extra-text-color); - `)]);const wt=Object.assign(Object.assign({},W.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function});var St=O({name:"Empty",props:wt,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:o}=we(e),s=W("Empty","-empty",xt,qe,e,t),{localeRef:r}=Ue("Empty"),a=Z(Xe,null),u=T(()=>{var f,m,z;return(f=e.description)!==null&&f!==void 0?f:(z=(m=a==null?void 0:a.mergedComponentPropsRef.value)===null||m===void 0?void 0:m.Empty)===null||z===void 0?void 0:z.description}),v=T(()=>{var f,m;return((m=(f=a==null?void 0:a.mergedComponentPropsRef.value)===null||f===void 0?void 0:f.Empty)===null||m===void 0?void 0:m.renderIcon)||(()=>d(bt,null))}),R=T(()=>{const{size:f}=e,{common:{cubicBezierEaseInOut:m},self:{[D("iconSize",f)]:z,[D("fontSize",f)]:F,textColor:h,iconColor:y,extraTextColor:M}}=s.value;return{"--n-icon-size":z,"--n-font-size":F,"--n-bezier":m,"--n-text-color":h,"--n-icon-color":y,"--n-extra-text-color":M}}),b=o?Se("empty",T(()=>{let f="";const{size:m}=e;return f+=m[0],f}),R,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:v,localizedDescription:T(()=>u.value||r.value.description),cssVars:o?void 0:R,themeClass:b==null?void 0:b.themeClass,onRender:b==null?void 0:b.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:o}=this;return o==null||o(),d("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?d("div",{class:`${t}-empty__icon`},e.icon?e.icon():d(ze,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?d("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?d("div",{class:`${t}-empty__extra`},e.extra()):null)}});function zt(e,t){return d(Ye,{name:"fade-in-scale-up-transition"},{default:()=>e?d(ze,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>d(pt)}):null})}var pe=O({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:t,pendingTmNodeRef:o,multipleRef:s,valueSetRef:r,renderLabelRef:a,renderOptionRef:u,labelFieldRef:v,valueFieldRef:R,showCheckmarkRef:b,nodePropsRef:f,handleOptionClick:m,handleOptionMouseEnter:z}=Z(ae),F=Y(()=>{const{value:S}=o;return S?e.tmNode.key===S.key:!1});function h(S){const{tmNode:x}=e;x.disabled||m(S,x)}function y(S){const{tmNode:x}=e;x.disabled||z(S,x)}function M(S){const{tmNode:x}=e,{value:I}=F;x.disabled||I||z(S,x)}return{multiple:s,isGrouped:Y(()=>{const{tmNode:S}=e,{parent:x}=S;return x&&x.rawNode.type==="group"}),showCheckmark:b,nodeProps:f,isPending:F,isSelected:Y(()=>{const{value:S}=t,{value:x}=s;if(S===null)return!1;const I=e.tmNode.rawNode[R.value];if(x){const{value:B}=r;return B.has(I)}else return S===I}),labelField:v,renderLabel:a,renderOption:u,handleMouseMove:M,handleMouseEnter:y,handleClick:h}},render(){const{clsPrefix:e,tmNode:{rawNode:t},isSelected:o,isPending:s,isGrouped:r,showCheckmark:a,nodeProps:u,renderOption:v,renderLabel:R,handleClick:b,handleMouseEnter:f,handleMouseMove:m}=this,z=zt(o,e),F=R?[R(t,o),a&&z]:[Re(t[this.labelField],t,o),a&&z],h=u==null?void 0:u(t),y=d("div",Object.assign({},h,{class:[`${e}-base-select-option`,t.class,h==null?void 0:h.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:o,[`${e}-base-select-option--grouped`]:r,[`${e}-base-select-option--pending`]:s,[`${e}-base-select-option--show-checkmark`]:a}],style:[(h==null?void 0:h.style)||"",t.style||""],onClick:ie([b,h==null?void 0:h.onClick]),onMouseenter:ie([f,h==null?void 0:h.onMouseenter]),onMousemove:ie([m,h==null?void 0:h.onMousemove])}),d("div",{class:`${e}-base-select-option__content`},F));return t.render?t.render({node:y,option:t,selected:o}):v?v({node:y,option:t,selected:o}):y}}),be=O({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:o,nodePropsRef:s}=Z(ae);return{labelField:o,nodeProps:s,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:o,nodeProps:s,tmNode:{rawNode:r}}=this,a=s==null?void 0:s(r),u=t?t(r,!1):Re(r[this.labelField],r,!1),v=d("div",Object.assign({},a,{class:[`${e}-base-select-group-header`,a==null?void 0:a.class]}),u);return r.render?r.render({node:v,option:r}):o?o({node:v,option:r,selected:!1}):v}}),Rt=L("base-select-menu",` - line-height: 1.5; - outline: none; - z-index: 0; - position: relative; - border-radius: var(--n-border-radius); - transition: - background-color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier); - background-color: var(--n-color); -`,[L("scrollbar",` - max-height: var(--n-height); - `),L("virtual-list",` - max-height: var(--n-height); - `),L("base-select-option",` - min-height: var(--n-option-height); - font-size: var(--n-option-font-size); - display: flex; - align-items: center; - `,[V("content",` - z-index: 1; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - `)]),L("base-select-group-header",` - min-height: var(--n-option-height); - font-size: .93em; - display: flex; - align-items: center; - `),L("base-select-menu-option-wrapper",` - position: relative; - width: 100%; - `),V("loading, empty",` - display: flex; - padding: 12px 32px; - flex: 1; - justify-content: center; - `),V("loading",` - color: var(--n-loading-color); - font-size: var(--n-loading-size); - `),V("action",` - padding: 8px var(--n-option-padding-left); - font-size: var(--n-option-font-size); - transition: - color .3s var(--n-bezier), - border-color .3s var(--n-bezier); - border-top: 1px solid var(--n-action-divider-color); - color: var(--n-action-text-color); - `),L("base-select-group-header",` - position: relative; - cursor: default; - padding: var(--n-option-padding); - color: var(--n-group-header-text-color); - `),L("base-select-option",` - cursor: pointer; - position: relative; - padding: var(--n-option-padding); - transition: - color .3s var(--n-bezier), - opacity .3s var(--n-bezier); - box-sizing: border-box; - color: var(--n-option-text-color); - opacity: 1; - `,[A("show-checkmark",` - padding-right: calc(var(--n-option-padding-right) + 20px); - `),j("&::before",` - content: ""; - position: absolute; - left: 4px; - right: 4px; - top: 0; - bottom: 0; - border-radius: var(--n-border-radius); - transition: background-color .3s var(--n-bezier); - `),j("&:active",` - color: var(--n-option-text-color-pressed); - `),A("grouped",` - padding-left: calc(var(--n-option-padding-left) * 1.5); - `),A("pending",[j("&::before",` - background-color: var(--n-option-color-pending); - `)]),A("selected",` - color: var(--n-option-text-color-active); - `,[j("&::before",` - background-color: var(--n-option-color-active); - `),A("pending",[j("&::before",` - background-color: var(--n-option-color-active-pending); - `)])]),A("disabled",` - cursor: not-allowed; - `,[Ze("selected",` - color: var(--n-option-text-color-disabled); - `),A("selected",` - opacity: var(--n-option-opacity-disabled); - `)]),V("check",` - font-size: 16px; - position: absolute; - right: calc(var(--n-option-padding-right) - 4px); - top: calc(50% - 7px); - color: var(--n-option-check-color); - transition: color .3s var(--n-bezier); - `,[Je({enterScale:"0.5"})])])]),Nt=O({name:"InternalSelectMenu",props:Object.assign(Object.assign({},W.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const t=W("InternalSelectMenu","-internal-select-menu",Rt,Qe,e,H(e,"clsPrefix")),o=$(null),s=$(null),r=$(null),a=T(()=>e.treeMate.getFlattenedNodes()),u=T(()=>et(a.value)),v=$(null);function R(){const{treeMate:n}=e;let l=null;const{value:w}=e;w===null?l=n.getFirstAvailableNode():(e.multiple?l=n.getNode((w||[])[(w||[]).length-1]):l=n.getNode(w),(!l||l.disabled)&&(l=n.getFirstAvailableNode())),i(l||null)}function b(){const{value:n}=v;n&&!e.treeMate.getNode(n.key)&&(v.value=null)}let f;ue(()=>e.show,n=>{n?f=ue(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?R():b(),tt(c)):b()},{immediate:!0}):f==null||f()},{immediate:!0}),xe(()=>{f==null||f()});const m=T(()=>re(t.value.self[D("optionHeight",e.size)])),z=T(()=>oe(t.value.self[D("padding",e.size)])),F=T(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),h=T(()=>{const n=a.value;return n&&n.length===0});function y(n){const{onToggle:l}=e;l&&l(n)}function M(n){const{onScroll:l}=e;l&&l(n)}function S(n){var l;(l=r.value)===null||l===void 0||l.sync(),M(n)}function x(){var n;(n=r.value)===null||n===void 0||n.sync()}function I(){const{value:n}=v;return n||null}function B(n,l){l.disabled||i(l,!1)}function E(n,l){l.disabled||y(l)}function J(n){var l;ve(n,"action")||(l=e.onKeyup)===null||l===void 0||l.call(e,n)}function Q(n){var l;ve(n,"action")||(l=e.onKeydown)===null||l===void 0||l.call(e,n)}function ee(n){var l;(l=e.onMousedown)===null||l===void 0||l.call(e,n),!e.focusable&&n.preventDefault()}function G(){const{value:n}=v;n&&i(n.getNext({loop:!0}),!0)}function U(){const{value:n}=v;n&&i(n.getPrev({loop:!0}),!0)}function i(n,l=!1){v.value=n,l&&c()}function c(){var n,l;const w=v.value;if(!w)return;const N=u.value(w.key);N!==null&&(e.virtualScroll?(n=s.value)===null||n===void 0||n.scrollTo({index:N}):(l=r.value)===null||l===void 0||l.scrollTo({index:N,elSize:m.value}))}function g(n){var l,w;!((l=o.value)===null||l===void 0)&&l.contains(n.target)&&((w=e.onFocus)===null||w===void 0||w.call(e,n))}function k(n){var l,w;!((l=o.value)===null||l===void 0)&&l.contains(n.relatedTarget)||(w=e.onBlur)===null||w===void 0||w.call(e,n)}fe(ae,{handleOptionMouseEnter:B,handleOptionClick:E,valueSetRef:F,pendingTmNodeRef:v,nodePropsRef:H(e,"nodeProps"),showCheckmarkRef:H(e,"showCheckmark"),multipleRef:H(e,"multiple"),valueRef:H(e,"value"),renderLabelRef:H(e,"renderLabel"),renderOptionRef:H(e,"renderOption"),labelFieldRef:H(e,"labelField"),valueFieldRef:H(e,"valueField")}),fe(nt,o),se(()=>{const{value:n}=r;n&&n.sync()});const C=T(()=>{const{size:n}=e,{common:{cubicBezierEaseInOut:l},self:{height:w,borderRadius:N,color:q,groupHeaderTextColor:ke,actionDividerColor:Ce,optionTextColorPressed:Te,optionTextColor:Pe,optionTextColorDisabled:_e,optionTextColorActive:Me,optionOpacityDisabled:Ne,optionCheckColor:Fe,actionTextColor:Ie,optionColorPending:Be,optionColorActive:Le,loadingColor:Oe,loadingSize:Ee,optionColorActivePending:He,[D("optionFontSize",n)]:$e,[D("optionHeight",n)]:Ve,[D("optionPadding",n)]:te}}=t.value;return{"--n-height":w,"--n-action-divider-color":Ce,"--n-action-text-color":Ie,"--n-bezier":l,"--n-border-radius":N,"--n-color":q,"--n-option-font-size":$e,"--n-group-header-text-color":ke,"--n-option-check-color":Fe,"--n-option-color-pending":Be,"--n-option-color-active":Le,"--n-option-color-active-pending":He,"--n-option-height":Ve,"--n-option-opacity-disabled":Ne,"--n-option-text-color":Pe,"--n-option-text-color-active":Me,"--n-option-text-color-disabled":_e,"--n-option-text-color-pressed":Te,"--n-option-padding":te,"--n-option-padding-left":oe(te,"left"),"--n-option-padding-right":oe(te,"right"),"--n-loading-color":Oe,"--n-loading-size":Ee}}),{inlineThemeDisabled:P}=e,p=P?Se("internal-select-menu",T(()=>e.size[0]),C,e):void 0,_={selfRef:o,next:G,prev:U,getPendingTmNode:I};return gt(o,e.onResize),Object.assign({mergedTheme:t,virtualListRef:s,scrollbarRef:r,itemSize:m,padding:z,flattenedNodes:a,empty:h,virtualListContainer(){const{value:n}=s;return n==null?void 0:n.listElRef},virtualListContent(){const{value:n}=s;return n==null?void 0:n.itemsElRef},doScroll:M,handleFocusin:g,handleFocusout:k,handleKeyUp:J,handleKeyDown:Q,handleMouseDown:ee,handleVirtualListResize:x,handleVirtualListScroll:S,cssVars:P?void 0:C,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender},_)},render(){const{$slots:e,virtualScroll:t,clsPrefix:o,mergedTheme:s,themeClass:r,onRender:a}=this;return a==null||a(),d("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${o}-base-select-menu`,r,this.multiple&&`${o}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},this.loading?d("div",{class:`${o}-base-select-menu__loading`},d(it,{clsPrefix:o,strokeWidth:20})):this.empty?d("div",{class:`${o}-base-select-menu__empty`,"data-empty":!0},rt(e.empty,()=>[d(St,{theme:s.peers.Empty,themeOverrides:s.peerOverrides.Empty})])):d(lt,{ref:"scrollbarRef",theme:s.peers.Scrollbar,themeOverrides:s.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},{default:()=>t?d(mt,{ref:"virtualListRef",class:`${o}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:u})=>u.isGroup?d(be,{key:u.key,clsPrefix:o,tmNode:u}):u.ignored?null:d(pe,{clsPrefix:o,key:u.key,tmNode:u})}):d("div",{class:`${o}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(u=>u.isGroup?d(be,{key:u.key,clsPrefix:o,tmNode:u}):d(pe,{clsPrefix:o,key:u.key,tmNode:u})))}),ot(e.action,u=>u&&[d("div",{class:`${o}-base-select-menu__action`,"data-action":!0,key:"action"},u),d(yt,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),Ft=O({name:"ListItem",setup(){const e=Z(ct,null);return e||st("list-item","`n-list-item` must be placed in `n-list`."),{showDivider:e.showDividerRef,mergedClsPrefix:e.mergedClsPrefixRef}},render(){const{$slots:e,mergedClsPrefix:t}=this;return d("li",{class:`${t}-list-item`},e.prefix?d("div",{class:`${t}-list-item__prefix`},e.prefix()):null,e.default?d("div",{class:`${t}-list-item__main`},e):null,e.suffix?d("div",{class:`${t}-list-item__suffix`},e.suffix()):null,this.showDivider&&d("div",{class:`${t}-list-item__divider`}))}});const kt=e=>{const{heightSmall:t,heightMedium:o,heightLarge:s,borderRadius:r}=e;return{color:"#eee",colorEnd:"#ddd",borderRadius:r,heightSmall:t,heightMedium:o,heightLarge:s}},Ct={name:"Skeleton",common:at,self:kt};var Tt=j([L("skeleton",` - height: 1em; - width: 100%; - transition: background-color .3s var(--n-bezier); - transition: - --n-color-start .3s var(--n-bezier), - --n-color-end .3s var(--n-bezier), - background-color .3s var(--n-bezier); - animation: 2s skeleton-loading infinite cubic-bezier(0.36, 0, 0.64, 1); - background-color: var(--n-color-start); - `),j("@keyframes skeleton-loading",` - 0% { - background: var(--n-color-start); - } - 40% { - background: var(--n-color-end); - } - 80% { - background: var(--n-color-start); - } - 100% { - background: var(--n-color-start); - } - `)]);const Pt=Object.assign(Object.assign({},W.props),{text:Boolean,round:Boolean,circle:Boolean,height:[String,Number],width:[String,Number],size:String,repeat:{type:Number,default:1},animated:{type:Boolean,default:!0},sharp:{type:Boolean,default:!0}});var It=O({name:"Skeleton",inheritAttrs:!1,props:Pt,setup(e){ut();const{mergedClsPrefixRef:t}=we(e),o=W("Skeleton","-skeleton",Tt,Ct,e,t);return{mergedClsPrefix:t,style:T(()=>{var s,r;const a=o.value,{common:{cubicBezierEaseInOut:u}}=a,v=a.self,{color:R,colorEnd:b,borderRadius:f}=v;let m;const{circle:z,sharp:F,round:h,width:y,height:M,size:S,text:x,animated:I}=e;S!==void 0&&(m=v[D("height",S)]);const B=z?(s=y!=null?y:M)!==null&&s!==void 0?s:m:y,E=(r=z&&y!=null?y:M)!==null&&r!==void 0?r:m;return{display:x?"inline-block":"",verticalAlign:x?"-0.125em":"",borderRadius:z?"50%":h?"4096px":F?"":f,width:typeof B=="number"?K(B):B,height:typeof E=="number"?K(E):E,animation:I?"":"none","--n-bezier":u,"--n-color-start":R,"--n-color-end":b}})}},render(){const{repeat:e,style:t,mergedClsPrefix:o,$attrs:s}=this,r=d("div",ye({class:`${o}-skeleton`,style:t},s));return e>1?d(dt,null,Array.apply(null,{length:e}).map(a=>[r,` -`])):r}});export{Nt as N,Ft as _,St as a,It as b,ut as c,ie as m,gt as u}; diff --git a/web/dist/assets/Thing.d394adea.js b/web/dist/assets/Thing.d394adea.js deleted file mode 100644 index e1daf838..00000000 --- a/web/dist/assets/Thing.d394adea.js +++ /dev/null @@ -1,34 +0,0 @@ -import{c as r,f as d,b as c,d as $,u as b,x as u,bB as y,j as E,y as S,A as w,h as i,ab as z}from"./index.d4f5aad2.js";var C=r("thing",` - display: flex; - transition: color .3s var(--n-bezier); - font-size: var(--n-font-size); - color: var(--n-text-color); -`,[r("thing-avatar",` - margin-right: 12px; - margin-top: 2px; - `),r("thing-avatar-header-wrapper",` - display: flex; - flex-wrap: nowrap; - `,[r("thing-header-wrapper",` - flex: 1; - `)]),r("thing-main",` - flex-grow: 1; - `,[r("thing-header",` - display: flex; - margin-bottom: 4px; - justify-content: space-between; - align-items: center; - `,[d("title",` - font-size: 16px; - font-weight: var(--n-title-font-weight); - transition: color .3s var(--n-bezier); - color: var(--n-title-text-color); - `)]),d("description",[c("&:not(:last-child)",` - margin-bottom: 4px; - `)]),d("content",[c("&:not(:first-child)",` - margin-top: 12px; - `)]),d("footer",[c("&:not(:first-child)",` - margin-top: 12px; - `)]),d("action",[c("&:not(:first-child)",` - margin-top: 12px; - `)])])]);const R=Object.assign(Object.assign({},u.props),{title:String,titleExtra:String,description:String,descriptionStyle:[String,Object],content:String,contentStyle:[String,Object],contentIndented:Boolean});var j=$({name:"Thing",props:R,setup(t,{slots:e}){const{mergedClsPrefixRef:h,inlineThemeDisabled:o,mergedRtlRef:f}=b(t),m=u("Thing","-thing",C,y,t,h),v=E("Thing",f,h),x=S(()=>{const{self:{titleTextColor:l,textColor:n,titleFontWeight:g,fontSize:s},common:{cubicBezierEaseInOut:_}}=m.value;return{"--n-bezier":_,"--n-font-size":s,"--n-text-color":n,"--n-title-font-weight":g,"--n-title-text-color":l}}),a=o?w("thing",void 0,x,t):void 0;return()=>{var l;const{value:n}=h,g=v?v.value:!1;return(l=a==null?void 0:a.onRender)===null||l===void 0||l.call(a),i("div",{class:[`${n}-thing`,a==null?void 0:a.themeClass,g&&`${n}-thing--rtl`],style:o?void 0:x.value},e.avatar&&t.contentIndented?i("div",{class:`${n}-thing-avatar`},e.avatar()):null,i("div",{class:`${n}-thing-main`},!t.contentIndented&&(e.header||t.title||e["header-extra"]||t.titleExtra||e.avatar)?i("div",{class:`${n}-thing-avatar-header-wrapper`},e.avatar?i("div",{class:`${n}-thing-avatar`},e.avatar()):null,e.header||t.title||e["header-extra"]||t.titleExtra?i("div",{class:`${n}-thing-header-wrapper`},i("div",{class:`${n}-thing-header`},e.header||t.title?i("div",{class:`${n}-thing-header__title`},e.header?e.header():t.title):null,e["header-extra"]||t.titleExtra?i("div",{class:`${n}-thing-header__extra`},e["header-extra"]?e["header-extra"]():t.titleExtra):null),e.description||t.description?i("div",{class:`${n}-thing-main__description`,style:t.descriptionStyle},e.description?e.description():t.description):null):null):i(z,null,e.header||t.title||e["header-extra"]||t.titleExtra?i("div",{class:`${n}-thing-header`},e.header||t.title?i("div",{class:`${n}-thing-header__title`},e.header?e.header():t.title):null,e["header-extra"]||t.titleExtra?i("div",{class:`${n}-thing-header__extra`},e["header-extra"]?e["header-extra"]():t.titleExtra):null):null,e.description||t.description?i("div",{class:`${n}-thing-main__description`,style:t.descriptionStyle},e.description?e.description():t.description):null),e.default||t.content?i("div",{class:`${n}-thing-main__content`,style:t.contentStyle},e.default?e.default():t.content):null,e.footer?i("div",{class:`${n}-thing-main__footer`},e.footer()):null,e.action?i("div",{class:`${n}-thing-main__action`},e.action()):null))}}});export{j as _}; diff --git a/web/dist/assets/Topic-4e4d8af1.js b/web/dist/assets/Topic-4e4d8af1.js new file mode 100644 index 00000000..f4f9e3e2 --- /dev/null +++ b/web/dist/assets/Topic-4e4d8af1.js @@ -0,0 +1 @@ +import{x as F,y as z,z as I,A as j,_ as E}from"./index-347d1d96.js";import{v as U}from"./@vicons-8f91201d.js";import{d as $,r as i,n as A,j as q,a3 as x,o as c,c as _,V as n,a1 as s,Q as b,e as V,M as f,O as u,_ as h,w as D,a7 as P,F as Q,a4 as G}from"./@vue-e0e89260.js";import{o as H,O as B,j as J,e as K,P as R,M as W,F as X,f as Y,g as Z,a as ee,k as oe}from"./naive-ui-62663ad7.js";import{_ as te}from"./main-nav.vue_vue_type_style_index_0_lang-be35896a.js";import{u as ne}from"./vuex-473b3783.js";import"./vue-router-b8e3382f.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const se={key:0,class:"tag-item"},ae={key:0,class:"tag-quote"},ce={key:1,class:"tag-quote tag-follow"},le={key:0,class:"options"},ie=$({__name:"tag-item",props:{tag:{},showAction:{type:Boolean},checkFollowing:{type:Boolean}},setup(T){const t=T,r=i(!1),m=A(()=>{let e=[];return t.tag.is_following===0?e.push({label:"关注",key:"follow"}):(t.tag.is_top===0?e.push({label:"置顶",key:"stick"}):e.push({label:"取消置顶",key:"unstick"}),e.push({label:"取消关注",key:"unfollow"})),e}),l=e=>{switch(e){case"follow":I({topic_id:t.tag.id}).then(o=>{t.tag.is_following=1,window.$message.success("关注成功")}).catch(o=>{console.log(o)});break;case"unfollow":z({topic_id:t.tag.id}).then(o=>{t.tag.is_following=0,window.$message.success("取消关注")}).catch(o=>{console.log(o)});break;case"stick":F({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("置顶成功")}).catch(o=>{console.log(o)});break;case"unstick":F({topic_id:t.tag.id}).then(o=>{t.tag.is_top=o.top_status,window.$message.success("取消置顶")}).catch(o=>{console.log(o)});break}};return q(()=>{r.value=!1}),(e,o)=>{const w=x("router-link"),g=H,k=B,a=J,d=K,v=R,p=W;return!e.checkFollowing||e.checkFollowing&&e.tag.is_following===1?(c(),_("div",se,[n(p,null,{header:s(()=>[(c(),b(k,{type:"success",size:"large",round:"",key:e.tag.id},{avatar:s(()=>[n(g,{src:e.tag.user.avatar},null,8,["src"])]),default:s(()=>[n(w,{class:"hash-link",to:{name:"home",query:{q:e.tag.tag,t:"tag"}}},{default:s(()=>[V(" #"+f(e.tag.tag),1)]),_:1},8,["to"]),e.showAction?u("",!0):(c(),_("span",ae,"("+f(e.tag.quote_num)+")",1)),e.showAction?(c(),_("span",ce,"("+f(e.tag.quote_num)+")",1)):u("",!0)]),_:1}))]),"header-extra":s(()=>[e.showAction?(c(),_("div",le,[n(v,{placement:"bottom-end",trigger:"click",size:"small",options:m.value,onSelect:l},{default:s(()=>[n(d,{type:"success",quaternary:"",circle:"",block:""},{icon:s(()=>[n(a,null,{default:s(()=>[n(h(U))]),_:1})]),_:1})]),_:1},8,["options"])])):u("",!0)]),_:1})])):u("",!0)}}});const _e=$({__name:"Topic",setup(T){const t=ne(),r=i([]),m=i("hot"),l=i(!1),e=i(!1),o=i(!1);D(e,()=>{e.value||(window.$message.success("保存成功"),t.commit("refreshTopicFollow"))});const w=A({get:()=>{let a="编辑";return e.value&&(a="保存"),a},set:a=>{}}),g=()=>{l.value=!0,j({type:m.value,num:50}).then(a=>{r.value=a.topics,l.value=!1}).catch(a=>{console.log(a),l.value=!1})},k=a=>{m.value=a,a=="follow"?o.value=!0:o.value=!1,g()};return q(()=>{g()}),(a,d)=>{const v=te,p=Y,C=B,L=Z,M=ie,N=ee,O=oe,S=X;return c(),_("div",null,[n(v,{title:"话题"}),n(S,{class:"main-content-wrap tags-wrap",bordered:""},{default:s(()=>[n(L,{type:"line",animated:"","onUpdate:value":k},P({default:s(()=>[n(p,{name:"hot",tab:"热门"}),n(p,{name:"new",tab:"最新"}),h(t).state.userLogined?(c(),b(p,{key:0,name:"follow",tab:"关注"})):u("",!0)]),_:2},[h(t).state.userLogined?{name:"suffix",fn:s(()=>[n(C,{checked:e.value,"onUpdate:checked":d[0]||(d[0]=y=>e.value=y),checkable:""},{default:s(()=>[V(f(w.value),1)]),_:1},8,["checked"])]),key:"0"}:void 0]),1024),n(O,{show:l.value},{default:s(()=>[n(N,null,{default:s(()=>[(c(!0),_(Q,null,G(r.value,y=>(c(),b(M,{tag:y,showAction:h(t).state.userLogined&&e.value,checkFollowing:o.value},null,8,["tag","showAction","checkFollowing"]))),256))]),_:1})]),_:1},8,["show"])]),_:1})])}}});const Me=E(_e,[["__scopeId","data-v-15794a53"]]);export{Me as default}; diff --git a/web/dist/assets/Topic-8dbcebb5.css b/web/dist/assets/Topic-8dbcebb5.css new file mode 100644 index 00000000..89cc452d --- /dev/null +++ b/web/dist/assets/Topic-8dbcebb5.css @@ -0,0 +1 @@ +.tag-item .tag-quote{margin-left:12px;font-size:14px;opacity:.75}.tag-item .tag-follow{margin-right:22px}.tag-item .options{margin-left:-32px;margin-bottom:4px;opacity:.55}.tag-item .n-thing .n-thing-header{margin-bottom:0}.tag-item .n-thing .n-thing-avatar-header-wrapper{align-items:center}.tags-wrap[data-v-15794a53]{padding:20px}.dark .tags-wrap[data-v-15794a53]{background-color:#101014bf} diff --git a/web/dist/assets/Topic.691bac81.js b/web/dist/assets/Topic.691bac81.js deleted file mode 100644 index b51417d8..00000000 --- a/web/dist/assets/Topic.691bac81.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as k}from"./main-nav.3167f221.js";import{ai as w,d as x,r as s,a2 as B,Y as r,a4 as a,a5 as n,c8 as D,W as _,ab as q,ac as C,c9 as E,ca as N,am as V,ah as F,c7 as I,a6 as L,a9 as M,aa as m,Z as S,ae as U,ao as W}from"./index.d4f5aad2.js";import{_ as Y}from"./List.a66e9ae7.js";const Z={class:"tag-hot"},$=x({__name:"Topic",setup(j){const c=s([]),u=s("hot"),o=s(!1),l=()=>{o.value=!0,D({type:u.value,num:50}).then(e=>{c.value=e.topics,o.value=!1}).catch(e=>{o.value=!1})},i=e=>{u.value=e,l()};return B(()=>{l()}),(e,z)=>{const d=k,p=E,g=N,v=V("router-link"),f=U,h=W,y=F,T=I,b=Y;return _(),r("div",null,[a(d,{title:"\u8BDD\u9898"}),a(b,{class:"main-content-wrap tags-wrap",bordered:""},{default:n(()=>[a(g,{type:"line",animated:"","onUpdate:value":i},{default:n(()=>[a(p,{name:"hot",tab:"\u70ED\u95E8"}),a(p,{name:"new",tab:"\u6700\u65B0"})]),_:1}),a(T,{show:o.value},{default:n(()=>[a(y,null,{default:n(()=>[(_(!0),r(q,null,C(c.value,t=>(_(),L(h,{class:"tag-item",type:"success",round:"",key:t.id},{avatar:n(()=>[a(f,{src:t.user.avatar},null,8,["src"])]),default:n(()=>[a(v,{class:"hash-link",to:{name:"home",query:{q:t.tag,t:"tag"}}},{default:n(()=>[M(" #"+m(t.tag),1)]),_:2},1032,["to"]),S("span",Z,"("+m(t.quote_num)+")",1)]),_:2},1024))),128))]),_:1})]),_:1},8,["show"])]),_:1})])}}});var J=w($,[["__scopeId","data-v-513fa4c6"]]);export{J as default}; diff --git a/web/dist/assets/Topic.909bef5a.css b/web/dist/assets/Topic.909bef5a.css deleted file mode 100644 index c332897c..00000000 --- a/web/dist/assets/Topic.909bef5a.css +++ /dev/null @@ -1 +0,0 @@ -.tags-wrap[data-v-513fa4c6]{padding:20px}.tags-wrap .tag-item .tag-hot[data-v-513fa4c6]{margin-left:12px;font-size:12px;opacity:.75} diff --git a/web/dist/assets/Upload.6bcec76c.js b/web/dist/assets/Upload.6bcec76c.js deleted file mode 100644 index 166da3dd..00000000 --- a/web/dist/assets/Upload.6bcec76c.js +++ /dev/null @@ -1,382 +0,0 @@ -import{bD as V,h as t,b as L,c as h,e as C,d as A,y as R,bE as H,N as j,bF as de,bG as ue,bH as ce,bI as fe,u as ge,x as Q,bJ as Te,z as te,A as he,n as $e,q as G,bp as ee,ba as Se,L as Le,M as De,bK as pe,r as W,v as ze,aK as _e,bw as Fe,K as Z,bL as Ie,ay as Oe,bC as Ue,bx as je,bM as re,f as U,au as Ne,bN as Ee,o as Me,t as F,s as Ae,p as He,bO as qe,ab as We,R as ie,V as Xe,w as ne}from"./index.d4f5aad2.js";var Ve=V("attach",t("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},t("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},t("g",{fill:"currentColor","fill-rule":"nonzero"},t("path",{d:"M3.25735931,8.70710678 L7.85355339,4.1109127 C8.82986412,3.13460197 10.4127766,3.13460197 11.3890873,4.1109127 C12.365398,5.08722343 12.365398,6.67013588 11.3890873,7.64644661 L6.08578644,12.9497475 C5.69526215,13.3402718 5.06209717,13.3402718 4.67157288,12.9497475 C4.28104858,12.5592232 4.28104858,11.9260582 4.67157288,11.5355339 L9.97487373,6.23223305 C10.1701359,6.0369709 10.1701359,5.72038841 9.97487373,5.52512627 C9.77961159,5.32986412 9.4630291,5.32986412 9.26776695,5.52512627 L3.96446609,10.8284271 C3.18341751,11.6094757 3.18341751,12.8758057 3.96446609,13.6568542 C4.74551468,14.4379028 6.01184464,14.4379028 6.79289322,13.6568542 L12.0961941,8.35355339 C13.4630291,6.98671837 13.4630291,4.77064094 12.0961941,3.40380592 C10.7293591,2.0369709 8.51328163,2.0369709 7.14644661,3.40380592 L2.55025253,8 C2.35499039,8.19526215 2.35499039,8.51184464 2.55025253,8.70710678 C2.74551468,8.90236893 3.06209717,8.90236893 3.25735931,8.70710678 Z"}))))),Ge=V("trash",t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("path",{d:"M432,144,403.33,419.74A32,32,0,0,1,371.55,448H140.46a32,32,0,0,1-31.78-28.26L80,144",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),t("rect",{x:"32",y:"64",width:"448",height:"80",rx:"16",ry:"16",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),t("line",{x1:"312",y1:"240",x2:"200",y2:"352",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),t("line",{x1:"312",y1:"352",x2:"200",y2:"240",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),Ke=V("download",t("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},t("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},t("g",{fill:"currentColor","fill-rule":"nonzero"},t("path",{d:"M3.5,13 L12.5,13 C12.7761424,13 13,13.2238576 13,13.5 C13,13.7454599 12.8231248,13.9496084 12.5898756,13.9919443 L12.5,14 L3.5,14 C3.22385763,14 3,13.7761424 3,13.5 C3,13.2545401 3.17687516,13.0503916 3.41012437,13.0080557 L3.5,13 L12.5,13 L3.5,13 Z M7.91012437,1.00805567 L8,1 C8.24545989,1 8.44960837,1.17687516 8.49194433,1.41012437 L8.5,1.5 L8.5,10.292 L11.1819805,7.6109127 C11.3555469,7.43734635 11.6249713,7.4180612 11.8198394,7.55305725 L11.8890873,7.6109127 C12.0626536,7.78447906 12.0819388,8.05390346 11.9469427,8.2487716 L11.8890873,8.31801948 L8.35355339,11.8535534 C8.17998704,12.0271197 7.91056264,12.0464049 7.7156945,11.9114088 L7.64644661,11.8535534 L4.1109127,8.31801948 C3.91565056,8.12275734 3.91565056,7.80617485 4.1109127,7.6109127 C4.28447906,7.43734635 4.55390346,7.4180612 4.7487716,7.55305725 L4.81801948,7.6109127 L7.5,10.292 L7.5,1.5 C7.5,1.25454011 7.67687516,1.05039163 7.91012437,1.00805567 L8,1 L7.91012437,1.00805567 Z"}))))),Ye=V("cancel",t("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},t("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},t("g",{fill:"currentColor","fill-rule":"nonzero"},t("path",{d:"M2.58859116,2.7156945 L2.64644661,2.64644661 C2.82001296,2.47288026 3.08943736,2.45359511 3.2843055,2.58859116 L3.35355339,2.64644661 L8,7.293 L12.6464466,2.64644661 C12.8417088,2.45118446 13.1582912,2.45118446 13.3535534,2.64644661 C13.5488155,2.84170876 13.5488155,3.15829124 13.3535534,3.35355339 L8.707,8 L13.3535534,12.6464466 C13.5271197,12.820013 13.5464049,13.0894374 13.4114088,13.2843055 L13.3535534,13.3535534 C13.179987,13.5271197 12.9105626,13.5464049 12.7156945,13.4114088 L12.6464466,13.3535534 L8,8.707 L3.35355339,13.3535534 C3.15829124,13.5488155 2.84170876,13.5488155 2.64644661,13.3535534 C2.45118446,13.1582912 2.45118446,12.8417088 2.64644661,12.6464466 L7.293,8 L2.64644661,3.35355339 C2.47288026,3.17998704 2.45359511,2.91056264 2.58859116,2.7156945 L2.64644661,2.64644661 L2.58859116,2.7156945 Z"}))))),Ze=V("retry",t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("path",{d:"M320,146s24.36-12-64-12A160,160,0,1,0,416,294",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-miterlimit: 10; stroke-width: 32px;"}),t("polyline",{points:"256 58 336 138 256 218",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),Je=L([h("progress",{display:"inline-block"},[h("progress-icon",` - color: var(--n-icon-color); - transition: color .3s var(--n-bezier); - `),C("line",` - width: 100%; - display: block; - `,[h("progress-content",` - display: flex; - align-items: center; - `,[h("progress-graph",{flex:1})]),h("progress-custom-content",{marginLeft:"14px"}),h("progress-icon",` - width: 30px; - padding-left: 14px; - height: var(--n-icon-size-line); - line-height: var(--n-icon-size-line); - font-size: var(--n-icon-size-line); - `,[C("as-text",` - color: var(--n-text-color-line-outer); - text-align: center; - width: 40px; - font-size: var(--n-font-size); - padding-left: 4px; - transition: color .3s var(--n-bezier); - `)])]),C("circle, dashboard",{width:"120px"},[h("progress-custom-content",` - position: absolute; - left: 50%; - top: 50%; - transform: translateX(-50%) translateY(-50%); - display: flex; - align-items: center; - justify-content: center; - `),h("progress-text",` - position: absolute; - left: 50%; - top: 50%; - transform: translateX(-50%) translateY(-50%); - display: flex; - align-items: center; - color: inherit; - font-size: var(--n-font-size-circle); - color: var(--n-text-color-circle); - font-weight: var(--n-font-weight-circle); - transition: color .3s var(--n-bezier); - white-space: nowrap; - `),h("progress-icon",` - position: absolute; - left: 50%; - top: 50%; - transform: translateX(-50%) translateY(-50%); - display: flex; - align-items: center; - color: var(--n-icon-color); - font-size: var(--n-icon-size-circle); - `)]),C("multiple-circle",` - width: 200px; - color: inherit; - `,[h("progress-text",` - font-weight: var(--n-font-weight-circle); - color: var(--n-text-color-circle); - position: absolute; - left: 50%; - top: 50%; - transform: translateX(-50%) translateY(-50%); - display: flex; - align-items: center; - justify-content: center; - transition: color .3s var(--n-bezier); - `)]),h("progress-content",{position:"relative"}),h("progress-graph",{position:"relative"},[h("progress-graph-circle",[L("svg",{verticalAlign:"bottom"}),h("progress-graph-circle-fill",` - stroke: var(--n-fill-color); - transition: - opacity .3s var(--n-bezier), - stroke .3s var(--n-bezier), - stroke-dasharray .3s var(--n-bezier); - `,[C("empty",{opacity:0})]),h("progress-graph-circle-rail",` - transition: stroke .3s var(--n-bezier); - overflow: hidden; - stroke: var(--n-rail-color); - `)]),h("progress-graph-line",[C("indicator-inside",[h("progress-graph-line-rail",` - height: 16px; - line-height: 16px; - border-radius: 10px; - `,[h("progress-graph-line-fill",` - height: inherit; - border-radius: 10px; - `),h("progress-graph-line-indicator",` - background: #0000; - white-space: nowrap; - text-align: right; - margin-left: 14px; - margin-right: 14px; - height: inherit; - font-size: 12px; - color: var(--n-text-color-line-inner); - transition: color .3s var(--n-bezier); - `)])]),C("indicator-inside-label",` - height: 16px; - display: flex; - align-items: center; - `,[h("progress-graph-line-rail",` - flex: 1; - transition: background-color .3s var(--n-bezier); - `),h("progress-graph-line-indicator",` - background: var(--n-fill-color); - font-size: 12px; - transform: translateZ(0); - display: flex; - vertical-align: middle; - height: 16px; - line-height: 16px; - padding: 0 10px; - border-radius: 10px; - position: absolute; - white-space: nowrap; - color: var(--n-text-color-line-inner); - transition: - right .2s var(--n-bezier), - color .3s var(--n-bezier), - background-color .3s var(--n-bezier); - `)]),h("progress-graph-line-rail",` - position: relative; - overflow: hidden; - height: var(--n-rail-height); - border-radius: 5px; - background-color: var(--n-rail-color); - transition: background-color .3s var(--n-bezier); - `,[h("progress-graph-line-fill",` - background: var(--n-fill-color); - position: relative; - border-radius: 5px; - height: inherit; - width: 100%; - max-width: 0%; - transition: - background-color .3s var(--n-bezier), - max-width .2s var(--n-bezier); - `,[C("processing",[L("&::after",` - content: ""; - background-image: var(--n-line-bg-processing); - animation: progress-processing-animation 2s var(--n-bezier) infinite; - `)])])])])])]),L("@keyframes progress-processing-animation",` - 0% { - position: absolute; - left: 0; - top: 0; - bottom: 0; - right: 100%; - opacity: 1; - } - 66% { - position: absolute; - left: 0; - top: 0; - bottom: 0; - right: 0; - opacity: 0; - } - 100% { - position: absolute; - left: 0; - top: 0; - bottom: 0; - right: 0; - opacity: 0; - } - `)]);const Qe={success:t(de,null),error:t(ue,null),warning:t(ce,null),info:t(fe,null)};var et=A({name:"ProgressLine",props:{clsPrefix:{type:String,required:!0},percentage:{type:Number,default:0},railColor:String,railStyle:[String,Object],fillColor:String,status:{type:String,required:!0},indicatorPlacement:{type:String,required:!0},indicatorTextColor:String,unit:{type:String,default:"%"},processing:{type:Boolean,required:!0},showIndicator:{type:Boolean,required:!0},height:[String,Number],railBorderRadius:[String,Number],fillBorderRadius:[String,Number]},setup(e,{slots:n}){const r=R(()=>H(e.height)),i=R(()=>e.railBorderRadius!==void 0?H(e.railBorderRadius):e.height!==void 0?H(e.height,{c:.5}):""),o=R(()=>e.fillBorderRadius!==void 0?H(e.fillBorderRadius):e.railBorderRadius!==void 0?H(e.railBorderRadius):e.height!==void 0?H(e.height,{c:.5}):"");return()=>{const{indicatorPlacement:s,railColor:u,railStyle:c,percentage:d,unit:l,indicatorTextColor:a,status:f,showIndicator:y,fillColor:p,processing:k,clsPrefix:v}=e;return t("div",{class:`${v}-progress-content`,role:"none"},t("div",{class:`${v}-progress-graph`,"aria-hidden":!0},t("div",{class:[`${v}-progress-graph-line`,{[`${v}-progress-graph-line--indicator-${s}`]:!0}]},t("div",{class:`${v}-progress-graph-line-rail`,style:[{backgroundColor:u,height:r.value,borderRadius:i.value},c]},t("div",{class:[`${v}-progress-graph-line-fill`,k&&`${v}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,backgroundColor:p,height:r.value,lineHeight:r.value,borderRadius:o.value}},s==="inside"?t("div",{class:`${v}-progress-graph-line-indicator`,style:{color:a}},d,l):null)))),y&&s==="outside"?t("div",null,n.default?t("div",{class:`${v}-progress-custom-content`,style:{color:a},role:"none"},n.default()):f==="default"?t("div",{role:"none",class:`${v}-progress-icon ${v}-progress-icon--as-text`,style:{color:a}},d,l):t("div",{class:`${v}-progress-icon`,"aria-hidden":!0},t(j,{clsPrefix:v},{default:()=>Qe[f]}))):null)}}});const tt={success:t(de,null),error:t(ue,null),warning:t(ce,null),info:t(fe,null)};var rt=A({name:"ProgressCircle",props:{clsPrefix:{type:String,required:!0},status:{type:String,required:!0},strokeWidth:{type:Number,required:!0},fillColor:String,railColor:String,railStyle:[String,Object],percentage:{type:Number,default:0},offsetDegree:{type:Number,default:0},showIndicator:{type:Boolean,required:!0},indicatorTextColor:String,unit:String,viewBoxWidth:{type:Number,required:!0},gapDegree:{type:Number,required:!0},gapOffsetDegree:{type:Number,default:0}},setup(e,{slots:n}){function r(i,o,s){const{gapDegree:u,viewBoxWidth:c,strokeWidth:d}=e,l=50,a=0,f=l,y=0,p=2*l,k=50+d/2,v=`M ${k},${k} m ${a},${f} - a ${l},${l} 0 1 1 ${y},${-p} - a ${l},${l} 0 1 1 ${-y},${p}`,B=Math.PI*2*l,D={stroke:s,strokeDasharray:`${i/100*(B-u)}px ${c*8}px`,strokeDashoffset:`-${u/2}px`,transformOrigin:o?"center":void 0,transform:o?`rotate(${o}deg)`:void 0};return{pathString:v,pathStyle:D}}return()=>{const{fillColor:i,railColor:o,strokeWidth:s,offsetDegree:u,status:c,percentage:d,showIndicator:l,indicatorTextColor:a,unit:f,gapOffsetDegree:y,clsPrefix:p}=e,{pathString:k,pathStyle:v}=r(100,0,o),{pathString:B,pathStyle:D}=r(d,u,i),T=100+s;return t("div",{class:`${p}-progress-content`,role:"none"},t("div",{class:`${p}-progress-graph`,"aria-hidden":!0},t("div",{class:`${p}-progress-graph-circle`,style:{transform:y?`rotate(${y}deg)`:void 0}},t("svg",{viewBox:`0 0 ${T} ${T}`},t("g",null,t("path",{class:`${p}-progress-graph-circle-rail`,d:k,"stroke-width":s,"stroke-linecap":"round",fill:"none",style:v})),t("g",null,t("path",{class:[`${p}-progress-graph-circle-fill`,d===0&&`${p}-progress-graph-circle-fill--empty`],d:B,"stroke-width":s,"stroke-linecap":"round",fill:"none",style:D}))))),l?t("div",null,n.default?t("div",{class:`${p}-progress-custom-content`,role:"none"},n.default()):c!=="default"?t("div",{class:`${p}-progress-icon`,"aria-hidden":!0},t(j,{clsPrefix:p},{default:()=>tt[c]})):t("div",{class:`${p}-progress-text`,style:{color:a},role:"none"},t("span",{class:`${p}-progress-text__percentage`},d),t("span",{class:`${p}-progress-text__unit`},f))):null)}}});function oe(e,n,r=100){return`m ${r/2} ${r/2-e} a ${e} ${e} 0 1 1 0 ${2*e} a ${e} ${e} 0 1 1 0 -${2*e}`}var it=A({name:"ProgressMultipleCircle",props:{clsPrefix:{type:String,required:!0},viewBoxWidth:{type:Number,required:!0},percentage:{type:Array,default:[0]},strokeWidth:{type:Number,required:!0},circleGap:{type:Number,required:!0},showIndicator:{type:Boolean,required:!0},fillColor:{type:Array,default:()=>[]},railColor:{type:Array,default:()=>[]},railStyle:{type:Array,default:()=>[]}},setup(e,{slots:n}){const r=R(()=>e.percentage.map((o,s)=>`${Math.PI*o/100*(e.viewBoxWidth/2-e.strokeWidth/2*(1+2*s)-e.circleGap*s)*2}, ${e.viewBoxWidth*8}`));return()=>{const{viewBoxWidth:i,strokeWidth:o,circleGap:s,showIndicator:u,fillColor:c,railColor:d,railStyle:l,percentage:a,clsPrefix:f}=e;return t("div",{class:`${f}-progress-content`,role:"none"},t("div",{class:`${f}-progress-graph`,"aria-hidden":!0},t("div",{class:`${f}-progress-graph-circle`},t("svg",{viewBox:`0 0 ${i} ${i}`},a.map((y,p)=>t("g",{key:p},t("path",{class:`${f}-progress-graph-circle-rail`,d:oe(i/2-o/2*(1+2*p)-s*p,o,i),"stroke-width":o,"stroke-linecap":"round",fill:"none",style:[{strokeDashoffset:0,stroke:d[p]},l[p]]}),t("path",{class:[`${f}-progress-graph-circle-fill`,y===0&&`${f}-progress-graph-circle-fill--empty`],d:oe(i/2-o/2*(1+2*p)-s*p,o,i),"stroke-width":o,"stroke-linecap":"round",fill:"none",style:{strokeDasharray:r.value[p],strokeDashoffset:0,stroke:c[p]}})))))),u&&n.default?t("div",null,t("div",{class:`${f}-progress-text`},n.default())):null)}}});const nt=Object.assign(Object.assign({},Q.props),{processing:Boolean,type:{type:String,default:"line"},gapDegree:Number,gapOffsetDegree:Number,status:{type:String,default:"default"},railColor:[String,Array],railStyle:[String,Array],color:[String,Array],viewBoxWidth:{type:Number,default:100},strokeWidth:{type:Number,default:7},percentage:[Number,Array],unit:{type:String,default:"%"},showIndicator:{type:Boolean,default:!0},indicatorPosition:{type:String,default:"outside"},indicatorPlacement:{type:String,default:"outside"},indicatorTextColor:String,circleGap:{type:Number,default:1},height:Number,borderRadius:[String,Number],fillBorderRadius:[String,Number],offsetDegree:Number});var ot=A({name:"Progress",props:nt,setup(e){const n=R(()=>e.indicatorPlacement||e.indicatorPosition),r=R(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type==="dashboard")return 75}),{mergedClsPrefixRef:i,inlineThemeDisabled:o}=ge(e),s=Q("Progress","-progress",Je,Te,e,i),u=R(()=>{const{status:d}=e,{common:{cubicBezierEaseInOut:l},self:{fontSize:a,fontSizeCircle:f,railColor:y,railHeight:p,iconSizeCircle:k,iconSizeLine:v,textColorCircle:B,textColorLineInner:D,textColorLineOuter:T,lineBgProcessing:x,fontWeightCircle:$,[te("iconColor",d)]:m,[te("fillColor",d)]:b}}=s.value;return{"--n-bezier":l,"--n-fill-color":b,"--n-font-size":a,"--n-font-size-circle":f,"--n-font-weight-circle":$,"--n-icon-color":m,"--n-icon-size-circle":k,"--n-icon-size-line":v,"--n-line-bg-processing":x,"--n-rail-color":y,"--n-rail-height":p,"--n-text-color-circle":B,"--n-text-color-line-inner":D,"--n-text-color-line-outer":T}}),c=o?he("progress",R(()=>e.status[0]),u,e):void 0;return{mergedClsPrefix:i,mergedIndicatorPlacement:n,gapDeg:r,cssVars:o?void 0:u,themeClass:c==null?void 0:c.themeClass,onRender:c==null?void 0:c.onRender}},render(){const{type:e,cssVars:n,indicatorTextColor:r,showIndicator:i,status:o,railColor:s,railStyle:u,color:c,percentage:d,viewBoxWidth:l,strokeWidth:a,mergedIndicatorPlacement:f,unit:y,borderRadius:p,fillBorderRadius:k,height:v,processing:B,circleGap:D,mergedClsPrefix:T,gapDeg:x,gapOffsetDegree:$,themeClass:m,$slots:b,onRender:w}=this;return w==null||w(),t("div",{class:[m,`${T}-progress`,`${T}-progress--${e}`,`${T}-progress--${o}`],style:n,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":d,role:e==="circle"||e==="line"||e==="dashboard"?"progressbar":"none"},e==="circle"||e==="dashboard"?t(rt,{clsPrefix:T,status:o,showIndicator:i,indicatorTextColor:r,railColor:s,fillColor:c,railStyle:u,offsetDegree:this.offsetDegree,percentage:d,viewBoxWidth:l,strokeWidth:a,gapDegree:x===void 0?e==="dashboard"?75:0:x,gapOffsetDegree:$,unit:y},b):e==="line"?t(et,{clsPrefix:T,status:o,showIndicator:i,indicatorTextColor:r,railColor:s,fillColor:c,railStyle:u,percentage:d,processing:B,indicatorPlacement:f,unit:y,fillBorderRadius:k,railBorderRadius:p,height:v},b):e==="multiple-circle"?t(it,{clsPrefix:T,strokeWidth:a,railColor:s,fillColor:c,railStyle:u,viewBoxWidth:l,percentage:d,showIndicator:i,circleGap:D},b):null)}});const q=$e("n-upload"),me="__UPLOAD_DRAGGER__";var at=A({name:"UploadDragger",[me]:!0,setup(e,{slots:n}){const r=G(q,null);return r||ee("upload-dragger","`n-upload-dragger` must be placed inside `n-upload`."),()=>{const{mergedClsPrefixRef:{value:i},mergedDisabledRef:{value:o},maxReachedRef:{value:s}}=r;return t("div",{class:[`${i}-upload-dragger`,(o||s)&&`${i}-upload-dragger--disabled`]},n)}}}),ve=globalThis&&globalThis.__awaiter||function(e,n,r,i){function o(s){return s instanceof r?s:new r(function(u){u(s)})}return new(r||(r=Promise))(function(s,u){function c(a){try{l(i.next(a))}catch(f){u(f)}}function d(a){try{l(i.throw(a))}catch(f){u(f)}}function l(a){a.done?s(a.value):o(a.value).then(c,d)}l((i=i.apply(e,n||[])).next())})};const be=e=>e.includes("image/"),ae=(e="")=>{const n=e.split("/"),i=n[n.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(i)||[""])[0]},le=/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i,ye=e=>{if(e.type)return be(e.type);const n=ae(e.name||"");if(le.test(n))return!0;const r=e.thumbnailUrl||e.url||"",i=ae(r);return!!(/^data:image\//.test(r)||le.test(i))};function lt(e){return ve(this,void 0,void 0,function*(){return yield new Promise(n=>{if(!e.type||!be(e.type)){n("");return}n(window.URL.createObjectURL(e))})})}const st=Se&&window.FileReader&&window.File;function dt(e){return e.isDirectory}function ut(e){return e.isFile}function ct(e,n){return ve(this,void 0,void 0,function*(){const r=[];let i,o=0;function s(){o++}function u(){o--,o||i(r)}function c(d){d.forEach(l=>{if(!!l){if(s(),n&&dt(l)){const a=l.createReader();s(),a.readEntries(f=>{c(f),u()},()=>{u()})}else ut(l)&&(s(),l.file(a=>{r.push({file:a,entry:l,source:"dnd"}),u()},()=>{u()}));u()}})}return yield new Promise(d=>{i=d,c(e)}),r})}function X(e){const{id:n,name:r,percentage:i,status:o,url:s,file:u,thumbnailUrl:c,type:d,fullPath:l,batchId:a}=e;return{id:n,name:r,percentage:i!=null?i:null,status:o,url:s!=null?s:null,file:u!=null?u:null,thumbnailUrl:c!=null?c:null,type:d!=null?d:null,fullPath:l!=null?l:null,batchId:a!=null?a:null}}function ft(e,n,r){return e=e.toLowerCase(),n=n.toLocaleLowerCase(),r=r.toLocaleLowerCase(),r.split(",").map(o=>o.trim()).filter(Boolean).some(o=>{if(o.startsWith(".")){if(e.endsWith(o))return!0}else if(o.includes("/")){const[s,u]=n.split("/"),[c,d]=o.split("/");if((c==="*"||s&&c&&c===s)&&(d==="*"||u&&d&&d===u))return!0}else return!0;return!1})}const gt=(e,n)=>{if(!e)return;const r=document.createElement("a");r.href=e,n!==void 0&&(r.download=n),document.body.appendChild(r),r.click(),document.body.removeChild(r)};var we=A({name:"UploadTrigger",props:{abstract:Boolean},setup(e,{slots:n}){const r=G(q,null);r||ee("upload-trigger","`n-upload-trigger` must be placed inside `n-upload`.");const{mergedClsPrefixRef:i,mergedDisabledRef:o,maxReachedRef:s,listTypeRef:u,dragOverRef:c,openOpenFileDialog:d,draggerInsideRef:l,handleFileAddition:a,mergedDirectoryDndRef:f,triggerStyleRef:y}=r,p=R(()=>u.value==="image-card");function k(){o.value||s.value||d()}function v(x){x.preventDefault(),c.value=!0}function B(x){x.preventDefault(),c.value=!0}function D(x){x.preventDefault(),c.value=!1}function T(x){var $;if(x.preventDefault(),!l.value||o.value||s.value){c.value=!1;return}const m=($=x.dataTransfer)===null||$===void 0?void 0:$.items;m!=null&&m.length?ct(Array.from(m).map(b=>b.webkitGetAsEntry()),f.value).then(b=>{a(b)}).finally(()=>{c.value=!1}):c.value=!1}return()=>{var x;const{value:$}=i;return e.abstract?(x=n.default)===null||x===void 0?void 0:x.call(n,{handleClick:k,handleDrop:T,handleDragOver:v,handleDragEnter:B,handleDragLeave:D}):t("div",{class:[`${$}-upload-trigger`,(o.value||s.value)&&`${$}-upload-trigger--disabled`,p.value&&`${$}-upload-trigger--image-card`],style:y.value,onClick:k,onDrop:T,onDragover:v,onDragenter:B,onDragleave:D},p.value?t(at,null,{default:()=>Le(n.default,()=>[t(j,{clsPrefix:$},{default:()=>t(De,null)})])}):n)}}}),ht=A({name:"UploadProgress",props:{show:Boolean,percentage:{type:Number,required:!0},status:{type:String,required:!0}},setup(){return{mergedTheme:G(q).mergedThemeRef}},render(){return t(pe,null,{default:()=>this.show?t(ot,{type:"line",showIndicator:!1,percentage:this.percentage,status:this.status,height:2,theme:this.mergedTheme.peers.Progress,themeOverrides:this.mergedTheme.peerOverrides.Progress}):null})}});const pt=t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"},t("g",{fill:"none"},t("path",{d:"M21.75 3A3.25 3.25 0 0 1 25 6.25v15.5A3.25 3.25 0 0 1 21.75 25H6.25A3.25 3.25 0 0 1 3 21.75V6.25A3.25 3.25 0 0 1 6.25 3h15.5zm.583 20.4l-7.807-7.68a.75.75 0 0 0-.968-.07l-.084.07l-7.808 7.68c.183.065.38.1.584.1h15.5c.204 0 .4-.035.583-.1l-7.807-7.68l7.807 7.68zM21.75 4.5H6.25A1.75 1.75 0 0 0 4.5 6.25v15.5c0 .208.036.408.103.593l7.82-7.692a2.25 2.25 0 0 1 3.026-.117l.129.117l7.82 7.692c.066-.185.102-.385.102-.593V6.25a1.75 1.75 0 0 0-1.75-1.75zm-3.25 3a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5zm0 1.5a1 1 0 1 0 0 2a1 1 0 0 0 0-2z",fill:"currentColor"}))),mt=t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"},t("g",{fill:"none"},t("path",{d:"M6.4 2A2.4 2.4 0 0 0 4 4.4v19.2A2.4 2.4 0 0 0 6.4 26h15.2a2.4 2.4 0 0 0 2.4-2.4V11.578c0-.729-.29-1.428-.805-1.944l-6.931-6.931A2.4 2.4 0 0 0 14.567 2H6.4zm-.9 2.4a.9.9 0 0 1 .9-.9H14V10a2 2 0 0 0 2 2h6.5v11.6a.9.9 0 0 1-.9.9H6.4a.9.9 0 0 1-.9-.9V4.4zm16.44 6.1H16a.5.5 0 0 1-.5-.5V4.06l6.44 6.44z",fill:"currentColor"})));var vt=globalThis&&globalThis.__awaiter||function(e,n,r,i){function o(s){return s instanceof r?s:new r(function(u){u(s)})}return new(r||(r=Promise))(function(s,u){function c(a){try{l(i.next(a))}catch(f){u(f)}}function d(a){try{l(i.throw(a))}catch(f){u(f)}}function l(a){a.done?s(a.value):o(a.value).then(c,d)}l((i=i.apply(e,n||[])).next())})};const J={paddingMedium:"0 3px",heightMedium:"24px",iconSizeMedium:"18px"};var bt=A({name:"UploadFile",props:{clsPrefix:{type:String,required:!0},file:{type:Object,required:!0},listType:{type:String,required:!0}},setup(e){const n=G(q),r=W(null),i=W(""),o=R(()=>{const{file:m}=e;return m.status==="finished"?"success":m.status==="error"?"error":"info"}),s=R(()=>{const{file:m}=e;if(m.status==="error")return"error"}),u=R(()=>{const{file:m}=e;return m.status==="uploading"}),c=R(()=>{if(!n.showCancelButtonRef.value)return!1;const{file:m}=e;return["uploading","pending","error"].includes(m.status)}),d=R(()=>{if(!n.showRemoveButtonRef.value)return!1;const{file:m}=e;return["finished"].includes(m.status)}),l=R(()=>{if(!n.showDownloadButtonRef.value)return!1;const{file:m}=e;return["finished"].includes(m.status)}),a=R(()=>{if(!n.showRetryButtonRef.value)return!1;const{file:m}=e;return["error"].includes(m.status)}),f=ze(()=>i.value||e.file.thumbnailUrl||e.file.url),y=R(()=>{if(!n.showPreviewButtonRef.value)return!1;const{file:{status:m},listType:b}=e;return["finished"].includes(m)&&f.value&&b==="image-card"});function p(){n.submit(e.file.id)}function k(m){m.preventDefault();const{file:b}=e;["finished","pending","error"].includes(b.status)?B(b):["uploading"].includes(b.status)?T(b):Ue("upload","The button clicked type is unknown.")}function v(m){m.preventDefault(),D(e.file)}function B(m){const{xhrMap:b,doChange:w,onRemoveRef:{value:K},mergedFileListRef:{value:g}}=n;Promise.resolve(K?K({file:Object.assign({},m),fileList:g}):!0).then(P=>{if(P===!1)return;const S=Object.assign({},m,{status:"removed"});b.delete(m.id),w(S,void 0,{remove:!0})})}function D(m){const{onDownloadRef:{value:b}}=n;Promise.resolve(b?b(Object.assign({},m)):!0).then(w=>{w!==!1&>(m.url,m.name)})}function T(m){const{xhrMap:b}=n,w=b.get(m.id);w==null||w.abort(),B(Object.assign({},m))}function x(){const{onPreviewRef:{value:m}}=n;if(m)m(e.file);else if(e.listType==="image-card"){const{value:b}=r;if(!b)return;b.click()}}const $=()=>vt(this,void 0,void 0,function*(){const{listType:m}=e;m!=="image"&&m!=="image-card"||n.shouldUseThumbnailUrlRef.value(e.file)&&(i.value=yield n.getFileThumbnailUrlResolver(e.file))});return _e(()=>{$()}),{mergedTheme:n.mergedThemeRef,progressStatus:o,buttonType:s,showProgress:u,disabled:n.mergedDisabledRef,showCancelButton:c,showRemoveButton:d,showDownloadButton:l,showRetryButton:a,showPreviewButton:y,mergedThumbnailUrl:f,shouldUseThumbnailUrl:n.shouldUseThumbnailUrlRef,renderIcon:n.renderIconRef,imageRef:r,handleRemoveOrCancelClick:k,handleDownloadClick:v,handleRetryClick:p,handlePreviewClick:x}},render(){const{clsPrefix:e,mergedTheme:n,listType:r,file:i,renderIcon:o}=this;let s;const u=r==="image";u||r==="image-card"?s=!this.shouldUseThumbnailUrl(i)||!this.mergedThumbnailUrl?t("span",{class:`${e}-upload-file-info__thumbnail`},o?o(i):ye(i)?t(j,{clsPrefix:e},{default:()=>pt}):t(j,{clsPrefix:e},{default:()=>mt})):t("a",{rel:"noopener noreferer",target:"_blank",href:i.url||void 0,class:`${e}-upload-file-info__thumbnail`,onClick:this.handlePreviewClick},r==="image-card"?t(Fe,{src:this.mergedThumbnailUrl||void 0,previewSrc:i.url||void 0,alt:i.name,ref:"imageRef"}):t("img",{src:this.mergedThumbnailUrl||void 0,alt:i.name})):s=t("span",{class:`${e}-upload-file-info__thumbnail`},o?o(i):t(j,{clsPrefix:e},{default:()=>t(Ve,null)}));const d=t(ht,{show:this.showProgress,percentage:i.percentage||0,status:this.progressStatus}),l=r==="text"||r==="image";return t("div",{class:[`${e}-upload-file`,`${e}-upload-file--${this.progressStatus}-status`,i.url&&i.status!=="error"&&r!=="image-card"&&`${e}-upload-file--with-url`,`${e}-upload-file--${r}-type`]},t("div",{class:`${e}-upload-file-info`},s,t("div",{class:`${e}-upload-file-info__name`},l&&(i.url&&i.status!=="error"?t("a",{rel:"noopener noreferer",target:"_blank",href:i.url||void 0,onClick:this.handlePreviewClick},i.name):t("span",{onClick:this.handlePreviewClick},i.name)),u&&d),t("div",{class:[`${e}-upload-file-info__action`,`${e}-upload-file-info__action--${r}-type`]},this.showPreviewButton?t(Z,{key:"preview",quaternary:!0,type:this.buttonType,onClick:this.handlePreviewClick,theme:n.peers.Button,themeOverrides:n.peerOverrides.Button,builtinThemeOverrides:J},{icon:()=>t(j,{clsPrefix:e},{default:()=>t(Ie,null)})}):null,(this.showRemoveButton||this.showCancelButton)&&!this.disabled&&t(Z,{key:"cancelOrTrash",theme:n.peers.Button,themeOverrides:n.peerOverrides.Button,quaternary:!0,builtinThemeOverrides:J,type:this.buttonType,onClick:this.handleRemoveOrCancelClick},{icon:()=>t(Oe,null,{default:()=>this.showRemoveButton?t(j,{clsPrefix:e,key:"trash"},{default:()=>t(Ge,null)}):t(j,{clsPrefix:e,key:"cancel"},{default:()=>t(Ye,null)})})}),this.showRetryButton&&!this.disabled&&t(Z,{key:"retry",quaternary:!0,type:this.buttonType,onClick:this.handleRetryClick,theme:n.peers.Button,themeOverrides:n.peerOverrides.Button,builtinThemeOverrides:J},{icon:()=>t(j,{clsPrefix:e},{default:()=>t(Ze,null)})}),this.showDownloadButton?t(Z,{key:"download",quaternary:!0,type:this.buttonType,onClick:this.handleDownloadClick,theme:n.peers.Button,themeOverrides:n.peerOverrides.Button,builtinThemeOverrides:J},{icon:()=>t(j,{clsPrefix:e},{default:()=>t(Ke,null)})}):null)),!u&&d)}}),yt=A({name:"UploadFileList",setup(e,{slots:n}){const r=G(q,null);r||ee("upload-file-list","`n-upload-file-list` must be placed inside `n-upload`.");const{abstractRef:i,mergedClsPrefixRef:o,listTypeRef:s,mergedFileListRef:u,fileListStyleRef:c,cssVarsRef:d,themeClassRef:l,maxReachedRef:a,showTriggerRef:f,imageGroupPropsRef:y}=r,p=R(()=>s.value==="image-card"),k=()=>u.value.map(B=>t(bt,{clsPrefix:o.value,key:B.id,file:B,listType:s.value})),v=()=>p.value?t(je,Object.assign({},y.value),{default:k}):t(pe,{group:!0},{default:k});return()=>{const{value:B}=o,{value:D}=i;return t("div",{class:[`${B}-upload-file-list`,p.value&&`${B}-upload-file-list--grid`,D?l==null?void 0:l.value:void 0],style:[D&&d?d.value:"",c.value]},v(),f.value&&!a.value&&p.value&&t(we,null,n))}}}),wt=L([h("upload","width: 100%;",[C("dragger-inside",[h("upload-trigger",` - display: block; - `)]),C("drag-over",[h("upload-dragger",` - border: var(--n-dragger-border-hover); - `)])]),h("upload-dragger",` - cursor: pointer; - box-sizing: border-box; - width: 100%; - text-align: center; - border-radius: var(--n-border-radius); - padding: 24px; - opacity: 1; - transition: - opacity .3s var(--n-bezier), - border-color .3s var(--n-bezier), - background-color .3s var(--n-bezier); - background-color: var(--n-dragger-color); - border: var(--n-dragger-border); - `,[L("&:hover",` - border: var(--n-dragger-border-hover); - `),C("disabled",` - cursor: not-allowed; - `)]),h("upload-trigger",` - display: inline-block; - box-sizing: border-box; - opacity: 1; - transition: opacity .3s var(--n-bezier); - `,[L("+",[h("upload-file-list","margin-top: 8px;")]),C("disabled",` - opacity: var(--n-item-disabled-opacity); - cursor: not-allowed; - `),C("image-card",` - width: 96px; - height: 96px; - `,[h("base-icon",` - font-size: 24px; - `),h("upload-dragger",` - padding: 0; - height: 100%; - width: 100%; - display: flex; - align-items: center; - justify-content: center; - `)])]),h("upload-file-list",` - line-height: var(--n-line-height); - opacity: 1; - transition: opacity .3s var(--n-bezier); - `,[L("a, img","outline: none;"),C("disabled",` - opacity: var(--n-item-disabled-opacity); - cursor: not-allowed; - `,[h("upload-file","cursor: not-allowed;")]),C("grid",` - display: grid; - grid-template-columns: repeat(auto-fill, 96px); - grid-gap: 8px; - margin-top: 0; - `),h("upload-file",` - display: block; - box-sizing: border-box; - cursor: default; - padding: 0px 12px 0 6px; - transition: background-color .3s var(--n-bezier); - border-radius: var(--n-border-radius); - `,[re(),h("progress",[re({foldPadding:!0})]),L("&:hover",` - background-color: var(--n-item-color-hover); - `,[h("upload-file-info",[U("action",` - opacity: 1; - `)])]),C("image-type",` - border-radius: var(--n-border-radius); - text-decoration: underline; - text-decoration-color: #0000; - `,[h("upload-file-info",` - padding-top: 0px; - padding-bottom: 0px; - width: 100%; - height: 100%; - display: flex; - justify-content: space-between; - align-items: center; - padding: 6px 0; - `,[h("progress",` - padding: 2px 0; - margin-bottom: 0; - `),U("name",` - padding: 0 8px; - `),U("thumbnail",` - width: 32px; - height: 32px; - font-size: 28px; - display: flex; - justify-content: center; - align-items: center; - `,[L("img",` - width: 100%; - `)])])]),C("text-type",[h("progress",` - box-sizing: border-box; - padding-bottom: 6px; - margin-bottom: 6px; - `)]),C("image-card-type",` - position: relative; - width: 96px; - height: 96px; - border: var(--n-item-border-image-card); - border-radius: var(--n-border-radius); - padding: 0; - display: flex; - align-items: center; - justify-content: center; - transition: border-color .3s var(--n-bezier), background-color .3s var(--n-bezier); - border-radius: var(--n-border-radius); - overflow: hidden; - `,[h("progress",` - position: absolute; - left: 8px; - bottom: 8px; - right: 8px; - width: unset; - `),h("upload-file-info",` - padding: 0; - width: 100%; - height: 100%; - `,[U("thumbnail",` - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: 36px; - `,[L("img",` - width: 100%; - `)])]),L("&::before",` - position: absolute; - z-index: 1; - left: 0; - right: 0; - top: 0; - bottom: 0; - border-radius: inherit; - opacity: 0; - transition: opacity .2s var(--n-bezier); - content: ""; - `),L("&:hover",[L("&::before","opacity: 1;"),h("upload-file-info",[U("thumbnail","opacity: .12;")])])]),C("error-status",[L("&:hover",` - background-color: var(--n-item-color-hover-error); - `),h("upload-file-info",[U("name","color: var(--n-item-text-color-error);"),U("thumbnail","color: var(--n-item-text-color-error);")]),C("image-card-type",` - border: var(--n-item-border-image-card-error); - `)]),C("with-url",` - cursor: pointer; - `,[h("upload-file-info",[U("name",` - color: var(--n-item-text-color-success); - text-decoration-color: var(--n-item-text-color-success); - `,[L("a",` - text-decoration: underline; - `)])])]),h("upload-file-info",` - position: relative; - padding-top: 6px; - padding-bottom: 6px; - display: flex; - flex-wrap: nowrap; - `,[U("thumbnail",` - font-size: 18px; - opacity: 1; - transition: opacity .2s var(--n-bezier); - color: var(--n-item-icon-color); - `,[h("base-icon",` - margin-right: 2px; - vertical-align: middle; - transition: color .3s var(--n-bezier); - `)]),U("action",` - padding-top: inherit; - padding-bottom: inherit; - position: absolute; - right: 0; - top: 0; - bottom: 0; - width: 80px; - display: flex; - align-items: center; - transition: opacity .2s var(--n-bezier); - justify-content: flex-end; - opacity: 0; - `,[h("button",[L("&:not(:last-child)",{marginRight:"4px"}),h("base-icon",[L("svg",[Ne()])])]),C("image-type",` - position: relative; - max-width: 80px; - width: auto; - `),C("image-card-type",` - z-index: 2; - position: absolute; - width: 100%; - height: 100%; - left: 0; - right: 0; - bottom: 0; - top: 0; - display: flex; - justify-content: center; - align-items: center; - `)]),U("name",` - color: var(--n-item-text-color); - flex: 1; - display: flex; - justify-content: center; - text-overflow: ellipsis; - overflow: hidden; - flex-direction: column; - text-decoration-color: #0000; - font-size: var(--n-font-size); - transition: - color .3s var(--n-bezier), - text-decoration-color .3s var(--n-bezier); - `,[L("a",` - color: inherit; - text-decoration: underline; - `)])])])]),h("upload-file-input",` - display: block; - width: 0; - height: 0; - opacity: 0; - `)]),se=globalThis&&globalThis.__awaiter||function(e,n,r,i){function o(s){return s instanceof r?s:new r(function(u){u(s)})}return new(r||(r=Promise))(function(s,u){function c(a){try{l(i.next(a))}catch(f){u(f)}}function d(a){try{l(i.throw(a))}catch(f){u(f)}}function l(a){a.done?s(a.value):o(a.value).then(c,d)}l((i=i.apply(e,n||[])).next())})};function xt(e,n,r){const{doChange:i,xhrMap:o}=e;let s=0;function u(d){var l;let a=Object.assign({},n,{status:"error",percentage:s});o.delete(n.id),a=X(((l=e.onError)===null||l===void 0?void 0:l.call(e,{file:a,event:d}))||a),i(a,d)}function c(d){var l;if(e.isErrorState){if(e.isErrorState(r)){u(d);return}}else if(r.status<200||r.status>=300){u(d);return}let a=Object.assign({},n,{status:"finished",percentage:s});o.delete(n.id),a=X(((l=e.onFinish)===null||l===void 0?void 0:l.call(e,{file:a,event:d}))||a),i(a,d)}return{handleXHRLoad:c,handleXHRError:u,handleXHRAbort(d){const l=Object.assign({},n,{status:"removed",file:null,percentage:s});o.delete(n.id),i(l,d)},handleXHRProgress(d){const l=Object.assign({},n,{status:"uploading"});if(d.lengthComputable){const a=Math.ceil(d.loaded/d.total*100);l.percentage=a,s=a}i(l,d)}}}function Ct(e){const{inst:n,file:r,data:i,headers:o,withCredentials:s,action:u,customRequest:c}=e,{doChange:d}=e.inst;let l=0;c({file:r,data:i,headers:o,withCredentials:s,action:u,onProgress(a){const f=Object.assign({},r,{status:"uploading"}),y=a.percent;f.percentage=y,l=y,d(f)},onFinish(){var a;let f=Object.assign({},r,{status:"finished",percentage:l});f=X(((a=n.onFinish)===null||a===void 0?void 0:a.call(n,{file:f}))||f),d(f)},onError(){var a;let f=Object.assign({},r,{status:"error",percentage:l});f=X(((a=n.onError)===null||a===void 0?void 0:a.call(n,{file:f}))||f),d(f)}})}function Rt(e,n,r){const i=xt(e,n,r);r.onabort=i.handleXHRAbort,r.onerror=i.handleXHRError,r.onload=i.handleXHRLoad,r.upload&&(r.upload.onprogress=i.handleXHRProgress)}function xe(e,n){return typeof e=="function"?e({file:n}):e||{}}function kt(e,n,r){const i=xe(n,r);!i||Object.keys(i).forEach(o=>{e.setRequestHeader(o,i[o])})}function Bt(e,n,r){const i=xe(n,r);!i||Object.keys(i).forEach(o=>{e.append(o,i[o])})}function Pt(e,n,r,{method:i,action:o,withCredentials:s,responseType:u,headers:c,data:d}){const l=new XMLHttpRequest;l.responseType=u,e.xhrMap.set(r.id,l),l.withCredentials=s;const a=new FormData;if(Bt(a,d,r),a.append(n,r.file),Rt(e,r,l),o!==void 0){l.open(i.toUpperCase(),o),kt(l,c,r),l.send(a);const f=Object.assign({},r,{status:"uploading"});e.doChange(f)}}const Tt=Object.assign(Object.assign({},Q.props),{name:{type:String,default:"file"},accept:String,action:String,customRequest:Function,directory:Boolean,directoryDnd:{type:Boolean,default:void 0},method:{type:String,default:"POST"},multiple:Boolean,showFileList:{type:Boolean,default:!0},data:[Object,Function],headers:[Object,Function],withCredentials:Boolean,responseType:{type:String,default:""},disabled:{type:Boolean,default:void 0},onChange:Function,onRemove:Function,onFinish:Function,onError:Function,onBeforeUpload:Function,isErrorState:Function,onDownload:Function,defaultUpload:{type:Boolean,default:!0},fileList:Array,"onUpdate:fileList":[Function,Array],onUpdateFileList:[Function,Array],fileListStyle:[String,Object],defaultFileList:{type:Array,default:()=>[]},showCancelButton:{type:Boolean,default:!0},showRemoveButton:{type:Boolean,default:!0},showDownloadButton:Boolean,showRetryButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},listType:{type:String,default:"text"},onPreview:Function,shouldUseThumbnailUrl:{type:Function,default:e=>st?ye(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerStyle:[String,Object],renderIcon:Object});var St=A({name:"Upload",props:Tt,setup(e){e.abstract&&e.listType==="image-card"&&ee("upload","when the list-type is image-card, abstract is not supported.");const{mergedClsPrefixRef:n,inlineThemeDisabled:r}=ge(e),i=Q("Upload","-upload",wt,Ee,e,n),o=Me(e),s=R(()=>{const{max:g}=e;return g!==void 0?p.value.length>=g:!1}),u=W(e.defaultFileList),c=F(e,"fileList"),d=W(null),l={value:!1},a=W(!1),f=new Map,y=Ae(c,u),p=R(()=>y.value.map(X));function k(){var g;(g=d.value)===null||g===void 0||g.click()}function v(g){const P=g.target;T(P.files?Array.from(P.files).map(S=>({file:S,entry:null,source:"input"})):null,g),P.value=""}function B(g){const{"onUpdate:fileList":P,onUpdateFileList:S}=e;P&&ne(P,g),S&&ne(S,g),u.value=g}const D=R(()=>e.multiple||e.directory);function T(g,P){if(!g||g.length===0)return;const{onBeforeUpload:S}=e;g=D.value?g:[g[0]];const{max:N,accept:O}=e;g=g.filter(({file:z,source:_})=>_==="dnd"&&(O==null?void 0:O.trim())?ft(z.name,z.type,O):!0),N&&(g=g.slice(0,N-p.value.length));const I=ie();Promise.all(g.map(({file:z,entry:_})=>se(this,void 0,void 0,function*(){var E;const M={id:ie(),batchId:I,name:z.name,status:"pending",percentage:0,file:z,url:null,type:z.type,thumbnailUrl:null,fullPath:(E=_==null?void 0:_.fullPath)!==null&&E!==void 0?E:`/${z.webkitRelativePath||z.name}`};return!S||(yield S({file:M,fileList:p.value}))!==!1?M:null}))).then(z=>se(this,void 0,void 0,function*(){let _=Promise.resolve();return z.forEach(E=>{_=_.then(Xe).then(()=>{E&&$(E,P,{append:!0})})}),yield _})).then(()=>{e.defaultUpload&&x()})}function x(g){const{method:P,action:S,withCredentials:N,headers:O,data:I,name:z}=e,_=g!==void 0?p.value.filter(M=>M.id===g):p.value,E=g!==void 0;_.forEach(M=>{const{status:Y}=M;(Y==="pending"||Y==="error"&&E)&&(e.customRequest?Ct({inst:{doChange:$,xhrMap:f,onFinish:e.onFinish,onError:e.onError},file:M,action:S,withCredentials:N,headers:O,data:I,customRequest:e.customRequest}):Pt({doChange:$,xhrMap:f,onFinish:e.onFinish,onError:e.onError,isErrorState:e.isErrorState},z,M,{method:P,action:S,withCredentials:N,responseType:e.responseType,headers:O,data:I}))})}const $=(g,P,S={append:!1,remove:!1})=>{const{append:N,remove:O}=S,I=Array.from(p.value),z=I.findIndex(_=>_.id===g.id);if(N||O||~z){N?I.push(g):O?I.splice(z,1):I.splice(z,1,g);const{onChange:_}=e;_&&_({file:g,fileList:I,event:P}),B(I)}};function m(g){var P;if(g.thumbnailUrl)return g.thumbnailUrl;const{createThumbnailUrl:S}=e;return S?(P=S(g.file,g))!==null&&P!==void 0?P:g.url||"":g.url?g.url:g.file?lt(g.file):""}const b=R(()=>{const{common:{cubicBezierEaseInOut:g},self:{draggerColor:P,draggerBorder:S,draggerBorderHover:N,itemColorHover:O,itemColorHoverError:I,itemTextColorError:z,itemTextColorSuccess:_,itemTextColor:E,itemIconColor:M,itemDisabledOpacity:Y,lineHeight:Ce,borderRadius:Re,fontSize:ke,itemBorderImageCardError:Be,itemBorderImageCard:Pe}}=i.value;return{"--n-bezier":g,"--n-border-radius":Re,"--n-dragger-border":S,"--n-dragger-border-hover":N,"--n-dragger-color":P,"--n-font-size":ke,"--n-item-color-hover":O,"--n-item-color-hover-error":I,"--n-item-disabled-opacity":Y,"--n-item-icon-color":M,"--n-item-text-color":E,"--n-item-text-color-error":z,"--n-item-text-color-success":_,"--n-line-height":Ce,"--n-item-border-image-card-error":Be,"--n-item-border-image-card":Pe}}),w=r?he("upload",void 0,b,e):void 0;He(q,{mergedClsPrefixRef:n,mergedThemeRef:i,showCancelButtonRef:F(e,"showCancelButton"),showDownloadButtonRef:F(e,"showDownloadButton"),showRemoveButtonRef:F(e,"showRemoveButton"),showRetryButtonRef:F(e,"showRetryButton"),onRemoveRef:F(e,"onRemove"),onDownloadRef:F(e,"onDownload"),mergedFileListRef:p,triggerStyleRef:F(e,"triggerStyle"),shouldUseThumbnailUrlRef:F(e,"shouldUseThumbnailUrl"),renderIconRef:F(e,"renderIcon"),xhrMap:f,submit:x,doChange:$,showPreviewButtonRef:F(e,"showPreviewButton"),onPreviewRef:F(e,"onPreview"),getFileThumbnailUrlResolver:m,listTypeRef:F(e,"listType"),dragOverRef:a,openOpenFileDialog:k,draggerInsideRef:l,handleFileAddition:T,mergedDisabledRef:o.mergedDisabledRef,maxReachedRef:s,fileListStyleRef:F(e,"fileListStyle"),abstractRef:F(e,"abstract"),acceptRef:F(e,"accept"),cssVarsRef:r?void 0:b,themeClassRef:w==null?void 0:w.themeClass,onRender:w==null?void 0:w.onRender,showTriggerRef:F(e,"showTrigger"),imageGroupPropsRef:F(e,"imageGroupProps"),mergedDirectoryDndRef:R(()=>{var g;return(g=e.directoryDnd)!==null&&g!==void 0?g:e.directory})});const K={clear:()=>{u.value=[]},submit:x,openOpenFileDialog:k};return Object.assign({mergedClsPrefix:n,draggerInsideRef:l,inputElRef:d,mergedTheme:i,dragOver:a,mergedMultiple:D,cssVars:r?void 0:b,themeClass:w==null?void 0:w.themeClass,onRender:w==null?void 0:w.onRender,handleFileInputChange:v},K)},render(){var e,n;const{draggerInsideRef:r,mergedClsPrefix:i,$slots:o,directory:s,onRender:u}=this;if(o.default&&!this.abstract){const d=o.default()[0];!((e=d==null?void 0:d.type)===null||e===void 0)&&e[me]&&(r.value=!0)}const c=t("input",Object.assign({},this.inputProps,{ref:"inputElRef",type:"file",class:`${i}-upload-file-input`,accept:this.accept,multiple:this.mergedMultiple,onChange:this.handleFileInputChange,webkitdirectory:s||void 0,directory:s||void 0}));return this.abstract?t(We,null,(n=o.default)===null||n===void 0?void 0:n.call(o),t(qe,{to:"body"},c)):(u==null||u(),t("div",{class:[`${i}-upload`,r.value&&`${i}-upload--dragger-inside`,this.dragOver&&`${i}-upload--drag-over`,this.themeClass],style:this.cssVars},c,this.showTrigger&&this.listType!=="image-card"&&t(we,null,o),this.showFileList&&t(yt,null,o)))}});export{we as _,ot as a,yt as b,St as c}; diff --git a/web/dist/assets/User-16103a6c.js b/web/dist/assets/User-16103a6c.js new file mode 100644 index 00000000..55c640e2 --- /dev/null +++ b/web/dist/assets/User-16103a6c.js @@ -0,0 +1 @@ +import{_ as Fe,a as Te}from"./post-item.vue_vue_type_style_index_0_lang-e2c8dabf.js";import{_ as Ie}from"./post-skeleton-ffa76165.js";import{C as Me,_ as D,D as Se,E as qe,B as S,F as Ce,G as We}from"./index-347d1d96.js";import{R as Z,K as ee,S as se,b as ae,e as N,i as te,T as Re,F as Be,G as Oe,j as K,o as Ae,O as De,P as Ne,k as Ve,f as Ee,g as He,I as je,H as Ge}from"./naive-ui-62663ad7.js";import{d as V,r as l,o as u,Q as F,a1 as o,a as p,V as a,e as b,M as y,E as Le,n as Ke,w as Qe,j as Je,c as h,_ as w,O as U,F as Q,a4 as J,s as X}from"./@vue-e0e89260.js";import{_ as Xe}from"./main-nav.vue_vue_type_style_index_0_lang-be35896a.js";import{u as Ye}from"./vuex-473b3783.js";import{b as Ze}from"./vue-router-b8e3382f.js";import{i as es,w as ss,x as Y,y as as,z as ts}from"./@vicons-8f91201d.js";import"./content-72d615e5.js";import"./paopao-video-player-aa5e8b3f.js";import"./formatTime-cdf4e6f1.js";import"./moment-2ab8298d.js";import"./copy-to-clipboard-1dd3075d.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const ns={class:"whisper-wrap"},os={class:"whisper-line"},ls={class:"whisper-line send-wrap"},is=V({__name:"whisper",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(q,{emit:P}){const d=q,c=l(""),t=l(!1),s=()=>{P("success")},_=()=>{t.value=!0,Me({user_id:d.user.id,content:c.value}).then(r=>{window.$message.success("发送成功"),t.value=!1,c.value="",s()}).catch(r=>{t.value=!1})};return(r,g)=>{const i=Z,m=ee,n=se,f=ae,x=N,$=te;return u(),F($,{show:r.show,"onUpdate:show":s,class:"whisper-card",preset:"card",size:"small",title:"私信","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:o(()=>[p("div",ns,[a(n,{"show-icon":!1},{default:o(()=>[b(" 即将发送私信给: "),a(m,{style:{"max-width":"100%"}},{default:o(()=>[a(i,{type:"success"},{default:o(()=>[b(y(r.user.nickname)+"@"+y(r.user.username),1)]),_:1})]),_:1})]),_:1}),p("div",os,[a(f,{type:"textarea",placeholder:"请输入私信内容(请勿发送不和谐内容,否则将会被封号)",autosize:{minRows:5,maxRows:10},value:c.value,"onUpdate:value":g[0]||(g[0]=z=>c.value=z),maxlength:"200","show-count":""},null,8,["value"])]),p("div",ls,[a(x,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:_},{default:o(()=>[b(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const us=D(is,[["__scopeId","data-v-0cbfe47c"]]),cs={class:"whisper-wrap"},rs={class:"whisper-line"},_s={class:"whisper-line send-wrap"},ps=V({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:{}},emits:["success"],setup(q,{emit:P}){const d=q,c=l(""),t=l(!1),s=()=>{P("success")},_=()=>{t.value=!0,Se({user_id:d.user.id,greetings:c.value}).then(r=>{window.$message.success("发送成功"),t.value=!1,c.value="",s()}).catch(r=>{t.value=!1})};return(r,g)=>{const i=Z,m=ee,n=se,f=ae,x=N,$=te;return u(),F($,{show:r.show,"onUpdate:show":s,class:"whisper-card",preset:"card",size:"small",title:"申请添加朋友","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:o(()=>[p("div",cs,[a(n,{"show-icon":!1},{default:o(()=>[b(" 发送添加朋友申请给: "),a(m,{style:{"max-width":"100%"}},{default:o(()=>[a(i,{type:"success"},{default:o(()=>[b(y(r.user.nickname)+"@"+y(r.user.username),1)]),_:1})]),_:1})]),_:1}),p("div",rs,[a(f,{type:"textarea",placeholder:"请输入真挚的问候语",autosize:{minRows:5,maxRows:10},value:c.value,"onUpdate:value":g[0]||(g[0]=z=>c.value=z),maxlength:"120","show-count":""},null,8,["value"])]),p("div",_s,[a(x,{strong:"",secondary:"",type:"primary",loading:t.value,onClick:_},{default:o(()=>[b(" 发送 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});const ds=D(ps,[["__scopeId","data-v-60be56a2"]]),ms={key:0,class:"profile-baseinfo"},vs={class:"avatar"},hs={class:"base-info"},gs={class:"username"},fs={class:"uid"},ws={key:0,class:"user-opts"},bs={key:0,class:"skeleton-wrap"},ks={key:1},ys={key:0,class:"empty-wrap"},Ps={key:1},xs={key:2},$s={key:0,class:"pagination-wrap"},zs=V({__name:"User",setup(q){const P=Re(),d=Ye(),c=Ze(),t=l(!1),s=Le({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),_=l(!1),r=l(!1),g=l(!1),i=l([]),m=l(c.query.username||""),n=l(+c.query.p||1),f=l("post"),x=l(+c.query.p||1),$=l(1),z=l(1),E=l(1),H=l(1),v=l(20),k=l(0),ne=()=>{switch(f.value){case"post":C();break;case"comment":W();break;case"highlight":R();break;case"media":B();break;case"star":O();break}},C=()=>{t.value=!0,S({username:m.value,style:"post",page:n.value,page_size:v.value}).then(e=>{t.value=!1,i.value=e.list||[],k.value=Math.ceil(e.pager.total_rows/v.value),window.scrollTo(0,0)}).catch(e=>{i.value=[],t.value=!1})},W=()=>{t.value=!0,S({username:m.value,style:"comment",page:n.value,page_size:v.value}).then(e=>{t.value=!1,i.value=e.list||[],k.value=Math.ceil(e.pager.total_rows/v.value),window.scrollTo(0,0)}).catch(e=>{i.value=[],t.value=!1})},R=()=>{t.value=!0,S({username:m.value,style:"highlight",page:n.value,page_size:v.value}).then(e=>{t.value=!1,i.value=e.list||[],k.value=Math.ceil(e.pager.total_rows/v.value),window.scrollTo(0,0)}).catch(e=>{i.value=[],t.value=!1})},B=()=>{t.value=!0,S({username:m.value,style:"media",page:n.value,page_size:v.value}).then(e=>{t.value=!1,i.value=e.list||[],k.value=Math.ceil(e.pager.total_rows/v.value),window.scrollTo(0,0)}).catch(e=>{i.value=[],t.value=!1})},O=()=>{t.value=!0,S({username:m.value,style:"star",page:n.value,page_size:v.value}).then(e=>{t.value=!1,i.value=e.list||[],k.value=Math.ceil(e.pager.total_rows/v.value),window.scrollTo(0,0)}).catch(e=>{i.value=[],t.value=!1})},oe=e=>{switch(f.value=e,f.value){case"post":n.value=x.value,C();break;case"comment":n.value=$.value,W();break;case"highlight":n.value=z.value,R();break;case"media":n.value=E.value,B();break;case"star":n.value=H.value,O();break}},A=()=>{_.value=!0,qe({username:m.value}).then(e=>{_.value=!1,s.id=e.id,s.avatar=e.avatar,s.username=e.username,s.nickname=e.nickname,s.is_admin=e.is_admin,s.is_friend=e.is_friend,s.status=e.status,ne()}).catch(e=>{_.value=!1,console.log(e)})},le=e=>{switch(n.value=e,f.value){case"post":x.value=e,C();break;case"comment":$.value=n.value,W();break;case"highlight":z.value=n.value,R();break;case"media":E.value=n.value,B();break;case"star":H.value=n.value,O();break}},ie=()=>{r.value=!0},ue=()=>{g.value=!0},ce=()=>{r.value=!1},re=()=>{g.value=!1},T=e=>()=>X(K,null,{default:()=>X(e)}),_e=Ke(()=>{let e=[{label:"私信",key:"whisper",icon:T(ss)}];return d.state.userInfo.is_admin&&(s.status===1?e.push({label:"禁言",key:"banned",icon:T(Y)}):e.push({label:"解封",key:"deblocking",icon:T(Y)})),s.is_friend?e.push({label:"删除好友",key:"delete",icon:T(as)}):e.push({label:"添加朋友",key:"requesting",icon:T(ts)}),e}),pe=e=>{switch(e){case"whisper":ie();break;case"delete":de();break;case"requesting":ue();break;case"banned":case"deblocking":me();break}},de=()=>{P.warning({title:"删除好友",content:"将好友 “"+s.nickname+"” 删除,将同时删除 点赞/收藏 列表中关于该朋友的 “好友可见” 推文",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{_.value=!0,Ce({user_id:s.id}).then(e=>{_.value=!1,s.is_friend=!1,C()}).catch(e=>{_.value=!1,console.log(e)})}})},me=()=>{P.warning({title:"警告",content:"确定对该用户进行"+(s.status===1?"禁言":"解封")+"处理吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{_.value=!0,We({id:s.id,status:s.status===1?2:1}).then(e=>{_.value=!1,A()}).catch(e=>{_.value=!1,console.log(e)})}})};return Qe(()=>({path:c.path,query:c.query}),(e,j)=>{j.path==="/user"&&e.path==="/user"&&(m.value=c.query.username||"",A())}),Je(()=>{A()}),(e,j)=>{const ve=Xe,he=Ae,G=De,ge=N,fe=Ne,we=us,be=Ve,I=Ee,ke=He,ye=Ie,Pe=je,xe=Fe,L=Ge,$e=Te,ze=Be,Ue=Oe;return u(),h("div",null,[a(ve,{title:"用户详情"}),a(ze,{class:"main-content-wrap profile-wrap",bordered:""},{default:o(()=>[a(be,{show:_.value},{default:o(()=>[s.id>0?(u(),h("div",ms,[p("div",vs,[a(he,{size:"large",src:s.avatar},null,8,["src"])]),p("div",hs,[p("div",gs,[p("strong",null,y(s.nickname),1),p("span",null," @"+y(s.username),1),w(d).state.userInfo.id>0&&w(d).state.userInfo.username!=s.username&&s.is_friend?(u(),F(G,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:o(()=>[b(" 好友 ")]),_:1})):U("",!0),s.is_admin?(u(),F(G,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:o(()=>[b(" 管理员 ")]),_:1})):U("",!0)]),p("div",fs,"UID. "+y(s.id),1)]),w(d).state.userInfo.id>0&&w(d).state.userInfo.username!=s.username?(u(),h("div",ws,[a(fe,{placement:"bottom-end",trigger:"click",size:"small",options:_e.value,onSelect:pe},{default:o(()=>[a(ge,{quaternary:"",circle:""},{icon:o(()=>[a(w(K),null,{default:o(()=>[a(w(es))]),_:1})]),_:1})]),_:1},8,["options"])])):U("",!0)])):U("",!0),a(we,{show:r.value,user:s,onSuccess:ce},null,8,["show","user"]),a(ds,{show:g.value,user:s,onSuccess:re},null,8,["show","user"])]),_:1},8,["show"]),a(ke,{class:"profile-tabs-wrap",type:"line",animated:"","onUpdate:value":oe},{default:o(()=>[a(I,{name:"post",tab:"泡泡"}),a(I,{name:"comment",tab:"评论"}),a(I,{name:"highlight",tab:"亮点"}),a(I,{name:"media",tab:"图文"}),a(I,{name:"star",tab:"喜欢"})]),_:1}),t.value?(u(),h("div",bs,[a(ye,{num:v.value},null,8,["num"])])):(u(),h("div",ks,[i.value.length===0?(u(),h("div",ys,[a(Pe,{size:"large",description:"暂无数据"})])):U("",!0),w(d).state.desktopModelShow?(u(),h("div",Ps,[(u(!0),h(Q,null,J(i.value,M=>(u(),F(L,{key:M.id},{default:o(()=>[a(xe,{post:M},null,8,["post"])]),_:2},1024))),128))])):(u(),h("div",xs,[(u(!0),h(Q,null,J(i.value,M=>(u(),F(L,{key:M.id},{default:o(()=>[a($e,{post:M},null,8,["post"])]),_:2},1024))),128))]))]))]),_:1}),k.value>0?(u(),h("div",$s,[a(Ue,{page:n.value,"onUpdate:page":le,"page-slot":w(d).state.collapsedRight?5:8,"page-count":k.value},null,8,["page","page-slot","page-count"])])):U("",!0)])}}});const ta=D(zs,[["__scopeId","data-v-0bc7883f"]]);export{ta as default}; diff --git a/web/dist/assets/User-19b50f61.css b/web/dist/assets/User-19b50f61.css new file mode 100644 index 00000000..8919f0a7 --- /dev/null +++ b/web/dist/assets/User-19b50f61.css @@ -0,0 +1 @@ +.whisper-wrap .whisper-line[data-v-0cbfe47c]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-0cbfe47c]{width:100%}.dark .whisper-wrap[data-v-0cbfe47c]{background-color:#101014bf}.whisper-wrap .whisper-line[data-v-60be56a2]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-60be56a2]{width:100%}.dark .whisper-wrap[data-v-60be56a2]{background-color:#101014bf}.profile-tabs-wrap[data-v-0bc7883f]{padding:0 16px}.profile-baseinfo[data-v-0bc7883f]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-0bc7883f]{width:55px}.profile-baseinfo .base-info[data-v-0bc7883f]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-0bc7883f]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-0bc7883f]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .top-tag[data-v-0bc7883f]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-0bc7883f]{position:absolute;top:16px;right:16px;opacity:.75}.pagination-wrap[data-v-0bc7883f]{padding:10px;display:flex;justify-content:center;overflow:hidden}.dark .profile-baseinfo[data-v-0bc7883f]{background-color:#18181c}.dark .profile-wrap[data-v-0bc7883f],.dark .pagination-wrap[data-v-0bc7883f]{background-color:#101014bf} diff --git a/web/dist/assets/User.4a6c33cd.js b/web/dist/assets/User.4a6c33cd.js deleted file mode 100644 index 13d78716..00000000 --- a/web/dist/assets/User.4a6c33cd.js +++ /dev/null @@ -1,22 +0,0 @@ -import{_ as ye}from"./post-item.11c28084.js";import{_ as be}from"./post-skeleton.38f0f247.js";import{E as Ce,k as G,cd as ke,c as K,a as xe,e as M,d as A,u as Y,x as U,r as m,y as E,bc as Be,h as P,ag as Fe,bd as Ee,q as Se,ce as De,bp as $e,m as R,bE as Te,z as N,A as Re,ai as O,W as y,a6 as z,a5 as p,Z as C,a4 as i,a9 as S,aa as $,cf as ze,_ as Z,K as W,bA as J,cg as Ae,ch as Ie,ci as Pe,S as Ue,a2 as Oe,af as We,Y as F,aj as Le,cj as je,a3 as D,a7 as T,ab as qe,ac as Me,$ as Ne,cc as Ve,ck as He,cl as Ge,ae as Ke,ao as Ye,c4 as Ze,c7 as Je,c9 as Qe,ca as Xe}from"./index.d4f5aad2.js";import{c as en,a as nn,_ as tn}from"./Skeleton.e1c16fcb.js";import{_ as Q}from"./Alert.6cb9deb6.js";import{_ as sn}from"./main-nav.3167f221.js";import{M as an}from"./MoreHorizFilled.b0eea69d.js";import{_ as on}from"./List.a66e9ae7.js";import{_ as ln}from"./Pagination.c13c2d34.js";import"./content.ed80294a.js";import"./formatTime.e07969bb.js";import"./Thing.d394adea.js";const un=Ce({name:"Ellipsis",common:G,peers:{Tooltip:ke}});var rn=un,cn=K("ellipsis",{overflow:"hidden"},[xe("line-clamp",` - white-space: nowrap; - display: inline-block; - vertical-align: bottom; - max-width: 100%; - `),M("line-clamp",` - display: -webkit-inline-box; - -webkit-box-orient: vertical; - `),M("cursor-pointer",` - cursor: pointer; - `)]);function V(e){return`${e}-ellipsis--line-clamp`}function H(e,l){return`${e}-ellipsis--cursor-${l}`}const dn=Object.assign(Object.assign({},U.props),{expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Boolean,Object],default:!0}});var X=A({name:"Ellipsis",inheritAttrs:!1,props:dn,setup(e,{slots:l,attrs:r}){const{mergedClsPrefixRef:t}=Y(e),u=U("Ellipsis","-ellipsis",cn,rn,e,t),n=m(null),c=m(null),f=m(null),d=m(!1),o=E(()=>{const{lineClamp:a}=e,{value:_}=d;return a!==void 0?{textOverflow:"","-webkit-line-clamp":_?"":a}:{textOverflow:_?"":"ellipsis","-webkit-line-clamp":""}});function v(){let a=!1;const{value:_}=d;if(_)return!0;const{value:g}=n;if(g){const{lineClamp:B}=e;if(k(g),B!==void 0)a=g.scrollHeight<=g.offsetHeight;else{const{value:I}=c;I&&(a=I.getBoundingClientRect().width<=g.getBoundingClientRect().width)}x(g,a)}return a}const h=E(()=>e.expandTrigger==="click"?()=>{var a;const{value:_}=d;_&&((a=f.value)===null||a===void 0||a.setShow(!1)),d.value=!_}:void 0);Be(()=>{var a;e.tooltip&&((a=f.value)===null||a===void 0||a.setShow(!1))});const w=()=>P("span",Object.assign({},Ee(r,{class:[`${t.value}-ellipsis`,e.lineClamp!==void 0?V(t.value):void 0,e.expandTrigger==="click"?H(t.value,"pointer"):void 0],style:o.value}),{ref:"triggerRef",onClick:h.value,onMouseenter:e.expandTrigger==="click"?v:void 0}),e.lineClamp?l:P("span",{ref:"triggerInnerRef"},l));function k(a){if(!a)return;const _=o.value,g=V(t.value);e.lineClamp!==void 0?b(a,g,"add"):b(a,g,"remove");for(const B in _)a.style[B]!==_[B]&&(a.style[B]=_[B])}function x(a,_){const g=H(t.value,"pointer");e.expandTrigger==="click"&&!_?b(a,g,"add"):b(a,g,"remove")}function b(a,_,g){g==="add"?a.classList.contains(_)||a.classList.add(_):a.classList.contains(_)&&a.classList.remove(_)}return{mergedTheme:u,triggerRef:n,triggerInnerRef:c,tooltipRef:f,handleClick:h,renderTrigger:w,getTooltipDisabled:v}},render(){var e;const{tooltip:l,renderTrigger:r,$slots:t}=this;if(l){const{mergedTheme:u}=this;return P(Fe,Object.assign({ref:"tooltipRef",placement:"top"},l,{getDisabled:this.getTooltipDisabled,theme:u.peers.Tooltip,themeOverrides:u.peerOverrides.Tooltip}),{trigger:r,default:(e=t.tooltip)!==null&&e!==void 0?e:t.default})}else return r()}});function _n(){const e=Se(De,null);return e===null&&$e("use-dialog","No outer founded."),e}const pn=e=>{const{primaryColor:l,successColor:r,warningColor:t,errorColor:u,infoColor:n,fontWeightStrong:c}=e;return{fontWeight:c,rotate:"252deg",colorStartPrimary:R(l,{alpha:.6}),colorEndPrimary:l,colorStartInfo:R(n,{alpha:.6}),colorEndInfo:n,colorStartWarning:R(t,{alpha:.6}),colorEndWarning:t,colorStartError:R(u,{alpha:.6}),colorEndError:u,colorStartSuccess:R(r,{alpha:.6}),colorEndSuccess:r}},mn={name:"GradientText",common:G,self:pn};var fn=mn,gn=K("gradient-text",` - display: inline-block; - font-weight: var(--n-font-weight); - -webkit-background-clip: text; - background-clip: text; - color: #0000; - white-space: nowrap; - background-image: linear-gradient(var(--n-rotate), var(--n-color-start) 0%, var(--n-color-end) 100%); - transition: - --n-color-start .3s var(--n-bezier), - --n-color-end .3s var(--n-bezier); -`);const vn=Object.assign(Object.assign({},U.props),{size:[String,Number],fontSize:[String,Number],type:{type:String,default:"primary"},color:[Object,String],gradient:[Object,String]});var ee=A({name:"GradientText",props:vn,setup(e){en();const{mergedClsPrefixRef:l,inlineThemeDisabled:r}=Y(e),t=E(()=>{const{type:o}=e;return o==="danger"?"error":o}),u=E(()=>{let o=e.size||e.fontSize;return o&&(o=Te(o)),o||void 0}),n=E(()=>{const o=e.color||e.gradient;if(typeof o=="string")return o;if(o){const v=o.deg||0,h=o.from,w=o.to;return`linear-gradient(${v}deg, ${h} 0%, ${w} 100%)`}}),c=U("GradientText","-gradient-text",gn,fn,e,l),f=E(()=>{const{value:o}=t,{common:{cubicBezierEaseInOut:v},self:{rotate:h,[N("colorStart",o)]:w,[N("colorEnd",o)]:k,fontWeight:x}}=c.value;return{"--n-bezier":v,"--n-rotate":h,"--n-color-start":w,"--n-color-end":k,"--n-font-weight":x}}),d=r?Re("gradient-text",E(()=>t.value[0]),f,e):void 0;return{mergedClsPrefix:l,compatibleType:t,styleFontSize:u,styleBgImage:n,cssVars:r?void 0:f,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{mergedClsPrefix:e,onRender:l}=this;return l==null||l(),P("span",{class:[`${e}-gradient-text`,`${e}-gradient-text--${this.compatibleType}-type`,this.themeClass],style:[{fontSize:this.styleFontSize,backgroundImage:this.styleBgImage},this.cssVars]},this.$slots)}});const hn={class:"whisper-wrap"},wn={class:"whisper-line"},yn={class:"whisper-line send-wrap"},bn=A({__name:"whisper",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(e,{emit:l}){const r=e,t=m(""),u=m(!1),n=()=>{l("success")},c=()=>{u.value=!0,ze({user_id:r.user.id,content:t.value}).then(f=>{window.$message.success("\u53D1\u9001\u6210\u529F"),u.value=!1,t.value="",n()}).catch(f=>{u.value=!1})};return(f,d)=>{const o=ee,v=X,h=Q,w=Z,k=W,x=J;return y(),z(x,{show:e.show,"onUpdate:show":n,class:"whisper-card",preset:"card",size:"small",title:"\u79C1\u4FE1","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:p(()=>[C("div",hn,[i(h,{"show-icon":!1},{default:p(()=>[S(" \u5373\u5C06\u53D1\u9001\u79C1\u4FE1\u7ED9: "),i(v,{style:{"max-width":"100%"}},{default:p(()=>[i(o,{type:"success"},{default:p(()=>[S($(e.user.nickname)+"@"+$(e.user.username),1)]),_:1})]),_:1})]),_:1}),C("div",wn,[i(w,{type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u79C1\u4FE1\u5185\u5BB9\uFF08\u8BF7\u52FF\u53D1\u9001\u4E0D\u548C\u8C10\u5185\u5BB9\uFF0C\u5426\u5219\u5C06\u4F1A\u88AB\u5C01\u53F7\uFF09",autosize:{minRows:5,maxRows:10},value:t.value,"onUpdate:value":d[0]||(d[0]=b=>t.value=b),maxlength:"200","show-count":""},null,8,["value"])]),C("div",yn,[i(k,{strong:"",secondary:"",type:"primary",loading:u.value,onClick:c},{default:p(()=>[S(" \u53D1\u9001 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});var Cn=O(bn,[["__scopeId","data-v-3e021430"]]);const kn={class:"whisper-wrap"},xn={class:"whisper-line"},Bn={class:"whisper-line send-wrap"},Fn=A({__name:"whisper-add-friend",props:{show:{type:Boolean,default:!1},user:null},emits:["success"],setup(e,{emit:l}){const r=e,t=m(""),u=m(!1),n=()=>{l("success")},c=()=>{u.value=!0,Ae({user_id:r.user.id,greetings:t.value}).then(f=>{window.$message.success("\u53D1\u9001\u6210\u529F"),u.value=!1,t.value="",n()}).catch(f=>{u.value=!1})};return(f,d)=>{const o=ee,v=X,h=Q,w=Z,k=W,x=J;return y(),z(x,{show:e.show,"onUpdate:show":n,class:"whisper-card",preset:"card",size:"small",title:"\u7533\u8BF7\u6DFB\u52A0\u670B\u53CB","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:p(()=>[C("div",kn,[i(h,{"show-icon":!1},{default:p(()=>[S(" \u53D1\u9001\u6DFB\u52A0\u670B\u53CB\u7533\u8BF7\u7ED9: "),i(v,{style:{"max-width":"100%"}},{default:p(()=>[i(o,{type:"success"},{default:p(()=>[S($(e.user.nickname)+"@"+$(e.user.username),1)]),_:1})]),_:1})]),_:1}),C("div",xn,[i(w,{type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u771F\u631A\u7684\u95EE\u5019\u8BED",autosize:{minRows:5,maxRows:10},value:t.value,"onUpdate:value":d[0]||(d[0]=b=>t.value=b),maxlength:"120","show-count":""},null,8,["value"])]),C("div",Bn,[i(k,{strong:"",secondary:"",type:"primary",loading:u.value,onClick:c},{default:p(()=>[S(" \u53D1\u9001 ")]),_:1},8,["loading"])])])]),_:1},8,["show"])}}});var En=O(Fn,[["__scopeId","data-v-bf9bc04e"]]);const Sn={key:0,class:"profile-baseinfo"},Dn={class:"avatar"},$n={class:"base-info"},Tn={class:"username"},Rn={class:"uid"},zn={key:0,class:"user-opts"},An={key:0,class:"pagination-wrap"},In={key:0,class:"skeleton-wrap"},Pn={key:1},Un={key:0,class:"empty-wrap"},On=A({__name:"User",setup(e){Ie();const l=_n(),r=Ne(),t=Le(),u=m(!1),n=Pe({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,status:1}),c=m(!1),f=m(!1),d=m(!1),o=m([]),v=m(t.query.username||""),h=m(+t.query.p||1),w=m(20),k=m(0),x=()=>{u.value=!0,Ve({username:v.value,page:h.value,page_size:w.value}).then(s=>{u.value=!1,o.value=s.list,k.value=Math.ceil(s.pager.total_rows/w.value),window.scrollTo(0,0)}).catch(s=>{u.value=!1})},b=()=>{c.value=!0,je({username:v.value}).then(s=>{c.value=!1,n.id=s.id,n.avatar=s.avatar,n.username=s.username,n.nickname=s.nickname,n.is_admin=s.is_admin,n.is_friend=s.is_friend,n.status=s.status,x()}).catch(s=>{c.value=!1,console.log(s)})},a=s=>{h.value=s,x()},_=()=>{f.value=!0},g=()=>{d.value=!0},B=()=>{f.value=!1},I=()=>{d.value=!1},ne=E(()=>{let s=[{label:"\u79C1\u4FE1",key:"whisper"}];return r.state.userInfo.is_admin&&(n.status===1?s.push({label:"\u7981\u8A00",key:"banned"}):s.push({label:"\u89E3\u5C01",key:"deblocking"})),n.is_friend?s.push({label:"\u5220\u9664\u597D\u53CB",key:"delete"}):s.push({label:"\u6DFB\u52A0\u670B\u53CB",key:"requesting"}),s}),te=s=>{switch(s){case"whisper":_();break;case"delete":se();break;case"requesting":g();break;case"banned":case"deblocking":ae();break}},se=()=>{l.warning({title:"\u5220\u9664\u597D\u53CB",content:"\u5C06\u597D\u53CB \u201C"+n.nickname+"\u201D \u5220\u9664\uFF0C\u5C06\u540C\u65F6\u5220\u9664 \u70B9\u8D5E/\u6536\u85CF \u5217\u8868\u4E2D\u5173\u4E8E\u8BE5\u670B\u53CB\u7684 \u201C\u597D\u53CB\u53EF\u89C1\u201D \u63A8\u6587",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>{c.value=!0,He({user_id:n.id}).then(s=>{c.value=!1,n.is_friend=!1,x()}).catch(s=>{c.value=!1,console.log(s)})}})},ae=()=>{l.warning({title:"\u8B66\u544A",content:"\u786E\u5B9A\u5BF9\u8BE5\u7528\u6237\u8FDB\u884C"+(n.status===1?"\u7981\u8A00":"\u89E3\u5C01")+"\u5904\u7406\u5417\uFF1F",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>{c.value=!0,Ge({id:n.id,status:n.status===1?2:1}).then(s=>{c.value=!1,b()}).catch(s=>{c.value=!1,console.log(s)})}})};return Ue(()=>({path:t.path,query:t.query}),(s,L)=>{L.path==="/user"&&s.path==="/user"&&(v.value=t.query.username||"",b())}),Oe(()=>{b()}),(s,L)=>{const oe=sn,ie=Ke,j=Ye,le=We,ue=W,re=Ze,ce=Cn,de=Je,_e=ln,pe=Qe,me=Xe,fe=be,ge=nn,ve=ye,he=tn,we=on;return y(),F("div",null,[i(oe,{title:"\u7528\u6237\u8BE6\u60C5"}),i(we,{class:"main-content-wrap profile-wrap",bordered:""},{footer:p(()=>[k.value>0?(y(),F("div",An,[i(_e,{page:h.value,"onUpdate:page":a,"page-slot":D(r).state.collapsedRight?5:8,"page-count":k.value},null,8,["page","page-slot","page-count"])])):T("",!0)]),default:p(()=>[i(de,{show:c.value},{default:p(()=>[n.id>0?(y(),F("div",Sn,[C("div",Dn,[i(ie,{size:"large",src:n.avatar},null,8,["src"])]),C("div",$n,[C("div",Tn,[C("strong",null,$(n.nickname),1),C("span",null," @"+$(n.username),1),D(r).state.userInfo.id>0&&D(r).state.userInfo.username!=n.username&&n.is_friend?(y(),z(j,{key:0,class:"top-tag",type:"info",size:"small",round:""},{default:p(()=>[S(" \u597D\u53CB ")]),_:1})):T("",!0),n.is_admin?(y(),z(j,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:p(()=>[S(" \u7BA1\u7406\u5458 ")]),_:1})):T("",!0)]),C("div",Rn,"UID. "+$(n.id),1)]),D(r).state.userInfo.id>0&&D(r).state.userInfo.username!=n.username?(y(),F("div",zn,[i(re,{placement:"bottom-end",trigger:"click",size:"small",options:D(ne),onSelect:te},{default:p(()=>[i(ue,{quaternary:"",circle:""},{icon:p(()=>[i(le,null,{default:p(()=>[i(D(an))]),_:1})]),_:1})]),_:1},8,["options"])])):T("",!0)])):T("",!0),i(ce,{show:f.value,user:n,onSuccess:B},null,8,["show","user"]),i(En,{show:d.value,user:n,onSuccess:I},null,8,["show","user"])]),_:1},8,["show"]),i(me,{class:"profile-tabs-wrap",animated:""},{default:p(()=>[i(pe,{name:"post",tab:"\u6CE1\u6CE1"})]),_:1}),u.value?(y(),F("div",In,[i(fe,{num:w.value},null,8,["num"])])):(y(),F("div",Pn,[o.value.length===0?(y(),F("div",Un,[i(ge,{size:"large",description:"\u6682\u65E0\u6570\u636E"})])):T("",!0),(y(!0),F(qe,null,Me(o.value,q=>(y(),z(he,{key:q.id},{default:p(()=>[i(ve,{post:q},null,8,["post"])]),_:2},1024))),128))]))]),_:1})])}}});var Jn=O(On,[["__scopeId","data-v-7a6aaa02"]]);export{Jn as default}; diff --git a/web/dist/assets/User.7b771241.css b/web/dist/assets/User.7b771241.css deleted file mode 100644 index c858a635..00000000 --- a/web/dist/assets/User.7b771241.css +++ /dev/null @@ -1 +0,0 @@ -.whisper-wrap .whisper-line[data-v-3e021430]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-3e021430]{width:100%}.whisper-wrap .whisper-line[data-v-bf9bc04e]{margin-top:10px}.whisper-wrap .whisper-line.send-wrap .n-button[data-v-bf9bc04e]{width:100%}.profile-tabs-wrap[data-v-7a6aaa02]{padding:0 16px}.profile-baseinfo[data-v-7a6aaa02]{display:flex;padding:16px}.profile-baseinfo .avatar[data-v-7a6aaa02]{width:55px}.profile-baseinfo .base-info[data-v-7a6aaa02]{position:relative;width:calc(100% - 55px)}.profile-baseinfo .base-info .username[data-v-7a6aaa02]{line-height:16px;font-size:16px}.profile-baseinfo .base-info .uid[data-v-7a6aaa02]{font-size:14px;line-height:14px;margin-top:10px;opacity:.75}.profile-baseinfo .base-info .top-tag[data-v-7a6aaa02]{transform:scale(.75)}.profile-baseinfo .user-opts[data-v-7a6aaa02]{position:absolute;top:16px;right:16px;opacity:.75}.pagination-wrap[data-v-7a6aaa02]{padding:10px;display:flex;justify-content:center;overflow:hidden} diff --git a/web/dist/assets/Wallet-77044929.css b/web/dist/assets/Wallet-77044929.css new file mode 100644 index 00000000..7d3fb3a1 --- /dev/null +++ b/web/dist/assets/Wallet-77044929.css @@ -0,0 +1 @@ +.balance-wrap[data-v-870bd246]{padding:16px}.balance-wrap .balance-line[data-v-870bd246]{display:flex;justify-content:space-between}.balance-wrap .balance-line .balance-opts[data-v-870bd246]{display:flex;flex-direction:column}.bill-line[data-v-870bd246]{padding:16px;display:flex;justify-content:space-between}.bill-line .income[data-v-870bd246],.bill-line .out[data-v-870bd246]{font-weight:700}.bill-line .income[data-v-870bd246]{color:#18a058}.pagination-wrap[data-v-870bd246]{padding:10px;display:flex;justify-content:center;overflow:hidden}.qrcode-wrap[data-v-870bd246]{display:flex;flex-direction:column;align-items:center;justify-content:center}.qrcode-wrap .pay-tips[data-v-870bd246]{margin-top:16px}.qrcode-wrap .pay-sub-tips[data-v-870bd246]{margin-top:4px;font-size:12px;opacity:.75;display:flex;align-items:center}.dark .income[data-v-870bd246]{color:#63e2b7}.dark .main-content-wrap[data-v-870bd246]{background-color:#101014bf} diff --git a/web/dist/assets/Wallet-f39d6a4c.js b/web/dist/assets/Wallet-f39d6a4c.js new file mode 100644 index 00000000..fd88485f --- /dev/null +++ b/web/dist/assets/Wallet-f39d6a4c.js @@ -0,0 +1 @@ +import{_ as X}from"./post-skeleton-ffa76165.js";import{_ as Y}from"./main-nav.vue_vue_type_style_index_0_lang-be35896a.js";import{d as Z,r as c,j as J,c as _,V as e,a1 as o,o as n,_ as y,O as w,a,e as k,F as N,a4 as $,z as ee,v as te,M as r,Q as q,L as oe,a2 as ae,W as ne,X as se}from"./@vue-e0e89260.js";import{u as le}from"./vuex-473b3783.js";import{b as ce}from"./vue-router-b8e3382f.js";import{b as ie}from"./qrcode-9719fc56.js";import{P as _e,Q as re,R as ue,S as pe,_ as de}from"./index-347d1d96.js";import{a as me}from"./formatTime-cdf4e6f1.js";import{Q as ge}from"./@vicons-8f91201d.js";import{F as ve,i as he,Y as fe,Z as ye,e as we,a as ke,G as be,I as Se,j as xe,l as Ce,h as Ie,H as Re}from"./naive-ui-62663ad7.js";import"./vooks-a50491fd.js";import"./evtd-b614532e.js";import"./encode-utf8-f813de00.js";import"./dijkstrajs-f906a09e.js";import"./axios-4a70c6fc.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./@css-render-580d83ec.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./moment-2ab8298d.js";const P=m=>(ne("data-v-870bd246"),m=m(),se(),m),Ae={class:"balance-wrap"},ze={class:"balance-line"},Ne={class:"balance-opts"},$e={key:0,class:"pagination-wrap"},qe={key:0,class:"skeleton-wrap"},Pe={key:1},We={key:0,class:"empty-wrap"},Be={class:"bill-line"},Fe={key:0,class:"amount-options"},Le={key:1,style:{"margin-top":"10px"}},Oe={class:"qrcode-wrap"},Te=P(()=>a("canvas",{id:"qrcode-container"},null,-1)),Ve={class:"pay-tips"},Ee={class:"pay-sub-tips"},Me=P(()=>a("span",{style:{"margin-left":"6px"}}," 支付结果实时同步中... ",-1)),Qe=Z({__name:"Wallet",setup(m){const i=le(),W=ce(),g=c(!1),u=c(100),v=c(!1),p=c(""),h=c(!1),b=c([]),S=c(+W.query.p||1),x=c(20),C=c(0),B=c([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),R=()=>{h.value=!0,re({page:S.value,page_size:x.value}).then(s=>{h.value=!1,b.value=s.list,C.value=Math.ceil(s.pager.total_rows/x.value),window.scrollTo(0,0)}).catch(s=>{h.value=!1})},F=s=>{S.value=s,R()},A=()=>{const s=localStorage.getItem("PAOPAO_TOKEN")||"";s?_e(s).then(l=>{i.commit("updateUserinfo",l),i.commit("triggerAuth",!1),R()}).catch(l=>{i.commit("triggerAuth",!0),i.commit("userLogout")}):(i.commit("triggerAuth",!0),i.commit("userLogout"))},L=()=>{g.value=!0},O=s=>{v.value=!0,ue({amount:u.value}).then(l=>{v.value=!1,p.value=l.pay,ie.toCanvas(document.querySelector("#qrcode-container"),l.pay,{width:150,margin:2});const I=setInterval(()=>{pe({id:l.id}).then(d=>{d.status==="TRADE_SUCCESS"&&(clearInterval(I),window.$message.success("充值成功"),g.value=!1,p.value="",A())}).catch(d=>{console.log(d)})},2e3)}).catch(l=>{v.value=!1})},T=()=>{i.state.userInfo.balance==0?window.$message.warning("您暂无可提现资金"):window.$message.warning("该功能即将开放")};return J(()=>{A()}),(s,l)=>{const I=Y,d=fe,V=ye,f=we,z=ke,E=be,M=X,Q=Se,U=Re,D=ve,j=xe,G=Ce,H=Ie,K=he;return n(),_("div",null,[e(I,{title:"钱包"}),e(D,{class:"main-content-wrap",bordered:""},{footer:o(()=>[C.value>1?(n(),_("div",$e,[e(E,{page:S.value,"onUpdate:page":F,"page-slot":y(i).state.collapsedRight?5:8,"page-count":C.value},null,8,["page","page-slot","page-count"])])):w("",!0)]),default:o(()=>[a("div",Ae,[a("div",ze,[e(V,{label:"账户余额 (元)"},{default:o(()=>[e(d,{from:0,to:(y(i).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["to"])]),_:1}),a("div",Ne,[e(z,{vertical:""},{default:o(()=>[e(f,{size:"small",secondary:"",type:"primary",onClick:L},{default:o(()=>[k(" 充值 ")]),_:1}),e(f,{size:"small",secondary:"",type:"tertiary",onClick:T},{default:o(()=>[k(" 提现 ")]),_:1})]),_:1})])])]),h.value?(n(),_("div",qe,[e(M,{num:x.value},null,8,["num"])])):(n(),_("div",Pe,[b.value.length===0?(n(),_("div",We,[e(Q,{size:"large",description:"暂无数据"})])):w("",!0),(n(!0),_(N,null,$(b.value,t=>(n(),q(U,{key:t.id},{default:o(()=>[a("div",Be,[a("div",null,"NO."+r(t.id),1),a("div",null,r(t.reason),1),a("div",{class:oe({income:t.change_amount>=0,out:t.change_amount<0})},r((t.change_amount>0?"+":"")+(t.change_amount/100).toFixed(2)),3),a("div",null,r(y(me)(t.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),e(K,{show:g.value,"onUpdate:show":l[0]||(l[0]=t=>g.value=t)},{default:o(()=>[e(H,{bordered:!1,title:"请选择充值金额",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:o(()=>[p.value.length===0?(n(),_("div",Fe,[e(z,{align:"baseline"},{default:o(()=>[(n(!0),_(N,null,$(B.value,t=>(n(),q(f,{key:t,size:"small",secondary:"",type:u.value===t?"info":"default",onClick:ae(Ue=>u.value=t,["stop"])},{default:o(()=>[k(r(t/100)+"元 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):w("",!0),u.value>0&&p.value.length===0?(n(),_("div",Le,[e(f,{loading:v.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:O},{icon:o(()=>[e(j,null,{default:o(()=>[e(y(ge))]),_:1})]),default:o(()=>[k(" 前往支付 ")]),_:1},8,["loading"])])):w("",!0),ee(a("div",Oe,[Te,a("div",Ve," 请使用支付宝扫码支付"+r((u.value/100).toFixed(2))+"元 ",1),a("div",Ee,[e(G,{value:100,type:"info",dot:"",processing:""}),Me])],512),[[te,p.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});const yt=de(Qe,[["__scopeId","data-v-870bd246"]]);export{yt as default}; diff --git a/web/dist/assets/Wallet.0c985f96.js b/web/dist/assets/Wallet.0c985f96.js deleted file mode 100644 index ac6dbcda..00000000 --- a/web/dist/assets/Wallet.0c985f96.js +++ /dev/null @@ -1,30 +0,0 @@ -import{_ as se}from"./post-skeleton.38f0f247.js";import{_ as ae}from"./main-nav.3167f221.js";import{cw as Lt,cx as ue,cy as St,d as at,J as le,r as D,y as _t,a2 as Ut,aK as ce,c as Q,f as X,u as fe,x as kt,cz as de,j as ge,A as he,h as x,B as Z,W as R,Y as L,Z as I,ai as me,af as pe,a4 as b,a5 as S,aj as _e,cA as we,bA as ye,a3 as tt,a7 as et,a9 as nt,ab as It,ac as Tt,b4 as Ce,b5 as ve,aa as $,$ as Ee,cB as Be,cC as be,cD as Ae,K as Ne,ah as Se,cs as Ie,aA as Te,a6 as Mt,cb as Me,a8 as Re,bW as Pe,bX as Fe}from"./index.d4f5aad2.js";import{f as De}from"./formatTime.e07969bb.js";import{_ as Le}from"./List.a66e9ae7.js";import{_ as Ue}from"./Pagination.c13c2d34.js";import{a as ke,_ as ze}from"./Skeleton.e1c16fcb.js";var Rt=1/0,Ve=17976931348623157e292;function xe(e){if(!e)return e===0?e:0;if(e=Lt(e),e===Rt||e===-Rt){var t=e<0?-1:1;return t*Ve}return e===e?e:0}function $e(e){var t=xe(e),i=t%1;return t===t?i?t-i:t:0}var He=ue.isFinite,Ke=Math.min;function Oe(e){var t=Math[e];return function(i,r){if(i=Lt(i),r=r==null?0:Ke($e(r),292),r&&He(i)){var o=(St(i)+"e").split("e"),n=t(o[0]+"e"+(+o[1]+r));return o=(St(n)+"e").split("e"),+(o[0]+"e"+(+o[1]-r))}return t(i)}}var Je=Oe("round"),Ye=Je;const je=e=>1-Math.pow(1-e,5);function qe(e){const{from:t,to:i,duration:r,onUpdate:o,onFinish:n}=e,s=()=>{const u=performance.now(),l=Math.min(u-a,r),c=t+(i-t)*je(l/r);if(l===r){n();return}o(c),requestAnimationFrame(s)},a=performance.now();s()}const Ge={to:{type:Number,default:0},precision:{type:Number,default:0},showSeparator:Boolean,locale:String,from:{type:Number,default:0},active:{type:Boolean,default:!0},duration:{type:Number,default:2e3},onFinish:Function};var We=at({name:"NumberAnimation",props:Ge,setup(e){const{localeRef:t}=le("name"),{duration:i}=e,r=D(e.from),o=_t(()=>{const{locale:f}=e;return f!==void 0?f:t.value});let n=!1;const s=f=>{r.value=f},a=()=>{var f;r.value=e.to,n=!1,(f=e.onFinish)===null||f===void 0||f.call(e)},u=(f=e.from,g=e.to)=>{n=!0,r.value=e.from,f!==g&&qe({from:f,to:g,duration:i,onUpdate:s,onFinish:a})},l=_t(()=>{var f;const p=Ye(r.value,e.precision).toFixed(e.precision).split("."),_=new Intl.NumberFormat(o.value),E=(f=_.formatToParts(.5).find(d=>d.type==="decimal"))===null||f===void 0?void 0:f.value,m=e.showSeparator?_.format(Number(p[0])):p[0],w=p[1];return{integer:m,decimal:w,decimalSeparator:E}});function c(){n||u()}return Ut(()=>{ce(()=>{e.active&&u()})}),Object.assign({formattedValue:l},{play:c})},render(){const{formattedValue:{integer:e,decimal:t,decimalSeparator:i}}=this;return[e,t?i:null,t]}}),Qe=Q("statistic",[X("label",` - font-weight: var(--n-label-font-weight); - transition: .3s color var(--n-bezier); - font-size: var(--n-label-font-size); - color: var(--n-label-text-color); - `),Q("statistic-value",` - margin-top: 4px; - font-weight: var(--n-value-font-weight); - `,[X("prefix",` - margin: 0 4px 0 0; - font-size: var(--n-value-font-size); - transition: .3s color var(--n-bezier); - color: var(--n-value-prefix-text-color); - `,[Q("icon",{verticalAlign:"-0.125em"})]),X("content",` - font-size: var(--n-value-font-size); - transition: .3s color var(--n-bezier); - color: var(--n-value-text-color); - `),X("suffix",` - margin: 0 0 0 4px; - font-size: var(--n-value-font-size); - transition: .3s color var(--n-bezier); - color: var(--n-value-suffix-text-color); - `,[Q("icon",{verticalAlign:"-0.125em"})])])]);const Xe=Object.assign(Object.assign({},kt.props),{tabularNums:Boolean,label:String,value:[String,Number]});var Ze=at({name:"Statistic",props:Xe,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:i,mergedRtlRef:r}=fe(e),o=kt("Statistic","-statistic",Qe,de,e,t),n=ge("Statistic",r,t),s=_t(()=>{const{self:{labelFontWeight:u,valueFontSize:l,valueFontWeight:c,valuePrefixTextColor:y,labelTextColor:f,valueSuffixTextColor:g,valueTextColor:p,labelFontSize:_},common:{cubicBezierEaseInOut:E}}=o.value;return{"--n-bezier":E,"--n-label-font-size":_,"--n-label-font-weight":u,"--n-label-text-color":f,"--n-value-font-weight":c,"--n-value-font-size":l,"--n-value-prefix-text-color":y,"--n-value-suffix-text-color":g,"--n-value-text-color":p}}),a=i?he("statistic",void 0,s,e):void 0;return{rtlEnabled:n,mergedClsPrefix:t,cssVars:i?void 0:s,themeClass:a==null?void 0:a.themeClass,onRender:a==null?void 0:a.onRender}},render(){var e;const{mergedClsPrefix:t,$slots:{default:i,label:r,prefix:o,suffix:n}}=this;return(e=this.onRender)===null||e===void 0||e.call(this),x("div",{class:[`${t}-statistic`,this.themeClass,this.rtlEnabled&&`${t}-statistic--rtl`],style:this.cssVars},Z(r,s=>x("div",{class:`${t}-statistic__label`},this.label||s)),x("div",{class:`${t}-statistic-value`,style:{fontVariantNumeric:this.tabularNums?"tabular-nums":""}},Z(o,s=>s&&x("span",{class:`${t}-statistic-value__prefix`},s)),this.value!==void 0?x("span",{class:`${t}-statistic-value__content`},this.value):Z(i,s=>s&&x("span",{class:`${t}-statistic-value__content`},s)),Z(n,s=>s&&x("span",{class:`${t}-statistic-value__suffix`},s))))}});const tn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},en=I("path",{d:"M102.41 32C62.38 32 32 64.12 32 103.78v304.45C32 447.86 64.38 480 104.41 480h303.2c40 0 72.39-32.14 72.39-71.77v-3.11c-1.35-.56-115.47-48.57-174.5-76.7c-39.82 48.57-91.18 78-144.5 78c-90.18 0-120.8-78.22-78.1-129.72c9.31-11.22 25.15-21.94 49.73-28c38.45-9.36 99.64 5.85 157 24.61a309.41 309.41 0 0 0 25.46-61.67H138.34V194h91.13v-31.83H119.09v-17.75h110.38V99s0-7.65 7.82-7.65h44.55v53H391v17.75H281.84V194h89.08a359.41 359.41 0 0 1-37.72 94.43c27 9.69 49.31 18.88 67.39 24.89c60.32 20 77.23 22.45 79.41 22.7V103.78C480 64.12 447.6 32 407.61 32h-305.2zM152 274.73q-5.81.06-11.67.63c-11.3 1.13-32.5 6.07-44.09 16.23c-34.74 30-13.94 84.93 56.37 84.93c40.87 0 81.71-25.9 113.79-67.37c-41.36-20-77-34.85-114.4-34.42z",fill:"currentColor"},null,-1),nn=[en];var on=at({name:"LogoAlipay",render:function(t,i){return R(),L("svg",tn,nn)}}),G={},rn=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},zt={},T={};let Et;const sn=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];T.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};T.getSymbolTotalCodewords=function(t){return sn[t]};T.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};T.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');Et=t};T.isKanjiModeEnabled=function(){return typeof Et!="undefined"};T.toSJIS=function(t){return Et(t)};var ut={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+i)}}e.isValid=function(r){return r&&typeof r.bit!="undefined"&&r.bit>=0&&r.bit<4},e.from=function(r,o){if(e.isValid(r))return r;try{return t(r)}catch{return o}}})(ut);function Vt(){this.buffer=[],this.length=0}Vt.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let i=0;i>>t-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var an=Vt;function W(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}W.prototype.set=function(e,t,i,r){const o=e*this.size+t;this.data[o]=i,r&&(this.reservedBit[o]=!0)};W.prototype.get=function(e,t){return this.data[e*this.size+t]};W.prototype.xor=function(e,t,i){this.data[e*this.size+t]^=i};W.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var un=W,xt={};(function(e){const t=T.getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const o=Math.floor(r/7)+2,n=t(r),s=n===145?26:Math.ceil((n-13)/(2*o-2))*2,a=[n-7];for(let u=1;u=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const n=o.size;let s=0,a=0,u=0,l=null,c=null;for(let y=0;y=5&&(s+=t.N1+(a-5)),l=g,a=1),g=o.get(f,y),g===c?u++:(u>=5&&(s+=t.N1+(u-5)),c=g,u=1)}a>=5&&(s+=t.N1+(a-5)),u>=5&&(s+=t.N1+(u-5))}return s},e.getPenaltyN2=function(o){const n=o.size;let s=0;for(let a=0;a=10&&(a===1488||a===93)&&s++,u=u<<1&2047|o.get(c,l),c>=10&&(u===1488||u===93)&&s++}return s*t.N3},e.getPenaltyN4=function(o){let n=0;const s=o.data.length;for(let u=0;u=0;){const s=n[0];for(let u=0;u0){const n=new Uint8Array(this.degree);return n.set(r,o),n}return r};var cn=Bt,Jt={},z={},bt={};bt.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var U={};const Yt="[0-9]+",fn="[A-Z $%*+\\-./:]+";let q="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";q=q.replace(/u/g,"\\u");const dn="(?:(?![A-Z0-9 $%*+\\-./:]|"+q+`)(?:.|[\r -]))+`;U.KANJI=new RegExp(q,"g");U.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");U.BYTE=new RegExp(dn,"g");U.NUMERIC=new RegExp(Yt,"g");U.ALPHANUMERIC=new RegExp(fn,"g");const gn=new RegExp("^"+q+"$"),hn=new RegExp("^"+Yt+"$"),mn=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");U.testKanji=function(t){return gn.test(t)};U.testNumeric=function(t){return hn.test(t)};U.testAlphanumeric=function(t){return mn.test(t)};(function(e){const t=bt,i=U;e.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(n,s){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?n.ccBits[0]:s<27?n.ccBits[1]:n.ccBits[2]},e.getBestModeForData=function(n){return i.testNumeric(n)?e.NUMERIC:i.testAlphanumeric(n)?e.ALPHANUMERIC:i.testKanji(n)?e.KANJI:e.BYTE},e.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},e.isValid=function(n){return n&&n.bit&&n.ccBits};function r(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(n,s){if(e.isValid(n))return n;try{return r(n)}catch{return s}}})(z);(function(e){const t=T,i=lt,r=ut,o=z,n=bt,s=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,a=t.getBCHDigit(s);function u(f,g,p){for(let _=1;_<=40;_++)if(g<=e.getCapacity(_,p,f))return _}function l(f,g){return o.getCharCountIndicator(f,g)+4}function c(f,g){let p=0;return f.forEach(function(_){p+=l(_.mode,g)+_.getBitsLength()}),p}function y(f,g){for(let p=1;p<=40;p++)if(c(f,p)<=e.getCapacity(p,g,o.MIXED))return p}e.from=function(g,p){return n.isValid(g)?parseInt(g,10):p},e.getCapacity=function(g,p,_){if(!n.isValid(g))throw new Error("Invalid QR Code version");typeof _=="undefined"&&(_=o.BYTE);const E=t.getSymbolTotalCodewords(g),m=i.getTotalCodewordsCount(g,p),w=(E-m)*8;if(_===o.MIXED)return w;const d=w-l(_,g);switch(_){case o.NUMERIC:return Math.floor(d/10*3);case o.ALPHANUMERIC:return Math.floor(d/11*2);case o.KANJI:return Math.floor(d/13);case o.BYTE:default:return Math.floor(d/8)}},e.getBestVersionForData=function(g,p){let _;const E=r.from(p,r.M);if(Array.isArray(g)){if(g.length>1)return y(g,E);if(g.length===0)return 1;_=g[0]}else _=g;return u(_.mode,_.getLength(),E)},e.getEncodedBits=function(g){if(!n.isValid(g)||g<7)throw new Error("Invalid QR Code version");let p=g<<12;for(;t.getBCHDigit(p)-a>=0;)p^=s<=0;)o^=qt<0&&(r=this.data.substr(i),o=parseInt(r,10),t.put(o,n*3+1))};var wn=H;const yn=z,dt=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function K(e){this.mode=yn.ALPHANUMERIC,this.data=e}K.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};K.prototype.getLength=function(){return this.data.length};K.prototype.getBitsLength=function(){return K.getBitsLength(this.data.length)};K.prototype.write=function(t){let i;for(i=0;i+2<=this.data.length;i+=2){let r=dt.indexOf(this.data[i])*45;r+=dt.indexOf(this.data[i+1]),t.put(r,11)}this.data.length%2&&t.put(dt.indexOf(this.data[i]),6)};var Cn=K,vn=function(t){for(var i=[],r=t.length,o=0;o=55296&&n<=56319&&r>o+1){var s=t.charCodeAt(o+1);s>=56320&&s<=57343&&(n=(n-55296)*1024+s-56320+65536,o+=1)}if(n<128){i.push(n);continue}if(n<2048){i.push(n>>6|192),i.push(n&63|128);continue}if(n<55296||n>=57344&&n<65536){i.push(n>>12|224),i.push(n>>6&63|128),i.push(n&63|128);continue}if(n>=65536&&n<=1114111){i.push(n>>18|240),i.push(n>>12&63|128),i.push(n>>6&63|128),i.push(n&63|128);continue}i.push(239,191,189)}return new Uint8Array(i).buffer};const En=vn,Bn=z;function O(e){this.mode=Bn.BYTE,typeof e=="string"&&(e=En(e)),this.data=new Uint8Array(e)}O.getBitsLength=function(t){return t*8};O.prototype.getLength=function(){return this.data.length};O.prototype.getBitsLength=function(){return O.getBitsLength(this.data.length)};O.prototype.write=function(e){for(let t=0,i=this.data.length;t=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` -Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),e.put(i,13)}};var Sn=J,Wt={exports:{}};(function(e){var t={single_source_shortest_paths:function(i,r,o){var n={},s={};s[r]=0;var a=t.PriorityQueue.make();a.push(r,0);for(var u,l,c,y,f,g,p,_,E;!a.empty();){u=a.pop(),l=u.value,y=u.cost,f=i[l]||{};for(c in f)f.hasOwnProperty(c)&&(g=f[c],p=y+g,_=s[c],E=typeof s[c]=="undefined",(E||_>p)&&(s[c]=p,a.push(c,p),n[c]=l))}if(typeof o!="undefined"&&typeof s[o]=="undefined"){var m=["Could not find a path from ",r," to ",o,"."].join("");throw new Error(m)}return n},extract_shortest_path_from_predecessor_list:function(i,r){for(var o=[],n=r;n;)o.push(n),i[n],n=i[n];return o.reverse(),o},find_path:function(i,r,o){var n=t.single_source_shortest_paths(i,r,o);return t.extract_shortest_path_from_predecessor_list(n,o)},PriorityQueue:{make:function(i){var r=t.PriorityQueue,o={},n;i=i||{};for(n in r)r.hasOwnProperty(n)&&(o[n]=r[n]);return o.queue=[],o.sorter=i.sorter||r.default_sorter,o},default_sorter:function(i,r){return i.cost-r.cost},push:function(i,r){var o={value:i,cost:r};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Wt);(function(e){const t=z,i=wn,r=Cn,o=bn,n=Sn,s=U,a=T,u=Wt.exports;function l(m){return unescape(encodeURIComponent(m)).length}function c(m,w,d){const h=[];let C;for(;(C=m.exec(d))!==null;)h.push({data:C[0],index:C.index,mode:w,length:C[0].length});return h}function y(m){const w=c(s.NUMERIC,t.NUMERIC,m),d=c(s.ALPHANUMERIC,t.ALPHANUMERIC,m);let h,C;return a.isKanjiModeEnabled()?(h=c(s.BYTE,t.BYTE,m),C=c(s.KANJI,t.KANJI,m)):(h=c(s.BYTE_KANJI,t.BYTE,m),C=[]),w.concat(d,h,C).sort(function(B,A){return B.index-A.index}).map(function(B){return{data:B.data,mode:B.mode,length:B.length}})}function f(m,w){switch(w){case t.NUMERIC:return i.getBitsLength(m);case t.ALPHANUMERIC:return r.getBitsLength(m);case t.KANJI:return n.getBitsLength(m);case t.BYTE:return o.getBitsLength(m)}}function g(m){return m.reduce(function(w,d){const h=w.length-1>=0?w[w.length-1]:null;return h&&h.mode===d.mode?(w[w.length-1].data+=d.data,w):(w.push(d),w)},[])}function p(m){const w=[];for(let d=0;d=0&&a<=6&&(u===0||u===6)||u>=0&&u<=6&&(a===0||a===6)||a>=2&&a<=4&&u>=2&&u<=4?e.set(n+a,s+u,!0,!0):e.set(n+a,s+u,!1,!0))}}function Un(e){const t=e.size;for(let i=8;i>a&1)===1,e.set(o,n,s,!0),e.set(n,o,s,!0)}function mt(e,t,i){const r=e.size,o=Fn.getEncodedBits(t,i);let n,s;for(n=0;n<15;n++)s=(o>>n&1)===1,n<6?e.set(n,8,s,!0):n<8?e.set(n+1,8,s,!0):e.set(r-15+n,8,s,!0),n<8?e.set(8,r-n-1,s,!0):n<9?e.set(8,15-n-1+1,s,!0):e.set(8,15-n-1,s,!0);e.set(r-8,8,1,!0)}function Vn(e,t){const i=e.size;let r=-1,o=i-1,n=7,s=0;for(let a=i-1;a>0;a-=2)for(a===6&&a--;;){for(let u=0;u<2;u++)if(!e.isReserved(o,a-u)){let l=!1;s>>n&1)===1),e.set(o,a-u,l),n--,n===-1&&(s++,n=7)}if(o+=r,o<0||i<=o){o-=r,r=-r;break}}}function xn(e,t,i){const r=new In;i.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),Dn.getCharCountIndicator(u.mode,e)),u.write(r)});const o=ft.getSymbolTotalCodewords(e),n=Ct.getTotalCodewordsCount(e,t),s=(o-n)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const a=(s-r.getLengthInBits())/8;for(let u=0;u=7&&zn(u,t),Vn(u,s),isNaN(r)&&(r=yt.getBestMask(u,mt.bind(null,u,i))),yt.applyMask(r,u),mt(u,i,r),{modules:u,version:t,errorCorrectionLevel:i,maskPattern:r,segments:o}}zt.create=function(t,i){if(typeof t=="undefined"||t==="")throw new Error("No input text");let r=gt.M,o,n;return typeof i!="undefined"&&(r=gt.from(i.errorCorrectionLevel,gt.M),o=st.from(i.version),n=yt.from(i.maskPattern),i.toSJISFunc&&ft.setToSJISFunction(i.toSJISFunc)),Hn(t,o,r,n)};var Qt={},At={};(function(e){function t(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let r=i.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+i);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(n){return[n,n]}))),r.length===6&&r.push("F","F");const o=parseInt(r.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const o=typeof r.margin=="undefined"||r.margin===null||r.margin<0?4:r.margin,n=r.width&&r.width>=21?r.width:void 0,s=r.scale||4;return{width:n,scale:n?4:s,margin:o,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,o){return o.width&&o.width>=r+o.margin*2?o.width/(r+o.margin*2):o.scale},e.getImageWidth=function(r,o){const n=e.getScale(r,o);return Math.floor((r+o.margin*2)*n)},e.qrToImageData=function(r,o,n){const s=o.modules.size,a=o.modules.data,u=e.getScale(s,n),l=Math.floor((s+n.margin*2)*u),c=n.margin*u,y=[n.color.light,n.color.dark];for(let f=0;f=c&&g>=c&&f0&&u>0&&e[a-1]||(r+=n?pt("M",u+i,.5+l+i):pt("m",o,0),o=0,n=!1),u+1':"",l="',c='viewBox="0 0 '+a+" "+a+'"',y=o.width?'width="'+o.width+'" height="'+o.width+'" ':"",f=''+u+l+` -`;return typeof r=="function"&&r(null,f),f};const Jn=rn,vt=zt,Zt=Qt,Yn=Xt;function Nt(e,t,i,r,o){const n=[].slice.call(arguments,1),s=n.length,a=typeof n[s-1]=="function";if(!a&&!Jn())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(o=i,i=t,t=r=void 0):s===3&&(t.getContext&&typeof o=="undefined"?(o=r,r=void 0):(o=r,r=i,i=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(i=t,t=r=void 0):s===2&&!t.getContext&&(r=i,i=t,t=void 0),new Promise(function(u,l){try{const c=vt.create(i,r);u(e(c,t,r))}catch(c){l(c)}})}try{const u=vt.create(i,r);o(null,e(u,t,r))}catch(u){o(u)}}G.create=vt.create;G.toCanvas=Nt.bind(null,Zt.render);G.toDataURL=Nt.bind(null,Zt.renderToDataURL);G.toString=Nt.bind(null,function(e,t,i){return Yn.render(e,i)});const te=e=>(Pe("data-v-4ef16ff5"),e=e(),Fe(),e),jn={class:"balance-wrap"},qn={class:"balance-line"},Gn={class:"balance-opts"},Wn={key:0,class:"pagination-wrap"},Qn={key:0,class:"skeleton-wrap"},Xn={key:1},Zn={key:0,class:"empty-wrap"},to={class:"bill-line"},eo={key:0,class:"amount-options"},no={key:1,style:{"margin-top":"10px"}},oo={class:"qrcode-wrap"},ro=te(()=>I("canvas",{id:"qrcode-container"},null,-1)),io={class:"pay-tips"},so={class:"pay-sub-tips"},ao=te(()=>I("span",{style:{"margin-left":"6px"}}," \u652F\u4ED8\u7ED3\u679C\u5B9E\u65F6\u540C\u6B65\u4E2D... ",-1)),uo=at({__name:"Wallet",setup(e){const t=Ee(),i=_e(),r=D(!1),o=D(100),n=D(!1),s=D(""),a=D(!1),u=D([]),l=D(+i.query.p||1),c=D(20),y=D(0),f=D([100,200,300,500,1e3,3e3,5e3,1e4,5e4]),g=()=>{a.value=!0,Be({page:l.value,page_size:c.value}).then(d=>{a.value=!1,u.value=d.list,y.value=Math.ceil(d.pager.total_rows/c.value),window.scrollTo(0,0)}).catch(d=>{a.value=!1})},p=d=>{l.value=d,g()},_=()=>{const d=localStorage.getItem("PAOPAO_TOKEN")||"";d?we(d).then(h=>{t.commit("updateUserinfo",h),t.commit("triggerAuth",!1),g()}).catch(h=>{t.commit("triggerAuth",!0),t.commit("userLogout")}):(t.commit("triggerAuth",!0),t.commit("userLogout"))},E=()=>{r.value=!0},m=d=>{n.value=!0,be({amount:o.value}).then(h=>{n.value=!1,s.value=h.pay,G.toCanvas(document.querySelector("#qrcode-container"),h.pay,{width:150,margin:2});const C=setInterval(()=>{Ae({id:h.id}).then(v=>{v.status==="TRADE_SUCCESS"&&(clearInterval(C),window.$message.success("\u5145\u503C\u6210\u529F"),r.value=!1,s.value="",_())}).catch(v=>{console.log(v)})},2e3)}).catch(h=>{n.value=!1})},w=()=>{t.state.userInfo.balance==0?window.$message.warning("\u60A8\u6682\u65E0\u53EF\u63D0\u73B0\u8D44\u91D1"):window.$message.warning("\u8BE5\u529F\u80FD\u5373\u5C06\u5F00\u653E")};return Ut(()=>{_()}),(d,h)=>{const C=ae,v=We,B=Ze,A=Ne,P=Se,M=Ue,V=se,Y=ke,F=ze,ee=Le,ne=pe,oe=Ie,re=Te,ie=ye;return R(),L("div",null,[b(C,{title:"\u94B1\u5305"}),b(ee,{class:"main-content-wrap",bordered:""},{footer:S(()=>[y.value>1?(R(),L("div",Wn,[b(M,{page:l.value,"onUpdate:page":p,"page-slot":tt(t).state.collapsedRight?5:8,"page-count":y.value},null,8,["page","page-slot","page-count"])])):et("",!0)]),default:S(()=>[I("div",jn,[I("div",qn,[b(B,{label:"\u8D26\u6237\u4F59\u989D (\u5143)"},{default:S(()=>[b(v,{from:0,to:(tt(t).state.userInfo.balance||0)/100,duration:500,precision:2},null,8,["from","to"])]),_:1}),I("div",Gn,[b(P,{vertical:""},{default:S(()=>[b(A,{size:"small",secondary:"",type:"primary",onClick:E},{default:S(()=>[nt(" \u5145\u503C ")]),_:1}),b(A,{size:"small",secondary:"",type:"tertiary",onClick:w},{default:S(()=>[nt(" \u63D0\u73B0 ")]),_:1})]),_:1})])])]),a.value?(R(),L("div",Qn,[b(V,{num:c.value},null,8,["num"])])):(R(),L("div",Xn,[u.value.length===0?(R(),L("div",Zn,[b(Y,{size:"large",description:"\u6682\u65E0\u6570\u636E"})])):et("",!0),(R(!0),L(It,null,Tt(u.value,N=>(R(),Mt(F,{key:N.id},{default:S(()=>[I("div",to,[I("div",null,"NO."+$(N.id),1),I("div",null,$(N.reason),1),I("div",{class:Me({income:N.change_amount>=0,out:N.change_amount<0})},$((N.change_amount>0?"+":"")+(N.change_amount/100).toFixed(2)),3),I("div",null,$(tt(De)(N.created_on)),1)])]),_:2},1024))),128))]))]),_:1}),b(ie,{show:r.value,"onUpdate:show":h[0]||(h[0]=N=>r.value=N)},{default:S(()=>[b(re,{bordered:!1,title:"\u8BF7\u9009\u62E9\u5145\u503C\u91D1\u989D",role:"dialog","aria-modal":"true",style:{width:"100%","max-width":"330px"}},{default:S(()=>[s.value.length===0?(R(),L("div",eo,[b(P,{align:"baseline"},{default:S(()=>[(R(!0),L(It,null,Tt(f.value,N=>(R(),Mt(A,{key:N,size:"small",secondary:"",type:o.value===N?"info":"default",onClick:Re(lo=>o.value=N,["stop"])},{default:S(()=>[nt($(N/100)+"\u5143 ",1)]),_:2},1032,["type","onClick"]))),128))]),_:1})])):et("",!0),o.value>0&&s.value.length===0?(R(),L("div",no,[b(A,{loading:n.value,strong:"",secondary:"",type:"info",style:{width:"100%"},onClick:m},{icon:S(()=>[b(ne,null,{default:S(()=>[b(tt(on))]),_:1})]),default:S(()=>[nt(" \u524D\u5F80\u652F\u4ED8 ")]),_:1},8,["loading"])])):et("",!0),Ce(I("div",oo,[ro,I("div",io," \u8BF7\u4F7F\u7528\u652F\u4ED8\u5B9D\u626B\u7801\u652F\u4ED8"+$((o.value/100).toFixed(2))+"\u5143 ",1),I("div",so,[b(oe,{value:100,type:"info",dot:"",processing:""}),ao])],512),[[ve,s.value.length>0]])]),_:1})]),_:1},8,["show"])])}}});var wo=me(uo,[["__scopeId","data-v-4ef16ff5"]]);export{wo as default}; diff --git a/web/dist/assets/Wallet.e5757b5e.css b/web/dist/assets/Wallet.e5757b5e.css deleted file mode 100644 index b0c3d8ec..00000000 --- a/web/dist/assets/Wallet.e5757b5e.css +++ /dev/null @@ -1 +0,0 @@ -.balance-wrap[data-v-4ef16ff5]{padding:16px}.balance-wrap .balance-line[data-v-4ef16ff5]{display:flex;justify-content:space-between}.balance-wrap .balance-line .balance-opts[data-v-4ef16ff5]{display:flex;flex-direction:column}.bill-line[data-v-4ef16ff5]{padding:16px;display:flex;justify-content:space-between}.bill-line .income[data-v-4ef16ff5],.bill-line .out[data-v-4ef16ff5]{font-weight:700}.bill-line .income[data-v-4ef16ff5]{color:#18a058}.pagination-wrap[data-v-4ef16ff5]{padding:10px;display:flex;justify-content:center;overflow:hidden}.qrcode-wrap[data-v-4ef16ff5]{display:flex;flex-direction:column;align-items:center;justify-content:center}.qrcode-wrap .pay-tips[data-v-4ef16ff5]{margin-top:16px}.qrcode-wrap .pay-sub-tips[data-v-4ef16ff5]{margin-top:4px;font-size:12px;opacity:.75;display:flex;align-items:center}.dark .income[data-v-4ef16ff5]{color:#63e2b7} diff --git a/web/dist/assets/async-validator-dee29e8b.js b/web/dist/assets/async-validator-dee29e8b.js new file mode 100644 index 00000000..90bf3087 --- /dev/null +++ b/web/dist/assets/async-validator-dee29e8b.js @@ -0,0 +1,12 @@ +function R(){return R=Object.assign?Object.assign.bind():function(i){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function M(i,e,r){return re()?M=Reflect.construct.bind():M=function(t,f,a){var s=[null];s.push.apply(s,f);var d=Function.bind.apply(t,s),w=new d;return a&&T(w,a.prototype),w},M.apply(null,arguments)}function ne(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function J(i){var e=typeof Map=="function"?new Map:void 0;return J=function(n){if(n===null||!ne(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,t)}function t(){return M(n,arguments,U(this).constructor)}return t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),T(t,n)},J(i)}var te=/%[sdj%]/g,ie=function(){};typeof process<"u"&&process.env;function W(i){if(!i||!i.length)return null;var e={};return i.forEach(function(r){var n=r.field;e[n]=e[n]||[],e[n].push(r)}),e}function F(i){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n=f)return s;switch(s){case"%s":return String(r[t++]);case"%d":return Number(r[t++]);case"%j":try{return JSON.stringify(r[t++])}catch{return"[Circular]"}break;default:return s}});return a}return i}function ae(i){return i==="string"||i==="url"||i==="hex"||i==="email"||i==="date"||i==="pattern"}function v(i,e){return!!(i==null||e==="array"&&Array.isArray(i)&&!i.length||ae(e)&&typeof i=="string"&&!i)}function fe(i,e,r){var n=[],t=0,f=i.length;function a(s){n.push.apply(n,s||[]),t++,t===f&&r(n)}i.forEach(function(s){e(s,a)})}function G(i,e,r){var n=0,t=i.length;function f(a){if(a&&a.length){r(a);return}var s=n;n=n+1,s()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},D={integer:function(e){return D.number(e)&&parseInt(e,10)===e},float:function(e){return D.number(e)&&!D.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!D.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(X.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(pe())},hex:function(e){return typeof e=="string"&&!!e.match(X.hex)}},ye=function(e,r,n,t,f){if(e.required&&r===void 0){C(e,r,n,t,f);return}var a=["integer","float","array","regexp","object","method","email","number","date","url","hex"],s=e.type;a.indexOf(s)>-1?D[s](r)||t.push(F(f.messages.types[s],e.fullField,e.type)):s&&typeof r!==e.type&&t.push(F(f.messages.types[s],e.fullField,e.type))},ge=function(e,r,n,t,f){var a=typeof e.len=="number",s=typeof e.min=="number",d=typeof e.max=="number",w=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,h=r,m=null,l=typeof r=="number",O=typeof r=="string",x=Array.isArray(r);if(l?m="number":O?m="string":x&&(m="array"),!m)return!1;x&&(h=r.length),O&&(h=r.replace(w,"_").length),a?h!==e.len&&t.push(F(f.messages[m].len,e.fullField,e.len)):s&&!d&&he.max?t.push(F(f.messages[m].max,e.fullField,e.max)):s&&d&&(he.max)&&t.push(F(f.messages[m].range,e.fullField,e.min,e.max))},N="enum",he=function(e,r,n,t,f){e[N]=Array.isArray(e[N])?e[N]:[],e[N].indexOf(r)===-1&&t.push(F(f.messages[N],e.fullField,e[N].join(", ")))},ve=function(e,r,n,t,f){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(r)||t.push(F(f.messages.pattern.mismatch,e.fullField,r,e.pattern));else if(typeof e.pattern=="string"){var a=new RegExp(e.pattern);a.test(r)||t.push(F(f.messages.pattern.mismatch,e.fullField,r,e.pattern))}}},c={required:C,whitespace:ce,type:ye,range:ge,enum:he,pattern:ve},me=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(v(r,"string")&&!e.required)return n();c.required(e,r,t,a,f,"string"),v(r,"string")||(c.type(e,r,t,a,f),c.range(e,r,t,a,f),c.pattern(e,r,t,a,f),e.whitespace===!0&&c.whitespace(e,r,t,a,f))}n(a)},le=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(v(r)&&!e.required)return n();c.required(e,r,t,a,f),r!==void 0&&c.type(e,r,t,a,f)}n(a)},we=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(r===""&&(r=void 0),v(r)&&!e.required)return n();c.required(e,r,t,a,f),r!==void 0&&(c.type(e,r,t,a,f),c.range(e,r,t,a,f))}n(a)},qe=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(v(r)&&!e.required)return n();c.required(e,r,t,a,f),r!==void 0&&c.type(e,r,t,a,f)}n(a)},be=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(v(r)&&!e.required)return n();c.required(e,r,t,a,f),v(r)||c.type(e,r,t,a,f)}n(a)},Fe=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(v(r)&&!e.required)return n();c.required(e,r,t,a,f),r!==void 0&&(c.type(e,r,t,a,f),c.range(e,r,t,a,f))}n(a)},xe=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(v(r)&&!e.required)return n();c.required(e,r,t,a,f),r!==void 0&&(c.type(e,r,t,a,f),c.range(e,r,t,a,f))}n(a)},Oe=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(r==null&&!e.required)return n();c.required(e,r,t,a,f,"array"),r!=null&&(c.type(e,r,t,a,f),c.range(e,r,t,a,f))}n(a)},Ee=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(v(r)&&!e.required)return n();c.required(e,r,t,a,f),r!==void 0&&c.type(e,r,t,a,f)}n(a)},Ae="enum",Pe=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(v(r)&&!e.required)return n();c.required(e,r,t,a,f),r!==void 0&&c[Ae](e,r,t,a,f)}n(a)},je=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(v(r,"string")&&!e.required)return n();c.required(e,r,t,a,f),v(r,"string")||c.pattern(e,r,t,a,f)}n(a)},_e=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(v(r,"date")&&!e.required)return n();if(c.required(e,r,t,a,f),!v(r,"date")){var d;r instanceof Date?d=r:d=new Date(r),c.type(e,d,t,a,f),d&&c.range(e,d.getTime(),t,a,f)}}n(a)},Re=function(e,r,n,t,f){var a=[],s=Array.isArray(r)?"array":typeof r;c.required(e,r,t,a,f,s),n(a)},B=function(e,r,n,t,f){var a=e.type,s=[],d=e.required||!e.required&&t.hasOwnProperty(e.field);if(d){if(v(r,a)&&!e.required)return n();c.required(e,r,t,s,f,a),v(r,a)||c.type(e,r,t,s,f)}n(s)},Ne=function(e,r,n,t,f){var a=[],s=e.required||!e.required&&t.hasOwnProperty(e.field);if(s){if(v(r)&&!e.required)return n();c.required(e,r,t,a,f)}n(a)},S={string:me,method:le,number:we,boolean:qe,regexp:be,integer:Fe,float:xe,array:Oe,object:Ee,enum:Pe,pattern:je,date:_e,url:B,hex:B,email:B,required:Re,any:Ne};function Z(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var I=Z(),L=function(){function i(r){this.rules=null,this._messages=I,this.define(r)}var e=i.prototype;return e.define=function(n){var t=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(f){var a=n[f];t.rules[f]=Array.isArray(a)?a:[a]})},e.messages=function(n){return n&&(this._messages=Q(Z(),n)),this._messages},e.validate=function(n,t,f){var a=this;t===void 0&&(t={}),f===void 0&&(f=function(){});var s=n,d=t,w=f;if(typeof d=="function"&&(w=d,d={}),!this.rules||Object.keys(this.rules).length===0)return w&&w(null,s),Promise.resolve(s);function h(u){var g=[],o={};function A(y){if(Array.isArray(y)){var b;g=(b=g).concat.apply(b,y)}else g.push(y)}for(var p=0;pt=>{const n=Le.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),O=e=>(e=e.toLowerCase(),t=>I(t)===e),M=e=>t=>typeof t===e,{isArray:P}=Array,F=M("undefined");function Ue(e){return e!==null&&!F(e)&&e.constructor!==null&&!F(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const me=O("ArrayBuffer");function je(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&me(e.buffer),t}const ke=M("string"),b=M("function"),ye=M("number"),q=e=>e!==null&&typeof e=="object",He=e=>e===!0||e===!1,L=e=>{if(I(e)!=="object")return!1;const t=Z(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ie=O("Date"),Me=O("File"),qe=O("Blob"),ze=O("FileList"),Je=e=>q(e)&&b(e.pipe),$e=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||b(e.append)&&((t=I(e))==="formdata"||t==="object"&&b(e.toString)&&e.toString()==="[object FormData]"))},Ve=O("URLSearchParams"),We=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function B(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),P(e))for(r=0,s=e.length;r0;)if(s=n[r],t===s.toLowerCase())return s;return null}const we=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),be=e=>!F(e)&&e!==we;function X(){const{caseless:e}=be(this)&&this||{},t={},n=(r,s)=>{const o=e&&Ee(t,s)||s;L(t[o])&&L(r)?t[o]=X(t[o],r):L(r)?t[o]=X({},r):P(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r(B(t,(s,o)=>{n&&b(s)?e[o]=he(s,n):e[o]=s},{allOwnKeys:r}),e),Ge=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Xe=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},ve=(e,t,n,r)=>{let s,o,i;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!u[i]&&(t[i]=e[i],u[i]=!0);e=n!==!1&&Z(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Qe=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Ye=e=>{if(!e)return null;if(P(e))return e;let t=e.length;if(!ye(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ze=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Z(Uint8Array)),et=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},tt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},nt=O("HTMLFormElement"),rt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),se=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),st=O("RegExp"),Se=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};B(n,(s,o)=>{t(s,o,e)!==!1&&(r[o]=s)}),Object.defineProperties(e,r)},ot=e=>{Se(e,(t,n)=>{if(b(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(b(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},it=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return P(e)?r(e):r(String(e).split(t)),n},at=()=>{},ct=(e,t)=>(e=+e,Number.isFinite(e)?e:t),V="abcdefghijklmnopqrstuvwxyz",oe="0123456789",Re={DIGIT:oe,ALPHA:V,ALPHA_DIGIT:V+V.toUpperCase()+oe},ut=(e=16,t=Re.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function lt(e){return!!(e&&b(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const ft=e=>{const t=new Array(10),n=(r,s)=>{if(q(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=P(r)?[]:{};return B(r,(i,u)=>{const d=n(i,s+1);!F(d)&&(o[u]=d)}),t[s]=void 0,o}}return r};return n(e,0)},dt=O("AsyncFunction"),pt=e=>e&&(q(e)||b(e))&&b(e.then)&&b(e.catch),a={isArray:P,isArrayBuffer:me,isBuffer:Ue,isFormData:$e,isArrayBufferView:je,isString:ke,isNumber:ye,isBoolean:He,isObject:q,isPlainObject:L,isUndefined:F,isDate:Ie,isFile:Me,isBlob:qe,isRegExp:st,isFunction:b,isStream:Je,isURLSearchParams:Ve,isTypedArray:Ze,isFileList:ze,forEach:B,merge:X,extend:Ke,trim:We,stripBOM:Ge,inherits:Xe,toFlatObject:ve,kindOf:I,kindOfTest:O,endsWith:Qe,toArray:Ye,forEachEntry:et,matchAll:tt,isHTMLForm:nt,hasOwnProperty:se,hasOwnProp:se,reduceDescriptors:Se,freezeMethods:ot,toObjectSet:it,toCamelCase:rt,noop:at,toFiniteNumber:ct,findKey:Ee,global:we,isContextDefined:be,ALPHABET:Re,generateString:ut,isSpecCompliantForm:lt,toJSONObject:ft,isAsyncFn:dt,isThenable:pt};function m(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}a.inherits(m,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Oe=m.prototype,Ae={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ae[e]={value:e}});Object.defineProperties(m,Ae);Object.defineProperty(Oe,"isAxiosError",{value:!0});m.from=(e,t,n,r,s,o)=>{const i=Object.create(Oe);return a.toFlatObject(e,i,function(d){return d!==Error.prototype},u=>u!=="isAxiosError"),m.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const ht=null;function v(e){return a.isPlainObject(e)||a.isArray(e)}function Te(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function ie(e,t,n){return e?e.concat(t).map(function(s,o){return s=Te(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function mt(e){return a.isArray(e)&&!e.some(v)}const yt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function z(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,A){return!a.isUndefined(A[h])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function c(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(!d&&a.isBlob(f))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,h,A){let S=f;if(f&&!A&&typeof f=="object"){if(a.endsWith(h,"{}"))h=r?h:h.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&mt(f)||(a.isFileList(f)||a.endsWith(h,"[]"))&&(S=a.toArray(f)))return h=Te(h),S.forEach(function(_,_e){!(a.isUndefined(_)||_===null)&&t.append(i===!0?ie([h],_e,o):i===null?h:h+"[]",c(_))}),!1}return v(f)?!0:(t.append(ie(A,h,o),c(f)),!1)}const p=[],w=Object.assign(yt,{defaultVisitor:l,convertValue:c,isVisitable:v});function y(f,h){if(!a.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+h.join("."));p.push(f),a.forEach(f,function(S,x){(!(a.isUndefined(S)||S===null)&&s.call(t,S,a.isString(x)?x.trim():x,h,w))===!0&&y(S,h?h.concat(x):[x])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return y(e),t}function ae(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ee(e,t){this._pairs=[],e&&z(e,this,t)}const Ne=ee.prototype;Ne.append=function(t,n){this._pairs.push([t,n])};Ne.toString=function(t){const n=t?function(r){return t.call(this,r,ae)}:ae;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Et(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function xe(e,t,n){if(!t)return e;const r=n&&n.encode||Et,s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new ee(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class wt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ce=wt,ge={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},bt=typeof URLSearchParams<"u"?URLSearchParams:ee,St=typeof FormData<"u"?FormData:null,Rt=typeof Blob<"u"?Blob:null,Ot=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),At=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),R={isBrowser:!0,classes:{URLSearchParams:bt,FormData:St,Blob:Rt},isStandardBrowserEnv:Ot,isStandardBrowserWebWorkerEnv:At,protocols:["http","https","file","blob","url","data"]};function Tt(e,t){return z(e,new R.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return R.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Nt(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function xt(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r=n.length;return i=!i&&a.isArray(s)?s.length:i,d?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!u):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=xt(s[i])),!u)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Nt(r),s,n,0)}),n}return null}const gt={"Content-Type":void 0};function Pt(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const J={transitional:ge,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s&&s?JSON.stringify(Pe(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Tt(t,this.formSerializer).toString();if((u=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return z(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Pt(t)):t}],transformResponse:[function(t){const n=this.transitional||J.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(u){if(i)throw u.name==="SyntaxError"?m.from(u,m.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};a.forEach(["delete","get","head"],function(t){J.headers[t]={}});a.forEach(["post","put","patch"],function(t){J.headers[t]=a.merge(gt)});const te=J,Ct=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ft=e=>{const t={};let n,r,s;return e&&e.split(` +`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Ct[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ue=Symbol("internals");function C(e){return e&&String(e).trim().toLowerCase()}function U(e){return e===!1||e==null?e:a.isArray(e)?e.map(U):String(e)}function Bt(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Dt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function W(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function _t(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Lt(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}class ${constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(u,d,c){const l=C(d);if(!l)throw new Error("header name must be a non-empty string");const p=a.findKey(s,l);(!p||s[p]===void 0||c===!0||c===void 0&&s[p]!==!1)&&(s[p||d]=U(u))}const i=(u,d)=>a.forEach(u,(c,l)=>o(c,l,d));return a.isPlainObject(t)||t instanceof this.constructor?i(t,n):a.isString(t)&&(t=t.trim())&&!Dt(t)?i(Ft(t),n):t!=null&&o(n,t,r),this}get(t,n){if(t=C(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Bt(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=C(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||W(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=C(i),i){const u=a.findKey(r,i);u&&(!n||W(r,r[u],u,n))&&(delete r[u],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||W(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=U(s),delete n[o];return}const u=t?_t(o):String(o).trim();u!==o&&delete n[o],n[u]=U(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[ue]=this[ue]={accessors:{}}).accessors,s=this.prototype;function o(i){const u=C(i);r[u]||(Lt(s,i),r[u]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}}$.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.freezeMethods($.prototype);a.freezeMethods($);const T=$;function K(e,t){const n=this||te,r=t||n,s=T.from(r.headers);let o=r.data;return a.forEach(e,function(u){o=u.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Ce(e){return!!(e&&e.__CANCEL__)}function D(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(D,m,{__CANCEL__:!0});function Ut(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const jt=R.isStandardBrowserEnv?function(){return{write:function(n,r,s,o,i,u){const d=[];d.push(n+"="+encodeURIComponent(r)),a.isNumber(s)&&d.push("expires="+new Date(s).toGMTString()),a.isString(o)&&d.push("path="+o),a.isString(i)&&d.push("domain="+i),u===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function kt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ht(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Fe(e,t){return e&&!kt(t)?Ht(e,t):t}const It=R.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const u=a.isString(i)?s(i):i;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}();function Mt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function qt(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(d){const c=Date.now(),l=r[o];i||(i=c),n[s]=d,r[s]=c;let p=o,w=0;for(;p!==s;)w+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),c-i{const o=s.loaded,i=s.lengthComputable?s.total:void 0,u=o-n,d=r(u),c=o<=i;n=o;const l={loaded:o,total:i,progress:i?o/i:void 0,bytes:u,rate:d||void 0,estimated:d&&i&&c?(i-o)/d:void 0,event:s};l[t?"download":"upload"]=!0,e(l)}}const zt=typeof XMLHttpRequest<"u",Jt=zt&&function(e){return new Promise(function(n,r){let s=e.data;const o=T.from(e.headers).normalize(),i=e.responseType;let u;function d(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}a.isFormData(s)&&(R.isStandardBrowserEnv||R.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const y=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(y+":"+f))}const l=Fe(e.baseURL,e.url);c.open(e.method.toUpperCase(),xe(l,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function p(){if(!c)return;const y=T.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),h={data:!i||i==="text"||i==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:y,config:e,request:c};Ut(function(S){n(S),d()},function(S){r(S),d()},h),c=null}if("onloadend"in c?c.onloadend=p:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(p)},c.onabort=function(){c&&(r(new m("Request aborted",m.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let f=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const h=e.transitional||ge;e.timeoutErrorMessage&&(f=e.timeoutErrorMessage),r(new m(f,h.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,c)),c=null},R.isStandardBrowserEnv){const y=(e.withCredentials||It(l))&&e.xsrfCookieName&&jt.read(e.xsrfCookieName);y&&o.set(e.xsrfHeaderName,y)}s===void 0&&o.setContentType(null),"setRequestHeader"in c&&a.forEach(o.toJSON(),function(f,h){c.setRequestHeader(h,f)}),a.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),i&&i!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",le(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",le(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=y=>{c&&(r(!y||y.type?new D(null,e,c):y),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const w=Mt(l);if(w&&R.protocols.indexOf(w)===-1){r(new m("Unsupported protocol "+w+":",m.ERR_BAD_REQUEST,e));return}c.send(s||null)})},j={http:ht,xhr:Jt};a.forEach(j,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const $t={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let s=0;se instanceof T?e.toJSON():e;function g(e,t){t=t||{};const n={};function r(c,l,p){return a.isPlainObject(c)&&a.isPlainObject(l)?a.merge.call({caseless:p},c,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(c,l,p){if(a.isUndefined(l)){if(!a.isUndefined(c))return r(void 0,c,p)}else return r(c,l,p)}function o(c,l){if(!a.isUndefined(l))return r(void 0,l)}function i(c,l){if(a.isUndefined(l)){if(!a.isUndefined(c))return r(void 0,c)}else return r(void 0,l)}function u(c,l,p){if(p in t)return r(c,l);if(p in e)return r(void 0,c)}const d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:u,headers:(c,l)=>s(de(c),de(l),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const p=d[l]||s,w=p(e[l],t[l],l);a.isUndefined(w)&&p!==u||(n[l]=w)}),n}const Be="1.4.0",ne={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ne[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const pe={};ne.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Be+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,u)=>{if(t===!1)throw new m(s(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!pe[i]&&(pe[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,u):!0}};function Vt(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const u=e[o],d=u===void 0||i(u,o,e);if(d!==!0)throw new m("option "+o+" must be "+d,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const Q={assertOptions:Vt,validators:ne},N=Q.validators;class H{constructor(t){this.defaults=t,this.interceptors={request:new ce,response:new ce}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=g(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Q.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:Q.assertOptions(s,{encode:N.function,serialize:N.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i;i=o&&a.merge(o.common,o[n.method]),i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),n.headers=T.concat(i,o);const u=[];let d=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(d=d&&h.synchronous,u.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let l,p=0,w;if(!d){const f=[fe.bind(this),void 0];for(f.unshift.apply(f,u),f.push.apply(f,c),w=f.length,l=Promise.resolve(n);p{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(u=>{r.subscribe(u),o=u}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,u){r.reason||(r.reason=new D(o,i,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new re(function(s){t=s}),cancel:t}}}const Wt=re;function Kt(e){return function(n){return e.apply(null,n)}}function Gt(e){return a.isObject(e)&&e.isAxiosError===!0}const Y={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Y).forEach(([e,t])=>{Y[t]=e});const Xt=Y;function De(e){const t=new k(e),n=he(k.prototype.request,t);return a.extend(n,k.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return De(g(e,s))},n}const E=De(te);E.Axios=k;E.CanceledError=D;E.CancelToken=Wt;E.isCancel=Ce;E.VERSION=Be;E.toFormData=z;E.AxiosError=m;E.Cancel=E.CanceledError;E.all=function(t){return Promise.all(t)};E.spread=Kt;E.isAxiosError=Gt;E.mergeConfig=g;E.AxiosHeaders=T;E.formToJSON=e=>Pe(a.isHTMLForm(e)?new FormData(e):e);E.HttpStatusCode=Xt;E.default=E;const vt=E;export{vt as a}; diff --git a/web/dist/assets/content-2fda112b.css b/web/dist/assets/content-2fda112b.css new file mode 100644 index 00000000..dcd03a9d --- /dev/null +++ b/web/dist/assets/content-2fda112b.css @@ -0,0 +1 @@ +.link-wrap[data-v-36eef76b]{margin-bottom:10px;position:relative}.link-wrap .link-item[data-v-36eef76b]{height:22px;display:flex;align-items:center;position:relative}.link-wrap .link-item .link-txt-wrap[data-v-36eef76b]{left:calc(1em + 4px);width:calc(100% - 1em);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;position:absolute}.link-wrap .link-item .link-txt-wrap .hash-link .link-txt[data-v-36eef76b]{word-break:break-all}.images-wrap{margin-top:10px}.post-img{display:flex;margin:0;border-radius:3px;overflow:hidden;background:rgba(0,0,0,.1);border:1px solid #eee}.post-img img{width:100%;height:100%}.x1{height:168px}.x2{height:108px}.x3{height:96px}.dark .post-img{border:1px solid #333}@media screen and (max-width: 821px){.x1{height:100px}.x2{height:70px}.x3{height:50px}}.attach-item[data-v-22563084]{margin:10px 0} diff --git a/web/dist/assets/content-72d615e5.js b/web/dist/assets/content-72d615e5.js new file mode 100644 index 00000000..a3b25b7d --- /dev/null +++ b/web/dist/assets/content-72d615e5.js @@ -0,0 +1 @@ +import{d as h,o as e,c as r,F as a,a4 as m,V as s,a1 as o,_ as c,a as C,a2 as k,M as I,Q as d,O as g,r as j,e as B,s as b}from"./@vue-e0e89260.js";import{N as D,O as M}from"./@vicons-8f91201d.js";import{j as $,V as N,W as V,m as O,X as z,e as F,i as L}from"./naive-ui-62663ad7.js";import{_ as A,M as T,N as U}from"./index-347d1d96.js";import{e as P}from"./paopao-video-player-aa5e8b3f.js";const R={class:"link-wrap"},Q={class:"link-txt-wrap"},S=["href"],W={class:"link-txt"},X=h({__name:"post-link",props:{links:{default:()=>[]}},setup(y){const l=y;return(p,u)=>{const x=$;return e(),r("div",R,[(e(!0),r(a,null,m(l.links,n=>(e(),r("div",{class:"link-item",key:n.id},[s(x,{class:"hash-link"},{default:o(()=>[s(c(D))]),_:1}),C("div",Q,[C("a",{href:n.content,class:"hash-link",target:"_blank",onClick:u[0]||(u[0]=k(()=>{},["stop"]))},[C("span",W,I(n.content),1)],8,S)])]))),128))])}}});const ot=A(X,[["__scopeId","data-v-36eef76b"]]),Z={key:0},st=h({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(y){const l=y;return(p,u)=>{const x=N,n=V;return l.videos.length>0?(e(),r("div",Z,[s(n,{"x-gap":4,"y-gap":4,cols:p.full?1:5},{default:o(()=>[s(x,{span:p.full?1:3},{default:o(()=>[(e(!0),r(a,null,m(l.videos,v=>(e(),d(c(P),{onClick:u[0]||(u[0]=k(()=>{},["stop"])),key:v.id,src:v.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):g("",!0)}}}),q={class:"images-wrap"},rt=h({__name:"post-image",props:{imgs:{default:()=>[]}},setup(y){const l=y,p="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",u="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(x,n)=>{const v=O,_=N,f=V,w=z;return e(),r("div",q,[[1].includes(l.imgs.length)?(e(),d(w,{key:0},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:2},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[0]||(n[0]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[2,3].includes(l.imgs.length)?(e(),d(w,{key:1},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[1]||(n[1]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[4].includes(l.imgs.length)?(e(),d(w,{key:2},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,t=>(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[2]||(n[2]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):g("",!0),[5].includes(l.imgs.length)?(e(),d(w,{key:3},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[3]||(n[3]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[4]||(n[4]=k(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),[6].includes(l.imgs.length)?(e(),d(w,{key:4},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i<3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[5]||(n[5]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,{key:t.id},[i>=3?(e(),d(_,{key:0},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[6]||(n[6]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),128))]),_:1})]),_:1})):g("",!0),l.imgs.length===7?(e(),d(w,{key:5},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[7]||(n[7]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[8]||(n[8]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===8?(e(),d(w,{key:6},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:4},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[9]||(n[9]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=4?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[10]||(n[10]=k(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0),l.imgs.length===9?(e(),d(w,{key:7},{default:o(()=>[s(f,{"x-gap":4,"y-gap":4,cols:3},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i<3?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[11]||(n[11]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=3&&i<6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[12]||(n[12]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1}),s(f,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:o(()=>[(e(!0),r(a,null,m(l.imgs,(t,i)=>(e(),r(a,null,[i>=6?(e(),d(_,{key:t.id},{default:o(()=>[s(v,{onError:()=>t.content=c(p),onClick:n[13]||(n[13]=k(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:t.content+c(u),"preview-src":t.content},null,8,["onError","src","preview-src"])]),_:2},1024)):g("",!0)],64))),256))]),_:1})]),_:1})):g("",!0)])}}});const G={class:"attachment-wrap"},H=h({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(y){const l=y,p=j(!1),u=j(""),x=j(0),n=_=>{p.value=!0,x.value=_.id,u.value="这是一个免费附件,您可以直接下载?",_.type===8&&(u.value=()=>b("div",{},[b("p",{},"这是一个收费附件,下载将收取"+(l.price/100).toFixed(2)+"元")]),T({id:x.value}).then(f=>{f.paid&&(u.value=()=>b("div",{},[b("p",{},"此次下载您已支付或无需付费,请确认下载")]))}).catch(f=>{p.value=!1}))},v=()=>{U({id:x.value}).then(_=>{window.open(_.signed_url.replace("http://","https://"),"_blank")}).catch(_=>{console.log(_)})};return(_,f)=>{const w=$,t=F,i=L;return e(),r("div",G,[(e(!0),r(a,null,m(_.attachments,E=>(e(),r("div",{class:"attach-item",key:E.id},[s(t,{onClick:k(J=>n(E),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:o(()=>[s(w,null,{default:o(()=>[s(c(M))]),_:1})]),default:o(()=>[B(" "+I(E.type===8?"收费":"免费")+"附件 ",1)]),_:2},1032,["onClick"])]))),128)),s(i,{show:p.value,"onUpdate:show":f[0]||(f[0]=E=>p.value=E),"mask-closable":!1,preset:"dialog",title:"下载提示",content:u.value,"positive-text":"确认下载","negative-text":"取消","icon-placement":"top",onPositiveClick:v},null,8,["show","content"])])}}});const lt=A(H,[["__scopeId","data-v-22563084"]]),ct=y=>{const l=[],p=[];var u=/(#|#)([^#@\s])+?\s+?/g,x=/@([a-zA-Z0-9])+?\s+?/g;return y=y.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(u,n=>(l.push(n.substr(1).trim()),''+n.trim()+" ")).replace(x,n=>(p.push(n.substr(1).trim()),''+n.trim()+" ")),{content:y,tags:l,users:p}};export{rt as _,lt as a,st as b,ot as c,ct as p}; diff --git a/web/dist/assets/content.93884ea1.css b/web/dist/assets/content.93884ea1.css deleted file mode 100644 index 593baf96..00000000 --- a/web/dist/assets/content.93884ea1.css +++ /dev/null @@ -1 +0,0 @@ -.link-wrap[data-v-4c9a59cc]{margin-bottom:10px}.link-wrap .link-item[data-v-4c9a59cc]{display:flex;align-items:center}.link-wrap .link-item .hash-link .link-txt[data-v-4c9a59cc]{margin-left:4px;word-break:break-all}.images-wrap{margin-top:10px}.post-img{display:flex;margin:0;border-radius:3px;overflow:hidden;background:rgba(0,0,0,.1);border:1px solid #eee}.post-img img{width:100%;height:100%}.x1{height:140px}.x2{height:90px}.x3{height:80px}.dark .post-img{border:1px solid #333}@media screen and (max-width: 821px){.x1{height:100px}.x2{height:70px}.x3{height:50px}}.attach-item[data-v-ca444ed2]{margin:10px 0} diff --git a/web/dist/assets/content.ed80294a.js b/web/dist/assets/content.ed80294a.js deleted file mode 100644 index e5ba04f6..00000000 --- a/web/dist/assets/content.ed80294a.js +++ /dev/null @@ -1,810 +0,0 @@ -import{b5 as V,bq as pe,y as D,r as z,as as ce,n as ve,d as C,q as fe,av as T,h as R,br as me,u as ye,v as L,a2 as he,p as ge,t as Q,ba as we,bd as W,be,bf as ke,C as $e,D as xe,bs as Z,W as a,Y as c,Z as E,ai as J,ab as g,ac as k,a4 as i,a5 as p,a3 as m,aa as q,a8 as $,af as ee,a6 as y,b4 as P,bt as ne,a7 as w,bu as te,bv as Se,bw as Ce,bx as _e,a9 as Ee,by as Be,bz as Re,K as ze,bA as je}from"./index.d4f5aad2.js";function Fe(e){if(typeof e=="number")return{"":e.toString()};const n={};return e.split(/ +/).forEach(l=>{if(l==="")return;const[s,u]=l.split(":");u===void 0?n[""]=s:n[s]=u}),n}function O(e,n){var l;if(e==null)return;const s=Fe(e);if(n===void 0)return s[""];if(typeof n=="string")return(l=s[n])!==null&&l!==void 0?l:s[""];if(Array.isArray(n)){for(let u=n.length-1;u>=0;--u){const o=n[u];if(o in s)return s[o]}return s[""]}else{let u,o=-1;return Object.keys(s).forEach(t=>{const d=Number(t);!Number.isNaN(d)&&n>=d&&d>=o&&(o=d,u=s[t])}),u}}function De(e){var n;const l=(n=e.dirs)===null||n===void 0?void 0:n.find(({dir:s})=>s===V);return!!(l&&l.value===!1)}const Me={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};function Ie(e){return`(min-width: ${e}px)`}const U={};function Ne(e=Me){if(!pe)return D(()=>[]);if(typeof window.matchMedia!="function")return D(()=>[]);const n=z({}),l=Object.keys(e),s=(u,o)=>{u.matches?n.value[o]=!0:n.value[o]=!1};return l.forEach(u=>{const o=e[u];let t,d;U[o]===void 0?(t=window.matchMedia(Ie(o)),t.addEventListener?t.addEventListener("change",v=>{d.forEach(h=>{h(v,u)})}):t.addListener&&t.addListener(v=>{d.forEach(h=>{h(v,u)})}),d=new Set,U[o]={mql:t,cbs:d}):(t=U[o].mql,d=U[o].cbs),d.add(s),t.matches&&d.forEach(v=>{v(t,u)})}),ce(()=>{l.forEach(u=>{const{cbs:o}=U[e[u]];o.has(s)&&o.delete(s)})}),D(()=>{const{value:u}=n;return l.filter(o=>u[o])})}const K=1,re=ve("n-grid"),oe=1,Ae={span:{type:[Number,String],default:oe},offset:{type:[Number,String],default:0},suffix:Boolean,privateOffset:Number,privateSpan:Number,privateColStart:Number,privateShow:{type:Boolean,default:!0}};var ie=C({__GRID_ITEM__:!0,name:"GridItem",alias:["Gi"],props:Ae,setup(){const{isSsrRef:e,xGapRef:n,itemStyleRef:l,overflowRef:s,layoutShiftDisabledRef:u}=fe(re),o=me();return{overflow:s,itemStyle:l,layoutShiftDisabled:u,mergedXGap:D(()=>T(n.value||0)),deriveStyle:()=>{e.value;const{privateSpan:t=oe,privateShow:d=!0,privateColStart:v=void 0,privateOffset:h=0}=o.vnode.props,{value:r}=n,f=T(r||0);return{display:d?"":"none",gridColumn:`${v!=null?v:`span ${t}`} / span ${t}`,marginLeft:h?`calc((100% - (${t} - 1) * ${f}) / ${t} * ${h} + ${f} * ${h})`:""}}}},render(){var e,n;if(this.layoutShiftDisabled){const{span:l,offset:s,mergedXGap:u}=this;return R("div",{style:{gridColumn:`span ${l} / span ${l}`,marginLeft:s?`calc((100% - (${l} - 1) * ${u}) / ${l} * ${s} + ${u} * ${s})`:""}},this.$slots)}return R("div",{style:[this.itemStyle,this.deriveStyle()]},(n=(e=this.$slots).default)===null||n===void 0?void 0:n.call(e,{overflow:this.overflow}))}});const Te={xs:0,s:640,m:1024,l:1280,xl:1536,xxl:1920},se=24,H="__ssr__",Pe={layoutShiftDisabled:Boolean,responsive:{type:[String,Boolean],default:"self"},cols:{type:[Number,String],default:se},itemResponsive:Boolean,collapsed:Boolean,collapsedRows:{type:Number,default:1},itemStyle:[Object,String],xGap:{type:[Number,String],default:0},yGap:{type:[Number,String],default:0}};var ae=C({name:"Grid",inheritAttrs:!1,props:Pe,setup(e){const{mergedClsPrefixRef:n,mergedBreakpointsRef:l}=ye(e),s=/^\d+$/,u=z(void 0),o=Ne((l==null?void 0:l.value)||Te),t=L(()=>!!(e.itemResponsive||!s.test(e.cols.toString())||!s.test(e.xGap.toString())||!s.test(e.yGap.toString()))),d=D(()=>{if(!!t.value)return e.responsive==="self"?u.value:o.value}),v=L(()=>{var x;return(x=Number(O(e.cols.toString(),d.value)))!==null&&x!==void 0?x:se}),h=L(()=>O(e.xGap.toString(),d.value)),r=L(()=>O(e.yGap.toString(),d.value)),f=x=>{u.value=x.contentRect.width},S=x=>{ke(f,x)},M=z(!1),I=D(()=>{if(e.responsive==="self")return S}),_=z(!1),j=z();return he(()=>{const{value:x}=j;x&&x.hasAttribute(H)&&(x.removeAttribute(H),_.value=!0)}),ge(re,{layoutShiftDisabledRef:Q(e,"layoutShiftDisabled"),isSsrRef:_,itemStyleRef:Q(e,"itemStyle"),xGapRef:h,overflowRef:M}),{isSsr:!we,contentEl:j,mergedClsPrefix:n,style:D(()=>e.layoutShiftDisabled?{width:"100%",display:"grid",gridTemplateColumns:`repeat(${e.cols}, minmax(0, 1fr))`,columnGap:T(e.xGap),rowGap:T(e.yGap)}:{width:"100%",display:"grid",gridTemplateColumns:`repeat(${v.value}, minmax(0, 1fr))`,columnGap:T(h.value),rowGap:T(r.value)}),isResponsive:t,responsiveQuery:d,responsiveCols:v,handleResize:I,overflow:M}},render(){if(this.layoutShiftDisabled)return R("div",W({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style},this.$attrs),this.$slots);const e=()=>{var n,l,s,u,o,t,d;this.overflow=!1;const v=$e(xe(this)),h=[],{collapsed:r,collapsedRows:f,responsiveCols:S,responsiveQuery:M}=this;v.forEach(b=>{var G,F,B,N;if(((G=b==null?void 0:b.type)===null||G===void 0?void 0:G.__GRID_ITEM__)!==!0)return;if(De(b)){const A=Z(b);A.props?A.props.privateShow=!1:A.props={privateShow:!1},h.push({child:A,rawChildSpan:0});return}b.dirs=((F=b.dirs)===null||F===void 0?void 0:F.filter(({dir:A})=>A!==V))||null;const X=Z(b),Y=Number((N=O((B=X.props)===null||B===void 0?void 0:B.span,M))!==null&&N!==void 0?N:K);Y!==0&&h.push({child:X,rawChildSpan:Y})});let I=0;const _=(n=h[h.length-1])===null||n===void 0?void 0:n.child;if(_!=null&&_.props){const b=(l=_.props)===null||l===void 0?void 0:l.suffix;b!==void 0&&b!==!1&&(I=(u=(s=_.props)===null||s===void 0?void 0:s.span)!==null&&u!==void 0?u:K,_.props.privateSpan=I,_.props.privateColStart=S+1-I,_.props.privateShow=(o=_.props.privateShow)!==null&&o!==void 0?o:!0)}let j=0,x=!1;for(const{child:b,rawChildSpan:G}of h){if(x&&(this.overflow=!0),!x){const F=Number((d=O((t=b.props)===null||t===void 0?void 0:t.offset,M))!==null&&d!==void 0?d:0),B=Math.min(G+F,S);if(b.props?(b.props.privateSpan=B,b.props.privateOffset=F):b.props={privateSpan:B,privateOffset:F},r){const N=j%S;B+N>S&&(j+=S-N),B+j+I>f*S?x=!0:j+=B}}x&&(b.props?b.props.privateShow!==!0&&(b.props.privateShow=!1):b.props={privateShow:!1})}return R("div",W({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style,[H]:this.isSsr||void 0},this.$attrs),h.map(({child:b})=>b))};return this.isResponsive&&this.responsive==="self"?R(be,{onResize:this.handleResize},{default:e}):e()}});const Ve={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},qe=E("path",{d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Ge=[qe];var An=C({name:"BookmarkOutline",render:function(n,l){return a(),c("svg",Ve,Ge)}});const Oe={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ue=E("path",{d:"M408 64H104a56.16 56.16 0 0 0-56 56v192a56.16 56.16 0 0 0 56 56h40v80l93.72-78.14a8 8 0 0 1 5.13-1.86H408a56.16 56.16 0 0 0 56-56V120a56.16 56.16 0 0 0-56-56z",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),Le=[Ue];var Tn=C({name:"ChatboxOutline",render:function(n,l){return a(),c("svg",Oe,Le)}});const He={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Xe=E("path",{d:"M320 336h76c55 0 100-21.21 100-75.6s-53-73.47-96-75.6C391.11 99.74 329 48 256 48c-69 0-113.44 45.79-128 91.2c-60 5.7-112 35.88-112 98.4S70 336 136 336h56",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),Ye=E("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 400.1l64 63.9l64-63.9"},null,-1),Qe=E("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 224v224.03"},null,-1),We=[Xe,Ye,Qe];var Ze=C({name:"CloudDownloadOutline",render:function(n,l){return a(),c("svg",He,We)}});const Ke={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Je=E("path",{d:"M352.92 80C288 80 256 144 256 144s-32-64-96.92-64c-52.76 0-94.54 44.14-95.08 96.81c-1.1 109.33 86.73 187.08 183 252.42a16 16 0 0 0 18 0c96.26-65.34 184.09-143.09 183-252.42c-.54-52.67-42.32-96.81-95.08-96.81z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),en=[Je];var Pn=C({name:"HeartOutline",render:function(n,l){return a(),c("svg",Ke,en)}});const nn={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},tn=E("path",{d:"M208 352h-64a96 96 0 0 1 0-192h64",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"36"},null,-1),rn=E("path",{d:"M304 160h64a96 96 0 0 1 0 192h-64",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"36"},null,-1),on=E("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"36",d:"M163.29 256h187.42"},null,-1),sn=[tn,rn,on];var an=C({name:"LinkOutline",render:function(n,l){return a(),c("svg",nn,sn)}});const ln={class:"link-wrap"},un=["href"],dn={class:"link-txt"},pn=C({__name:"post-link",props:{links:{default:()=>[]}},setup(e){const n=e;return(l,s)=>{const u=ee;return a(),c("div",ln,[(a(!0),c(g,null,k(n.links,o=>(a(),c("div",{class:"link-item",key:o.id},[i(u,{class:"hash-link"},{default:p(()=>[i(m(an))]),_:1}),E("a",{href:o.content,class:"hash-link",target:"_blank",onClick:s[0]||(s[0]=$(()=>{},["stop"]))},[E("span",dn,q(o.content),1)],8,un)]))),128))])}}});var Vn=J(pn,[["__scopeId","data-v-4c9a59cc"]]),le=C({name:"BasicTheme",props:{uuid:{type:String,required:!0},src:{type:String,required:!0},autoplay:{type:Boolean,required:!0},loop:{type:Boolean,required:!0},controls:{type:Boolean,required:!0},hoverable:{type:Boolean,required:!0},mask:{type:Boolean,required:!0},colors:{type:[String,Array],required:!0},time:{type:Object,required:!0},playing:{type:Boolean,default:!1},duration:{type:[String,Number],required:!0}},data(){return{hovered:!1,volume:!1,amount:1}},computed:{colorFrom(){var e;return typeof this.colors=="string"?this.colors?this.colors:"#fbbf24":(e=this.colors)!==null&&e!==void 0&&e[0]?this.colors[0]:"#fbbf24"},colorTo(){var e;return typeof this.colors=="string"?this.colors?this.colors:"#fbbf24":(e=this.colors)!==null&&e!==void 0&&e[1]?this.colors[1]:"#ec4899"}},mounted(){this.$emit("setPlayer",this.$refs[this.uuid])},methods:{setVolume(){this.$refs[this.uuid].volume=this.amount},stopVolume(){return this.amount>0?this.amount=0:this.amount=1}}});const cn={class:"relative"},vn={class:"flex items-center justify-start w-full"},fn={class:"font-sans text-white text-xs w-24"},mn={class:"mr-3 ml-2"},yn={class:"relative"},hn={class:"px-3 py-2 rounded-lg flex items-center transform translate-x-2",style:{"background-color":"rgba(0, 0, 0, .8)"}},gn=i("img",{src:"https://en-zo.dev/vue-videoplayer/play.svg",alt:"Icon play video",class:"transform translate-x-0.5 w-12"},null,-1);function wn(e,n,l,s,u,o){return a(),y("div",{class:"shadow-xl rounded-xl overflow-hidden relative",onMouseenter:n[15]||(n[15]=t=>e.hovered=!0),onMouseleave:n[16]||(n[16]=t=>e.hovered=!1),onKeydown:n[17]||(n[17]=te(t=>e.$emit("play"),["left"]))},[i("div",cn,[i("video",{ref:e.uuid,class:"w-full",loop:e.loop,autoplay:e.autoplay,muted:e.autoplay,onTimeupdate:n[1]||(n[1]=t=>e.$emit("timeupdate",t.target)),onPause:n[2]||(n[2]=t=>e.$emit("isPlaying",!1)),onPlay:n[3]||(n[3]=t=>e.$emit("isPlaying",!0)),onClick:n[4]||(n[4]=t=>e.$emit("play"))},[i("source",{src:e.src,type:"video/mp4"},null,8,["src"])],40,["loop","autoplay","muted"]),e.controls?(a(),y("div",{key:0,class:[{"opacity-0 translate-y-full":!e.hoverable&&e.hovered,"opacity-0 translate-y-full":e.hoverable&&!e.hovered},"transition duration-300 transform absolute w-full bottom-0 left-0 flex items-center justify-between overlay px-5 pt-3 pb-5"]},[i("div",vn,[i("p",fn,q(e.time.display)+"/"+q(e.duration),1),i("div",mn,[P(i("img",{src:"https://en-zo.dev/vue-videoplayer/pause.svg",alt:"Icon pause video",class:"w-5 cursor-pointer",onClick:n[5]||(n[5]=t=>e.$emit("play"))},null,512),[[V,e.playing]]),P(i("img",{src:"https://en-zo.dev/vue-videoplayer/play.svg",alt:"Icon play video",class:"w-5 cursor-pointer",onClick:n[6]||(n[6]=t=>e.$emit("play"))},null,512),[[V,!e.playing]])]),i("div",{class:"w-full h-1 bg-white bg-opacity-60 rounded-sm cursor-pointer",onClick:n[7]||(n[7]=t=>e.$emit("position",t))},[i("div",{class:"relative h-full pointer-events-none",style:`width: ${e.time.progress}%; transition: width .2s ease-in-out;`},[i("div",{class:"w-full rounded-sm h-full gradient-variable bg-gradient-to-r pointer-events-none absolute top-0 left-0",style:`--tw-gradient-from: ${e.colorFrom};--tw-gradient-to: ${e.colorTo};transition: width .2s ease-in-out`},null,4),i("div",{class:"w-full rounded-sm filter blur-sm h-full gradient-variable bg-gradient-to-r pointer-events-none absolute top-0 left-0",style:`--tw-gradient-from: ${e.colorFrom};--tw-gradient-to: ${e.colorTo};transition: width .2s ease-in-out`},null,4)],4)])]),i("div",{class:"ml-5 flex items-center justify-end",onMouseleave:n[13]||(n[13]=t=>e.volume=!1)},[i("div",yn,[i("div",{class:`w-128 origin-left translate-x-2 -rotate-90 w-128 transition duration-200 absolute transform top-0 py-2 ${e.volume?"-translate-y-4":"opacity-0 -translate-y-1 pointer-events-none"}`},[i("div",hn,[P(i("input",{"onUpdate:modelValue":n[8]||(n[8]=t=>e.amount=t),type:"range",step:"0.05",min:"0",max:"1",class:"rounded-lg overflow-hidden appearance-none bg-white bg-opacity-30 h-1 w-128 vertical-range",onInput:n[9]||(n[9]=(...t)=>e.setVolume&&e.setVolume(...t))},null,544),[[ne,e.amount]])])],2),i("img",{src:`https://en-zo.dev/vue-videoplayer/volume-${Math.ceil(e.amount*2)}.svg`,alt:"High volume video",class:"w-5 cursor-pointer relative",style:{"z-index":"2"},onClick:n[10]||(n[10]=(...t)=>e.stopVolume&&e.stopVolume(...t)),onMouseenter:n[11]||(n[11]=t=>e.volume=!0)},null,40,["src"])]),i("img",{src:"https://en-zo.dev/vue-videoplayer/maximize.svg",alt:"Fullscreen",class:"w-3 ml-4 cursor-pointer",onClick:n[12]||(n[12]=t=>e.$emit("fullScreen"))})],32)],2)):w("",!0),!e.autoplay&&e.mask&&e.time.current===0?(a(),y("div",{key:1,class:`transition transform duration-300 absolute top-0 left-0 w-full h-full bg-black bg-opacity-50 backdrop-filter z-10 flex items-center justify-center ${e.playing?"opacity-0 pointer-events-none":""}`},[i("div",{class:"w-20 h-20 rounded-full bg-white bg-opacity-20 transition duration-200 hover:bg-opacity-40 flex items-center justify-center cursor-pointer",onClick:n[14]||(n[14]=t=>e.$emit("play"))},[gn])],2)):w("",!0)])],32)}le.render=wn;var ue=C({name:"BasicTheme",props:{uuid:{type:String,required:!0},src:{type:String,required:!0},autoplay:{type:Boolean,required:!0},loop:{type:Boolean,required:!0},controls:{type:Boolean,required:!0},hoverable:{type:Boolean,required:!0},mask:{type:Boolean,required:!0},colors:{type:[String,Array],required:!0},time:{type:Object,required:!0},playing:{type:Boolean,default:!1},duration:{type:[String,Number],required:!0}},data(){return{hovered:!1,volume:!1,amount:1}},computed:{color(){var e;return typeof this.colors=="string"?this.colors?this.colors:"#8B5CF6":(e=this.colors)!==null&&e!==void 0&&e[0]?this.colors[0]:"#8B5CF6"}},mounted(){this.$emit("setPlayer",this.$refs[this.uuid])},methods:{setVolume(){this.$refs[this.uuid].volume=this.amount},stopVolume(){return this.amount>0?this.amount=0:this.amount=1}}});const bn={class:"relative"},kn={class:"mr-5"},$n={class:"relative mr-6"},xn={class:"px-3 py-3 rounded-xl flex items-center transform translate-x-9 bg-black bg-opacity-30"},Sn=i("img",{src:"https://en-zo.dev/vue-videoplayer/play.svg",alt:"Icon play video",class:"transform translate-x-0.5 w-12"},null,-1);function Cn(e,n,l,s,u,o){return a(),y("div",{class:"shadow-xl rounded-3xl overflow-hidden relative",onMouseenter:n[14]||(n[14]=t=>e.hovered=!0),onMouseleave:n[15]||(n[15]=t=>e.hovered=!1),onKeydown:n[16]||(n[16]=te(t=>e.$emit("play"),["left"]))},[i("div",bn,[i("video",{ref:e.uuid,class:"w-full",loop:e.loop,autoplay:e.autoplay,muted:e.autoplay,onTimeupdate:n[1]||(n[1]=t=>e.$emit("timeupdate",t.target)),onPause:n[2]||(n[2]=t=>e.$emit("isPlaying",!1)),onPlay:n[3]||(n[3]=t=>e.$emit("isPlaying",!0)),onClick:n[4]||(n[4]=t=>e.$emit("play"))},[i("source",{src:e.src,type:"video/mp4"},null,8,["src"])],40,["loop","autoplay","muted"]),e.controls?(a(),y("div",{key:0,class:[{"opacity-0 translate-y-full":!e.hoverable&&e.hovered,"opacity-0 translate-y-full":e.hoverable&&!e.hovered},"absolute px-5 pb-5 bottom-0 left-0 w-full transition duration-300 transform"]},[i("div",{class:"w-full bg-black bg-opacity-30 px-5 py-4 rounded-xl flex items-center justify-between",onMouseleave:n[12]||(n[12]=t=>e.volume=!1)},[i("div",{class:"font-sans py-1 px-2 text-white rounded-md text-xs mr-5 whitespace-nowrap font-medium w-32 text-center",style:`font-size: 11px; background-color: ${e.color}`},q(e.time.display)+"\xA0/\xA0"+q(e.duration),5),i("div",kn,[P(i("img",{src:"https://en-zo.dev/vue-videoplayer/basic/pause.svg",alt:"Icon pause video",class:"w-4 cursor-pointer filter-white transition duration-300",onClick:n[5]||(n[5]=t=>e.$emit("play"))},null,512),[[V,e.playing]]),P(i("img",{src:"https://en-zo.dev/vue-videoplayer/basic/play.svg",alt:"Icon play video",class:"w-4 cursor-pointer filter-white transition duration-300",onClick:n[6]||(n[6]=t=>e.$emit("play"))},null,512),[[V,!e.playing]])]),i("div",{class:"w-full h-1 bg-white bg-opacity-40 rounded-sm cursor-pointer mr-6",onClick:n[7]||(n[7]=t=>e.$emit("position",t))},[i("div",{class:"w-full rounded-sm h-full bg-white pointer-events-none",style:`width: ${e.time.progress}%; transition: width .2s ease-in-out;`},null,4)]),i("div",$n,[i("div",{class:`w-128 origin-left translate-x-2 -rotate-90 w-128 transition duration-200 absolute transform top-0 py-2 ${e.volume?"-translate-y-4":"opacity-0 -translate-y-1 pointer-events-none"}`},[i("div",xn,[P(i("input",{"onUpdate:modelValue":n[8]||(n[8]=t=>e.amount=t),type:"range",step:"0.05",min:"0",max:"1",class:"rounded-lg overflow-hidden appearance-none bg-white bg-opacity-30 h-1.5 w-128 vertical-range"},null,512),[[ne,e.amount]])])],2),i("img",{src:`https://en-zo.dev/vue-videoplayer/basic/volume_${Math.ceil(e.amount*2)}.svg`,alt:"High volume video",class:"w-5 cursor-pointer filter-white transition duration-300 relative",style:{"z-index":"2"},onClick:n[9]||(n[9]=(...t)=>e.stopVolume&&e.stopVolume(...t)),onMouseenter:n[10]||(n[10]=t=>e.volume=!0)},null,40,["src"])]),i("img",{src:"https://en-zo.dev/vue-videoplayer/basic/fullscreen.svg",alt:"Fullscreen",class:"w-4 cursor-pointer filter-white transition duration-300",onClick:n[11]||(n[11]=t=>e.$emit("fullScreen"))})],32)],2)):w("",!0),!e.autoplay&&e.mask&&e.time.current===0?(a(),y("div",{key:1,class:`transition transform duration-300 absolute top-0 left-0 w-full h-full bg-black bg-opacity-50 backdrop-filter z-10 flex items-center justify-center ${e.playing?"opacity-0 pointer-events-none":""}`},[i("div",{class:"w-20 h-20 rounded-full bg-white bg-opacity-20 transition duration-200 hover:bg-opacity-40 flex items-center justify-center cursor-pointer",onClick:n[13]||(n[13]=t=>e.$emit("play"))},[Sn])],2)):w("",!0)])],32)}ue.render=Cn;var de=C({name:"Vue3PlayerVideo",components:{basic:ue,gradient:le},props:{src:{type:String,required:!0},autoplay:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},controls:{type:Boolean,default:!0},mask:{type:Boolean,default:!0},colors:{type:[String,Array],default(){return["#8B5CF6","#ec4899"]}},hoverable:{type:Boolean,default:!1},theme:{type:String,default:"basic"}},data(){return{uuid:Math.random().toString(36).substr(2,18),player:null,duration:0,playing:!1,time:{progress:0,display:0,current:0}}},watch:{"time.current"(e){this.time.display=this.format(Number(e)),this.time.progress=e*100/this.player.duration}},methods:{isPlaying(e){this.playing=e},play(){return this.playing?this.player.pause():this.player.play()},setPlayer(e){this.player=e,this.player.addEventListener("loadeddata",()=>{this.player.readyState>=3&&(this.duration=this.format(Number(this.player.duration)),this.time.display=this.format(0))})},stop(){this.player.pause(),this.player.currentTime=0},fullScreen(){this.player.webkitEnterFullscreen()},position(e){this.player.pause();const n=e.target.getBoundingClientRect(),s=(e.clientX-n.left)*100/e.target.offsetWidth;this.player.currentTime=s*this.player.duration/100,this.player.play()},format(e){const n=Math.floor(e/3600),l=Math.floor(e%3600/60),s=Math.round(e%60);return[n,l>9?l:n?"0"+l:l||"00",s>9?s:"0"+s].filter(Boolean).join(":")}}});const _n={class:"vue3-player-video"};function En(e,n,l,s,u,o){return a(),y("div",_n,[(a(),y(Se(e.theme),{uuid:e.uuid,src:e.src,autoplay:e.autoplay,loop:e.loop,controls:e.controls,mask:e.mask,colors:e.colors,time:e.time,playing:e.playing,duration:e.duration,hoverable:e.hoverable,onPlay:e.play,onStop:e.stop,onTimeupdate:n[1]||(n[1]=({currentTime:t})=>e.time.current=t),onPosition:e.position,onFullScreen:e.fullScreen,onSetPlayer:e.setPlayer,onIsPlaying:e.isPlaying},null,8,["uuid","src","autoplay","loop","controls","mask","colors","time","playing","duration","hoverable","onPlay","onStop","onPosition","onFullScreen","onSetPlayer","onIsPlaying"]))])}function Bn(e,n){n===void 0&&(n={});var l=n.insertAt;if(!(!e||typeof document=="undefined")){var s=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css",l==="top"&&s.firstChild?s.insertBefore(u,s.firstChild):s.appendChild(u),u.styleSheet?u.styleSheet.cssText=e:u.appendChild(document.createTextNode(e))}}var Rn=`/*! tailwindcss v2.1.2 | MIT License | https://tailwindcss.com */ - -/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */ - -/* -Document -======== -*/ - -/** -Use a better box model (opinionated). -*/ - -*, -::before, -::after { - box-sizing: border-box; -} - -/** -Use a more readable tab size (opinionated). -*/ - -/** -1. Correct the line height in all browsers. -2. Prevent adjustments of font size after orientation changes in iOS. -*/ - -/* -Sections -======== -*/ - -/** -Remove the margin in all browsers. -*/ - -/** -Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3) -*/ - -/* -Grouping content -================ -*/ - -/** -1. Add the correct height in Firefox. -2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) -*/ - -/* -Text-level semantics -==================== -*/ - -/** -Add the correct text decoration in Chrome, Edge, and Safari. -*/ - -/** -Add the correct font weight in Edge and Safari. -*/ - -/** -1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3) -2. Correct the odd 'em' font sizing in all browsers. -*/ - -/** -Add the correct font size in all browsers. -*/ - -/** -Prevent 'sub' and 'sup' elements from affecting the line height in all browsers. -*/ - -/* -Tabular data -============ -*/ - -/** -1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) -2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) -*/ - -/* -Forms -===== -*/ - -/** -1. Change the font styles in all browsers. -2. Remove the margin in Firefox and Safari. -*/ - - -input { - font-family: inherit; /* 1 */ - font-size: 100%; /* 1 */ - line-height: 1.15; /* 1 */ - margin: 0; /* 2 */ -} - -/** -Remove the inheritance of text transform in Edge and Firefox. -1. Remove the inheritance of text transform in Firefox. -*/ - -/** -Correct the inability to style clickable types in iOS and Safari. -*/ - - -[type='button'], -[type='reset'], -[type='submit'] { - -webkit-appearance: button; -} - -/** -Remove the inner border and padding in Firefox. -*/ - -::-moz-focus-inner { - border-style: none; - padding: 0; -} - -/** -Restore the focus styles unset by the previous rule. -*/ - -:-moz-focusring { - outline: 1px dotted ButtonText; -} - -/** -Remove the additional ':invalid' styles in Firefox. -See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737 -*/ - -:-moz-ui-invalid { - box-shadow: none; -} - -/** -Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers. -*/ - -/** -Add the correct vertical alignment in Chrome and Firefox. -*/ - -progress { - vertical-align: baseline; -} - -/** -Correct the cursor style of increment and decrement buttons in Safari. -*/ - -::-webkit-inner-spin-button, -::-webkit-outer-spin-button { - height: auto; -} - -/** -1. Correct the odd appearance in Chrome and Safari. -2. Correct the outline style in Safari. -*/ - -[type='search'] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ -} - -/** -Remove the inner padding in Chrome and Safari on macOS. -*/ - -::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** -1. Correct the inability to style clickable types in iOS and Safari. -2. Change font properties to 'inherit' in Safari. -*/ - -::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ -} - -/* -Interactive -=========== -*/ - -/* -Add the correct display in Chrome and Safari. -*/ - -/** - * Manually forked from SUIT CSS Base: https://github.com/suitcss/base - * A thin layer on top of normalize.css that provides a starting point more - * suitable for web applications. - */ - -/** - * Removes the default spacing and border for appropriate elements. - */ - - -p { - margin: 0; -} - -/** - * Work around a Firefox/IE bug where the transparent \`button\` background - * results in a loss of the default \`button\` focus styles. - */ - -/** - * Tailwind custom reset styles - */ - -/** - * 1. Use the user's configured \`sans\` font-family (with Tailwind's default - * sans-serif font stack as a fallback) as a sane default. - * 2. Use Tailwind's default "normal" line-height so the user isn't forced - * to override it to ensure consistency even when using the default theme. - */ - -/** - * Inherit font-family and line-height from \`html\` so users can set them as - * a class directly on the \`html\` element. - */ - -/** - * 1. Prevent padding and border from affecting element width. - * - * We used to set this in the html element and inherit from - * the parent element for everything else. This caused issues - * in shadow-dom-enhanced elements like
where the content - * is wrapped by a div with box-sizing set to \`content-box\`. - * - * https://github.com/mozdevs/cssremedy/issues/4 - * - * - * 2. Allow adding a border to an element by just adding a border-width. - * - * By default, the way the browser specifies that an element should have no - * border is by setting it's border-style to \`none\` in the user-agent - * stylesheet. - * - * In order to easily add borders to elements by just setting the \`border-width\` - * property, we change the default border-style for all elements to \`solid\`, and - * use border-width to hide them instead. This way our \`border\` utilities only - * need to set the \`border-width\` property instead of the entire \`border\` - * shorthand, making our border utilities much more straightforward to compose. - * - * https://github.com/tailwindcss/tailwindcss/pull/116 - */ - -*, -::before, -::after { - box-sizing: border-box; /* 1 */ - border-width: 0; /* 2 */ - border-style: solid; /* 2 */ - border-color: #e5e7eb; /* 2 */ -} - -/* - * Ensure horizontal rules are visible by default - */ - -/** - * Undo the \`border-style: none\` reset that Normalize applies to images so that - * our \`border-{width}\` utilities have the expected effect. - * - * The Normalize reset is unnecessary for us since we default the border-width - * to 0 on all elements. - * - * https://github.com/tailwindcss/tailwindcss/issues/362 - */ - -img { - border-style: solid; -} - -input:-ms-input-placeholder { - opacity: 1; - color: #9ca3af; -} - -input::placeholder { - opacity: 1; - color: #9ca3af; -} - - -[role="button"] { - cursor: pointer; -} - -/** - * Reset links to optimize for opt-in styling instead of - * opt-out. - */ - -/** - * Reset form element properties that are easy to forget to - * style explicitly so you don't inadvertently introduce - * styles that deviate from your design system. These styles - * supplement a partial reset that is already applied by - * normalize.css. - */ - - -input { - padding: 0; - line-height: inherit; - color: inherit; -} - -/** - * Use the configured 'mono' font family for elements that - * are expected to be rendered with a monospace font, falling - * back to the system monospace stack if there is no configured - * 'mono' font family. - */ - -/** - * Make replaced elements \`display: block\` by default as that's - * the behavior you want almost all of the time. Inspired by - * CSS Remedy, with \`svg\` added as well. - * - * https://github.com/mozdevs/cssremedy/issues/14 - */ - -img, -svg, -video { - display: block; - vertical-align: middle; -} - -/** - * Constrain images and videos to the parent width and preserve - * their intrinsic aspect ratio. - * - * https://github.com/mozdevs/cssremedy/issues/14 - */ - -img, -video { - max-width: 100%; - height: auto; -} - -.vue3-player-video .appearance-none{ - -webkit-appearance: none; - appearance: none; -} - -.vue3-player-video .bg-black{ - --tw-bg-opacity: 1; - background-color: rgba(0, 0, 0, var(--tw-bg-opacity)); -} - -.vue3-player-video .bg-white{ - --tw-bg-opacity: 1; - background-color: rgba(255, 255, 255, var(--tw-bg-opacity)); -} - -.vue3-player-video .bg-gradient-to-r{ - background-image: linear-gradient(to right, var(--tw-gradient-stops)); -} - -.vue3-player-video .bg-opacity-20{ - --tw-bg-opacity: 0.2; -} - -.vue3-player-video .bg-opacity-30{ - --tw-bg-opacity: 0.3; -} - -.vue3-player-video .bg-opacity-40{ - --tw-bg-opacity: 0.4; -} - -.vue3-player-video .bg-opacity-50{ - --tw-bg-opacity: 0.5; -} - -.vue3-player-video .bg-opacity-60{ - --tw-bg-opacity: 0.6; -} - -.vue3-player-video .hover\\:bg-opacity-40:hover{ - --tw-bg-opacity: 0.4; -} - -.vue3-player-video .rounded-sm{ - border-radius: 0.125rem; -} - -.vue3-player-video .rounded-md{ - border-radius: 0.375rem; -} - -.vue3-player-video .rounded-lg{ - border-radius: 0.5rem; -} - -.vue3-player-video .rounded-xl{ - border-radius: 0.75rem; -} - -.vue3-player-video .rounded-3xl{ - border-radius: 1.5rem; -} - -.vue3-player-video .rounded-full{ - border-radius: 9999px; -} - -.vue3-player-video .cursor-pointer{ - cursor: pointer; -} - -.vue3-player-video .flex{ - display: flex; -} - -.vue3-player-video .items-center{ - align-items: center; -} - -.vue3-player-video .justify-start{ - justify-content: flex-start; -} - -.vue3-player-video .justify-end{ - justify-content: flex-end; -} - -.vue3-player-video .justify-center{ - justify-content: center; -} - -.vue3-player-video .justify-between{ - justify-content: space-between; -} - -.vue3-player-video .font-sans{ - font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; -} - -.vue3-player-video .font-medium{ - font-weight: 500; -} - -.vue3-player-video .h-1{ - height: 0.25rem; -} - -.vue3-player-video .h-20{ - height: 5rem; -} - -.vue3-player-video .h-full{ - height: 100%; -} - -.vue3-player-video .text-xs{ - font-size: 0.75rem; - line-height: 1rem; -} - -.vue3-player-video .ml-2{ - margin-left: 0.5rem; -} - -.vue3-player-video .mr-3{ - margin-right: 0.75rem; -} - -.vue3-player-video .ml-4{ - margin-left: 1rem; -} - -.vue3-player-video .mr-5{ - margin-right: 1.25rem; -} - -.vue3-player-video .ml-5{ - margin-left: 1.25rem; -} - -.vue3-player-video .mr-6{ - margin-right: 1.5rem; -} - -.vue3-player-video .opacity-0{ - opacity: 0; -} - -.vue3-player-video .overflow-hidden{ - overflow: hidden; -} - -.vue3-player-video .py-1{ - padding-top: 0.25rem; - padding-bottom: 0.25rem; -} - -.vue3-player-video .py-2{ - padding-top: 0.5rem; - padding-bottom: 0.5rem; -} - -.vue3-player-video .px-2{ - padding-left: 0.5rem; - padding-right: 0.5rem; -} - -.vue3-player-video .py-3{ - padding-top: 0.75rem; - padding-bottom: 0.75rem; -} - -.vue3-player-video .px-3{ - padding-left: 0.75rem; - padding-right: 0.75rem; -} - -.vue3-player-video .py-4{ - padding-top: 1rem; - padding-bottom: 1rem; -} - -.vue3-player-video .px-5{ - padding-left: 1.25rem; - padding-right: 1.25rem; -} - -.vue3-player-video .pt-3{ - padding-top: 0.75rem; -} - -.vue3-player-video .pb-5{ - padding-bottom: 1.25rem; -} - -.vue3-player-video .pointer-events-none{ - pointer-events: none; -} - -.vue3-player-video .absolute{ - position: absolute; -} - -.vue3-player-video .relative{ - position: relative; -} - -.vue3-player-video .top-0{ - top: 0px; -} - -.vue3-player-video .bottom-0{ - bottom: 0px; -} - -.vue3-player-video .left-0{ - left: 0px; -} - -*{ - --tw-shadow: 0 0 #0000; -} - -.vue3-player-video .shadow-xl{ - --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); - box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); -} - -*{ - --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/); - --tw-ring-offset-width: 0px; - --tw-ring-offset-color: #fff; - --tw-ring-color: rgba(59, 130, 246, 0.5); - --tw-ring-offset-shadow: 0 0 #0000; - --tw-ring-shadow: 0 0 #0000; -} - -.vue3-player-video .text-center{ - text-align: center; -} - -.vue3-player-video .text-white{ - --tw-text-opacity: 1; - color: rgba(255, 255, 255, var(--tw-text-opacity)); -} - -.vue3-player-video .whitespace-nowrap{ - white-space: nowrap; -} - -.vue3-player-video .w-3{ - width: 0.75rem; -} - -.vue3-player-video .w-4{ - width: 1rem; -} - -.vue3-player-video .w-5{ - width: 1.25rem; -} - -.vue3-player-video .w-12{ - width: 3rem; -} - -.vue3-player-video .w-20{ - width: 5rem; -} - -.vue3-player-video .w-24{ - width: 6rem; -} - -.vue3-player-video .w-32{ - width: 8rem; -} - -.vue3-player-video .w-full{ - width: 100%; -} - -.vue3-player-video .z-10{ - z-index: 10; -} - -.vue3-player-video .transform{ - --tw-translate-x: 0; - --tw-translate-y: 0; - --tw-rotate: 0; - --tw-skew-x: 0; - --tw-skew-y: 0; - --tw-scale-x: 1; - --tw-scale-y: 1; - transform: translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.vue3-player-video .origin-left{ - transform-origin: left; -} - -.vue3-player-video .-rotate-90{ - --tw-rotate: -90deg; -} - -.vue3-player-video .translate-x-0{ - --tw-translate-x: 0px; -} - -.vue3-player-video .translate-x-2{ - --tw-translate-x: 0.5rem; -} - -.vue3-player-video .translate-x-9{ - --tw-translate-x: 2.25rem; -} - -.vue3-player-video .-translate-y-1{ - --tw-translate-y: -0.25rem; -} - -.vue3-player-video .-translate-y-4{ - --tw-translate-y: -1rem; -} - -.vue3-player-video .translate-y-full{ - --tw-translate-y: 100%; -} - -.vue3-player-video .transition{ - transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter; - transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; - transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; -} - -.vue3-player-video .ease-in-out{ - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); -} - -.vue3-player-video .duration-200{ - transition-duration: 200ms; -} - -.vue3-player-video .duration-300{ - transition-duration: 300ms; -} - -@keyframes spin{ - to{ - transform: rotate(360deg); - } -} - -@keyframes ping{ - 75%, 100%{ - transform: scale(2); - opacity: 0; - } -} - -@keyframes pulse{ - 50%{ - opacity: .5; - } -} - -@keyframes bounce{ - 0%, 100%{ - transform: translateY(-25%); - animation-timing-function: cubic-bezier(0.8,0,1,1); - } - - 50%{ - transform: none; - animation-timing-function: cubic-bezier(0,0,0.2,1); - } -} - -.vue3-player-video .filter{ - --tw-blur: var(--tw-empty,/*!*/ /*!*/); - --tw-brightness: var(--tw-empty,/*!*/ /*!*/); - --tw-contrast: var(--tw-empty,/*!*/ /*!*/); - --tw-grayscale: var(--tw-empty,/*!*/ /*!*/); - --tw-hue-rotate: var(--tw-empty,/*!*/ /*!*/); - --tw-invert: var(--tw-empty,/*!*/ /*!*/); - --tw-saturate: var(--tw-empty,/*!*/ /*!*/); - --tw-sepia: var(--tw-empty,/*!*/ /*!*/); - --tw-drop-shadow: var(--tw-empty,/*!*/ /*!*/); - filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); -} - -.vue3-player-video .blur-sm{ - --tw-blur: blur(4px); -} - -.vue3-player-video .blur{ - --tw-blur: blur(8px); -} - -.vue3-player-video .backdrop-filter{ - --tw-backdrop-blur: var(--tw-empty,/*!*/ /*!*/); - --tw-backdrop-brightness: var(--tw-empty,/*!*/ /*!*/); - --tw-backdrop-contrast: var(--tw-empty,/*!*/ /*!*/); - --tw-backdrop-grayscale: var(--tw-empty,/*!*/ /*!*/); - --tw-backdrop-hue-rotate: var(--tw-empty,/*!*/ /*!*/); - --tw-backdrop-invert: var(--tw-empty,/*!*/ /*!*/); - --tw-backdrop-opacity: var(--tw-empty,/*!*/ /*!*/); - --tw-backdrop-saturate: var(--tw-empty,/*!*/ /*!*/); - --tw-backdrop-sepia: var(--tw-empty,/*!*/ /*!*/); - -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); - backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); -} - -.overlay { - background: linear-gradient(0deg, rgba(0,0,0,0.41961), transparent) -} - -.vertical-range::-webkit-slider-thumb { - width: 6px; - -webkit-appearance: none; - appearance: none; - height: 6px; - background-color: white; - cursor: ns-resize; - box-shadow: -405px 0 0 400px rgba(255, 255, 255, .6); - border-radius: 50%; -} - -.backdrop-filter { - -webkit-backdrop-filter: blur(15px) !important; - backdrop-filter: blur(15px) !important; -} - -.filter-white:hover { - filter: brightness(2); -} - -.gradient-variable { - --tw-gradient-from: #fbbf24; - --tw-gradient-to: #ec4899; - --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(251, 191, 36, 0)) -} - -`;Bn(Rn);de.render=En;var zn=(()=>{const e=de;return e.install=n=>{n.component("Vue3PlayerVideo",e)},e})(),jn=zn;const Fn={key:0},qn=C({__name:"post-video",props:{videos:{default:()=>[]},full:{type:Boolean,default:!1}},setup(e){const n=e;return(l,s)=>{const u=ie,o=ae;return n.videos.length>0?(a(),c("div",Fn,[i(o,{"x-gap":4,"y-gap":4,cols:e.full?1:5},{default:p(()=>[i(u,{span:e.full?1:3},{default:p(()=>[(a(!0),c(g,null,k(n.videos,t=>(a(),y(m(jn),{onClick:s[0]||(s[0]=$(()=>{},["stop"])),key:t.id,src:t.content,colors:["#18a058","#2aca75"],hoverable:!0,theme:"gradient"},null,8,["src"]))),128))]),_:1},8,["span"])]),_:1},8,["cols"])])):w("",!0)}}});const Dn={class:"images-wrap"},Gn=C({__name:"post-image",props:{imgs:{default:()=>[]}},setup(e){const n=e,l="https://paopao-assets.oss-cn-shanghai.aliyuncs.com/public/404.png",s="?x-oss-process=image/resize,m_fill,w_300,h_300,limit_0/auto-orient,1/format,png";return(u,o)=>{const t=Ce,d=ie,v=ae,h=_e;return a(),c("div",Dn,[[1].includes(n.imgs.length)?(a(),y(h,{key:0},{default:p(()=>[i(v,{"x-gap":4,"y-gap":4,cols:2},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,r=>(a(),y(d,{key:r.id},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[0]||(o[0]=$(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):w("",!0),[2,3].includes(n.imgs.length)?(a(),y(h,{key:1},{default:p(()=>[i(v,{"x-gap":4,"y-gap":4,cols:3},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,r=>(a(),y(d,{key:r.id},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[1]||(o[1]=$(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):w("",!0),[4].includes(n.imgs.length)?(a(),y(h,{key:2},{default:p(()=>[i(v,{"x-gap":4,"y-gap":4,cols:4},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,r=>(a(),y(d,{key:r.id},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[2]||(o[2]=$(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024))),128))]),_:1})]),_:1})):w("",!0),[5].includes(n.imgs.length)?(a(),y(h,{key:3},{default:p(()=>[i(v,{"x-gap":4,"y-gap":4,cols:3},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,(r,f)=>(a(),c(g,{key:r.id},[f<3?(a(),y(d,{key:0},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[3]||(o[3]=$(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024)):w("",!0)],64))),128))]),_:1}),i(v,{"x-gap":4,"y-gap":4,cols:2,style:{"margin-top":"4px"}},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,(r,f)=>(a(),c(g,{key:r.id},[f>=3?(a(),y(d,{key:0},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[4]||(o[4]=$(()=>{},["stop"])),class:"post-img x1","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024)):w("",!0)],64))),128))]),_:1})]),_:1})):w("",!0),[6].includes(n.imgs.length)?(a(),y(h,{key:4},{default:p(()=>[i(v,{"x-gap":4,"y-gap":4,cols:3},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,(r,f)=>(a(),c(g,{key:r.id},[f<3?(a(),y(d,{key:0},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[5]||(o[5]=$(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024)):w("",!0)],64))),128))]),_:1}),i(v,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,(r,f)=>(a(),c(g,{key:r.id},[f>=3?(a(),y(d,{key:0},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[6]||(o[6]=$(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024)):w("",!0)],64))),128))]),_:1})]),_:1})):w("",!0),n.imgs.length===7?(a(),y(h,{key:5},{default:p(()=>[i(v,{"x-gap":4,"y-gap":4,cols:4},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,(r,f)=>(a(),c(g,null,[f<4?(a(),y(d,{key:r.id},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[7]||(o[7]=$(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024)):w("",!0)],64))),256))]),_:1}),i(v,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,(r,f)=>(a(),c(g,null,[f>=4?(a(),y(d,{key:r.id},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[8]||(o[8]=$(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024)):w("",!0)],64))),256))]),_:1})]),_:1})):w("",!0),n.imgs.length===8?(a(),y(h,{key:6},{default:p(()=>[i(v,{"x-gap":4,"y-gap":4,cols:4},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,(r,f)=>(a(),c(g,null,[f<4?(a(),y(d,{key:r.id},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[9]||(o[9]=$(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024)):w("",!0)],64))),256))]),_:1}),i(v,{"x-gap":4,"y-gap":4,cols:4,style:{"margin-top":"4px"}},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,(r,f)=>(a(),c(g,null,[f>=4?(a(),y(d,{key:r.id},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[10]||(o[10]=$(()=>{},["stop"])),class:"post-img x3","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024)):w("",!0)],64))),256))]),_:1})]),_:1})):w("",!0),n.imgs.length===9?(a(),y(h,{key:7},{default:p(()=>[i(v,{"x-gap":4,"y-gap":4,cols:3},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,(r,f)=>(a(),c(g,null,[f<3?(a(),y(d,{key:r.id},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[11]||(o[11]=$(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024)):w("",!0)],64))),256))]),_:1}),i(v,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,(r,f)=>(a(),c(g,null,[f>=3&&f<6?(a(),y(d,{key:r.id},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[12]||(o[12]=$(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024)):w("",!0)],64))),256))]),_:1}),i(v,{"x-gap":4,"y-gap":4,cols:3,style:{"margin-top":"4px"}},{default:p(()=>[(a(!0),c(g,null,k(n.imgs,(r,f)=>(a(),c(g,null,[f>=6?(a(),y(d,{key:r.id},{default:p(()=>[i(t,{onError:()=>r.content=m(l),onClick:o[13]||(o[13]=$(()=>{},["stop"])),class:"post-img x2","object-fit":"cover",src:r.content+m(s),"preview-src":r.content},null,8,["onError","src","preview-src"])]),_:2},1024)):w("",!0)],64))),256))]),_:1})]),_:1})):w("",!0)])}}});const Mn={class:"attachment-wrap"},In=C({__name:"post-attachment",props:{attachments:{default:()=>[]},price:{default:0}},setup(e){const n=e,l=z(!1),s=z(""),u=z(0),o=d=>{l.value=!0,u.value=d.id,s.value="\u8FD9\u662F\u4E00\u4E2A\u514D\u8D39\u9644\u4EF6\uFF0C\u60A8\u53EF\u4EE5\u76F4\u63A5\u4E0B\u8F7D\uFF1F",d.type===8&&(s.value=()=>R("div",{},[R("p",{},"\u8FD9\u662F\u4E00\u4E2A\u6536\u8D39\u9644\u4EF6\uFF0C\u4E0B\u8F7D\u5C06\u6536\u53D6"+(n.price/100).toFixed(2)+"\u5143")]),Be({id:u.value}).then(v=>{v.paid&&(s.value=()=>R("div",{},[R("p",{},"\u6B64\u6B21\u4E0B\u8F7D\u60A8\u5DF2\u652F\u4ED8\u6216\u65E0\u9700\u4ED8\u8D39\uFF0C\u8BF7\u786E\u8BA4\u4E0B\u8F7D")]))}).catch(v=>{l.value=!1}))},t=()=>{Re({id:u.value}).then(d=>{window.open(d.signed_url.replace("http://","https://"),"_blank")}).catch(d=>{console.log(d)})};return(d,v)=>{const h=ee,r=ze,f=je;return a(),c("div",Mn,[(a(!0),c(g,null,k(e.attachments,S=>(a(),c("div",{class:"attach-item",key:S.id},[i(r,{onClick:$(M=>o(S),["stop"]),type:"primary",size:"tiny",dashed:""},{icon:p(()=>[i(h,null,{default:p(()=>[i(m(Ze))]),_:1})]),default:p(()=>[Ee(" "+q(S.type===8?"\u6536\u8D39":"\u514D\u8D39")+"\u9644\u4EF6 ",1)]),_:2},1032,["onClick"])]))),128)),i(f,{show:l.value,"onUpdate:show":v[0]||(v[0]=S=>l.value=S),"mask-closable":!1,preset:"dialog",title:"\u4E0B\u8F7D\u63D0\u793A",content:s.value,"positive-text":"\u786E\u8BA4\u4E0B\u8F7D","negative-text":"\u53D6\u6D88","icon-placement":"top",onPositiveClick:t},null,8,["show","content"])])}}});var On=J(In,[["__scopeId","data-v-ca444ed2"]]);const Un=e=>{const n=[],l=[];var s=/(#|#)([^#@])+?\s+?/g,u=/@([a-zA-Z0-9])+?\s+?/g;return e=e.replace(/<[^>]*?>/gi,"").replace(/(.*?)<\/[^>]*?>/gi,"").replace(s,o=>(n.push(o.substr(1).trim()),''+o.trim()+" ")).replace(u,o=>(l.push(o.substr(1).trim()),''+o.trim()+" ")),{content:e,tags:n,users:l}};export{An as B,Tn as C,Pn as H,On as _,Gn as a,qn as b,Vn as c,Un as p}; diff --git a/web/dist/assets/copy-to-clipboard-1dd3075d.js b/web/dist/assets/copy-to-clipboard-1dd3075d.js new file mode 100644 index 00000000..8d75d5e9 --- /dev/null +++ b/web/dist/assets/copy-to-clipboard-1dd3075d.js @@ -0,0 +1 @@ +import{t as p}from"./toggle-selection-93f4ad84.js";var C=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function y(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var m=p,f={"text/plain":"Text","text/html":"Url",default:"Text"},g="Copy to clipboard: #{key}, Enter";function b(a){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,t)}function w(a,t){var r,d,i,n,l,e,c=!1;t||(t={}),r=t.debug||!1;try{i=m(),n=document.createRange(),l=document.getSelection(),e=document.createElement("span"),e.textContent=a,e.ariaHidden="true",e.style.all="unset",e.style.position="fixed",e.style.top=0,e.style.clip="rect(0, 0, 0, 0)",e.style.whiteSpace="pre",e.style.webkitUserSelect="text",e.style.MozUserSelect="text",e.style.msUserSelect="text",e.style.userSelect="text",e.addEventListener("copy",function(o){if(o.stopPropagation(),t.format)if(o.preventDefault(),typeof o.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var s=f[t.format]||f.default;window.clipboardData.setData(s,a)}else o.clipboardData.clearData(),o.clipboardData.setData(t.format,a);t.onCopy&&(o.preventDefault(),t.onCopy(o.clipboardData))}),document.body.appendChild(e),n.selectNodeContents(e),l.addRange(n);var u=document.execCommand("copy");if(!u)throw new Error("copy command was unsuccessful");c=!0}catch(o){r&&console.error("unable to copy using execCommand: ",o),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",a),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(s){r&&console.error("unable to copy using clipboardData: ",s),r&&console.error("falling back to prompt"),d=b("message"in t?t.message:g),window.prompt(d,a)}}finally{l&&(typeof l.removeRange=="function"?l.removeRange(n):l.removeAllRanges()),e&&document.body.removeChild(e),i()}return c}var v=w;const h=y(v);export{h as a,C as c}; diff --git a/web/dist/assets/css-render-6a5c5852.js b/web/dist/assets/css-render-6a5c5852.js new file mode 100644 index 00000000..7481621a --- /dev/null +++ b/web/dist/assets/css-render-6a5c5852.js @@ -0,0 +1,15 @@ +import{m as b}from"./@emotion-8a8e73f6.js";function v(n){let e=0;for(let t=0;t{let u=v(r);if(u){if(u===1){n.forEach(f=>{t.push(r.replace("&",f))});return}}else{n.forEach(f=>{t.push((f&&f+" ")+r)});return}let i=[r];for(;u--;){const f=[];i.forEach(o=>{n.forEach(l=>{f.push(o.replace("&",l))})}),i=f}i.forEach(f=>t.push(f))}),t}function R(n,e){const t=[];return e.split($).forEach(r=>{n.forEach(u=>{t.push((u&&u+" ")+r)})}),t}function q(n){let e=[""];return n.forEach(t=>{t=t&&t.trim(),t&&(t.includes("&")?e=j(e,t):e=R(e,t))}),e.join(", ").replace(_," ")}function x(n){if(!n)return;const e=n.parentElement;e&&e.removeChild(n)}function m(n){return document.querySelector(`style[cssr-id="${n}"]`)}function k(n){const e=document.createElement("style");return e.setAttribute("cssr-id",n),e}function h(n){return n?/^\s*@(s|m)/.test(n):!1}const S=/[A-Z]/g;function C(n){return n.replace(S,e=>"-"+e.toLowerCase())}function B(n,e=" "){return typeof n=="object"&&n!==null?` { +`+Object.entries(n).map(t=>e+` ${C(t[0])}: ${t[1]};`).join(` +`)+` +`+e+"}":`: ${n};`}function L(n,e,t){return typeof n=="function"?n({context:e.context,props:t}):n}function E(n,e,t,r){if(!e)return"";const u=L(e,t,r);if(!u)return"";if(typeof u=="string")return`${n} { +${u} +}`;const i=Object.keys(u);if(i.length===0)return t.config.keepEmptyBlock?n+` { +}`:"";const f=n?[n+" {"]:[];return i.forEach(o=>{const l=u[o];if(o==="raw"){f.push(` +`+l+` +`);return}o=C(o),l!=null&&f.push(` ${o}${B(l)}`)}),n&&f.push("}"),f.join(` +`)}function y(n,e,t){n&&n.forEach(r=>{if(Array.isArray(r))y(r,e,t);else if(typeof r=="function"){const u=r(e);Array.isArray(u)?y(u,e,t):u&&t(u)}else r&&t(r)})}function w(n,e,t,r,u,i){const f=n.$;let o="";if(!f||typeof f=="string")h(f)?o=f:e.push(f);else if(typeof f=="function"){const s={context:r.context,props:u};h(s.value)?o=s.value:e.push(s.value)}else if(f.before&&f.before(r.context),!f.$||typeof f.$=="string")h(f.$)?o=f.$:e.push(f.$);else if(f.$){const s=f.$({context:r.context,props:u});h(s)?o=s:e.push(s)}const l=q(e),c=E(l,n.props,r,u);o?(t.push(`${o} {`),i&&c&&i.insertRule(`${o} { +${c} +} +`)):(i&&c&&i.insertRule(c),!i&&c.length&&t.push(c)),n.children&&y(n.children,{context:r.context,props:u},s=>{if(typeof s=="string"){const a=E(l,{raw:s},r,u);i?i.insertRule(a):t.push(a)}else w(s,e,t,r,u,i)}),e.pop(),o&&t.push("}"),f&&f.after&&f.after(r.context)}function A(n,e,t,r=!1){const u=[];return w(n,[],u,e,t,r?n.instance.__styleSheet:void 0),r?"":u.join(` + +`)}typeof window<"u"&&(window.__cssrContext={});function M(n,e,t){const{els:r}=e;if(t===void 0)r.forEach(x),e.els=[];else{const u=m(t);u&&r.includes(u)&&(x(u),e.els=r.filter(i=>i!==u))}}function g(n,e){n.push(e)}function O(n,e,t,r,u,i,f,o,l){if(i&&!l){if(t===void 0){console.error("[css-render/mount]: `id` is required in `silent` mode.");return}const d=window.__cssrContext;d[t]||(d[t]=!0,A(e,n,r,i));return}let c;if(t===void 0&&(c=e.render(r),t=b(c)),l){l.adapter(t,c??e.render(r));return}const s=m(t);if(s!==null&&!f)return s;const a=s??k(t);if(c===void 0&&(c=e.render(r)),a.textContent=c,s!==null)return s;if(o){const d=document.head.querySelector(`meta[name="${o}"]`);if(d)return document.head.insertBefore(a,d),g(e.els,a),a}return u?document.head.insertBefore(a,document.head.querySelector("style, link")):document.head.appendChild(a),g(e.els,a),a}function T(n){return A(this,this.instance,n)}function W(n={}){const{id:e,ssr:t,props:r,head:u=!1,silent:i=!1,force:f=!1,anchorMetaName:o}=n;return O(this.instance,this,e,r,u,i,f,o,t)}function U(n={}){const{id:e}=n;M(this.instance,this,e)}const p=function(n,e,t,r){return{instance:n,$:e,props:t,children:r,els:[],render:T,mount:W,unmount:U}},Z=function(n,e,t,r){return Array.isArray(e)?p(n,{$:null},null,e):Array.isArray(t)?p(n,e,null,t):Array.isArray(r)?p(n,e,t,r):p(n,e,t,null)};function D(n={}){let e=null;const t={c:(...r)=>Z(t,...r),use:(r,...u)=>r.install(t,...u),find:m,context:{},config:n,get __styleSheet(){if(!e){const r=document.createElement("style");return document.head.appendChild(r),e=document.styleSheets[document.styleSheets.length-1],e}return e}};return t}function F(n,e){if(n===void 0)return!1;if(e){const{context:{ids:t}}=e;return t.has(n)}return m(n)!==null}export{D as C,F as e}; diff --git a/web/dist/assets/date-fns-975a2d8f.js b/web/dist/assets/date-fns-975a2d8f.js new file mode 100644 index 00000000..3c6ed314 --- /dev/null +++ b/web/dist/assets/date-fns-975a2d8f.js @@ -0,0 +1 @@ +function c(a){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.width?String(t.width):a.defaultWidth,n=a.formats[e]||a.formats[a.defaultWidth];return n}}function m(a){return function(t,e){var n=e!=null&&e.context?String(e.context):"standalone",r;if(n==="formatting"&&a.formattingValues){var i=a.defaultFormattingWidth||a.defaultWidth,o=e!=null&&e.width?String(e.width):i;r=a.formattingValues[o]||a.formattingValues[i]}else{var u=a.defaultWidth,l=e!=null&&e.width?String(e.width):a.defaultWidth;r=a.values[l]||a.values[u]}var d=a.argumentCallback?a.argumentCallback(t):t;return r[d]}}function s(a){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.width,r=n&&a.matchPatterns[n]||a.matchPatterns[a.defaultMatchWidth],i=t.match(r);if(!i)return null;var o=i[0],u=n&&a.parsePatterns[n]||a.parsePatterns[a.defaultParseWidth],l=Array.isArray(u)?g(u,function(h){return h.test(o)}):v(u,function(h){return h.test(o)}),d;d=a.valueCallback?a.valueCallback(l):l,d=e.valueCallback?e.valueCallback(d):d;var f=t.slice(o.length);return{value:d,rest:f}}}function v(a,t){for(var e in a)if(a.hasOwnProperty(e)&&t(a[e]))return e}function g(a,t){for(var e=0;e1&&arguments[1]!==void 0?arguments[1]:{},n=t.match(a.matchPattern);if(!n)return null;var r=n[0],i=t.match(a.parsePattern);if(!i)return null;var o=a.valueCallback?a.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;var u=t.slice(r.length);return{value:o,rest:u}}}var y={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},w=function(t,e,n){var r,i=y[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};const P=w;var p={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},M={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},W={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},k={date:c({formats:p,defaultWidth:"full"}),time:c({formats:M,defaultWidth:"full"}),dateTime:c({formats:W,defaultWidth:"full"})};const S=k;var C={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},D=function(t,e,n,r){return C[t]};const F=D;var A={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},x={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},T={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},j={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},V={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},N={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},q=function(t,e){var n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},z={ordinalNumber:q,era:m({values:A,defaultWidth:"wide"}),quarter:m({values:x,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:m({values:T,defaultWidth:"wide"}),day:m({values:j,defaultWidth:"wide"}),dayPeriod:m({values:V,defaultWidth:"wide",formattingValues:N,defaultFormattingWidth:"wide"})};const J=z;var L=/^(\d+)(th|st|nd|rd)?/i,R=/\d+/i,X={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},O={any:[/^b/i,/^(a|c)/i]},E={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Q={any:[/1/i,/2/i,/3/i,/4/i]},$={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Y={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},B={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},H={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},I={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},K={ordinalNumber:b({matchPattern:L,parsePattern:R,valueCallback:function(t){return parseInt(t,10)}}),era:s({matchPatterns:X,defaultMatchWidth:"wide",parsePatterns:O,defaultParseWidth:"any"}),quarter:s({matchPatterns:E,defaultMatchWidth:"wide",parsePatterns:Q,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:s({matchPatterns:$,defaultMatchWidth:"wide",parsePatterns:Y,defaultParseWidth:"any"}),day:s({matchPatterns:_,defaultMatchWidth:"wide",parsePatterns:B,defaultParseWidth:"any"}),dayPeriod:s({matchPatterns:H,defaultMatchWidth:"any",parsePatterns:I,defaultParseWidth:"any"})};const U=K;var G={code:"en-US",formatDistance:P,formatLong:S,formatRelative:F,localize:J,match:U,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Z=G;export{Z as d}; diff --git a/web/dist/assets/date-fns-tz-4ed993c7.js b/web/dist/assets/date-fns-tz-4ed993c7.js new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/web/dist/assets/date-fns-tz-4ed993c7.js @@ -0,0 +1 @@ + diff --git a/web/dist/assets/dijkstrajs-f906a09e.js b/web/dist/assets/dijkstrajs-f906a09e.js new file mode 100644 index 00000000..5183fdcc --- /dev/null +++ b/web/dist/assets/dijkstrajs-f906a09e.js @@ -0,0 +1 @@ +var l={exports:{}};(function(y){var u={single_source_shortest_paths:function(o,e,t){var r={},n={};n[e]=0;var i=u.PriorityQueue.make();i.push(e,0);for(var f,p,s,c,_,h,a,v,d;!i.empty();){f=i.pop(),p=f.value,c=f.cost,_=o[p]||{};for(s in _)_.hasOwnProperty(s)&&(h=_[s],a=c+h,v=n[s],d=typeof n[s]>"u",(d||v>a)&&(n[s]=a,i.push(s,a),r[s]=p))}if(typeof t<"u"&&typeof n[t]>"u"){var m=["Could not find a path from ",e," to ",t,"."].join("");throw new Error(m)}return r},extract_shortest_path_from_predecessor_list:function(o,e){for(var t=[],r=e;r;)t.push(r),o[r],r=o[r];return t.reverse(),t},find_path:function(o,e,t){var r=u.single_source_shortest_paths(o,e,t);return u.extract_shortest_path_from_predecessor_list(r,t)},PriorityQueue:{make:function(o){var e=u.PriorityQueue,t={},r;o=o||{};for(r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t.queue=[],t.sorter=o.sorter||e.default_sorter,t},default_sorter:function(o,e){return o.cost-e.cost},push:function(o,e){var t={value:o,cost:e};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};y.exports=u})(l);var x=l.exports;export{x as d}; diff --git a/web/dist/assets/encode-utf8-f813de00.js b/web/dist/assets/encode-utf8-f813de00.js new file mode 100644 index 00000000..9a76bce9 --- /dev/null +++ b/web/dist/assets/encode-utf8-f813de00.js @@ -0,0 +1 @@ +var F=function(x){for(var r=[],s=x.length,h=0;h=55296&&u<=56319&&s>h+1){var f=x.charCodeAt(h+1);f>=56320&&f<=57343&&(u=(u-55296)*1024+f-56320+65536,h+=1)}if(u<128){r.push(u);continue}if(u<2048){r.push(u>>6|192),r.push(u&63|128);continue}if(u<55296||u>=57344&&u<65536){r.push(u>>12|224),r.push(u>>6&63|128),r.push(u&63|128);continue}if(u>=65536&&u<=1114111){r.push(u>>18|240),r.push(u>>12&63|128),r.push(u>>6&63|128),r.push(u&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};export{F as e}; diff --git a/web/dist/assets/evtd-b614532e.js b/web/dist/assets/evtd-b614532e.js new file mode 100644 index 00000000..722d007c --- /dev/null +++ b/web/dist/assets/evtd-b614532e.js @@ -0,0 +1 @@ +function P(r){return r.composedPath()[0]}const q={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function A(r,i,c){if(r==="mousemoveoutside"){const d=s=>{i.contains(P(s))||c(s)};return{mousemove:d,touchstart:d}}else if(r==="clickoutside"){let d=!1;const s=b=>{d=!i.contains(P(b))},u=b=>{d&&(i.contains(P(b))||c(b))};return{mousedown:s,mouseup:u,touchstart:s,touchend:u}}return console.error(`[evtd/create-trap-handler]: name \`${r}\` is invalid. This could be a bug of evtd.`),{}}function U(r,i,c){const d=q[r];let s=d.get(i);s===void 0&&d.set(i,s=new WeakMap);let u=s.get(c);return u===void 0&&s.set(c,u=A(r,i,c)),u}function B(r,i,c,d){if(r==="mousemoveoutside"||r==="clickoutside"){const s=U(r,i,c);return Object.keys(s).forEach(u=>{J(u,document,s[u],d)}),!0}return!1}function F(r,i,c,d){if(r==="mousemoveoutside"||r==="clickoutside"){const s=U(r,i,c);return Object.keys(s).forEach(u=>{K(u,document,s[u],d)}),!0}return!1}function G(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const r=new WeakMap,i=new WeakMap;function c(){r.set(this,!0)}function d(){r.set(this,!0),i.set(this,!0)}function s(n,e,t){const o=n[e];return n[e]=function(){return t.apply(n,arguments),o.apply(n,arguments)},n}function u(n,e){n[e]=Event.prototype[e]}const b=new WeakMap,W=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function x(){var n;return(n=b.get(this))!==null&&n!==void 0?n:null}function O(n,e){W!==void 0&&Object.defineProperty(n,"currentTarget",{configurable:!0,enumerable:!0,get:e??W.get})}const T={bubble:{},capture:{}},H={};function z(){const n=function(e){const{type:t,eventPhase:o,bubbles:a}=e,p=P(e);if(o===2)return;const w=o===1?"capture":"bubble";let f=p;const l=[];for(;f===null&&(f=window),l.push(f),f!==window;)f=f.parentNode||null;const h=T.capture[t],v=T.bubble[t];if(s(e,"stopPropagation",c),s(e,"stopImmediatePropagation",d),O(e,x),w==="capture"){if(h===void 0)return;for(let g=l.length-1;g>=0&&!r.has(e);--g){const m=l[g],k=h.get(m);if(k!==void 0){b.set(e,m);for(const E of k){if(i.has(e))break;E(e)}}if(g===0&&!a&&v!==void 0){const E=v.get(m);if(E!==void 0)for(const $ of E){if(i.has(e))break;$(e)}}}}else if(w==="bubble"){if(v===void 0)return;for(let g=0;gp(e))};return n.displayName="evtdUnifiedWindowEventHandler",n}const j=z(),M=I();function D(n,e){const t=T[n];return t[e]===void 0&&(t[e]=new Map,window.addEventListener(e,j,n==="capture")),t[e]}function C(n){return H[n]===void 0&&(H[n]=new Set,window.addEventListener(n,M)),H[n]}function L(n,e){let t=n.get(e);return t===void 0&&n.set(e,t=new Set),t}function y(n,e,t,o){const a=T[e][t];if(a!==void 0){const p=a.get(n);if(p!==void 0&&p.has(o))return!0}return!1}function N(n,e){const t=H[n];return!!(t!==void 0&&t.has(e))}function _(n,e,t,o){let a;if(typeof o=="object"&&o.once===!0?a=h=>{S(n,e,a,o),t(h)}:a=t,B(n,e,a,o))return;const w=o===!0||typeof o=="object"&&o.capture===!0?"capture":"bubble",f=D(w,n),l=L(f,e);if(l.has(a)||l.add(a),e===window){const h=C(n);h.has(a)||h.add(a)}}function S(n,e,t,o){if(F(n,e,t,o))return;const p=o===!0||typeof o=="object"&&o.capture===!0,w=p?"capture":"bubble",f=D(w,n),l=L(f,e);if(e===window&&!y(e,p?"bubble":"capture",n,t)&&N(n,t)){const v=H[n];v.delete(t),v.size===0&&(window.removeEventListener(n,M),H[n]=void 0)}l.has(t)&&l.delete(t),l.size===0&&f.delete(e),f.size===0&&(window.removeEventListener(n,j,w==="capture"),T[w][n]=void 0)}return{on:_,off:S}}const{on:J,off:K}=G();export{K as a,J as o}; diff --git a/web/dist/assets/formatTime-cdf4e6f1.js b/web/dist/assets/formatTime-cdf4e6f1.js new file mode 100644 index 00000000..13c2c4d8 --- /dev/null +++ b/web/dist/assets/formatTime-cdf4e6f1.js @@ -0,0 +1 @@ +import{h as r}from"./moment-2ab8298d.js";r.locale("zh-cn");const f=e=>r.unix(e).fromNow(),a=e=>{let t=r.unix(e),o=r();return t.year()!=o.year()?t.utc(!0).format("YYYY-MM-DD HH:mm"):r().diff(t,"month")>3?t.utc(!0).format("MM-DD HH:mm"):t.fromNow()},n=e=>{let t=r.unix(e),o=r();return t.year()!=o.year()?t.utc(!0).format("YYYY-MM-DD"):r().diff(t,"month")>3?t.utc(!0).format("MM-DD"):t.fromNow()};export{f as a,n as b,a as f}; diff --git a/web/dist/assets/formatTime.e07969bb.js b/web/dist/assets/formatTime.e07969bb.js deleted file mode 100644 index 5e330c25..00000000 --- a/web/dist/assets/formatTime.e07969bb.js +++ /dev/null @@ -1,11 +0,0 @@ -//! moment.js -//! version : 2.29.4 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com -var Wt;function l(){return Wt.apply(null,arguments)}function Ds(e){Wt=e}function I(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function ae(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function nt(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(y(e,t))return!1;return!0}function b(e){return e===void 0}function q(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function De(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Nt(e,t){var s=[],r,a=e.length;for(r=0;r>>0,r;for(r=0;r0)for(s=0;s=0;return(n?s?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}var ut=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,pe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,qe={},ue={};function h(e,t,s,r){var a=r;typeof r=="string"&&(a=function(){return this[r]()}),e&&(ue[e]=a),t&&(ue[t[0]]=function(){return E(a.apply(this,arguments),t[1],t[2])}),s&&(ue[s]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function Os(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Ts(e){var t=e.match(ut),s,r;for(s=0,r=t.length;s=0&&pe.test(e);)e=e.replace(pe,r),pe.lastIndex=0,s-=1;return e}var xs={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function bs(e){var t=this._longDateFormat[e],s=this._longDateFormat[e.toUpperCase()];return t||!s?t:(this._longDateFormat[e]=s.match(ut).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var Ws="Invalid date";function Ns(){return this._invalidDate}var Ps="%d",Rs=/\d{1,2}/;function Fs(e){return this._ordinal.replace("%d",e)}var Ls={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Is(e,t,s,r){var a=this._relativeTime[s];return V(a)?a(e,t,s,r):a.replace(/%d/i,e)}function Cs(e,t){var s=this._relativeTime[e>0?"future":"past"];return V(s)?s(t):s.replace(/%s/i,t)}var ye={};function O(e,t){var s=e.toLowerCase();ye[s]=ye[s+"s"]=ye[t]=e}function F(e){return typeof e=="string"?ye[e]||ye[e.toLowerCase()]:void 0}function dt(e){var t={},s,r;for(r in e)y(e,r)&&(s=F(r),s&&(t[s]=e[r]));return t}var Lt={};function T(e,t){Lt[e]=t}function Us(e){var t=[],s;for(s in e)y(e,s)&&t.push({unit:s,priority:Lt[s]});return t.sort(function(r,a){return r.priority-a.priority}),t}function Ce(e){return e%4===0&&e%100!==0||e%400===0}function P(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function _(e){var t=+e,s=0;return t!==0&&isFinite(t)&&(s=P(t)),s}function fe(e,t){return function(s){return s!=null?(It(this,e,s),l.updateOffset(this,t),this):We(this,e)}}function We(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function It(e,t,s){e.isValid()&&!isNaN(s)&&(t==="FullYear"&&Ce(e.year())&&e.month()===1&&e.date()===29?(s=_(s),e._d["set"+(e._isUTC?"UTC":"")+t](s,e.month(),Ge(s,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](s))}function Hs(e){return e=F(e),V(this[e])?this[e]():this}function Es(e,t){if(typeof e=="object"){e=dt(e);var s=Us(e),r,a=s.length;for(r=0;r68?1900:2e3)};var Zt=fe("FullYear",!0);function nr(){return Ce(this.year())}function ir(e,t,s,r,a,n,i){var d;return e<100&&e>=0?(d=new Date(e+400,t,s,r,a,n,i),isFinite(d.getFullYear())&&d.setFullYear(e)):d=new Date(e,t,s,r,a,n,i),d}function ke(e){var t,s;return e<100&&e>=0?(s=Array.prototype.slice.call(arguments),s[0]=e+400,t=new Date(Date.UTC.apply(null,s)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Pe(e,t,s){var r=7+t-s,a=(7+ke(e,0,r).getUTCDay()-t)%7;return-a+r-1}function $t(e,t,s,r,a){var n=(7+s-r)%7,i=Pe(e,r,a),d=1+7*(t-1)+n+i,c,k;return d<=0?(c=e-1,k=we(c)+d):d>we(e)?(c=e+1,k=d-we(e)):(c=e,k=d),{year:c,dayOfYear:k}}function Me(e,t,s){var r=Pe(e.year(),t,s),a=Math.floor((e.dayOfYear()-r-1)/7)+1,n,i;return a<1?(i=e.year()-1,n=a+B(i,t,s)):a>B(e.year(),t,s)?(n=a-B(e.year(),t,s),i=e.year()+1):(i=e.year(),n=a),{week:n,year:i}}function B(e,t,s){var r=Pe(e,t,s),a=Pe(e+1,t,s);return(we(e)-r+a)/7}h("w",["ww",2],"wo","week");h("W",["WW",2],"Wo","isoWeek");O("week","w");O("isoWeek","W");T("week",5);T("isoWeek",5);u("w",D);u("ww",D,N);u("W",D);u("WW",D,N);ve(["w","ww","W","WW"],function(e,t,s,r){t[r.substr(0,1)]=_(e)});function or(e){return Me(e,this._week.dow,this._week.doy).week}var lr={dow:0,doy:6};function ur(){return this._week.dow}function dr(){return this._week.doy}function hr(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function fr(e){var t=Me(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}h("d",0,"do","day");h("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});h("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});h("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});h("e",0,0,"weekday");h("E",0,0,"isoWeekday");O("day","d");O("weekday","e");O("isoWeekday","E");T("day",11);T("weekday",11);T("isoWeekday",11);u("d",D);u("e",D);u("E",D);u("dd",function(e,t){return t.weekdaysMinRegex(e)});u("ddd",function(e,t){return t.weekdaysShortRegex(e)});u("dddd",function(e,t){return t.weekdaysRegex(e)});ve(["dd","ddd","dddd"],function(e,t,s,r){var a=s._locale.weekdaysParse(e,r,s._strict);a!=null?t.d=a:f(s).invalidWeekday=e});ve(["d","e","E"],function(e,t,s,r){t[r]=_(e)});function cr(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function _r(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function ct(e,t){return e.slice(t,7).concat(e.slice(0,t))}var mr="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Bt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),yr="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),wr=ge,kr=ge,Mr=ge;function Sr(e,t){var s=I(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?ct(s,this._week.dow):e?s[e.day()]:s}function Dr(e){return e===!0?ct(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Yr(e){return e===!0?ct(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function gr(e,t,s){var r,a,n,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)n=A([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(n,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(n,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(n,"").toLocaleLowerCase();return s?t==="dddd"?(a=g.call(this._weekdaysParse,i),a!==-1?a:null):t==="ddd"?(a=g.call(this._shortWeekdaysParse,i),a!==-1?a:null):(a=g.call(this._minWeekdaysParse,i),a!==-1?a:null):t==="dddd"?(a=g.call(this._weekdaysParse,i),a!==-1||(a=g.call(this._shortWeekdaysParse,i),a!==-1)?a:(a=g.call(this._minWeekdaysParse,i),a!==-1?a:null)):t==="ddd"?(a=g.call(this._shortWeekdaysParse,i),a!==-1||(a=g.call(this._weekdaysParse,i),a!==-1)?a:(a=g.call(this._minWeekdaysParse,i),a!==-1?a:null)):(a=g.call(this._minWeekdaysParse,i),a!==-1||(a=g.call(this._weekdaysParse,i),a!==-1)?a:(a=g.call(this._shortWeekdaysParse,i),a!==-1?a:null))}function vr(e,t,s){var r,a,n;if(this._weekdaysParseExact)return gr.call(this,e,t,s);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(a=A([2e3,1]).day(r),s&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(n="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(n.replace(".",""),"i")),s&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(s&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(s&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!s&&this._weekdaysParse[r].test(e))return r}}function pr(e){if(!this.isValid())return e!=null?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return e!=null?(e=cr(e,this.localeData()),this.add(e-t,"d")):t}function Or(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function Tr(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=_r(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function xr(e){return this._weekdaysParseExact?(y(this,"_weekdaysRegex")||_t.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(y(this,"_weekdaysRegex")||(this._weekdaysRegex=wr),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function br(e){return this._weekdaysParseExact?(y(this,"_weekdaysRegex")||_t.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(y(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=kr),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Wr(e){return this._weekdaysParseExact?(y(this,"_weekdaysRegex")||_t.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(y(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Mr),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function _t(){function e(x,G){return G.length-x.length}var t=[],s=[],r=[],a=[],n,i,d,c,k;for(n=0;n<7;n++)i=A([2e3,1]).day(n),d=W(this.weekdaysMin(i,"")),c=W(this.weekdaysShort(i,"")),k=W(this.weekdays(i,"")),t.push(d),s.push(c),r.push(k),a.push(d),a.push(c),a.push(k);t.sort(e),s.sort(e),r.sort(e),a.sort(e),this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function mt(){return this.hours()%12||12}function Nr(){return this.hours()||24}h("H",["HH",2],0,"hour");h("h",["hh",2],0,mt);h("k",["kk",2],0,Nr);h("hmm",0,0,function(){return""+mt.apply(this)+E(this.minutes(),2)});h("hmmss",0,0,function(){return""+mt.apply(this)+E(this.minutes(),2)+E(this.seconds(),2)});h("Hmm",0,0,function(){return""+this.hours()+E(this.minutes(),2)});h("Hmmss",0,0,function(){return""+this.hours()+E(this.minutes(),2)+E(this.seconds(),2)});function qt(e,t){h(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}qt("a",!0);qt("A",!1);O("hour","h");T("hour",13);function Jt(e,t){return t._meridiemParse}u("a",Jt);u("A",Jt);u("H",D);u("h",D);u("k",D);u("HH",D,N);u("hh",D,N);u("kk",D,N);u("hmm",Ht);u("hmmss",Et);u("Hmm",Ht);u("Hmmss",Et);M(["H","HH"],v);M(["k","kk"],function(e,t,s){var r=_(e);t[v]=r===24?0:r});M(["a","A"],function(e,t,s){s._isPm=s._locale.isPM(e),s._meridiem=e});M(["h","hh"],function(e,t,s){t[v]=_(e),f(s).bigHour=!0});M("hmm",function(e,t,s){var r=e.length-2;t[v]=_(e.substr(0,r)),t[L]=_(e.substr(r)),f(s).bigHour=!0});M("hmmss",function(e,t,s){var r=e.length-4,a=e.length-2;t[v]=_(e.substr(0,r)),t[L]=_(e.substr(r,2)),t[$]=_(e.substr(a)),f(s).bigHour=!0});M("Hmm",function(e,t,s){var r=e.length-2;t[v]=_(e.substr(0,r)),t[L]=_(e.substr(r))});M("Hmmss",function(e,t,s){var r=e.length-4,a=e.length-2;t[v]=_(e.substr(0,r)),t[L]=_(e.substr(r,2)),t[$]=_(e.substr(a))});function Pr(e){return(e+"").toLowerCase().charAt(0)==="p"}var Rr=/[ap]\.?m?\.?/i,Fr=fe("Hours",!0);function Lr(e,t,s){return e>11?s?"pm":"PM":s?"am":"AM"}var Qt={calendar:vs,longDateFormat:xs,invalidDate:Ws,ordinal:Ps,dayOfMonthOrdinalParse:Rs,relativeTime:Ls,months:qs,monthsShort:At,week:lr,weekdays:mr,weekdaysMin:yr,weekdaysShort:Bt,meridiemParse:Rr},Y={},_e={},Se;function Ir(e,t){var s,r=Math.min(e.length,t.length);for(s=0;s0;){if(a=je(n.slice(0,s).join("-")),a)return a;if(r&&r.length>=s&&Ir(n,r)>=s-1)break;s--}t++}return Se}function Ur(e){return e.match("^[^/\\\\]*$")!=null}function je(e){var t=null,s;if(Y[e]===void 0&&typeof module!="undefined"&&module&&module.exports&&Ur(e))try{t=Se._abbr,s=require,s("./locale/"+e),te(t)}catch{Y[e]=null}return Y[e]}function te(e,t){var s;return e&&(b(t)?s=J(e):s=yt(e,t),s?Se=s:typeof console!="undefined"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Se._abbr}function yt(e,t){if(t!==null){var s,r=Qt;if(t.abbr=e,Y[e]!=null)Rt("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Y[e]._config;else if(t.parentLocale!=null)if(Y[t.parentLocale]!=null)r=Y[t.parentLocale]._config;else if(s=je(t.parentLocale),s!=null)r=s._config;else return _e[t.parentLocale]||(_e[t.parentLocale]=[]),_e[t.parentLocale].push({name:e,config:t}),null;return Y[e]=new lt(Ke(r,t)),_e[e]&&_e[e].forEach(function(a){yt(a.name,a.config)}),te(e),Y[e]}else return delete Y[e],null}function Hr(e,t){if(t!=null){var s,r,a=Qt;Y[e]!=null&&Y[e].parentLocale!=null?Y[e].set(Ke(Y[e]._config,t)):(r=je(e),r!=null&&(a=r._config),t=Ke(a,t),r==null&&(t.abbr=e),s=new lt(t),s.parentLocale=Y[e],Y[e]=s),te(e)}else Y[e]!=null&&(Y[e].parentLocale!=null?(Y[e]=Y[e].parentLocale,e===te()&&te(e)):Y[e]!=null&&delete Y[e]);return Y[e]}function J(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Se;if(!I(e)){if(t=je(e),t)return t;e=[e]}return Cr(e)}function Er(){return et(Y)}function wt(e){var t,s=e._a;return s&&f(e).overflow===-2&&(t=s[Z]<0||s[Z]>11?Z:s[H]<1||s[H]>Ge(s[p],s[Z])?H:s[v]<0||s[v]>24||s[v]===24&&(s[L]!==0||s[$]!==0||s[re]!==0)?v:s[L]<0||s[L]>59?L:s[$]<0||s[$]>59?$:s[re]<0||s[re]>999?re:-1,f(e)._overflowDayOfYear&&(tH)&&(t=H),f(e)._overflowWeeks&&t===-1&&(t=Zs),f(e)._overflowWeekday&&t===-1&&(t=$s),f(e).overflow=t),e}var Ar=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Vr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Gr=/Z|[+-]\d\d(?::?\d\d)?/,Oe=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Je=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],jr=/^\/?Date\((-?\d+)/i,zr=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Zr={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Xt(e){var t,s,r=e._i,a=Ar.exec(r)||Vr.exec(r),n,i,d,c,k=Oe.length,x=Je.length;if(a){for(f(e).iso=!0,t=0,s=k;twe(i)||e._dayOfYear===0)&&(f(e)._overflowDayOfYear=!0),s=ke(i,0,e._dayOfYear),e._a[Z]=s.getUTCMonth(),e._a[H]=s.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=a[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[v]===24&&e._a[L]===0&&e._a[$]===0&&e._a[re]===0&&(e._nextDay=!0,e._a[v]=0),e._d=(e._useUTC?ke:ir).apply(null,r),n=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[v]=24),e._w&&typeof e._w.d!="undefined"&&e._w.d!==n&&(f(e).weekdayMismatch=!0)}}function ea(e){var t,s,r,a,n,i,d,c,k;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(n=1,i=4,s=oe(t.GG,e._a[p],Me(S(),1,4).year),r=oe(t.W,1),a=oe(t.E,1),(a<1||a>7)&&(c=!0)):(n=e._locale._week.dow,i=e._locale._week.doy,k=Me(S(),n,i),s=oe(t.gg,e._a[p],k.year),r=oe(t.w,k.week),t.d!=null?(a=t.d,(a<0||a>6)&&(c=!0)):t.e!=null?(a=t.e+n,(t.e<0||t.e>6)&&(c=!0)):a=n),r<1||r>B(s,n,i)?f(e)._overflowWeeks=!0:c!=null?f(e)._overflowWeekday=!0:(d=$t(s,r,a,n,i),e._a[p]=d.year,e._dayOfYear=d.dayOfYear)}l.ISO_8601=function(){};l.RFC_2822=function(){};function Mt(e){if(e._f===l.ISO_8601){Xt(e);return}if(e._f===l.RFC_2822){Kt(e);return}e._a=[],f(e).empty=!0;var t=""+e._i,s,r,a,n,i,d=t.length,c=0,k,x;for(a=Ft(e._f,e._locale).match(ut)||[],x=a.length,s=0;s0&&f(e).unusedInput.push(i),t=t.slice(t.indexOf(r)+r.length),c+=r.length),ue[n]?(r?f(e).empty=!1:f(e).unusedTokens.push(n),zs(n,r,e)):e._strict&&!r&&f(e).unusedTokens.push(n);f(e).charsLeftOver=d-c,t.length>0&&f(e).unusedInput.push(t),e._a[v]<=12&&f(e).bigHour===!0&&e._a[v]>0&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[v]=ta(e._locale,e._a[v],e._meridiem),k=f(e).era,k!==null&&(e._a[p]=e._locale.erasConvertYear(k,e._a[p])),kt(e),wt(e)}function ta(e,t,s){var r;return s==null?t:e.meridiemHour!=null?e.meridiemHour(t,s):(e.isPM!=null&&(r=e.isPM(s),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function sa(e){var t,s,r,a,n,i,d=!1,c=e._f.length;if(c===0){f(e).invalidFormat=!0,e._d=new Date(NaN);return}for(a=0;athis?this:e:Ie()});function ss(e,t){var s,r;if(t.length===1&&I(t[0])&&(t=t[0]),!t.length)return S();for(s=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ga(){if(!b(this._isDSTShifted))return this._isDSTShifted;var e={},t;return ot(e,this),e=es(e),e._a?(t=e._isUTC?A(e._a):S(e._a),this._isDSTShifted=this.isValid()&&_a(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function va(){return this.isValid()?!this._isUTC:!1}function pa(){return this.isValid()?this._isUTC:!1}function as(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Oa=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ta=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function U(e,t){var s=e,r=null,a,n,i;return xe(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:q(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(r=Oa.exec(e))?(a=r[1]==="-"?-1:1,s={y:0,d:_(r[H])*a,h:_(r[v])*a,m:_(r[L])*a,s:_(r[$])*a,ms:_(st(r[re]*1e3))*a}):(r=Ta.exec(e))?(a=r[1]==="-"?-1:1,s={y:se(r[2],a),M:se(r[3],a),w:se(r[4],a),d:se(r[5],a),h:se(r[6],a),m:se(r[7],a),s:se(r[8],a)}):s==null?s={}:typeof s=="object"&&("from"in s||"to"in s)&&(i=xa(S(s.from),S(s.to)),s={},s.ms=i.milliseconds,s.M=i.months),n=new ze(s),xe(e)&&y(e,"_locale")&&(n._locale=e._locale),xe(e)&&y(e,"_isValid")&&(n._isValid=e._isValid),n}U.fn=ze.prototype;U.invalid=ca;function se(e,t){var s=e&&parseFloat(e.replace(",","."));return(isNaN(s)?0:s)*t}function xt(e,t){var s={};return s.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(s.months,"M").isAfter(t)&&--s.months,s.milliseconds=+t-+e.clone().add(s.months,"M"),s}function xa(e,t){var s;return e.isValid()&&t.isValid()?(t=Dt(t,e),e.isBefore(t)?s=xt(e,t):(s=xt(t,e),s.milliseconds=-s.milliseconds,s.months=-s.months),s):{milliseconds:0,months:0}}function ns(e,t){return function(s,r){var a,n;return r!==null&&!isNaN(+r)&&(Rt(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=s,s=r,r=n),a=U(s,r),is(this,a,e),this}}function is(e,t,s,r){var a=t._milliseconds,n=st(t._days),i=st(t._months);!e.isValid()||(r=r==null?!0:r,i&&Gt(e,We(e,"Month")+i*s),n&&It(e,"Date",We(e,"Date")+n*s),a&&e._d.setTime(e._d.valueOf()+a*s),r&&l.updateOffset(e,n||i))}var ba=ns(1,"add"),Wa=ns(-1,"subtract");function os(e){return typeof e=="string"||e instanceof String}function Na(e){return C(e)||De(e)||os(e)||q(e)||Ra(e)||Pa(e)||e===null||e===void 0}function Pa(e){var t=ae(e)&&!nt(e),s=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a,n,i=r.length;for(a=0;as.valueOf():s.valueOf()9999?Te(s,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):V(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Te(s,"Z")):Te(s,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function $a(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",s,r,a,n;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),s="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",n=t+'[")]',this.format(s+r+a+n)}function Ba(e){e||(e=this.isUtc()?l.defaultFormatUtc:l.defaultFormat);var t=Te(this,e);return this.localeData().postformat(t)}function qa(e,t){return this.isValid()&&(C(e)&&e.isValid()||S(e).isValid())?U({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Ja(e){return this.from(S(),e)}function Qa(e,t){return this.isValid()&&(C(e)&&e.isValid()||S(e).isValid())?U({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Xa(e){return this.to(S(),e)}function ls(e){var t;return e===void 0?this._locale._abbr:(t=J(e),t!=null&&(this._locale=t),this)}var us=R("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function ds(){return this._locale}var Re=1e3,de=60*Re,Fe=60*de,hs=(365*400+97)*24*Fe;function he(e,t){return(e%t+t)%t}function fs(e,t,s){return e<100&&e>=0?new Date(e+400,t,s)-hs:new Date(e,t,s).valueOf()}function cs(e,t,s){return e<100&&e>=0?Date.UTC(e+400,t,s)-hs:Date.UTC(e,t,s)}function Ka(e){var t,s;if(e=F(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(s=this._isUTC?cs:fs,e){case"year":t=s(this.year(),0,1);break;case"quarter":t=s(this.year(),this.month()-this.month()%3,1);break;case"month":t=s(this.year(),this.month(),1);break;case"week":t=s(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=s(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=he(t+(this._isUTC?0:this.utcOffset()*de),Fe);break;case"minute":t=this._d.valueOf(),t-=he(t,de);break;case"second":t=this._d.valueOf(),t-=he(t,Re);break}return this._d.setTime(t),l.updateOffset(this,!0),this}function en(e){var t,s;if(e=F(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(s=this._isUTC?cs:fs,e){case"year":t=s(this.year()+1,0,1)-1;break;case"quarter":t=s(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=s(this.year(),this.month()+1,1)-1;break;case"week":t=s(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=s(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Fe-he(t+(this._isUTC?0:this.utcOffset()*de),Fe)-1;break;case"minute":t=this._d.valueOf(),t+=de-he(t,de)-1;break;case"second":t=this._d.valueOf(),t+=Re-he(t,Re)-1;break}return this._d.setTime(t),l.updateOffset(this,!0),this}function tn(){return this._d.valueOf()-(this._offset||0)*6e4}function sn(){return Math.floor(this.valueOf()/1e3)}function rn(){return new Date(this.valueOf())}function an(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function nn(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function on(){return this.isValid()?this.toISOString():null}function ln(){return it(this)}function un(){return K({},f(this))}function dn(){return f(this).overflow}function hn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}h("N",0,0,"eraAbbr");h("NN",0,0,"eraAbbr");h("NNN",0,0,"eraAbbr");h("NNNN",0,0,"eraName");h("NNNNN",0,0,"eraNarrow");h("y",["y",1],"yo","eraYear");h("y",["yy",2],0,"eraYear");h("y",["yyy",3],0,"eraYear");h("y",["yyyy",4],0,"eraYear");u("N",Yt);u("NN",Yt);u("NNN",Yt);u("NNNN",Yn);u("NNNNN",gn);M(["N","NN","NNN","NNNN","NNNNN"],function(e,t,s,r){var a=s._locale.erasParse(e,r,s._strict);a?f(s).era=a:f(s).invalidEra=e});u("y",ce);u("yy",ce);u("yyy",ce);u("yyyy",ce);u("yo",vn);M(["y","yy","yyy","yyyy"],p);M(["yo"],function(e,t,s,r){var a;s._locale._eraYearOrdinalRegex&&(a=e.match(s._locale._eraYearOrdinalRegex)),s._locale.eraYearOrdinalParse?t[p]=s._locale.eraYearOrdinalParse(e,a):t[p]=parseInt(e,10)});function fn(e,t){var s,r,a,n=this._eras||J("en")._eras;for(s=0,r=n.length;s=0)return n[r]}function _n(e,t){var s=e.since<=e.until?1:-1;return t===void 0?l(e.since).year():l(e.since).year()+(t-e.offset)*s}function mn(){var e,t,s,r=this.localeData().eras();for(e=0,t=r.length;en&&(t=n),Nn.call(this,e,t,s,r,a))}function Nn(e,t,s,r,a){var n=$t(e,t,s,r,a),i=ke(n.year,0,n.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}h("Q",0,"Qo","quarter");O("quarter","Q");T("quarter",7);u("Q",Ct);M("Q",function(e,t){t[Z]=(_(e)-1)*3});function Pn(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}h("D",["DD",2],"Do","date");O("date","D");T("date",9);u("D",D);u("DD",D,N);u("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});M(["D","DD"],H);M("Do",function(e,t){t[H]=_(e.match(D)[0])});var ms=fe("Date",!0);h("DDD",["DDDD",3],"DDDo","dayOfYear");O("dayOfYear","DDD");T("dayOfYear",4);u("DDD",He);u("DDDD",Ut);M(["DDD","DDDD"],function(e,t,s){s._dayOfYear=_(e)});function Rn(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}h("m",["mm",2],0,"minute");O("minute","m");T("minute",14);u("m",D);u("mm",D,N);M(["m","mm"],L);var Fn=fe("Minutes",!1);h("s",["ss",2],0,"second");O("second","s");T("second",15);u("s",D);u("ss",D,N);M(["s","ss"],$);var Ln=fe("Seconds",!1);h("S",0,0,function(){return~~(this.millisecond()/100)});h(0,["SS",2],0,function(){return~~(this.millisecond()/10)});h(0,["SSS",3],0,"millisecond");h(0,["SSSS",4],0,function(){return this.millisecond()*10});h(0,["SSSSS",5],0,function(){return this.millisecond()*100});h(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});h(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});h(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});h(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});O("millisecond","ms");T("millisecond",16);u("S",He,Ct);u("SS",He,N);u("SSS",He,Ut);var ee,ys;for(ee="SSSS";ee.length<=9;ee+="S")u(ee,ce);function In(e,t){t[re]=_(("0."+e)*1e3)}for(ee="S";ee.length<=9;ee+="S")M(ee,In);ys=fe("Milliseconds",!1);h("z",0,0,"zoneAbbr");h("zz",0,0,"zoneName");function Cn(){return this._isUTC?"UTC":""}function Un(){return this._isUTC?"Coordinated Universal Time":""}var o=Ye.prototype;o.add=ba;o.calendar=Ia;o.clone=Ca;o.diff=ja;o.endOf=en;o.format=Ba;o.from=qa;o.fromNow=Ja;o.to=Qa;o.toNow=Xa;o.get=Hs;o.invalidAt=dn;o.isAfter=Ua;o.isBefore=Ha;o.isBetween=Ea;o.isSame=Aa;o.isSameOrAfter=Va;o.isSameOrBefore=Ga;o.isValid=ln;o.lang=us;o.locale=ls;o.localeData=ds;o.max=oa;o.min=ia;o.parsingFlags=un;o.set=Es;o.startOf=Ka;o.subtract=Wa;o.toArray=an;o.toObject=nn;o.toDate=rn;o.toISOString=Za;o.inspect=$a;typeof Symbol!="undefined"&&Symbol.for!=null&&(o[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});o.toJSON=on;o.toString=za;o.unix=sn;o.valueOf=tn;o.creationData=hn;o.eraName=mn;o.eraNarrow=yn;o.eraAbbr=wn;o.eraYear=kn;o.year=Zt;o.isLeapYear=nr;o.weekYear=pn;o.isoWeekYear=On;o.quarter=o.quarters=Pn;o.month=jt;o.daysInMonth=sr;o.week=o.weeks=hr;o.isoWeek=o.isoWeeks=fr;o.weeksInYear=bn;o.weeksInWeekYear=Wn;o.isoWeeksInYear=Tn;o.isoWeeksInISOWeekYear=xn;o.date=ms;o.day=o.days=pr;o.weekday=Or;o.isoWeekday=Tr;o.dayOfYear=Rn;o.hour=o.hours=Fr;o.minute=o.minutes=Fn;o.second=o.seconds=Ln;o.millisecond=o.milliseconds=ys;o.utcOffset=ya;o.utc=ka;o.local=Ma;o.parseZone=Sa;o.hasAlignedHourOffset=Da;o.isDST=Ya;o.isLocal=va;o.isUtcOffset=pa;o.isUtc=as;o.isUTC=as;o.zoneAbbr=Cn;o.zoneName=Un;o.dates=R("dates accessor is deprecated. Use date instead.",ms);o.months=R("months accessor is deprecated. Use month instead",jt);o.years=R("years accessor is deprecated. Use year instead",Zt);o.zone=R("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",wa);o.isDSTShifted=R("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ga);function Hn(e){return S(e*1e3)}function En(){return S.apply(null,arguments).parseZone()}function ws(e){return e}var w=lt.prototype;w.calendar=ps;w.longDateFormat=bs;w.invalidDate=Ns;w.ordinal=Fs;w.preparse=ws;w.postformat=ws;w.relativeTime=Is;w.pastFuture=Cs;w.set=gs;w.eras=fn;w.erasParse=cn;w.erasConvertYear=_n;w.erasAbbrRegex=Sn;w.erasNameRegex=Mn;w.erasNarrowRegex=Dn;w.months=Xs;w.monthsShort=Ks;w.monthsParse=tr;w.monthsRegex=ar;w.monthsShortRegex=rr;w.week=or;w.firstDayOfYear=dr;w.firstDayOfWeek=ur;w.weekdays=Sr;w.weekdaysMin=Yr;w.weekdaysShort=Dr;w.weekdaysParse=vr;w.weekdaysRegex=xr;w.weekdaysShortRegex=br;w.weekdaysMinRegex=Wr;w.isPM=Pr;w.meridiem=Lr;function Le(e,t,s,r){var a=J(),n=A().set(r,t);return a[s](n,e)}function ks(e,t,s){if(q(e)&&(t=e,e=void 0),e=e||"",t!=null)return Le(e,t,s,"month");var r,a=[];for(r=0;r<12;r++)a[r]=Le(e,r,s,"month");return a}function vt(e,t,s,r){typeof e=="boolean"?(q(t)&&(s=t,t=void 0),t=t||""):(t=e,s=t,e=!1,q(t)&&(s=t,t=void 0),t=t||"");var a=J(),n=e?a._week.dow:0,i,d=[];if(s!=null)return Le(t,(s+n)%7,r,"day");for(i=0;i<7;i++)d[i]=Le(t,(i+n)%7,r,"day");return d}function An(e,t){return ks(e,t,"months")}function Vn(e,t){return ks(e,t,"monthsShort")}function Gn(e,t,s){return vt(e,t,s,"weekdays")}function jn(e,t,s){return vt(e,t,s,"weekdaysShort")}function zn(e,t,s){return vt(e,t,s,"weekdaysMin")}te("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,s=_(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+s}});l.lang=R("moment.lang is deprecated. Use moment.locale instead.",te);l.langData=R("moment.langData is deprecated. Use moment.localeData instead.",J);var j=Math.abs;function Zn(){var e=this._data;return this._milliseconds=j(this._milliseconds),this._days=j(this._days),this._months=j(this._months),e.milliseconds=j(e.milliseconds),e.seconds=j(e.seconds),e.minutes=j(e.minutes),e.hours=j(e.hours),e.months=j(e.months),e.years=j(e.years),this}function Ms(e,t,s,r){var a=U(t,s);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function $n(e,t){return Ms(this,e,t,1)}function Bn(e,t){return Ms(this,e,t,-1)}function bt(e){return e<0?Math.floor(e):Math.ceil(e)}function qn(){var e=this._milliseconds,t=this._days,s=this._months,r=this._data,a,n,i,d,c;return e>=0&&t>=0&&s>=0||e<=0&&t<=0&&s<=0||(e+=bt(at(s)+t)*864e5,t=0,s=0),r.milliseconds=e%1e3,a=P(e/1e3),r.seconds=a%60,n=P(a/60),r.minutes=n%60,i=P(n/60),r.hours=i%24,t+=P(i/24),c=P(Ss(t)),s+=c,t-=bt(at(c)),d=P(s/12),s%=12,r.days=t,r.months=s,r.years=d,this}function Ss(e){return e*4800/146097}function at(e){return e*146097/4800}function Jn(e){if(!this.isValid())return NaN;var t,s,r=this._milliseconds;if(e=F(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,s=this._months+Ss(t),e){case"month":return s;case"quarter":return s/3;case"year":return s/12}else switch(t=this._days+Math.round(at(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function Qn(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+_(this._months/12)*31536e6:NaN}function Q(e){return function(){return this.as(e)}}var Xn=Q("ms"),Kn=Q("s"),ei=Q("m"),ti=Q("h"),si=Q("d"),ri=Q("w"),ai=Q("M"),ni=Q("Q"),ii=Q("y");function oi(){return U(this)}function li(e){return e=F(e),this.isValid()?this[e+"s"]():NaN}function ne(e){return function(){return this.isValid()?this._data[e]:NaN}}var ui=ne("milliseconds"),di=ne("seconds"),hi=ne("minutes"),fi=ne("hours"),ci=ne("days"),_i=ne("months"),mi=ne("years");function yi(){return P(this.days()/7)}var z=Math.round,le={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function wi(e,t,s,r,a){return a.relativeTime(t||1,!!s,e,r)}function ki(e,t,s,r){var a=U(e).abs(),n=z(a.as("s")),i=z(a.as("m")),d=z(a.as("h")),c=z(a.as("d")),k=z(a.as("M")),x=z(a.as("w")),G=z(a.as("y")),X=n<=s.ss&&["s",n]||n0,X[4]=r,wi.apply(null,X)}function Mi(e){return e===void 0?z:typeof e=="function"?(z=e,!0):!1}function Si(e,t){return le[e]===void 0?!1:t===void 0?le[e]:(le[e]=t,e==="s"&&(le.ss=t-1),!0)}function Di(e,t){if(!this.isValid())return this.localeData().invalidDate();var s=!1,r=le,a,n;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(s=e),typeof t=="object"&&(r=Object.assign({},le,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),a=this.localeData(),n=ki(this,!s,r,a),s&&(n=a.pastFuture(+this,n)),a.postformat(n)}var Qe=Math.abs;function ie(e){return(e>0)-(e<0)||+e}function $e(){if(!this.isValid())return this.localeData().invalidDate();var e=Qe(this._milliseconds)/1e3,t=Qe(this._days),s=Qe(this._months),r,a,n,i,d=this.asSeconds(),c,k,x,G;return d?(r=P(e/60),a=P(r/60),e%=60,r%=60,n=P(s/12),s%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",c=d<0?"-":"",k=ie(this._months)!==ie(d)?"-":"",x=ie(this._days)!==ie(d)?"-":"",G=ie(this._milliseconds)!==ie(d)?"-":"",c+"P"+(n?k+n+"Y":"")+(s?k+s+"M":"")+(t?x+t+"D":"")+(a||r||e?"T":"")+(a?G+a+"H":"")+(r?G+r+"M":"")+(e?G+i+"S":"")):"P0D"}var m=ze.prototype;m.isValid=fa;m.abs=Zn;m.add=$n;m.subtract=Bn;m.as=Jn;m.asMilliseconds=Xn;m.asSeconds=Kn;m.asMinutes=ei;m.asHours=ti;m.asDays=si;m.asWeeks=ri;m.asMonths=ai;m.asQuarters=ni;m.asYears=ii;m.valueOf=Qn;m._bubble=qn;m.clone=oi;m.get=li;m.milliseconds=ui;m.seconds=di;m.minutes=hi;m.hours=fi;m.days=ci;m.weeks=yi;m.months=_i;m.years=mi;m.humanize=Di;m.toISOString=$e;m.toString=$e;m.toJSON=$e;m.locale=ls;m.localeData=ds;m.toIsoString=R("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$e);m.lang=us;h("X",0,0,"unix");h("x",0,0,"valueOf");u("x",Ae);u("X",Vs);M("X",function(e,t,s){s._d=new Date(parseFloat(e)*1e3)});M("x",function(e,t,s){s._d=new Date(_(e))});//! moment.js -l.version="2.29.4";Ds(S);l.fn=o;l.min=la;l.max=ua;l.now=da;l.utc=A;l.unix=Hn;l.months=An;l.isDate=De;l.locale=te;l.invalid=Ie;l.duration=U;l.isMoment=C;l.weekdays=Gn;l.parseZone=En;l.localeData=J;l.isDuration=xe;l.monthsShort=Vn;l.weekdaysMin=zn;l.defineLocale=yt;l.updateLocale=Hr;l.locales=Er;l.weekdaysShort=jn;l.normalizeUnits=F;l.relativeTimeRounding=Mi;l.relativeTimeThreshold=Si;l.calendarFormat=La;l.prototype=o;l.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};//! moment.js locale configuration -l.defineLocale("zh-cn",{months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u56DB\u6708_\u4E94\u6708_\u516D\u6708_\u4E03\u6708_\u516B\u6708_\u4E5D\u6708_\u5341\u6708_\u5341\u4E00\u6708_\u5341\u4E8C\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661F\u671F\u65E5_\u661F\u671F\u4E00_\u661F\u671F\u4E8C_\u661F\u671F\u4E09_\u661F\u671F\u56DB_\u661F\u671F\u4E94_\u661F\u671F\u516D".split("_"),weekdaysShort:"\u5468\u65E5_\u5468\u4E00_\u5468\u4E8C_\u5468\u4E09_\u5468\u56DB_\u5468\u4E94_\u5468\u516D".split("_"),weekdaysMin:"\u65E5_\u4E00_\u4E8C_\u4E09_\u56DB_\u4E94_\u516D".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5E74M\u6708D\u65E5",LLL:"YYYY\u5E74M\u6708D\u65E5Ah\u70B9mm\u5206",LLLL:"YYYY\u5E74M\u6708D\u65E5ddddAh\u70B9mm\u5206",l:"YYYY/M/D",ll:"YYYY\u5E74M\u6708D\u65E5",lll:"YYYY\u5E74M\u6708D\u65E5 HH:mm",llll:"YYYY\u5E74M\u6708D\u65E5dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return e===12&&(e=0),t==="\u51CC\u6668"||t==="\u65E9\u4E0A"||t==="\u4E0A\u5348"?e:t==="\u4E0B\u5348"||t==="\u665A\u4E0A"?e+12:e>=11?e:e+12},meridiem:function(e,t,s){var r=e*100+t;return r<600?"\u51CC\u6668":r<900?"\u65E9\u4E0A":r<1130?"\u4E0A\u5348":r<1230?"\u4E2D\u5348":r<1800?"\u4E0B\u5348":"\u665A\u4E0A"},calendar:{sameDay:"[\u4ECA\u5929]LT",nextDay:"[\u660E\u5929]LT",nextWeek:function(e){return e.week()!==this.week()?"[\u4E0B]dddLT":"[\u672C]dddLT"},lastDay:"[\u6628\u5929]LT",lastWeek:function(e){return this.week()!==e.week()?"[\u4E0A]dddLT":"[\u672C]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65E5";case"M":return e+"\u6708";case"w":case"W":return e+"\u5468";default:return e}},relativeTime:{future:"%s\u540E",past:"%s\u524D",s:"\u51E0\u79D2",ss:"%d \u79D2",m:"1 \u5206\u949F",mm:"%d \u5206\u949F",h:"1 \u5C0F\u65F6",hh:"%d \u5C0F\u65F6",d:"1 \u5929",dd:"%d \u5929",w:"1 \u5468",ww:"%d \u5468",M:"1 \u4E2A\u6708",MM:"%d \u4E2A\u6708",y:"1 \u5E74",yy:"%d \u5E74"},week:{dow:1,doy:4}});l.locale("zh-cn");const Yi=e=>l.unix(e).fromNow();export{Yi as f}; diff --git a/web/dist/assets/index-347d1d96.js b/web/dist/assets/index-347d1d96.js new file mode 100644 index 00000000..10f453d3 --- /dev/null +++ b/web/dist/assets/index-347d1d96.js @@ -0,0 +1 @@ +import{d as z,r as R,E as J,j,o as v,Q as D,a1 as a,a as k,V as s,c as T,e as S,P as q,a2 as N,O as M,_ as h,n as Q,w as H,a3 as ae,F as X,a4 as Y,M as I,s as P,a5 as he,R as Z,L as ge,a6 as fe}from"./@vue-e0e89260.js";import{c as ve,a as we,u as le,b as ye}from"./vue-router-b8e3382f.js";import{c as ke,u as B}from"./vuex-473b3783.js";import{a as be}from"./axios-4a70c6fc.js";import{_ as Pe,N as Le,a as ue,b as ce,c as Oe,d as Ae,e as ie,f as Te,g as Re,h as de,i as Ee,j as F,k as Ce,u as $e,l as Ie,m as Se,n as Me,o as Ue,p as Ke,q as qe,r as Ne,s as De,t as xe}from"./naive-ui-62663ad7.js";import{S as Fe,M as Ve,L as ze,C as Be,B as We,P as He,W as je,a as Qe,H as ee,b as te,c as oe}from"./@vicons-8f91201d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-59ca65c3.js";import"./evtd-b614532e.js";import"./@css-render-580d83ec.js";import"./vooks-a50491fd.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const n of c)if(n.type==="childList")for(const m of n.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function l(c){const n={};return c.integrity&&(n.integrity=c.integrity),c.referrerPolicy&&(n.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?n.credentials="include":c.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(c){if(c.ep)return;c.ep=!0;const n=l(c);fetch(c.href,n)}})();const Ge="modulepreload",Je=function(e){return"/"+e},se={},A=function(t,l,i){if(!l||l.length===0)return t();const c=document.getElementsByTagName("link");return Promise.all(l.map(n=>{if(n=Je(n),n in se)return;se[n]=!0;const m=n.endsWith(".css"),d=m?'[rel="stylesheet"]':"";if(!!i)for(let b=c.length-1;b>=0;b--){const _=c[b];if(_.href===n&&(!m||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${d}`))return;const g=document.createElement("link");if(g.rel=m?"stylesheet":Ge,m||(g.as="script",g.crossOrigin=""),g.href=n,document.head.appendChild(g),m)return new Promise((b,_)=>{g.addEventListener("load",b),g.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>t()).catch(n=>{const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=n,window.dispatchEvent(m),!m.defaultPrevented)throw n})},Xe=[{path:"/",name:"home",meta:{title:"广场",keepAlive:!0},component:()=>A(()=>import("./Home-2052eeff.js"),["assets/Home-2052eeff.js","assets/post-item.vue_vue_type_style_index_0_lang-e2c8dabf.js","assets/content-72d615e5.js","assets/@vue-e0e89260.js","assets/@vicons-8f91201d.js","assets/naive-ui-62663ad7.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-aa5e8b3f.js","assets/content-2fda112b.css","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/formatTime-cdf4e6f1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-ffa76165.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/IEnum-a180d93e.js","assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Home-c075a37e.css","assets/vfonts-7afd136d.css"])},{path:"/post",name:"post",meta:{title:"话题详情"},component:()=>A(()=>import("./Post-655e33bb.js"),["assets/Post-655e33bb.js","assets/@vue-e0e89260.js","assets/vuex-473b3783.js","assets/formatTime-cdf4e6f1.js","assets/moment-2ab8298d.js","assets/IEnum-a180d93e.js","assets/@vicons-8f91201d.js","assets/naive-ui-62663ad7.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/content-72d615e5.js","assets/paopao-video-player-aa5e8b3f.js","assets/content-2fda112b.css","assets/vue-router-b8e3382f.js","assets/post-skeleton-ffa76165.js","assets/post-skeleton-f1900002.css","assets/lodash-94eb5868.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js","assets/main-nav-569a7b0c.css","assets/v3-infinite-loading-e5c2e8bf.js","assets/v3-infinite-loading-1ff9ffe7.css","assets/axios-4a70c6fc.js","assets/Post-00695942.css","assets/vfonts-7afd136d.css"])},{path:"/topic",name:"topic",meta:{title:"话题"},component:()=>A(()=>import("./Topic-4e4d8af1.js"),["assets/Topic-4e4d8af1.js","assets/@vicons-8f91201d.js","assets/@vue-e0e89260.js","assets/naive-ui-62663ad7.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Topic-8dbcebb5.css","assets/vfonts-7afd136d.css"])},{path:"/anouncement",name:"anouncement",meta:{title:"公告"},component:()=>A(()=>import("./Anouncement-cdcdf9cc.js"),["assets/Anouncement-cdcdf9cc.js","assets/post-skeleton-ffa76165.js","assets/naive-ui-62663ad7.js","assets/seemly-76b7b838.js","assets/@vue-e0e89260.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/@vicons-8f91201d.js","assets/main-nav-569a7b0c.css","assets/formatTime-cdf4e6f1.js","assets/moment-2ab8298d.js","assets/axios-4a70c6fc.js","assets/Anouncement-662e2d95.css","assets/vfonts-7afd136d.css"])},{path:"/profile",name:"profile",meta:{title:"主页"},component:()=>A(()=>import("./Profile-38be829d.js"),["assets/Profile-38be829d.js","assets/post-item.vue_vue_type_style_index_0_lang-e2c8dabf.js","assets/content-72d615e5.js","assets/@vue-e0e89260.js","assets/@vicons-8f91201d.js","assets/naive-ui-62663ad7.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-aa5e8b3f.js","assets/content-2fda112b.css","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/formatTime-cdf4e6f1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-ffa76165.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Profile-cc270bed.css","assets/vfonts-7afd136d.css"])},{path:"/user",name:"user",meta:{title:"用户详情"},component:()=>A(()=>import("./User-16103a6c.js"),["assets/User-16103a6c.js","assets/post-item.vue_vue_type_style_index_0_lang-e2c8dabf.js","assets/content-72d615e5.js","assets/@vue-e0e89260.js","assets/@vicons-8f91201d.js","assets/naive-ui-62663ad7.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-aa5e8b3f.js","assets/content-2fda112b.css","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/formatTime-cdf4e6f1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-ffa76165.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/User-19b50f61.css","assets/vfonts-7afd136d.css"])},{path:"/messages",name:"messages",meta:{title:"消息"},component:()=>A(()=>import("./Messages-a4e3044c.js"),["assets/Messages-a4e3044c.js","assets/@vue-e0e89260.js","assets/vue-router-b8e3382f.js","assets/formatTime-cdf4e6f1.js","assets/moment-2ab8298d.js","assets/@vicons-8f91201d.js","assets/naive-ui-62663ad7.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js","assets/vuex-473b3783.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Messages-7ed31ecd.css","assets/vfonts-7afd136d.css"])},{path:"/collection",name:"collection",meta:{title:"收藏"},component:()=>A(()=>import("./Collection-734ccce8.js"),["assets/Collection-734ccce8.js","assets/post-item.vue_vue_type_style_index_0_lang-e2c8dabf.js","assets/content-72d615e5.js","assets/@vue-e0e89260.js","assets/@vicons-8f91201d.js","assets/naive-ui-62663ad7.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/paopao-video-player-aa5e8b3f.js","assets/content-2fda112b.css","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/formatTime-cdf4e6f1.js","assets/moment-2ab8298d.js","assets/copy-to-clipboard-1dd3075d.js","assets/toggle-selection-93f4ad84.js","assets/post-item-593ff254.css","assets/post-skeleton-ffa76165.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Collection-b97b3cf7.css","assets/vfonts-7afd136d.css"])},{path:"/contacts",name:"contacts",meta:{title:"好友"},component:()=>A(()=>import("./Contacts-5e407299.js"),["assets/Contacts-5e407299.js","assets/vue-router-b8e3382f.js","assets/@vue-e0e89260.js","assets/naive-ui-62663ad7.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-ffa76165.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js","assets/vuex-473b3783.js","assets/@vicons-8f91201d.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Contacts-b60e5e0d.css","assets/vfonts-7afd136d.css"])},{path:"/wallet",name:"wallet",meta:{title:"钱包"},component:()=>A(()=>import("./Wallet-f39d6a4c.js"),["assets/Wallet-f39d6a4c.js","assets/post-skeleton-ffa76165.js","assets/naive-ui-62663ad7.js","assets/seemly-76b7b838.js","assets/@vue-e0e89260.js","assets/vueuc-59ca65c3.js","assets/evtd-b614532e.js","assets/@css-render-580d83ec.js","assets/vooks-a50491fd.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/post-skeleton-f1900002.css","assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js","assets/vuex-473b3783.js","assets/vue-router-b8e3382f.js","assets/@vicons-8f91201d.js","assets/main-nav-569a7b0c.css","assets/qrcode-9719fc56.js","assets/encode-utf8-f813de00.js","assets/dijkstrajs-f906a09e.js","assets/formatTime-cdf4e6f1.js","assets/moment-2ab8298d.js","assets/axios-4a70c6fc.js","assets/Wallet-77044929.css","assets/vfonts-7afd136d.css"])},{path:"/setting",name:"setting",meta:{title:"设置"},component:()=>A(()=>import("./Setting-31b9ee2e.js"),["assets/Setting-31b9ee2e.js","assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js","assets/vuex-473b3783.js","assets/@vue-e0e89260.js","assets/vue-router-b8e3382f.js","assets/vooks-a50491fd.js","assets/evtd-b614532e.js","assets/@vicons-8f91201d.js","assets/naive-ui-62663ad7.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/@css-render-580d83ec.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/Setting-bfd24152.css","assets/vfonts-7afd136d.css"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>A(()=>import("./404-c808adcf.js"),["assets/404-c808adcf.js","assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js","assets/vuex-473b3783.js","assets/@vue-e0e89260.js","assets/vue-router-b8e3382f.js","assets/vooks-a50491fd.js","assets/evtd-b614532e.js","assets/@vicons-8f91201d.js","assets/naive-ui-62663ad7.js","assets/seemly-76b7b838.js","assets/vueuc-59ca65c3.js","assets/@css-render-580d83ec.js","assets/vdirs-b0483831.js","assets/@juggle-41516555.js","assets/css-render-6a5c5852.js","assets/@emotion-8a8e73f6.js","assets/lodash-es-8412e618.js","assets/treemate-25c27bff.js","assets/async-validator-dee29e8b.js","assets/date-fns-975a2d8f.js","assets/main-nav-569a7b0c.css","assets/axios-4a70c6fc.js","assets/404-020b2afd.css","assets/vfonts-7afd136d.css"])},{path:"/:pathMatch(.*)",redirect:"/404"}],pe=ve({history:we(),routes:Xe});pe.beforeEach((e,t,l)=>{document.title=`${e.meta.title} | 泡泡 - 一个清新文艺的微社区`,l()});const Ye=ke({state:{refresh:Date.now(),refreshTopicFollow:Date.now(),theme:localStorage.getItem("PAOPAO_THEME"),collapsedLeft:document.body.clientWidth<=821,collapsedRight:document.body.clientWidth<=821,drawerModelShow:document.body.clientWidth<=821,desktopModelShow:document.body.clientWidth>821,authModalShow:!1,authModelTab:"signin",userLogined:!1,userInfo:{id:0,username:"",nickname:""}},mutations:{refresh(e,t){e.refresh=t||Date.now()},refreshTopicFollow(e){e.refreshTopicFollow=Date.now()},triggerTheme(e,t){e.theme=t},triggerAuth(e,t){e.authModalShow=t},triggerAuthKey(e,t){e.authModelTab=t},triggerCollapsedLeft(e,t){e.collapsedLeft=t,e.drawerModelShow=t,e.desktopModelShow=!t},triggerCollapsedRight(e,t){e.collapsedRight=t},updateUserinfo(e,t){e.userInfo=t,e.userInfo.id>0&&(e.userLogined=!0)},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:""},e.userLogined=!1}},actions:{},modules:{}}),G=be.create({baseURL:"",timeout:3e4});G.interceptors.request.use(e=>(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));G.interceptors.response.use(e=>{const{data:t={},code:l=0}=(e==null?void 0:e.data)||{};if(+l==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var l;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"鉴权失败"):window.$store.commit("triggerAuth",!0)):window.$message.error(((l=t==null?void 0:t.data)==null?void 0:l.msg)||"请求失败"),Promise.reject((t==null?void 0:t.data)||{})});function o(e){return G(e)}const ne=e=>o({method:"post",url:"/v1/auth/login",data:e}),Ze=e=>o({method:"post",url:"/v1/auth/register",data:e}),W=(e="")=>o({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}}),et={class:"auth-wrap"},tt={key:0},ot=z({__name:"auth",setup(e){const t=R("true".toLowerCase()==="true"),l=B(),i=R(!1),c=R(),n=J({username:"",password:""}),m=R(),d=J({username:"",password:"",repassword:""}),U={username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"},repassword:[{required:!0,message:"请输入密码"},{validator:(_,u)=>!!d.password&&d.password.startsWith(u)&&d.password.length>=u.length,message:"两次密码输入不一致",trigger:"input"}]},g=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=c.value)==null||u.validate(L=>{L||(i.value=!0,ne({username:n.username,password:n.password}).then(p=>{const O=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",O),W(O)}).then(p=>{window.$message.success("登录成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),l.commit("refresh"),n.username="",n.password=""}).catch(p=>{i.value=!1}))})},b=_=>{var u;_.preventDefault(),_.stopPropagation(),(u=m.value)==null||u.validate(L=>{L||(i.value=!0,Ze({username:d.username,password:d.password}).then(p=>ne({username:d.username,password:d.password})).then(p=>{const O=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",O),W(O)}).then(p=>{window.$message.success("注册成功"),i.value=!1,l.commit("updateUserinfo",p),l.commit("triggerAuth",!1),d.username="",d.password="",d.repassword=""}).catch(p=>{i.value=!1}))})};return j(()=>{const _=localStorage.getItem("PAOPAO_TOKEN")||"";_?W(_).then(u=>{l.commit("updateUserinfo",u),l.commit("triggerAuth",!1)}).catch(u=>{l.commit("userLogout")}):l.commit("userLogout")}),(_,u)=>{const L=Pe,p=Le,O=ue,r=ce,w=Oe,y=Ae,C=ie,x=Te,$=Re,K=de,V=Ee;return v(),D(V,{show:h(l).state.authModalShow,"onUpdate:show":u[7]||(u[7]=f=>h(l).state.authModalShow=f),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:a(()=>[k("div",et,[s(K,{bordered:!1},{default:a(()=>[t.value?M("",!0):(v(),T("div",tt,[s(O,{justify:"center"},{default:a(()=>[s(p,null,{default:a(()=>[s(L,{type:"success"},{default:a(()=>[S("账号登录")]),_:1})]),_:1})]),_:1}),s(y,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(w,{label:"账户",path:"username"},{default:a(()=>[s(r,{value:n.username,"onUpdate:value":u[0]||(u[0]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:q(N(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(w,{label:"密码",path:"password"},{default:a(()=>[s(r,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:q(N(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(C,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])])),t.value?(v(),D($,{key:1,"default-value":h(l).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:a(()=>[s(x,{name:"signin",tab:"登录"},{default:a(()=>[s(y,{ref_key:"loginRef",ref:c,model:n,rules:{username:{required:!0,message:"请输入账户名"},password:{required:!0,message:"请输入密码"}}},{default:a(()=>[s(w,{label:"账户",path:"username"},{default:a(()=>[s(r,{value:n.username,"onUpdate:value":u[2]||(u[2]=f=>n.username=f),placeholder:"请输入用户名",onKeyup:q(N(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(w,{label:"密码",path:"password"},{default:a(()=>[s(r,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[3]||(u[3]=f=>n.password=f),placeholder:"请输入账户密码",onKeyup:q(N(g,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(C,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:g},{default:a(()=>[S(" 登录 ")]),_:1},8,["loading"])]),_:1}),s(x,{name:"signup",tab:"注册"},{default:a(()=>[s(y,{ref_key:"registerRef",ref:m,model:d,rules:U},{default:a(()=>[s(w,{label:"用户名",path:"username"},{default:a(()=>[s(r,{value:d.username,"onUpdate:value":u[4]||(u[4]=f=>d.username=f),placeholder:"用户名注册后无法修改"},null,8,["value"])]),_:1}),s(w,{label:"密码",path:"password"},{default:a(()=>[s(r,{type:"password","show-password-on":"mousedown",placeholder:"密码不少于6位",value:d.password,"onUpdate:value":u[5]||(u[5]=f=>d.password=f),onKeyup:q(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),s(w,{label:"重复密码",path:"repassword"},{default:a(()=>[s(r,{type:"password","show-password-on":"mousedown",placeholder:"请再次输入密码",value:d.repassword,"onUpdate:value":u[6]||(u[6]=f=>d.repassword=f),onKeyup:q(N(b,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),s(C,{type:"primary",block:"",secondary:"",strong:"",loading:i.value,onClick:b},{default:a(()=>[S(" 注册 ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])):M("",!0)]),_:1})])]),_:1},8,["show"])}}});const me=(e,t)=>{const l=e.__vccOpts||e;for(const[i,c]of t)l[i]=c;return l},st=me(ot,[["__scopeId","data-v-053dfa44"]]),Xt=e=>o({method:"get",url:"/v1/posts",params:e}),nt=e=>o({method:"get",url:"/v1/tags",params:e}),Yt=e=>o({method:"get",url:"/v1/post",params:e}),Zt=e=>o({method:"get",url:"/v1/post/star",params:e}),eo=e=>o({method:"post",url:"/v1/post/star",data:e}),to=e=>o({method:"get",url:"/v1/post/collection",params:e}),oo=e=>o({method:"post",url:"/v1/post/collection",data:e}),so=e=>o({method:"get",url:"/v1/post/comments",params:e}),no=e=>o({method:"get",url:"/v1/user/contacts",params:e}),ro=e=>o({method:"post",url:"/v1/post",data:e}),ao=e=>o({method:"delete",url:"/v1/post",data:e}),lo=e=>o({method:"post",url:"/v1/post/lock",data:e}),uo=e=>o({method:"post",url:"/v1/post/stick",data:e}),co=e=>o({method:"post",url:"/v1/post/highlight",data:e}),io=e=>o({method:"post",url:"/v1/post/visibility",data:e}),po=e=>o({method:"post",url:"/v1/tweet/comment/thumbsup",data:e}),mo=e=>o({method:"post",url:"/v1/tweet/comment/thumbsdown",data:e}),_o=e=>o({method:"post",url:"/v1/tweet/reply/thumbsup",data:e}),ho=e=>o({method:"post",url:"/v1/tweet/reply/thumbsdown",data:e}),go=e=>o({method:"post",url:"/v1/post/comment",data:e}),fo=e=>o({method:"delete",url:"/v1/post/comment",data:e}),vo=e=>o({method:"post",url:"/v1/post/comment/reply",data:e}),wo=e=>o({method:"delete",url:"/v1/post/comment/reply",data:e}),yo=e=>o({method:"post",url:"/v1/topic/stick",data:e}),ko=e=>o({method:"post",url:"/v1/topic/follow",data:e}),bo=e=>o({method:"post",url:"/v1/topic/unfollow",data:e}),rt={key:0,class:"rightbar-wrap"},at={class:"search-wrap"},lt={class:"post-num"},ut={class:"post-num"},ct={class:"copyright"},it=["href"],dt=["href"],pt=z({__name:"rightbar",setup(e){const t=R([]),l=R([]),i=R(!1),c=R(""),n=B(),m=le(),d="2023 paopao.info",U="Roc's Me",g="",b="泡泡(PaoPao)开源社区",_="https://www.paopao.info",u=+"6",L=+"12",p=()=>{i.value=!0,nt({type:"hot_extral",num:L,extral_num:u}).then(y=>{t.value=y.topics,l.value=y.extral_topics??[],w.value=!0,i.value=!1}).catch(y=>{i.value=!1})},O=y=>y>=1e3?(y/1e3).toFixed(1)+"k":y,r=()=>{m.push({name:"home",query:{q:c.value}})},w=Q({get:()=>n.state.userLogined&&l.value.length!==0,set:y=>{}});return H(()=>({refreshTopicFollow:n.state.refreshTopicFollow,userLogined:n.state.userLogined}),(y,C)=>{(y.refreshTopicFollow!==C.refreshTopicFollow||y.userLogined)&&p()}),j(()=>{p()}),(y,C)=>{const x=F,$=ce,K=ae("router-link"),V=Ce,f=de,_e=ue;return h(n).state.collapsedRight?M("",!0):(v(),T("div",rt,[k("div",at,[s($,{round:"",clearable:"",placeholder:"搜一搜...",value:c.value,"onUpdate:value":C[0]||(C[0]=E=>c.value=E),onKeyup:q(N(r,["prevent"]),["enter"])},{prefix:a(()=>[s(x,{component:h(Fe)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),w.value?(v(),D(f,{key:0,class:"hottopic-wrap",title:"关注话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(V,{show:i.value},{default:a(()=>[(v(!0),T(X,null,Y(l.value,E=>(v(),T("div",{class:"hot-tag-item",key:E.id},[s(K,{class:"hash-link",to:{name:"home",query:{q:E.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(E.tag),1)]),_:2},1032,["to"]),k("div",lt,I(O(E.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1})):M("",!0),s(f,{class:"hottopic-wrap",title:"热门话题",embedded:"",bordered:!1,size:"small"},{default:a(()=>[s(V,{show:i.value},{default:a(()=>[(v(!0),T(X,null,Y(t.value,E=>(v(),T("div",{class:"hot-tag-item",key:E.id},[s(K,{class:"hash-link",to:{name:"home",query:{q:E.tag,t:"tag"}}},{default:a(()=>[S(" #"+I(E.tag),1)]),_:2},1032,["to"]),k("div",ut,I(O(E.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),s(f,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:a(()=>[k("div",ct,"© "+I(h(d)),1),k("div",null,[s(_e,null,{default:a(()=>[k("a",{href:h(g),target:"_blank",class:"hash-link"},I(h(U)),9,it),k("a",{href:h(_),target:"_blank",class:"hash-link"},I(h(b)),9,dt)]),_:1})])]),_:1})]))}}});const mt=me(pt,[["__scopeId","data-v-f4a84024"]]),Po=(e={})=>o({method:"get",url:"/v1/captcha",params:e}),Lo=e=>o({method:"post",url:"/v1/captcha",data:e}),Oo=e=>o({method:"post",url:"/v1/user/whisper",data:e}),Ao=e=>o({method:"post",url:"/v1/friend/requesting",data:e}),To=e=>o({method:"post",url:"/v1/friend/add",data:e}),Ro=e=>o({method:"post",url:"/v1/friend/reject",data:e}),Eo=e=>o({method:"post",url:"/v1/friend/delete",data:e}),Co=e=>o({method:"post",url:"/v1/user/phone",data:e}),$o=e=>o({method:"post",url:"/v1/user/activate",data:e}),Io=e=>o({method:"post",url:"/v1/user/password",data:e}),So=e=>o({method:"post",url:"/v1/user/nickname",data:e}),Mo=e=>o({method:"post",url:"/v1/user/avatar",data:e}),re=(e={})=>o({method:"get",url:"/v1/user/msgcount/unread",params:e}),Uo=e=>o({method:"get",url:"/v1/user/messages",params:e}),Ko=e=>o({method:"post",url:"/v1/user/message/read",data:e}),qo=e=>o({method:"get",url:"/v1/user/collections",params:e}),No=e=>o({method:"get",url:"/v1/user/profile",params:e}),Do=e=>o({method:"get",url:"/v1/user/posts",params:e}),xo=e=>o({method:"get",url:"/v1/user/wallet/bills",params:e}),Fo=e=>o({method:"post",url:"/v1/user/recharge",data:e}),Vo=e=>o({method:"get",url:"/v1/user/recharge",params:e}),zo=e=>o({method:"get",url:"/v1/suggest/users",params:e}),Bo=e=>o({method:"get",url:"/v1/suggest/tags",params:e}),Wo=e=>o({method:"get",url:"/v1/attachment/precheck",params:e}),Ho=e=>o({method:"get",url:"/v1/attachment",params:e}),jo=e=>o({method:"post",url:"/v1/admin/user/status",data:e}),_t="/assets/logo-52afee68.png",ht={class:"sidebar-wrap"},gt={class:"logo-wrap"},ft={key:0,class:"user-wrap"},vt={class:"user-info"},wt={class:"nickname"},yt={class:"nickname-txt"},kt={class:"username"},bt={class:"user-mini-wrap"},Pt={key:1,class:"user-wrap"},Lt={key:0,class:"login-only-wrap"},Ot={key:1,class:"login-wrap"},At=z({__name:"sidebar",setup(e){const t=B(),l=ye(),i=le(),c=R(!1),n=R(l.name||""),m=R(),d=R("true".toLowerCase()==="true"),U=+"5000";H(l,()=>{n.value=l.name}),H(t.state,()=>{t.state.userInfo.id>0?m.value||(re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)}),m.value=setInterval(()=>{re().then(r=>{c.value=r.count>0}).catch(r=>{console.log(r)})},U)):m.value&&clearInterval(m.value)}),j(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const g=Q(()=>{const r=[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}];return"false".toLowerCase()==="true"&&r.push({label:"公告",key:"anouncement",icon:()=>P(Ve),href:"/anouncement"}),r.push({label:"主页",key:"profile",icon:()=>P(ze),href:"/profile"}),r.push({label:"消息",key:"messages",icon:()=>P(Be),href:"/messages"}),r.push({label:"收藏",key:"collection",icon:()=>P(We),href:"/collection"}),r.push({label:"好友",key:"contacts",icon:()=>P(He),href:"/contacts"}),"false".toLocaleLowerCase()==="true"&&r.push({label:"钱包",key:"wallet",icon:()=>P(je),href:"/wallet"}),r.push({label:"设置",key:"setting",icon:()=>P(Qe),href:"/setting"}),t.state.userInfo.id>0?r:[{label:"广场",key:"home",icon:()=>P(ee),href:"/"},{label:"话题",key:"topic",icon:()=>P(te),href:"/topic"}]}),b=r=>"href"in r?P("div",{},r.label):r.label,_=r=>r.key==="messages"?P(Ie,{dot:!0,show:c.value,processing:!0},{default:()=>P(F,{color:r.key===n.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:r.icon})}):P(F,null,{default:r.icon}),u=(r,w={})=>{n.value=r,i.push({name:r})},L=()=>{l.path==="/"&&t.commit("refresh"),u("home")},p=r=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",r)},O=()=>{t.commit("userLogout"),t.commit("refresh"),L()};return window.$store=t,window.$message=$e(),(r,w)=>{const y=Se,C=Me,x=Ue,$=ie;return v(),T("div",ht,[k("div",gt,[s(y,{class:"logo-img",width:"36",src:h(_t),"preview-disabled":!0,onClick:L},null,8,["src"])]),s(C,{accordion:!0,"icon-size":24,options:g.value,"render-label":b,"render-icon":_,value:n.value,"onUpdate:value":u},null,8,["options","value"]),h(t).state.userInfo.id>0?(v(),T("div",ft,[s(x,{class:"user-avatar",round:"",size:34,src:h(t).state.userInfo.avatar},null,8,["src"]),k("div",vt,[k("div",wt,[k("span",yt,I(h(t).state.userInfo.nickname),1),s($,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:O},{icon:a(()=>[s(h(F),null,{default:a(()=>[s(h(oe))]),_:1})]),_:1})]),k("div",kt,"@"+I(h(t).state.userInfo.username),1)]),k("div",bt,[s($,{class:"logout",quaternary:"",circle:"",onClick:O},{icon:a(()=>[s(h(F),{size:24},{default:a(()=>[s(h(oe))]),_:1})]),_:1})])])):(v(),T("div",Pt,[d.value?M("",!0):(v(),T("div",Lt,[s($,{strong:"",secondary:"",round:"",type:"primary",onClick:w[0]||(w[0]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1})])),d.value?(v(),T("div",Ot,[s($,{strong:"",secondary:"",round:"",type:"primary",onClick:w[1]||(w[1]=K=>p("signin"))},{default:a(()=>[S(" 登录 ")]),_:1}),s($,{strong:"",secondary:"",round:"",type:"info",onClick:w[2]||(w[2]=K=>p("signup"))},{default:a(()=>[S(" 注册 ")]),_:1})])):M("",!0)]))])}}});const Tt={"has-sider":"",class:"main-wrap",position:"static"},Rt={key:0},Et={class:"content-wrap"},Ct=z({__name:"App",setup(e){const t=B(),l=Q(()=>t.state.theme==="dark"?qe:null);return(i,c)=>{const n=At,m=ae("router-view"),d=mt,U=st,g=Ne,b=De,_=xe,u=Ke;return v(),D(u,{theme:l.value},{default:a(()=>[s(b,null,{default:a(()=>[s(g,null,{default:a(()=>{var L;return[k("div",{class:ge(["app-container",{dark:((L=l.value)==null?void 0:L.name)==="dark",mobile:!h(t).state.desktopModelShow}])},[k("div",Tt,[h(t).state.desktopModelShow?(v(),T("div",Rt,[s(n)])):M("",!0),k("div",Et,[s(m,{class:"app-wrap"},{default:a(({Component:p})=>[(v(),D(he,null,[i.$route.meta.keepAlive?(v(),D(Z(p),{key:0})):M("",!0)],1024)),i.$route.meta.keepAlive?M("",!0):(v(),D(Z(p),{key:0}))]),_:1})]),s(d)]),s(U)],2)]}),_:1})]),_:1}),s(_)]),_:1},8,["theme"])}}});fe(Ct).use(pe).use(Ye).mount("#app");export{At as $,nt as A,Do as B,Oo as C,Ao as D,No as E,Eo as F,jo as G,To as H,Ro as I,Ko as J,Uo as K,qo as L,Wo as M,Ho as N,no as O,W as P,xo as Q,Fo as R,Vo as S,Po as T,Mo as U,Io as V,Co as W,$o as X,So as Y,Lo as Z,me as _,Bo as a,Xt as b,ro as c,ho as d,wo as e,po as f,zo as g,mo as h,vo as i,fo as j,go as k,Zt as l,to as m,ao as n,lo as o,co as p,eo as q,oo as r,uo as s,_o as t,Yt as u,io as v,so as w,yo as x,bo as y,ko as z}; diff --git a/web/dist/assets/index-c5cff9e7.css b/web/dist/assets/index-c5cff9e7.css new file mode 100644 index 00000000..9526b802 --- /dev/null +++ b/web/dist/assets/index-c5cff9e7.css @@ -0,0 +1 @@ +.auth-wrap[data-v-053dfa44]{margin-top:-30px}.dark .auth-wrap[data-v-053dfa44]{background-color:#101014bf}.rightbar-wrap[data-v-f4a84024]{width:240px;position:fixed;left:calc(50% + var(--content-main) / 2 + 10px)}.rightbar-wrap .search-wrap[data-v-f4a84024]{margin:12px 0}.rightbar-wrap .hot-tag-item[data-v-f4a84024]{line-height:2;position:relative}.rightbar-wrap .hot-tag-item .hash-link[data-v-f4a84024]{width:calc(100% - 60px);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block}.rightbar-wrap .hot-tag-item .post-num[data-v-f4a84024]{position:absolute;right:0;top:0;width:60px;text-align:right;line-height:2;opacity:.5}.rightbar-wrap .hottopic-wrap[data-v-f4a84024]{margin-bottom:10px}.rightbar-wrap .copyright-wrap .copyright[data-v-f4a84024]{font-size:12px;opacity:.75}.rightbar-wrap .copyright-wrap .hash-link[data-v-f4a84024]{font-size:12px}.dark .hottopic-wrap[data-v-f4a84024],.dark .copyright-wrap[data-v-f4a84024]{background-color:#18181c}.sidebar-wrap{z-index:99;width:200px;height:100vh;position:fixed;right:calc(50% + var(--content-main) / 2 + 10px);padding:12px 0;box-sizing:border-box}.sidebar-wrap .n-menu .n-menu-item-content:before{border-radius:21px}.logo-wrap{display:flex;justify-content:flex-start;margin-bottom:12px}.logo-wrap .logo-img{margin-left:24px}.logo-wrap .logo-img:hover{cursor:pointer}.user-wrap{display:flex;align-items:center;position:absolute;bottom:12px;left:12px;right:12px}.user-wrap .user-mini-wrap{display:none}.user-wrap .user-avatar{margin-right:8px}.user-wrap .user-info{display:flex;flex-direction:column}.user-wrap .user-info .nickname{font-size:16px;font-weight:700;line-height:16px;height:16px;margin-bottom:2px;display:flex;align-items:center}.user-wrap .user-info .nickname .nickname-txt{max-width:90px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.user-wrap .user-info .nickname .logout{margin-left:6px}.user-wrap .user-info .username{font-size:14px;line-height:16px;height:16px;width:120px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;opacity:.75}.user-wrap .login-only-wrap{display:flex;justify-content:center;width:100%}.user-wrap .login-only-wrap button{margin:0 4px;width:80%}.user-wrap .login-wrap{display:flex;justify-content:center;width:100%}.user-wrap .login-wrap button{margin:0 4px}.auth-card .n-card-header{z-index:999}@media screen and (max-width: 821px){.sidebar-wrap{width:200px;right:calc(100% - 200px)}.logo-wrap .logo-img{margin-left:12px!important}.user-wrap .user-avatar,.user-wrap .user-info,.user-wrap .login-only-wrap,.user-wrap .login-wrap{margin-bottom:32px}}:root{--content-main: 600px}.app-container{margin:0}.app-container .app-wrap{width:100%;margin:0 auto}.main-wrap{min-height:100vh;display:flex;flex-direction:row;justify-content:center}.main-wrap .content-wrap{width:100%;max-width:var(--content-main);position:relative}.main-wrap .main-content-wrap{margin:0;border-top:none;border-radius:0}.main-wrap .main-content-wrap .n-list-item{padding:0}.empty-wrap{min-height:300px;display:flex;align-items:center;justify-content:center}.hash-link,.user-link{color:#18a058;text-decoration:none;cursor:pointer}.hash-link:hover,.user-link:hover{opacity:.8}.beian-link{color:#333;text-decoration:none}.beian-link:hover{opacity:.75}.username-link{color:#000;color:none;text-decoration:none;cursor:pointer}.username-link:hover{text-decoration:underline}.dark .hash-link,.dark .user-link{color:#63e2b7}.dark .username-link{color:#eee}.dark .beian-link{color:#ddd}@media screen and (max-width: 821px){.content-wrap{top:0;position:absolute!important}} diff --git a/web/dist/assets/index.cd3e5166.css b/web/dist/assets/index.cd3e5166.css deleted file mode 100644 index 26e61ad4..00000000 --- a/web/dist/assets/index.cd3e5166.css +++ /dev/null @@ -1 +0,0 @@ -.auth-wrap[data-v-66895776]{margin-top:-30px}.rightbar-wrap[data-v-715681a1]{width:240px;position:fixed;left:calc(50% + var(--content-main) / 2 + 10px)}.rightbar-wrap .search-wrap[data-v-715681a1]{margin:12px 0}.rightbar-wrap .hot-tag-item[data-v-715681a1]{line-height:2;position:relative}.rightbar-wrap .hot-tag-item .hash-link[data-v-715681a1]{width:calc(100% - 60px);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block}.rightbar-wrap .hot-tag-item .post-num[data-v-715681a1]{position:absolute;right:0;top:0;width:60px;text-align:right;line-height:2;opacity:.5}.rightbar-wrap .copyright-wrap[data-v-715681a1]{margin-top:10px}.rightbar-wrap .copyright-wrap .copyright[data-v-715681a1]{font-size:12px;opacity:.75}.rightbar-wrap .copyright-wrap .hash-link[data-v-715681a1]{font-size:12px}.sidebar-wrap{z-index:99;width:200px;height:100vh;position:fixed;right:calc(50% + var(--content-main) / 2 + 10px);padding:12px 0;box-sizing:border-box}.sidebar-wrap .n-menu .n-menu-item-content:before{border-radius:21px}.logo-wrap{display:flex;justify-content:flex-start;margin-bottom:12px}.logo-wrap .logo-img{margin-left:24px}.logo-wrap .logo-img:hover{cursor:pointer}.user-wrap{display:flex;align-items:center;position:absolute;bottom:12px;left:12px;right:12px}.user-wrap .user-mini-wrap{display:none}.user-wrap .user-avatar{margin-right:8px}.user-wrap .user-info{display:flex;flex-direction:column}.user-wrap .user-info .nickname{font-size:16px;font-weight:700;line-height:16px;height:16px;margin-bottom:2px;display:flex;align-items:center}.user-wrap .user-info .nickname .nickname-txt{max-width:90px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.user-wrap .user-info .nickname .logout{margin-left:6px}.user-wrap .user-info .username{font-size:14px;line-height:16px;height:16px;width:120px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;opacity:.75}.user-wrap .login-wrap{display:flex;justify-content:center;width:100%}.user-wrap .login-wrap button{margin:0 4px}.auth-card .n-card-header{z-index:999}@media screen and (max-width: 821px){.sidebar-wrap{width:65px;right:calc(100% - 60px)}.logo-wrap .logo-img{margin-left:12px!important}.user-wrap .user-avatar,.user-wrap .user-info,.user-wrap .login-wrap{display:none}.user-wrap .user-mini-wrap{display:block!important}}:root{--content-main: 500px}.app-container{margin:0}.app-container .app-wrap{width:100%;margin:0 auto}.main-wrap{min-height:100vh;display:flex;flex-direction:row;justify-content:center}.main-wrap .content-wrap{width:100%;max-width:var(--content-main);position:relative}.main-wrap .main-content-wrap{margin:0;border-top:none;border-radius:0}.main-wrap .main-content-wrap .n-list-item{padding:0}.empty-wrap{min-height:300px;display:flex;align-items:center;justify-content:center}.hash-link,.user-link{color:#18a058;text-decoration:none;cursor:pointer}.hash-link:hover,.user-link:hover{opacity:.8}.beian-link{color:#333;text-decoration:none}.beian-link:hover{opacity:.75}.username-link{color:#000;color:none;text-decoration:none;cursor:pointer}.username-link:hover{text-decoration:underline}.dark .hash-link,.dark .user-link{color:#63e2b7}.dark .username-link{color:#eee}.dark .beian-link{color:#ddd}@media screen and (max-width: 821px){.content-wrap{top:0;left:60px;position:absolute!important;width:calc(100% - 60px)!important}}@font-face{font-family:v-sans;font-weight:400;src:url(/assets/LatoLatin-Regular.ddd4ef7f.woff2)}@font-face{font-family:v-sans;font-weight:600;src:url(/assets/LatoLatin-Semibold.267eef30.woff2)}@font-face{font-family:v-mono;font-weight:400;src:url(/assets/FiraCode-Regular.f13d1ece.woff2)} diff --git a/web/dist/assets/index.d4f5aad2.js b/web/dist/assets/index.d4f5aad2.js deleted file mode 100644 index e791b518..00000000 --- a/web/dist/assets/index.d4f5aad2.js +++ /dev/null @@ -1,2005 +0,0 @@ -const S0=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function r(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerpolicy&&(i.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?i.credentials="include":n.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(n){if(n.ep)return;n.ep=!0;const i=r(n);fetch(n.href,i)}};S0();function sc(e,t){const r=Object.create(null),o=e.split(",");for(let n=0;n!!r[n.toLowerCase()]:n=>!!r[n]}function Fa(e){if(ke(e)){const t={};for(let r=0;r{if(r){const o=r.split(_0);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function ja(e){let t="";if(ft(e))t=e;else if(ke(e))for(let r=0;rft(e)?e:e==null?"":ke(e)||it(e)&&(e.toString===Oh||!Oe(e.toString))?JSON.stringify(e,Eh,2):String(e),Eh=(e,t)=>t&&t.__v_isRef?Eh(e,t.value):pn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((r,[o,n])=>(r[`${o} =>`]=n,r),{})}:Rh(t)?{[`Set(${t.size})`]:[...t.values()]}:it(t)&&!ke(t)&&!Ah(t)?String(t):t,nt={},hn=[],pr=()=>{},E0=()=>!1,R0=/^on[^a-z]/,Na=e=>R0.test(e),cc=e=>e.startsWith("onUpdate:"),_t=Object.assign,dc=(e,t)=>{const r=e.indexOf(t);r>-1&&e.splice(r,1)},I0=Object.prototype.hasOwnProperty,Ve=(e,t)=>I0.call(e,t),ke=Array.isArray,pn=e=>Wa(e)==="[object Map]",Rh=e=>Wa(e)==="[object Set]",Oe=e=>typeof e=="function",ft=e=>typeof e=="string",uc=e=>typeof e=="symbol",it=e=>e!==null&&typeof e=="object",Ih=e=>it(e)&&Oe(e.then)&&Oe(e.catch),Oh=Object.prototype.toString,Wa=e=>Oh.call(e),O0=e=>Wa(e).slice(8,-1),Ah=e=>Wa(e)==="[object Object]",fc=e=>ft(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ma=sc(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Va=e=>{const t=Object.create(null);return r=>t[r]||(t[r]=e(r))},A0=/-(\w)/g,Pr=Va(e=>e.replace(A0,(t,r)=>r?r.toUpperCase():"")),M0=/\B([A-Z])/g,Ho=Va(e=>e.replace(M0,"-$1").toLowerCase()),Ua=Va(e=>e.charAt(0).toUpperCase()+e.slice(1)),Tl=Va(e=>e?`on${Ua(e)}`:""),vi=(e,t)=>!Object.is(e,t),vn=(e,t)=>{for(let r=0;r{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:r})},mi=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Ed;const B0=()=>Ed||(Ed=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});let wr;class Mh{constructor(t=!1){this.detached=t,this.active=!0,this.effects=[],this.cleanups=[],this.parent=wr,!t&&wr&&(this.index=(wr.scopes||(wr.scopes=[])).push(this)-1)}run(t){if(this.active){const r=wr;try{return wr=this,t()}finally{wr=r}}}on(){wr=this}off(){wr=this.parent}stop(t){if(this.active){let r,o;for(r=0,o=this.effects.length;r{const t=new Set(e);return t.w=0,t.n=0,t},Bh=e=>(e.w&no)>0,Lh=e=>(e.n&no)>0,D0=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let r=0;for(let o=0;o{(c==="length"||c>=s)&&l.push(d)})}else switch(r!==void 0&&l.push(a.get(r)),t){case"add":ke(e)?fc(r)&&l.push(a.get("length")):(l.push(a.get(Io)),pn(e)&&l.push(a.get(gs)));break;case"delete":ke(e)||(l.push(a.get(Io)),pn(e)&&l.push(a.get(gs)));break;case"set":pn(e)&&l.push(a.get(Io));break}if(l.length===1)l[0]&&bs(l[0]);else{const s=[];for(const d of l)d&&s.push(...d);bs(hc(s))}}function bs(e,t){const r=ke(e)?e:[...e];for(const o of r)o.computed&&Id(o);for(const o of r)o.computed||Id(o)}function Id(e,t){(e!==fr||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const j0=sc("__proto__,__v_isRef,__isVue"),Fh=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(uc)),N0=vc(),W0=vc(!1,!0),V0=vc(!0),Od=U0();function U0(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...r){const o=Ke(this);for(let i=0,a=this.length;i{e[t]=function(...r){An();const o=Ke(this)[t].apply(this,r);return Mn(),o}}),e}function vc(e=!1,t=!1){return function(o,n,i){if(n==="__v_isReactive")return!e;if(n==="__v_isReadonly")return e;if(n==="__v_isShallow")return t;if(n==="__v_raw"&&i===(e?t?l1:Uh:t?Vh:Wh).get(o))return o;const a=ke(o);if(!e&&a&&Ve(Od,n))return Reflect.get(Od,n,i);const l=Reflect.get(o,n,i);return(uc(n)?Fh.has(n):j0(n))||(e||Qt(o,"get",n),t)?l:Et(l)?a&&fc(n)?l:l.value:it(l)?e?kr(l):vr(l):l}}const K0=jh(),q0=jh(!0);function jh(e=!1){return function(r,o,n,i){let a=r[o];if(wn(a)&&Et(a)&&!Et(n))return!1;if(!e&&(!_a(n)&&!wn(n)&&(a=Ke(a),n=Ke(n)),!ke(r)&&Et(a)&&!Et(n)))return a.value=n,!0;const l=ke(r)&&fc(o)?Number(o)e,Ka=e=>Reflect.getPrototypeOf(e);function qi(e,t,r=!1,o=!1){e=e.__v_raw;const n=Ke(e),i=Ke(t);r||(t!==i&&Qt(n,"get",t),Qt(n,"get",i));const{has:a}=Ka(n),l=o?mc:r?xc:gi;if(a.call(n,t))return l(e.get(t));if(a.call(n,i))return l(e.get(i));e!==n&&e.get(t)}function Gi(e,t=!1){const r=this.__v_raw,o=Ke(r),n=Ke(e);return t||(e!==n&&Qt(o,"has",e),Qt(o,"has",n)),e===n?r.has(e):r.has(e)||r.has(n)}function Yi(e,t=!1){return e=e.__v_raw,!t&&Qt(Ke(e),"iterate",Io),Reflect.get(e,"size",e)}function Ad(e){e=Ke(e);const t=Ke(this);return Ka(t).has.call(t,e)||(t.add(e),Hr(t,"add",e,e)),this}function Md(e,t){t=Ke(t);const r=Ke(this),{has:o,get:n}=Ka(r);let i=o.call(r,e);i||(e=Ke(e),i=o.call(r,e));const a=n.call(r,e);return r.set(e,t),i?vi(t,a)&&Hr(r,"set",e,t):Hr(r,"add",e,t),this}function Bd(e){const t=Ke(this),{has:r,get:o}=Ka(t);let n=r.call(t,e);n||(e=Ke(e),n=r.call(t,e)),o&&o.call(t,e);const i=t.delete(e);return n&&Hr(t,"delete",e,void 0),i}function Ld(){const e=Ke(this),t=e.size!==0,r=e.clear();return t&&Hr(e,"clear",void 0,void 0),r}function Xi(e,t){return function(o,n){const i=this,a=i.__v_raw,l=Ke(a),s=t?mc:e?xc:gi;return!e&&Qt(l,"iterate",Io),a.forEach((d,c)=>o.call(n,s(d),s(c),i))}}function Zi(e,t,r){return function(...o){const n=this.__v_raw,i=Ke(n),a=pn(i),l=e==="entries"||e===Symbol.iterator&&a,s=e==="keys"&&a,d=n[e](...o),c=r?mc:t?xc:gi;return!t&&Qt(i,"iterate",s?gs:Io),{next(){const{value:u,done:f}=d.next();return f?{value:u,done:f}:{value:l?[c(u[0]),c(u[1])]:c(u),done:f}},[Symbol.iterator](){return this}}}}function Gr(e){return function(...t){return e==="delete"?!1:this}}function Q0(){const e={get(i){return qi(this,i)},get size(){return Yi(this)},has:Gi,add:Ad,set:Md,delete:Bd,clear:Ld,forEach:Xi(!1,!1)},t={get(i){return qi(this,i,!1,!0)},get size(){return Yi(this)},has:Gi,add:Ad,set:Md,delete:Bd,clear:Ld,forEach:Xi(!1,!0)},r={get(i){return qi(this,i,!0)},get size(){return Yi(this,!0)},has(i){return Gi.call(this,i,!0)},add:Gr("add"),set:Gr("set"),delete:Gr("delete"),clear:Gr("clear"),forEach:Xi(!0,!1)},o={get(i){return qi(this,i,!0,!0)},get size(){return Yi(this,!0)},has(i){return Gi.call(this,i,!0)},add:Gr("add"),set:Gr("set"),delete:Gr("delete"),clear:Gr("clear"),forEach:Xi(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(i=>{e[i]=Zi(i,!1,!1),r[i]=Zi(i,!0,!1),t[i]=Zi(i,!1,!0),o[i]=Zi(i,!0,!0)}),[e,r,t,o]}const[e1,t1,r1,o1]=Q0();function gc(e,t){const r=t?e?o1:r1:e?t1:e1;return(o,n,i)=>n==="__v_isReactive"?!e:n==="__v_isReadonly"?e:n==="__v_raw"?o:Reflect.get(Ve(r,n)&&n in o?r:o,n,i)}const n1={get:gc(!1,!1)},i1={get:gc(!1,!0)},a1={get:gc(!0,!1)},Wh=new WeakMap,Vh=new WeakMap,Uh=new WeakMap,l1=new WeakMap;function s1(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function c1(e){return e.__v_skip||!Object.isExtensible(e)?0:s1(O0(e))}function vr(e){return wn(e)?e:bc(e,!1,Nh,n1,Wh)}function d1(e){return bc(e,!1,J0,i1,Vh)}function kr(e){return bc(e,!0,Z0,a1,Uh)}function bc(e,t,r,o,n){if(!it(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=n.get(e);if(i)return i;const a=c1(e);if(a===0)return e;const l=new Proxy(e,a===2?o:r);return n.set(e,l),l}function mn(e){return wn(e)?mn(e.__v_raw):!!(e&&e.__v_isReactive)}function wn(e){return!!(e&&e.__v_isReadonly)}function _a(e){return!!(e&&e.__v_isShallow)}function Kh(e){return mn(e)||wn(e)}function Ke(e){const t=e&&e.__v_raw;return t?Ke(t):e}function Pa(e){return $a(e,"__v_skip",!0),e}const gi=e=>it(e)?vr(e):e,xc=e=>it(e)?kr(e):e;function qh(e){ro&&fr&&(e=Ke(e),Dh(e.dep||(e.dep=hc())))}function Gh(e,t){e=Ke(e),e.dep&&bs(e.dep)}function Et(e){return!!(e&&e.__v_isRef===!0)}function V(e){return Yh(e,!1)}function u1(e){return Yh(e,!0)}function Yh(e,t){return Et(e)?e:new f1(e,t)}class f1{constructor(t,r){this.__v_isShallow=r,this.dep=void 0,this.__v_isRef=!0,this._rawValue=r?t:Ke(t),this._value=r?t:gi(t)}get value(){return qh(this),this._value}set value(t){const r=this.__v_isShallow||_a(t)||wn(t);t=r?t:Ke(t),vi(t,this._rawValue)&&(this._rawValue=t,this._value=r?t:gi(t),Gh(this))}}function Ze(e){return Et(e)?e.value:e}const h1={get:(e,t,r)=>Ze(Reflect.get(e,t,r)),set:(e,t,r,o)=>{const n=e[t];return Et(n)&&!Et(r)?(n.value=r,!0):Reflect.set(e,t,r,o)}};function Xh(e){return mn(e)?e:new Proxy(e,h1)}class p1{constructor(t,r,o){this._object=t,this._key=r,this._defaultValue=o,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}}function Te(e,t,r){const o=e[t];return Et(o)?o:new p1(e,t,r)}var Zh;class v1{constructor(t,r,o,n){this._setter=r,this.dep=void 0,this.__v_isRef=!0,this[Zh]=!1,this._dirty=!0,this.effect=new pc(t,()=>{this._dirty||(this._dirty=!0,Gh(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=o}get value(){const t=Ke(this);return qh(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}Zh="__v_isReadonly";function m1(e,t,r=!1){let o,n;const i=Oe(e);return i?(o=e,n=pr):(o=e.get,n=e.set),new v1(o,n,i||!n,r)}function oo(e,t,r,o){let n;try{n=o?e(...o):e()}catch(i){qa(i,t,r)}return n}function ir(e,t,r,o){if(Oe(e)){const i=oo(e,t,r,o);return i&&Ih(i)&&i.catch(a=>{qa(a,t,r)}),i}const n=[];for(let i=0;i>>1;xi(Mt[o])$r&&Mt.splice(t,1)}function C1(e){ke(e)?gn.push(...e):(!Br||!Br.includes(e,e.allowRecurse?So+1:So))&&gn.push(e),Qh()}function Hd(e,t=bi?$r+1:0){for(;txi(r)-xi(o)),So=0;Soe.id==null?1/0:e.id,y1=(e,t)=>{const r=xi(e)-xi(t);if(r===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return r};function tp(e){xs=!1,bi=!0,Mt.sort(y1);const t=pr;try{for($r=0;$rft(p)?p.trim():p)),u&&(n=r.map(mi))}let l,s=o[l=Tl(t)]||o[l=Tl(Pr(t))];!s&&i&&(s=o[l=Tl(Ho(t))]),s&&ir(s,e,6,n);const d=o[l+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,ir(d,e,6,n)}}function rp(e,t,r=!1){const o=t.emitsCache,n=o.get(e);if(n!==void 0)return n;const i=e.emits;let a={},l=!1;if(!Oe(e)){const s=d=>{const c=rp(d,t,!0);c&&(l=!0,_t(a,c))};!r&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}return!i&&!l?(it(e)&&o.set(e,null),null):(ke(i)?i.forEach(s=>a[s]=null):_t(a,i),it(e)&&o.set(e,a),a)}function Ga(e,t){return!e||!Na(t)?!1:(t=t.slice(2).replace(/Once$/,""),Ve(e,t[0].toLowerCase()+t.slice(1))||Ve(e,Ho(t))||Ve(e,t))}let Rt=null,Ya=null;function ka(e){const t=Rt;return Rt=e,Ya=e&&e.type.__scopeId||null,t}function RM(e){Ya=e}function IM(){Ya=null}function qe(e,t=Rt,r){if(!t||e._n)return e;const o=(...n)=>{o._d&&Xd(-1);const i=ka(t);let a;try{a=e(...n)}finally{ka(i),o._d&&Xd(1)}return a};return o._n=!0,o._c=!0,o._d=!0,o}function zl(e){const{type:t,vnode:r,proxy:o,withProxy:n,props:i,propsOptions:[a],slots:l,attrs:s,emit:d,render:c,renderCache:u,data:f,setupState:p,ctx:h,inheritAttrs:g}=e;let b,m;const y=ka(e);try{if(r.shapeFlag&4){const x=n||o;b=Sr(c.call(x,x,u,i,p,f,h)),m=s}else{const x=t;b=Sr(x.length>1?x(i,{attrs:s,slots:l,emit:d}):x(i,null)),m=t.props?s:S1(s)}}catch(x){li.length=0,qa(x,e,1),b=be(Dt)}let w=b;if(m&&g!==!1){const x=Object.keys(m),{shapeFlag:k}=w;x.length&&k&7&&(a&&x.some(cc)&&(m=$1(m,a)),w=lr(w,m))}return r.dirs&&(w=lr(w),w.dirs=w.dirs?w.dirs.concat(r.dirs):r.dirs),r.transition&&(w.transition=r.transition),b=w,ka(y),b}const S1=e=>{let t;for(const r in e)(r==="class"||r==="style"||Na(r))&&((t||(t={}))[r]=e[r]);return t},$1=(e,t)=>{const r={};for(const o in e)(!cc(o)||!(o.slice(9)in t))&&(r[o]=e[o]);return r};function _1(e,t,r){const{props:o,children:n,component:i}=e,{props:a,children:l,patchFlag:s}=t,d=i.emitsOptions;if(t.dirs||t.transition)return!0;if(r&&s>=0){if(s&1024)return!0;if(s&16)return o?Dd(o,a,d):!!a;if(s&8){const c=t.dynamicProps;for(let u=0;ue.__isSuspense;function k1(e,t){t&&t.pendingBranch?ke(e)?t.effects.push(...e):t.effects.push(e):C1(e)}function Be(e,t){if($t){let r=$t.provides;const o=$t.parent&&$t.parent.provides;o===r&&(r=$t.provides=Object.create(o)),r[e]=t}}function me(e,t,r=!1){const o=$t||Rt;if(o){const n=o.parent==null?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides;if(n&&e in n)return n[e];if(arguments.length>1)return r&&Oe(t)?t.call(o.proxy):t}}function Wt(e,t){return wc(e,null,t)}const Ji={};function De(e,t,r){return wc(e,t,r)}function wc(e,t,{immediate:r,deep:o,flush:n,onTrack:i,onTrigger:a}=nt){const l=$t;let s,d=!1,c=!1;if(Et(e)?(s=()=>e.value,d=_a(e)):mn(e)?(s=()=>e,o=!0):ke(e)?(c=!0,d=e.some(w=>mn(w)||_a(w)),s=()=>e.map(w=>{if(Et(w))return w.value;if(mn(w))return Po(w);if(Oe(w))return oo(w,l,2)})):Oe(e)?t?s=()=>oo(e,l,2):s=()=>{if(!(l&&l.isUnmounted))return u&&u(),ir(e,l,3,[f])}:s=pr,t&&o){const w=s;s=()=>Po(w())}let u,f=w=>{u=m.onStop=()=>{oo(w,l,4)}},p;if(wi)if(f=pr,t?r&&ir(t,l,3,[s(),c?[]:void 0,f]):s(),n==="sync"){const w=gx();p=w.__watcherHandles||(w.__watcherHandles=[])}else return pr;let h=c?new Array(e.length).fill(Ji):Ji;const g=()=>{if(!!m.active)if(t){const w=m.run();(o||d||(c?w.some((x,k)=>vi(x,h[k])):vi(w,h)))&&(u&&u(),ir(t,l,3,[w,h===Ji?void 0:c&&h[0]===Ji?[]:h,f]),h=w)}else m.run()};g.allowRecurse=!!t;let b;n==="sync"?b=g:n==="post"?b=()=>kt(g,l&&l.suspense):(g.pre=!0,l&&(g.id=l.uid),b=()=>yc(g));const m=new pc(s,b);t?r?g():h=m.run():n==="post"?kt(m.run.bind(m),l&&l.suspense):m.run();const y=()=>{m.stop(),l&&l.scope&&dc(l.scope.effects,m)};return p&&p.push(y),y}function T1(e,t,r){const o=this.proxy,n=ft(e)?e.includes(".")?np(o,e):()=>o[e]:e.bind(o,o);let i;Oe(t)?i=t:(i=t.handler,r=t);const a=$t;_n(this);const l=wc(n,i.bind(o),r);return a?_n(a):Oo(),l}function np(e,t){const r=t.split(".");return()=>{let o=e;for(let n=0;n{Po(r,t)});else if(Ah(e))for(const r in e)Po(e[r],t);return e}function ip(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return gt(()=>{e.isMounted=!0}),ht(()=>{e.isUnmounting=!0}),e}const tr=[Function,Array],z1={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:tr,onEnter:tr,onAfterEnter:tr,onEnterCancelled:tr,onBeforeLeave:tr,onLeave:tr,onAfterLeave:tr,onLeaveCancelled:tr,onBeforeAppear:tr,onAppear:tr,onAfterAppear:tr,onAppearCancelled:tr},setup(e,{slots:t}){const r=Wr(),o=ip();let n;return()=>{const i=t.default&&Sc(t.default(),!0);if(!i||!i.length)return;let a=i[0];if(i.length>1){for(const g of i)if(g.type!==Dt){a=g;break}}const l=Ke(e),{mode:s}=l;if(o.isLeaving)return El(a);const d=Fd(a);if(!d)return El(a);const c=Ci(d,l,o,r);Sn(d,c);const u=r.subTree,f=u&&Fd(u);let p=!1;const{getTransitionKey:h}=d.type;if(h){const g=h();n===void 0?n=g:g!==n&&(n=g,p=!0)}if(f&&f.type!==Dt&&(!$o(d,f)||p)){const g=Ci(f,l,o,r);if(Sn(f,g),s==="out-in")return o.isLeaving=!0,g.afterLeave=()=>{o.isLeaving=!1,r.update.active!==!1&&r.update()},El(a);s==="in-out"&&d.type!==Dt&&(g.delayLeave=(b,m,y)=>{const w=lp(o,f);w[String(f.key)]=f,b._leaveCb=()=>{m(),b._leaveCb=void 0,delete c.delayedLeave},c.delayedLeave=y})}return a}}},ap=z1;function lp(e,t){const{leavingVNodes:r}=e;let o=r.get(t.type);return o||(o=Object.create(null),r.set(t.type,o)),o}function Ci(e,t,r,o){const{appear:n,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:s,onAfterEnter:d,onEnterCancelled:c,onBeforeLeave:u,onLeave:f,onAfterLeave:p,onLeaveCancelled:h,onBeforeAppear:g,onAppear:b,onAfterAppear:m,onAppearCancelled:y}=t,w=String(e.key),x=lp(r,e),k=($,R)=>{$&&ir($,o,9,R)},T=($,R)=>{const _=R[1];k($,R),ke($)?$.every(N=>N.length<=1)&&_():$.length<=1&&_()},S={mode:i,persisted:a,beforeEnter($){let R=l;if(!r.isMounted)if(n)R=g||l;else return;$._leaveCb&&$._leaveCb(!0);const _=x[w];_&&$o(e,_)&&_.el._leaveCb&&_.el._leaveCb(),k(R,[$])},enter($){let R=s,_=d,N=c;if(!r.isMounted)if(n)R=b||s,_=m||d,N=y||c;else return;let E=!1;const F=$._enterCb=j=>{E||(E=!0,j?k(N,[$]):k(_,[$]),S.delayedLeave&&S.delayedLeave(),$._enterCb=void 0)};R?T(R,[$,F]):F()},leave($,R){const _=String(e.key);if($._enterCb&&$._enterCb(!0),r.isUnmounting)return R();k(u,[$]);let N=!1;const E=$._leaveCb=F=>{N||(N=!0,R(),F?k(h,[$]):k(p,[$]),$._leaveCb=void 0,x[_]===e&&delete x[_])};x[_]=e,f?T(f,[$,E]):E()},clone($){return Ci($,t,r,o)}};return S}function El(e){if(Xa(e))return e=lr(e),e.children=null,e}function Fd(e){return Xa(e)?e.children?e.children[0]:void 0:e}function Sn(e,t){e.shapeFlag&6&&e.component?Sn(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Sc(e,t=!1,r){let o=[],n=0;for(let i=0;i1)for(let i=0;i!!e.type.__asyncLoader,Xa=e=>e.type.__isKeepAlive,E1={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const r=Wr(),o=r.ctx;if(!o.renderer)return()=>{const y=t.default&&t.default();return y&&y.length===1?y[0]:y};const n=new Map,i=new Set;let a=null;const l=r.suspense,{renderer:{p:s,m:d,um:c,o:{createElement:u}}}=o,f=u("div");o.activate=(y,w,x,k,T)=>{const S=y.component;d(y,w,x,0,l),s(S.vnode,y,w,x,S,l,k,y.slotScopeIds,T),kt(()=>{S.isDeactivated=!1,S.a&&vn(S.a);const $=y.props&&y.props.onVnodeMounted;$&&nr($,S.parent,y)},l)},o.deactivate=y=>{const w=y.component;d(y,f,null,1,l),kt(()=>{w.da&&vn(w.da);const x=y.props&&y.props.onVnodeUnmounted;x&&nr(x,w.parent,y),w.isDeactivated=!0},l)};function p(y){Rl(y),c(y,r,l,!0)}function h(y){n.forEach((w,x)=>{const k=ks(w.type);k&&(!y||!y(k))&&g(x)})}function g(y){const w=n.get(y);!a||w.type!==a.type?p(w):a&&Rl(a),n.delete(y),i.delete(y)}De(()=>[e.include,e.exclude],([y,w])=>{y&&h(x=>ei(y,x)),w&&h(x=>!ei(w,x))},{flush:"post",deep:!0});let b=null;const m=()=>{b!=null&&n.set(b,Il(r.subTree))};return gt(m),$c(m),ht(()=>{n.forEach(y=>{const{subTree:w,suspense:x}=r,k=Il(w);if(y.type===k.type){Rl(k);const T=k.component.da;T&&kt(T,x);return}p(y)})}),()=>{if(b=null,!t.default)return null;const y=t.default(),w=y[0];if(y.length>1)return a=null,y;if(!$n(w)||!(w.shapeFlag&4)&&!(w.shapeFlag&128))return a=null,w;let x=Il(w);const k=x.type,T=ks(bn(x)?x.type.__asyncResolved||{}:k),{include:S,exclude:$,max:R}=e;if(S&&(!T||!ei(S,T))||$&&T&&ei($,T))return a=x,w;const _=x.key==null?k:x.key,N=n.get(_);return x.el&&(x=lr(x),w.shapeFlag&128&&(w.ssContent=x)),b=_,N?(x.el=N.el,x.component=N.component,x.transition&&Sn(x,x.transition),x.shapeFlag|=512,i.delete(_),i.add(_)):(i.add(_),R&&i.size>parseInt(R,10)&&g(i.values().next().value)),x.shapeFlag|=256,a=x,op(w.type)?w:x}}},R1=E1;function ei(e,t){return ke(e)?e.some(r=>ei(r,t)):ft(e)?e.split(",").includes(t):e.test?e.test(t):!1}function sp(e,t){dp(e,"a",t)}function cp(e,t){dp(e,"da",t)}function dp(e,t,r=$t){const o=e.__wdc||(e.__wdc=()=>{let n=r;for(;n;){if(n.isDeactivated)return;n=n.parent}return e()});if(Za(t,o,r),r){let n=r.parent;for(;n&&n.parent;)Xa(n.parent.vnode)&&I1(o,t,r,n),n=n.parent}}function I1(e,t,r,o){const n=Za(t,e,o,!0);_c(()=>{dc(o[t],n)},r)}function Rl(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Il(e){return e.shapeFlag&128?e.ssContent:e}function Za(e,t,r=$t,o=!1){if(r){const n=r[e]||(r[e]=[]),i=t.__weh||(t.__weh=(...a)=>{if(r.isUnmounted)return;An(),_n(r);const l=ir(t,r,e,a);return Oo(),Mn(),l});return o?n.unshift(i):n.push(i),i}}const jr=e=>(t,r=$t)=>(!wi||e==="sp")&&Za(e,(...o)=>t(...o),r),Nr=jr("bm"),gt=jr("m"),O1=jr("bu"),$c=jr("u"),ht=jr("bum"),_c=jr("um"),A1=jr("sp"),M1=jr("rtg"),B1=jr("rtc");function L1(e,t=$t){Za("ec",e,t)}function Tr(e,t){const r=Rt;if(r===null)return e;const o=el(r)||r.proxy,n=e.dirs||(e.dirs=[]);for(let i=0;it(a,l,void 0,i&&i[l]));else{const a=Object.keys(e);n=new Array(a.length);for(let l=0,s=a.length;l{const i=o.fn(...n);return i&&(i.key=o.key),i}:o.fn)}return e}function D1(e,t,r={},o,n){if(Rt.isCE||Rt.parent&&bn(Rt.parent)&&Rt.parent.isCE)return t!=="default"&&(r.name=t),be("slot",r,o&&o());let i=e[t];i&&i._c&&(i._d=!1),lt();const a=i&&pp(i(r)),l=ko(Je,{key:r.key||a&&a.key||`_${t}`},a||(o?o():[]),a&&e._===1?64:-2);return!n&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),i&&i._c&&(i._d=!0),l}function pp(e){return e.some(t=>$n(t)?!(t.type===Dt||t.type===Je&&!pp(t.children)):!0)?e:null}const Cs=e=>e?kp(e)?el(e)||e.proxy:Cs(e.parent):null,ii=_t(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=>Cs(e.parent),$root:e=>Cs(e.root),$emit:e=>e.emit,$options:e=>kc(e),$forceUpdate:e=>e.f||(e.f=()=>yc(e.update)),$nextTick:e=>e.n||(e.n=Zt.bind(e.proxy)),$watch:e=>T1.bind(e)}),Ol=(e,t)=>e!==nt&&!e.__isScriptSetup&&Ve(e,t),F1={get({_:e},t){const{ctx:r,setupState:o,data:n,props:i,accessCache:a,type:l,appContext:s}=e;let d;if(t[0]!=="$"){const p=a[t];if(p!==void 0)switch(p){case 1:return o[t];case 2:return n[t];case 4:return r[t];case 3:return i[t]}else{if(Ol(o,t))return a[t]=1,o[t];if(n!==nt&&Ve(n,t))return a[t]=2,n[t];if((d=e.propsOptions[0])&&Ve(d,t))return a[t]=3,i[t];if(r!==nt&&Ve(r,t))return a[t]=4,r[t];ys&&(a[t]=0)}}const c=ii[t];let u,f;if(c)return t==="$attrs"&&Qt(e,"get",t),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(r!==nt&&Ve(r,t))return a[t]=4,r[t];if(f=s.config.globalProperties,Ve(f,t))return f[t]},set({_:e},t,r){const{data:o,setupState:n,ctx:i}=e;return Ol(n,t)?(n[t]=r,!0):o!==nt&&Ve(o,t)?(o[t]=r,!0):Ve(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=r,!0)},has({_:{data:e,setupState:t,accessCache:r,ctx:o,appContext:n,propsOptions:i}},a){let l;return!!r[a]||e!==nt&&Ve(e,a)||Ol(t,a)||(l=i[0])&&Ve(l,a)||Ve(o,a)||Ve(ii,a)||Ve(n.config.globalProperties,a)},defineProperty(e,t,r){return r.get!=null?e._.accessCache[t]=0:Ve(r,"value")&&this.set(e,t,r.value,null),Reflect.defineProperty(e,t,r)}};let ys=!0;function j1(e){const t=kc(e),r=e.proxy,o=e.ctx;ys=!1,t.beforeCreate&&Wd(t.beforeCreate,e,"bc");const{data:n,computed:i,methods:a,watch:l,provide:s,inject:d,created:c,beforeMount:u,mounted:f,beforeUpdate:p,updated:h,activated:g,deactivated:b,beforeDestroy:m,beforeUnmount:y,destroyed:w,unmounted:x,render:k,renderTracked:T,renderTriggered:S,errorCaptured:$,serverPrefetch:R,expose:_,inheritAttrs:N,components:E,directives:F,filters:j}=t;if(d&&N1(d,o,null,e.appContext.config.unwrapInjectedRef),a)for(const X in a){const ne=a[X];Oe(ne)&&(o[X]=ne.bind(r))}if(n){const X=n.call(r,r);it(X)&&(e.data=vr(X))}if(ys=!0,i)for(const X in i){const ne=i[X],pe=Oe(ne)?ne.bind(r,r):Oe(ne.get)?ne.get.bind(r,r):pr,Ce=!Oe(ne)&&Oe(ne.set)?ne.set.bind(r):pr,$e=H({get:pe,set:Ce});Object.defineProperty(o,X,{enumerable:!0,configurable:!0,get:()=>$e.value,set:_e=>$e.value=_e})}if(l)for(const X in l)vp(l[X],o,r,X);if(s){const X=Oe(s)?s.call(r):s;Reflect.ownKeys(X).forEach(ne=>{Be(ne,X[ne])})}c&&Wd(c,e,"c");function A(X,ne){ke(ne)?ne.forEach(pe=>X(pe.bind(r))):ne&&X(ne.bind(r))}if(A(Nr,u),A(gt,f),A(O1,p),A($c,h),A(sp,g),A(cp,b),A(L1,$),A(B1,T),A(M1,S),A(ht,y),A(_c,x),A(A1,R),ke(_))if(_.length){const X=e.exposed||(e.exposed={});_.forEach(ne=>{Object.defineProperty(X,ne,{get:()=>r[ne],set:pe=>r[ne]=pe})})}else e.exposed||(e.exposed={});k&&e.render===pr&&(e.render=k),N!=null&&(e.inheritAttrs=N),E&&(e.components=E),F&&(e.directives=F)}function N1(e,t,r=pr,o=!1){ke(e)&&(e=ws(e));for(const n in e){const i=e[n];let a;it(i)?"default"in i?a=me(i.from||n,i.default,!0):a=me(i.from||n):a=me(i),Et(a)&&o?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>a.value,set:l=>a.value=l}):t[n]=a}}function Wd(e,t,r){ir(ke(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,r)}function vp(e,t,r,o){const n=o.includes(".")?np(r,o):()=>r[o];if(ft(e)){const i=t[e];Oe(i)&&De(n,i)}else if(Oe(e))De(n,e.bind(r));else if(it(e))if(ke(e))e.forEach(i=>vp(i,t,r,o));else{const i=Oe(e.handler)?e.handler.bind(r):t[e.handler];Oe(i)&&De(n,i,e)}}function kc(e){const t=e.type,{mixins:r,extends:o}=t,{mixins:n,optionsCache:i,config:{optionMergeStrategies:a}}=e.appContext,l=i.get(t);let s;return l?s=l:!n.length&&!r&&!o?s=t:(s={},n.length&&n.forEach(d=>Ta(s,d,a,!0)),Ta(s,t,a)),it(t)&&i.set(t,s),s}function Ta(e,t,r,o=!1){const{mixins:n,extends:i}=t;i&&Ta(e,i,r,!0),n&&n.forEach(a=>Ta(e,a,r,!0));for(const a in t)if(!(o&&a==="expose")){const l=W1[a]||r&&r[a];e[a]=l?l(e[a],t[a]):t[a]}return e}const W1={data:Vd,props:Co,emits:Co,methods:Co,computed:Co,beforeCreate:Ht,created:Ht,beforeMount:Ht,mounted:Ht,beforeUpdate:Ht,updated:Ht,beforeDestroy:Ht,beforeUnmount:Ht,destroyed:Ht,unmounted:Ht,activated:Ht,deactivated:Ht,errorCaptured:Ht,serverPrefetch:Ht,components:Co,directives:Co,watch:U1,provide:Vd,inject:V1};function Vd(e,t){return t?e?function(){return _t(Oe(e)?e.call(this,this):e,Oe(t)?t.call(this,this):t)}:t:e}function V1(e,t){return Co(ws(e),ws(t))}function ws(e){if(ke(e)){const t={};for(let r=0;r0)&&!(a&16)){if(a&8){const c=e.vnode.dynamicProps;for(let u=0;u{s=!0;const[f,p]=gp(u,t,!0);_t(a,f),p&&l.push(...p)};!r&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!i&&!s)return it(e)&&o.set(e,hn),hn;if(ke(i))for(let c=0;c-1,p[1]=g<0||h-1||Ve(p,"default"))&&l.push(u)}}}const d=[a,l];return it(e)&&o.set(e,d),d}function Ud(e){return e[0]!=="$"}function Kd(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:e===null?"null":""}function qd(e,t){return Kd(e)===Kd(t)}function Gd(e,t){return ke(t)?t.findIndex(r=>qd(r,e)):Oe(t)&&qd(t,e)?0:-1}const bp=e=>e[0]==="_"||e==="$stable",Tc=e=>ke(e)?e.map(Sr):[Sr(e)],G1=(e,t,r)=>{if(t._n)return t;const o=qe((...n)=>Tc(t(...n)),r);return o._c=!1,o},xp=(e,t,r)=>{const o=e._ctx;for(const n in e){if(bp(n))continue;const i=e[n];if(Oe(i))t[n]=G1(n,i,o);else if(i!=null){const a=Tc(i);t[n]=()=>a}}},Cp=(e,t)=>{const r=Tc(t);e.slots.default=()=>r},Y1=(e,t)=>{if(e.vnode.shapeFlag&32){const r=t._;r?(e.slots=Ke(t),$a(t,"_",r)):xp(t,e.slots={})}else e.slots={},t&&Cp(e,t);$a(e.slots,Qa,1)},X1=(e,t,r)=>{const{vnode:o,slots:n}=e;let i=!0,a=nt;if(o.shapeFlag&32){const l=t._;l?r&&l===1?i=!1:(_t(n,t),!r&&l===1&&delete n._):(i=!t.$stable,xp(t,n)),a=t}else t&&(Cp(e,t),a={default:1});if(i)for(const l in n)!bp(l)&&!(l in a)&&delete n[l]};function yp(){return{app:null,config:{isNativeTag:E0,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Z1=0;function J1(e,t){return function(o,n=null){Oe(o)||(o=Object.assign({},o)),n!=null&&!it(n)&&(n=null);const i=yp(),a=new Set;let l=!1;const s=i.app={_uid:Z1++,_component:o,_props:n,_container:null,_context:i,_instance:null,version:bx,get config(){return i.config},set config(d){},use(d,...c){return a.has(d)||(d&&Oe(d.install)?(a.add(d),d.install(s,...c)):Oe(d)&&(a.add(d),d(s,...c))),s},mixin(d){return i.mixins.includes(d)||i.mixins.push(d),s},component(d,c){return c?(i.components[d]=c,s):i.components[d]},directive(d,c){return c?(i.directives[d]=c,s):i.directives[d]},mount(d,c,u){if(!l){const f=be(o,n);return f.appContext=i,c&&t?t(f,d):e(f,d,u),l=!0,s._container=d,d.__vue_app__=s,el(f.component)||f.component.proxy}},unmount(){l&&(e(null,s._container),delete s._container.__vue_app__)},provide(d,c){return i.provides[d]=c,s}};return s}}function $s(e,t,r,o,n=!1){if(ke(e)){e.forEach((f,p)=>$s(f,t&&(ke(t)?t[p]:t),r,o,n));return}if(bn(o)&&!n)return;const i=o.shapeFlag&4?el(o.component)||o.component.proxy:o.el,a=n?null:i,{i:l,r:s}=e,d=t&&t.r,c=l.refs===nt?l.refs={}:l.refs,u=l.setupState;if(d!=null&&d!==s&&(ft(d)?(c[d]=null,Ve(u,d)&&(u[d]=null)):Et(d)&&(d.value=null)),Oe(s))oo(s,l,12,[a,c]);else{const f=ft(s),p=Et(s);if(f||p){const h=()=>{if(e.f){const g=f?Ve(u,s)?u[s]:c[s]:s.value;n?ke(g)&&dc(g,i):ke(g)?g.includes(i)||g.push(i):f?(c[s]=[i],Ve(u,s)&&(u[s]=c[s])):(s.value=[i],e.k&&(c[e.k]=s.value))}else f?(c[s]=a,Ve(u,s)&&(u[s]=a)):p&&(s.value=a,e.k&&(c[e.k]=a))};a?(h.id=-1,kt(h,r)):h()}}}const kt=k1;function Q1(e){return ex(e)}function ex(e,t){const r=B0();r.__VUE__=!0;const{insert:o,remove:n,patchProp:i,createElement:a,createText:l,createComment:s,setText:d,setElementText:c,parentNode:u,nextSibling:f,setScopeId:p=pr,insertStaticContent:h}=e,g=(C,P,I,W=null,z=null,L=null,Y=!1,q=null,J=!!P.dynamicChildren)=>{if(C===P)return;C&&!$o(C,P)&&(W=G(C),_e(C,z,L,!0),C=null),P.patchFlag===-2&&(J=!1,P.dynamicChildren=null);const{type:Z,ref:fe,shapeFlag:de}=P;switch(Z){case Ja:b(C,P,I,W);break;case Dt:m(C,P,I,W);break;case ga:C==null&&y(P,I,W,Y);break;case Je:E(C,P,I,W,z,L,Y,q,J);break;default:de&1?k(C,P,I,W,z,L,Y,q,J):de&6?F(C,P,I,W,z,L,Y,q,J):(de&64||de&128)&&Z.process(C,P,I,W,z,L,Y,q,J,ce)}fe!=null&&z&&$s(fe,C&&C.ref,L,P||C,!P)},b=(C,P,I,W)=>{if(C==null)o(P.el=l(P.children),I,W);else{const z=P.el=C.el;P.children!==C.children&&d(z,P.children)}},m=(C,P,I,W)=>{C==null?o(P.el=s(P.children||""),I,W):P.el=C.el},y=(C,P,I,W)=>{[C.el,C.anchor]=h(C.children,P,I,W,C.el,C.anchor)},w=({el:C,anchor:P},I,W)=>{let z;for(;C&&C!==P;)z=f(C),o(C,I,W),C=z;o(P,I,W)},x=({el:C,anchor:P})=>{let I;for(;C&&C!==P;)I=f(C),n(C),C=I;n(P)},k=(C,P,I,W,z,L,Y,q,J)=>{Y=Y||P.type==="svg",C==null?T(P,I,W,z,L,Y,q,J):R(C,P,z,L,Y,q,J)},T=(C,P,I,W,z,L,Y,q)=>{let J,Z;const{type:fe,props:de,shapeFlag:he,transition:we,dirs:Ie}=C;if(J=C.el=a(C.type,L,de&&de.is,de),he&8?c(J,C.children):he&16&&$(C.children,J,null,W,z,L&&fe!=="foreignObject",Y,q),Ie&&vo(C,null,W,"created"),de){for(const Fe in de)Fe!=="value"&&!ma(Fe)&&i(J,Fe,null,de[Fe],L,C.children,W,z,ee);"value"in de&&i(J,"value",null,de.value),(Z=de.onVnodeBeforeMount)&&nr(Z,W,C)}S(J,C,C.scopeId,Y,W),Ie&&vo(C,null,W,"beforeMount");const Ne=(!z||z&&!z.pendingBranch)&&we&&!we.persisted;Ne&&we.beforeEnter(J),o(J,P,I),((Z=de&&de.onVnodeMounted)||Ne||Ie)&&kt(()=>{Z&&nr(Z,W,C),Ne&&we.enter(J),Ie&&vo(C,null,W,"mounted")},z)},S=(C,P,I,W,z)=>{if(I&&p(C,I),W)for(let L=0;L{for(let Z=J;Z{const q=P.el=C.el;let{patchFlag:J,dynamicChildren:Z,dirs:fe}=P;J|=C.patchFlag&16;const de=C.props||nt,he=P.props||nt;let we;I&&mo(I,!1),(we=he.onVnodeBeforeUpdate)&&nr(we,I,P,C),fe&&vo(P,C,I,"beforeUpdate"),I&&mo(I,!0);const Ie=z&&P.type!=="foreignObject";if(Z?_(C.dynamicChildren,Z,q,I,W,Ie,L):Y||ne(C,P,q,null,I,W,Ie,L,!1),J>0){if(J&16)N(q,P,de,he,I,W,z);else if(J&2&&de.class!==he.class&&i(q,"class",null,he.class,z),J&4&&i(q,"style",de.style,he.style,z),J&8){const Ne=P.dynamicProps;for(let Fe=0;Fe{we&&nr(we,I,P,C),fe&&vo(P,C,I,"updated")},W)},_=(C,P,I,W,z,L,Y)=>{for(let q=0;q{if(I!==W){if(I!==nt)for(const q in I)!ma(q)&&!(q in W)&&i(C,q,I[q],null,Y,P.children,z,L,ee);for(const q in W){if(ma(q))continue;const J=W[q],Z=I[q];J!==Z&&q!=="value"&&i(C,q,Z,J,Y,P.children,z,L,ee)}"value"in W&&i(C,"value",I.value,W.value)}},E=(C,P,I,W,z,L,Y,q,J)=>{const Z=P.el=C?C.el:l(""),fe=P.anchor=C?C.anchor:l("");let{patchFlag:de,dynamicChildren:he,slotScopeIds:we}=P;we&&(q=q?q.concat(we):we),C==null?(o(Z,I,W),o(fe,I,W),$(P.children,I,fe,z,L,Y,q,J)):de>0&&de&64&&he&&C.dynamicChildren?(_(C.dynamicChildren,he,I,z,L,Y,q),(P.key!=null||z&&P===z.subTree)&&zc(C,P,!0)):ne(C,P,I,fe,z,L,Y,q,J)},F=(C,P,I,W,z,L,Y,q,J)=>{P.slotScopeIds=q,C==null?P.shapeFlag&512?z.ctx.activate(P,I,W,Y,J):j(P,I,W,z,L,Y,J):Q(C,P,J)},j=(C,P,I,W,z,L,Y)=>{const q=C.component=dx(C,W,z);if(Xa(C)&&(q.ctx.renderer=ce),ux(q),q.asyncDep){if(z&&z.registerDep(q,A),!C.el){const J=q.subTree=be(Dt);m(null,J,P,I)}return}A(q,C,P,I,z,L,Y)},Q=(C,P,I)=>{const W=P.component=C.component;if(_1(C,P,I))if(W.asyncDep&&!W.asyncResolved){X(W,P,I);return}else W.next=P,x1(W.update),W.update();else P.el=C.el,W.vnode=P},A=(C,P,I,W,z,L,Y)=>{const q=()=>{if(C.isMounted){let{next:fe,bu:de,u:he,parent:we,vnode:Ie}=C,Ne=fe,Fe;mo(C,!1),fe?(fe.el=Ie.el,X(C,fe,Y)):fe=Ie,de&&vn(de),(Fe=fe.props&&fe.props.onVnodeBeforeUpdate)&&nr(Fe,we,fe,Ie),mo(C,!0);const et=zl(C),xt=C.subTree;C.subTree=et,g(xt,et,u(xt.el),G(xt),C,z,L),fe.el=et.el,Ne===null&&P1(C,et.el),he&&kt(he,z),(Fe=fe.props&&fe.props.onVnodeUpdated)&&kt(()=>nr(Fe,we,fe,Ie),z)}else{let fe;const{el:de,props:he}=P,{bm:we,m:Ie,parent:Ne}=C,Fe=bn(P);if(mo(C,!1),we&&vn(we),!Fe&&(fe=he&&he.onVnodeBeforeMount)&&nr(fe,Ne,P),mo(C,!0),de&&ge){const et=()=>{C.subTree=zl(C),ge(de,C.subTree,C,z,null)};Fe?P.type.__asyncLoader().then(()=>!C.isUnmounted&&et()):et()}else{const et=C.subTree=zl(C);g(null,et,I,W,C,z,L),P.el=et.el}if(Ie&&kt(Ie,z),!Fe&&(fe=he&&he.onVnodeMounted)){const et=P;kt(()=>nr(fe,Ne,et),z)}(P.shapeFlag&256||Ne&&bn(Ne.vnode)&&Ne.vnode.shapeFlag&256)&&C.a&&kt(C.a,z),C.isMounted=!0,P=I=W=null}},J=C.effect=new pc(q,()=>yc(Z),C.scope),Z=C.update=()=>J.run();Z.id=C.uid,mo(C,!0),Z()},X=(C,P,I)=>{P.component=C;const W=C.vnode.props;C.vnode=P,C.next=null,q1(C,P.props,W,I),X1(C,P.children,I),An(),Hd(),Mn()},ne=(C,P,I,W,z,L,Y,q,J=!1)=>{const Z=C&&C.children,fe=C?C.shapeFlag:0,de=P.children,{patchFlag:he,shapeFlag:we}=P;if(he>0){if(he&128){Ce(Z,de,I,W,z,L,Y,q,J);return}else if(he&256){pe(Z,de,I,W,z,L,Y,q,J);return}}we&8?(fe&16&&ee(Z,z,L),de!==Z&&c(I,de)):fe&16?we&16?Ce(Z,de,I,W,z,L,Y,q,J):ee(Z,z,L,!0):(fe&8&&c(I,""),we&16&&$(de,I,W,z,L,Y,q,J))},pe=(C,P,I,W,z,L,Y,q,J)=>{C=C||hn,P=P||hn;const Z=C.length,fe=P.length,de=Math.min(Z,fe);let he;for(he=0;hefe?ee(C,z,L,!0,!1,de):$(P,I,W,z,L,Y,q,J,de)},Ce=(C,P,I,W,z,L,Y,q,J)=>{let Z=0;const fe=P.length;let de=C.length-1,he=fe-1;for(;Z<=de&&Z<=he;){const we=C[Z],Ie=P[Z]=J?eo(P[Z]):Sr(P[Z]);if($o(we,Ie))g(we,Ie,I,null,z,L,Y,q,J);else break;Z++}for(;Z<=de&&Z<=he;){const we=C[de],Ie=P[he]=J?eo(P[he]):Sr(P[he]);if($o(we,Ie))g(we,Ie,I,null,z,L,Y,q,J);else break;de--,he--}if(Z>de){if(Z<=he){const we=he+1,Ie=wehe)for(;Z<=de;)_e(C[Z],z,L,!0),Z++;else{const we=Z,Ie=Z,Ne=new Map;for(Z=Ie;Z<=he;Z++){const bt=P[Z]=J?eo(P[Z]):Sr(P[Z]);bt.key!=null&&Ne.set(bt.key,Z)}let Fe,et=0;const xt=he-Ie+1;let Ft=!1,qr=0;const er=new Array(xt);for(Z=0;Z=xt){_e(bt,z,L,!0);continue}let re;if(bt.key!=null)re=Ne.get(bt.key);else for(Fe=Ie;Fe<=he;Fe++)if(er[Fe-Ie]===0&&$o(bt,P[Fe])){re=Fe;break}re===void 0?_e(bt,z,L,!0):(er[re-Ie]=Z+1,re>=qr?qr=re:Ft=!0,g(bt,P[re],I,null,z,L,Y,q,J),et++)}const Gt=Ft?tx(er):hn;for(Fe=Gt.length-1,Z=xt-1;Z>=0;Z--){const bt=Ie+Z,re=P[bt],ve=bt+1{const{el:L,type:Y,transition:q,children:J,shapeFlag:Z}=C;if(Z&6){$e(C.component.subTree,P,I,W);return}if(Z&128){C.suspense.move(P,I,W);return}if(Z&64){Y.move(C,P,I,ce);return}if(Y===Je){o(L,P,I);for(let de=0;deq.enter(L),z);else{const{leave:de,delayLeave:he,afterLeave:we}=q,Ie=()=>o(L,P,I),Ne=()=>{de(L,()=>{Ie(),we&&we()})};he?he(L,Ie,Ne):Ne()}else o(L,P,I)},_e=(C,P,I,W=!1,z=!1)=>{const{type:L,props:Y,ref:q,children:J,dynamicChildren:Z,shapeFlag:fe,patchFlag:de,dirs:he}=C;if(q!=null&&$s(q,null,I,C,!0),fe&256){P.ctx.deactivate(C);return}const we=fe&1&&he,Ie=!bn(C);let Ne;if(Ie&&(Ne=Y&&Y.onVnodeBeforeUnmount)&&nr(Ne,P,C),fe&6)U(C.component,I,W);else{if(fe&128){C.suspense.unmount(I,W);return}we&&vo(C,null,P,"beforeUnmount"),fe&64?C.type.remove(C,P,I,z,ce,W):Z&&(L!==Je||de>0&&de&64)?ee(Z,P,I,!1,!0):(L===Je&&de&384||!z&&fe&16)&&ee(J,P,I),W&&Ge(C)}(Ie&&(Ne=Y&&Y.onVnodeUnmounted)||we)&&kt(()=>{Ne&&nr(Ne,P,C),we&&vo(C,null,P,"unmounted")},I)},Ge=C=>{const{type:P,el:I,anchor:W,transition:z}=C;if(P===Je){Le(I,W);return}if(P===ga){x(C);return}const L=()=>{n(I),z&&!z.persisted&&z.afterLeave&&z.afterLeave()};if(C.shapeFlag&1&&z&&!z.persisted){const{leave:Y,delayLeave:q}=z,J=()=>Y(I,L);q?q(C.el,L,J):J()}else L()},Le=(C,P)=>{let I;for(;C!==P;)I=f(C),n(C),C=I;n(P)},U=(C,P,I)=>{const{bum:W,scope:z,update:L,subTree:Y,um:q}=C;W&&vn(W),z.stop(),L&&(L.active=!1,_e(Y,C,P,I)),q&&kt(q,P),kt(()=>{C.isUnmounted=!0},P),P&&P.pendingBranch&&!P.isUnmounted&&C.asyncDep&&!C.asyncResolved&&C.suspenseId===P.pendingId&&(P.deps--,P.deps===0&&P.resolve())},ee=(C,P,I,W=!1,z=!1,L=0)=>{for(let Y=L;YC.shapeFlag&6?G(C.component.subTree):C.shapeFlag&128?C.suspense.next():f(C.anchor||C.el),se=(C,P,I)=>{C==null?P._vnode&&_e(P._vnode,null,null,!0):g(P._vnode||null,C,P,null,null,null,I),Hd(),ep(),P._vnode=C},ce={p:g,um:_e,m:$e,r:Ge,mt:j,mc:$,pc:ne,pbc:_,n:G,o:e};let Re,ge;return t&&([Re,ge]=t(ce)),{render:se,hydrate:Re,createApp:J1(se,Re)}}function mo({effect:e,update:t},r){e.allowRecurse=t.allowRecurse=r}function zc(e,t,r=!1){const o=e.children,n=t.children;if(ke(o)&&ke(n))for(let i=0;i>1,e[r[l]]0&&(t[o]=r[i-1]),r[i]=o)}}for(i=r.length,a=r[i-1];i-- >0;)r[i]=a,a=t[a];return r}const rx=e=>e.__isTeleport,ai=e=>e&&(e.disabled||e.disabled===""),Yd=e=>typeof SVGElement!="undefined"&&e instanceof SVGElement,_s=(e,t)=>{const r=e&&e.to;return ft(r)?t?t(r):null:r},ox={__isTeleport:!0,process(e,t,r,o,n,i,a,l,s,d){const{mc:c,pc:u,pbc:f,o:{insert:p,querySelector:h,createText:g,createComment:b}}=d,m=ai(t.props);let{shapeFlag:y,children:w,dynamicChildren:x}=t;if(e==null){const k=t.el=g(""),T=t.anchor=g("");p(k,r,o),p(T,r,o);const S=t.target=_s(t.props,h),$=t.targetAnchor=g("");S&&(p($,S),a=a||Yd(S));const R=(_,N)=>{y&16&&c(w,_,N,n,i,a,l,s)};m?R(r,T):S&&R(S,$)}else{t.el=e.el;const k=t.anchor=e.anchor,T=t.target=e.target,S=t.targetAnchor=e.targetAnchor,$=ai(e.props),R=$?r:T,_=$?k:S;if(a=a||Yd(T),x?(f(e.dynamicChildren,x,R,n,i,a,l),zc(e,t,!0)):s||u(e,t,R,_,n,i,a,l,!1),m)$||Qi(t,r,k,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const N=t.target=_s(t.props,h);N&&Qi(t,N,null,d,0)}else $&&Qi(t,T,S,d,1)}Sp(t)},remove(e,t,r,o,{um:n,o:{remove:i}},a){const{shapeFlag:l,children:s,anchor:d,targetAnchor:c,target:u,props:f}=e;if(u&&i(c),(a||!ai(f))&&(i(d),l&16))for(let p=0;p0?hr||hn:null,ix(),yi>0&&hr&&hr.push(e),e}function It(e,t,r,o,n,i){return $p(Me(e,t,r,o,n,i,!0))}function ko(e,t,r,o,n){return $p(be(e,t,r,o,n,!0))}function $n(e){return e?e.__v_isVNode===!0:!1}function $o(e,t){return e.type===t.type&&e.key===t.key}const Qa="__vInternal",_p=({key:e})=>e!=null?e:null,ba=({ref:e,ref_key:t,ref_for:r})=>e!=null?ft(e)||Et(e)||Oe(e)?{i:Rt,r:e,k:t,f:!!r}:e:null;function Me(e,t=null,r=null,o=0,n=null,i=e===Je?0:1,a=!1,l=!1){const s={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&_p(t),ref:t&&ba(t),scopeId:Ya,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Rt};return l?(Ec(s,r),i&128&&e.normalize(s)):r&&(s.shapeFlag|=ft(r)?8:16),yi>0&&!a&&hr&&(s.patchFlag>0||i&6)&&s.patchFlag!==32&&hr.push(s),s}const be=ax;function ax(e,t=null,r=null,o=0,n=null,i=!1){if((!e||e===fp)&&(e=Dt),$n(e)){const l=lr(e,t,!0);return r&&Ec(l,r),yi>0&&!i&&hr&&(l.shapeFlag&6?hr[hr.indexOf(e)]=l:hr.push(l)),l.patchFlag|=-2,l}if(vx(e)&&(e=e.__vccOpts),t){t=lx(t);let{class:l,style:s}=t;l&&!ft(l)&&(t.class=ja(l)),it(s)&&(Kh(s)&&!ke(s)&&(s=_t({},s)),t.style=Fa(s))}const a=ft(e)?1:op(e)?128:rx(e)?64:it(e)?4:Oe(e)?2:0;return Me(e,t,r,o,n,a,i,!0)}function lx(e){return e?Kh(e)||Qa in e?_t({},e):e:null}function lr(e,t,r=!1){const{props:o,ref:n,patchFlag:i,children:a}=e,l=t?so(o||{},t):o;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&_p(l),ref:t&&t.ref?r&&n?ke(n)?n.concat(ba(t)):[n,ba(t)]:ba(t):n,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Je?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&lr(e.ssContent),ssFallback:e.ssFallback&&lr(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx}}function mr(e=" ",t=0){return be(Ja,null,e,t)}function Pp(e,t){const r=be(ga,null,e);return r.staticCount=t,r}function Ps(e="",t=!1){return t?(lt(),ko(Dt,null,e)):be(Dt,null,e)}function Sr(e){return e==null||typeof e=="boolean"?be(Dt):ke(e)?be(Je,null,e.slice()):typeof e=="object"?eo(e):be(Ja,null,String(e))}function eo(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:lr(e)}function Ec(e,t){let r=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(ke(t))r=16;else if(typeof t=="object")if(o&65){const n=t.default;n&&(n._c&&(n._d=!1),Ec(e,n()),n._c&&(n._d=!0));return}else{r=32;const n=t._;!n&&!(Qa in t)?t._ctx=Rt:n===3&&Rt&&(Rt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Oe(t)?(t={default:t,_ctx:Rt},r=32):(t=String(t),o&64?(r=16,t=[mr(t)]):r=8);e.children=t,e.shapeFlag|=r}function so(...e){const t={};for(let r=0;r$t||Rt,_n=e=>{$t=e,e.scope.on()},Oo=()=>{$t&&$t.scope.off(),$t=null};function kp(e){return e.vnode.shapeFlag&4}let wi=!1;function ux(e,t=!1){wi=t;const{props:r,children:o}=e.vnode,n=kp(e);K1(e,r,n,t),Y1(e,o);const i=n?fx(e,t):void 0;return wi=!1,i}function fx(e,t){const r=e.type;e.accessCache=Object.create(null),e.proxy=Pa(new Proxy(e.ctx,F1));const{setup:o}=r;if(o){const n=e.setupContext=o.length>1?px(e):null;_n(e),An();const i=oo(o,e,0,[e.props,n]);if(Mn(),Oo(),Ih(i)){if(i.then(Oo,Oo),t)return i.then(a=>{Zd(e,a,t)}).catch(a=>{qa(a,e,0)});e.asyncDep=i}else Zd(e,i,t)}else Tp(e,t)}function Zd(e,t,r){Oe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:it(t)&&(e.setupState=Xh(t)),Tp(e,r)}let Jd;function Tp(e,t,r){const o=e.type;if(!e.render){if(!t&&Jd&&!o.render){const n=o.template||kc(e).template;if(n){const{isCustomElement:i,compilerOptions:a}=e.appContext.config,{delimiters:l,compilerOptions:s}=o,d=_t(_t({isCustomElement:i,delimiters:l},a),s);o.render=Jd(n,d)}}e.render=o.render||pr}_n(e),An(),j1(e),Mn(),Oo()}function hx(e){return new Proxy(e.attrs,{get(t,r){return Qt(e,"get","$attrs"),t[r]}})}function px(e){const t=o=>{e.exposed=o||{}};let r;return{get attrs(){return r||(r=hx(e))},slots:e.slots,emit:e.emit,expose:t}}function el(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Xh(Pa(e.exposed)),{get(t,r){if(r in t)return t[r];if(r in ii)return ii[r](e)},has(t,r){return r in t||r in ii}}))}function ks(e,t=!0){return Oe(e)?e.displayName||e.name:e.name||t&&e.__name}function vx(e){return Oe(e)&&"__vccOpts"in e}const H=(e,t)=>m1(e,t,wi);function v(e,t,r){const o=arguments.length;return o===2?it(t)&&!ke(t)?$n(t)?be(e,null,[t]):be(e,t):be(e,null,t):(o>3?r=Array.prototype.slice.call(arguments,2):o===3&&$n(r)&&(r=[r]),be(e,t,r))}const mx=Symbol(""),gx=()=>me(mx),bx="3.2.45",xx="http://www.w3.org/2000/svg",_o=typeof document!="undefined"?document:null,Qd=_o&&_o.createElement("template"),Cx={insert:(e,t,r)=>{t.insertBefore(e,r||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,r,o)=>{const n=t?_o.createElementNS(xx,e):_o.createElement(e,r?{is:r}:void 0);return e==="select"&&o&&o.multiple!=null&&n.setAttribute("multiple",o.multiple),n},createText:e=>_o.createTextNode(e),createComment:e=>_o.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>_o.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,r,o,n,i){const a=r?r.previousSibling:t.lastChild;if(n&&(n===i||n.nextSibling))for(;t.insertBefore(n.cloneNode(!0),r),!(n===i||!(n=n.nextSibling)););else{Qd.innerHTML=o?`${e}`:e;const l=Qd.content;if(o){const s=l.firstChild;for(;s.firstChild;)l.appendChild(s.firstChild);l.removeChild(s)}t.insertBefore(l,r)}return[a?a.nextSibling:t.firstChild,r?r.previousSibling:t.lastChild]}};function yx(e,t,r){const o=e._vtc;o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):r?e.setAttribute("class",t):e.className=t}function wx(e,t,r){const o=e.style,n=ft(r);if(r&&!n){for(const i in r)Ts(o,i,r[i]);if(t&&!ft(t))for(const i in t)r[i]==null&&Ts(o,i,"")}else{const i=o.display;n?t!==r&&(o.cssText=r):t&&e.removeAttribute("style"),"_vod"in e&&(o.display=i)}}const eu=/\s*!important$/;function Ts(e,t,r){if(ke(r))r.forEach(o=>Ts(e,t,o));else if(r==null&&(r=""),t.startsWith("--"))e.setProperty(t,r);else{const o=Sx(e,t);eu.test(r)?e.setProperty(Ho(o),r.replace(eu,""),"important"):e[o]=r}}const tu=["Webkit","Moz","ms"],Al={};function Sx(e,t){const r=Al[t];if(r)return r;let o=Pr(t);if(o!=="filter"&&o in e)return Al[t]=o;o=Ua(o);for(let n=0;nMl||(zx.then(()=>Ml=0),Ml=Date.now());function Rx(e,t){const r=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=r.attached)return;ir(Ix(o,r.value),t,5,[o])};return r.value=e,r.attached=Ex(),r}function Ix(e,t){if(ke(t)){const r=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{r.call(e),e._stopped=!0},t.map(o=>n=>!n._stopped&&o&&o(n))}else return t}const nu=/^on[a-z]/,Ox=(e,t,r,o,n=!1,i,a,l,s)=>{t==="class"?yx(e,o,n):t==="style"?wx(e,r,o):Na(t)?cc(t)||kx(e,t,r,o,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Ax(e,t,o,n))?_x(e,t,o,i,a,l,s):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),$x(e,t,o,n))};function Ax(e,t,r,o){return o?!!(t==="innerHTML"||t==="textContent"||t in e&&nu.test(t)&&Oe(r)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||nu.test(t)&&ft(r)?!1:t in e}const Yr="transition",Un="animation",Bt=(e,{slots:t})=>v(ap,Ep(e),t);Bt.displayName="Transition";const zp={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Mx=Bt.props=_t({},ap.props,zp),go=(e,t=[])=>{ke(e)?e.forEach(r=>r(...t)):e&&e(...t)},iu=e=>e?ke(e)?e.some(t=>t.length>1):e.length>1:!1;function Ep(e){const t={};for(const E in e)E in zp||(t[E]=e[E]);if(e.css===!1)return t;const{name:r="v",type:o,duration:n,enterFromClass:i=`${r}-enter-from`,enterActiveClass:a=`${r}-enter-active`,enterToClass:l=`${r}-enter-to`,appearFromClass:s=i,appearActiveClass:d=a,appearToClass:c=l,leaveFromClass:u=`${r}-leave-from`,leaveActiveClass:f=`${r}-leave-active`,leaveToClass:p=`${r}-leave-to`}=e,h=Bx(n),g=h&&h[0],b=h&&h[1],{onBeforeEnter:m,onEnter:y,onEnterCancelled:w,onLeave:x,onLeaveCancelled:k,onBeforeAppear:T=m,onAppear:S=y,onAppearCancelled:$=w}=t,R=(E,F,j)=>{Qr(E,F?c:l),Qr(E,F?d:a),j&&j()},_=(E,F)=>{E._isLeaving=!1,Qr(E,u),Qr(E,p),Qr(E,f),F&&F()},N=E=>(F,j)=>{const Q=E?S:y,A=()=>R(F,E,j);go(Q,[F,A]),au(()=>{Qr(F,E?s:i),Mr(F,E?c:l),iu(Q)||lu(F,o,g,A)})};return _t(t,{onBeforeEnter(E){go(m,[E]),Mr(E,i),Mr(E,a)},onBeforeAppear(E){go(T,[E]),Mr(E,s),Mr(E,d)},onEnter:N(!1),onAppear:N(!0),onLeave(E,F){E._isLeaving=!0;const j=()=>_(E,F);Mr(E,u),Ip(),Mr(E,f),au(()=>{!E._isLeaving||(Qr(E,u),Mr(E,p),iu(x)||lu(E,o,b,j))}),go(x,[E,j])},onEnterCancelled(E){R(E,!1),go(w,[E])},onAppearCancelled(E){R(E,!0),go($,[E])},onLeaveCancelled(E){_(E),go(k,[E])}})}function Bx(e){if(e==null)return null;if(it(e))return[Bl(e.enter),Bl(e.leave)];{const t=Bl(e);return[t,t]}}function Bl(e){return mi(e)}function Mr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.add(r)),(e._vtc||(e._vtc=new Set)).add(t)}function Qr(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const{_vtc:r}=e;r&&(r.delete(t),r.size||(e._vtc=void 0))}function au(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Lx=0;function lu(e,t,r,o){const n=e._endId=++Lx,i=()=>{n===e._endId&&o()};if(r)return setTimeout(i,r);const{type:a,timeout:l,propCount:s}=Rp(e,t);if(!a)return o();const d=a+"end";let c=0;const u=()=>{e.removeEventListener(d,f),i()},f=p=>{p.target===e&&++c>=s&&u()};setTimeout(()=>{c(r[h]||"").split(", "),n=o(`${Yr}Delay`),i=o(`${Yr}Duration`),a=su(n,i),l=o(`${Un}Delay`),s=o(`${Un}Duration`),d=su(l,s);let c=null,u=0,f=0;t===Yr?a>0&&(c=Yr,u=a,f=i.length):t===Un?d>0&&(c=Un,u=d,f=s.length):(u=Math.max(a,d),c=u>0?a>d?Yr:Un:null,f=c?c===Yr?i.length:s.length:0);const p=c===Yr&&/\b(transform|all)(,|$)/.test(o(`${Yr}Property`).toString());return{type:c,timeout:u,propCount:f,hasTransform:p}}function su(e,t){for(;e.lengthcu(r)+cu(e[o])))}function cu(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function Ip(){return document.body.offsetHeight}const Op=new WeakMap,Ap=new WeakMap,Hx={name:"TransitionGroup",props:_t({},Mx,{tag:String,moveClass:String}),setup(e,{slots:t}){const r=Wr(),o=ip();let n,i;return $c(()=>{if(!n.length)return;const a=e.moveClass||`${e.name||"v"}-move`;if(!Nx(n[0].el,r.vnode.el,a))return;n.forEach(Dx),n.forEach(Fx);const l=n.filter(jx);Ip(),l.forEach(s=>{const d=s.el,c=d.style;Mr(d,a),c.transform=c.webkitTransform=c.transitionDuration="";const u=d._moveCb=f=>{f&&f.target!==d||(!f||/transform$/.test(f.propertyName))&&(d.removeEventListener("transitionend",u),d._moveCb=null,Qr(d,a))};d.addEventListener("transitionend",u)})}),()=>{const a=Ke(e),l=Ep(a);let s=a.tag||Je;n=i,i=t.default?Sc(t.default()):[];for(let d=0;d{a.split(/\s+/).forEach(l=>l&&o.classList.remove(l))}),r.split(/\s+/).forEach(a=>a&&o.classList.add(a)),o.style.display="none";const n=t.nodeType===1?t:t.parentNode;n.appendChild(o);const{hasTransform:i}=Rp(o);return n.removeChild(o),i}const du=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ke(t)?r=>vn(t,r):t};function Wx(e){e.target.composing=!0}function uu(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const AM={created(e,{modifiers:{lazy:t,trim:r,number:o}},n){e._assign=du(n);const i=o||n.props&&n.props.type==="number";ln(e,t?"change":"input",a=>{if(a.target.composing)return;let l=e.value;r&&(l=l.trim()),i&&(l=mi(l)),e._assign(l)}),r&&ln(e,"change",()=>{e.value=e.value.trim()}),t||(ln(e,"compositionstart",Wx),ln(e,"compositionend",uu),ln(e,"change",uu))},mounted(e,{value:t}){e.value=t==null?"":t},beforeUpdate(e,{value:t,modifiers:{lazy:r,trim:o,number:n}},i){if(e._assign=du(i),e.composing||document.activeElement===e&&e.type!=="range"&&(r||o&&e.value.trim()===t||(n||e.type==="number")&&mi(e.value)===t))return;const a=t==null?"":t;e.value!==a&&(e.value=a)}},Vx=["ctrl","shift","alt","meta"],Ux={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)=>Vx.some(r=>e[`${r}Key`]&&!t.includes(r))},ti=(e,t)=>(r,...o)=>{for(let n=0;nr=>{if(!("key"in r))return;const o=Ho(r.key);if(t.some(n=>n===o||Kx[n]===o))return e(r)},Si={beforeMount(e,{value:t},{transition:r}){e._vod=e.style.display==="none"?"":e.style.display,r&&t?r.beforeEnter(e):Kn(e,t)},mounted(e,{value:t},{transition:r}){r&&t&&r.enter(e)},updated(e,{value:t,oldValue:r},{transition:o}){!t!=!r&&(o?t?(o.beforeEnter(e),Kn(e,!0),o.enter(e)):o.leave(e,()=>{Kn(e,!1)}):Kn(e,t))},beforeUnmount(e,{value:t}){Kn(e,t)}};function Kn(e,t){e.style.display=t?e._vod:"none"}const qx=_t({patchProp:Ox},Cx);let fu;function Gx(){return fu||(fu=Q1(qx))}const Yx=(...e)=>{const t=Gx().createApp(...e),{mount:r}=t;return t.mount=o=>{const n=Xx(o);if(!n)return;const i=t._component;!Oe(i)&&!i.render&&!i.template&&(i.template=n.innerHTML),n.innerHTML="";const a=r(n,!1,n instanceof SVGElement);return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),a},t};function Xx(e){return ft(e)?document.querySelector(e):e}const Zx="modulepreload",hu={},Jx="/",rr=function(t,r){return!r||r.length===0?t():Promise.all(r.map(o=>{if(o=`${Jx}${o}`,o in hu)return;hu[o]=!0;const n=o.endsWith(".css"),i=n?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${i}`))return;const a=document.createElement("link");if(a.rel=n?"stylesheet":Zx,n||(a.as="script",a.crossOrigin=""),a.href=o,document.head.appendChild(a),n)return new Promise((l,s)=>{a.addEventListener("load",l),a.addEventListener("error",()=>s(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())};function Qx(){return Mp().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Mp(){return typeof navigator!="undefined"&&typeof window!="undefined"?window:typeof global!="undefined"?global:{}}const eC=typeof Proxy=="function",tC="devtools-plugin:setup",rC="plugin:settings:set";let Yo,zs;function oC(){var e;return Yo!==void 0||(typeof window!="undefined"&&window.performance?(Yo=!0,zs=window.performance):typeof global!="undefined"&&((e=global.perf_hooks)===null||e===void 0?void 0:e.performance)?(Yo=!0,zs=global.perf_hooks.performance):Yo=!1),Yo}function nC(){return oC()?zs.now():Date.now()}class iC{constructor(t,r){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=r;const o={};if(t.settings)for(const a in t.settings){const l=t.settings[a];o[a]=l.defaultValue}const n=`__vue-devtools-plugin-settings__${t.id}`;let i=Object.assign({},o);try{const a=localStorage.getItem(n),l=JSON.parse(a);Object.assign(i,l)}catch{}this.fallbacks={getSettings(){return i},setSettings(a){try{localStorage.setItem(n,JSON.stringify(a))}catch{}i=a},now(){return nC()}},r&&r.on(rC,(a,l)=>{a===this.plugin.id&&this.fallbacks.setSettings(l)}),this.proxiedOn=new Proxy({},{get:(a,l)=>this.target?this.target.on[l]:(...s)=>{this.onQueue.push({method:l,args:s})}}),this.proxiedTarget=new Proxy({},{get:(a,l)=>this.target?this.target[l]:l==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(l)?(...s)=>(this.targetQueue.push({method:l,args:s,resolve:()=>{}}),this.fallbacks[l](...s)):(...s)=>new Promise(d=>{this.targetQueue.push({method:l,args:s,resolve:d})})})}async setRealTarget(t){this.target=t;for(const r of this.onQueue)this.target.on[r.method](...r.args);for(const r of this.targetQueue)r.resolve(await this.target[r.method](...r.args))}}function aC(e,t){const r=e,o=Mp(),n=Qx(),i=eC&&r.enableEarlyProxy;if(n&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!i))n.emit(tC,e,t);else{const a=i?new iC(r,n):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:r,setupFn:t,proxy:a}),a&&t(a.proxiedTarget)}}/*! - * vue-router v4.1.6 - * (c) 2022 Eduardo San Martin Morote - * @license MIT - */const sn=typeof window!="undefined";function lC(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const Xe=Object.assign;function Ll(e,t){const r={};for(const o in t){const n=t[o];r[o]=gr(n)?n.map(e):e(n)}return r}const si=()=>{},gr=Array.isArray,sC=/\/$/,cC=e=>e.replace(sC,"");function Hl(e,t,r="/"){let o,n={},i="",a="";const l=t.indexOf("#");let s=t.indexOf("?");return l=0&&(s=-1),s>-1&&(o=t.slice(0,s),i=t.slice(s+1,l>-1?l:t.length),n=e(i)),l>-1&&(o=o||t.slice(0,l),a=t.slice(l,t.length)),o=hC(o!=null?o:t,r),{fullPath:o+(i&&"?")+i+a,path:o,query:n,hash:a}}function dC(e,t){const r=t.query?e(t.query):"";return t.path+(r&&"?")+r+(t.hash||"")}function pu(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function uC(e,t,r){const o=t.matched.length-1,n=r.matched.length-1;return o>-1&&o===n&&Pn(t.matched[o],r.matched[n])&&Bp(t.params,r.params)&&e(t.query)===e(r.query)&&t.hash===r.hash}function Pn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Bp(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(!fC(e[r],t[r]))return!1;return!0}function fC(e,t){return gr(e)?vu(e,t):gr(t)?vu(t,e):e===t}function vu(e,t){return gr(t)?e.length===t.length&&e.every((r,o)=>r===t[o]):e.length===1&&e[0]===t}function hC(e,t){if(e.startsWith("/"))return e;if(!e)return t;const r=t.split("/"),o=e.split("/");let n=r.length-1,i,a;for(i=0;i1&&n--;else break;return r.slice(0,n).join("/")+"/"+o.slice(i-(i===o.length?1:0)).join("/")}var $i;(function(e){e.pop="pop",e.push="push"})($i||($i={}));var ci;(function(e){e.back="back",e.forward="forward",e.unknown=""})(ci||(ci={}));function pC(e){if(!e)if(sn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),cC(e)}const vC=/^[^#]+#/;function mC(e,t){return e.replace(vC,"#")+t}function gC(e,t){const r=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-r.left-(t.left||0),top:o.top-r.top-(t.top||0)}}const tl=()=>({left:window.pageXOffset,top:window.pageYOffset});function bC(e){let t;if("el"in e){const r=e.el,o=typeof r=="string"&&r.startsWith("#"),n=typeof r=="string"?o?document.getElementById(r.slice(1)):document.querySelector(r):r;if(!n)return;t=gC(n,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function mu(e,t){return(history.state?history.state.position-t:-1)+e}const Es=new Map;function xC(e,t){Es.set(e,t)}function CC(e){const t=Es.get(e);return Es.delete(e),t}let yC=()=>location.protocol+"//"+location.host;function Lp(e,t){const{pathname:r,search:o,hash:n}=t,i=e.indexOf("#");if(i>-1){let l=n.includes(e.slice(i))?e.slice(i).length:1,s=n.slice(l);return s[0]!=="/"&&(s="/"+s),pu(s,"")}return pu(r,e)+o+n}function wC(e,t,r,o){let n=[],i=[],a=null;const l=({state:f})=>{const p=Lp(e,location),h=r.value,g=t.value;let b=0;if(f){if(r.value=p,t.value=f,a&&a===h){a=null;return}b=g?f.position-g.position:0}else o(p);n.forEach(m=>{m(r.value,h,{delta:b,type:$i.pop,direction:b?b>0?ci.forward:ci.back:ci.unknown})})};function s(){a=r.value}function d(f){n.push(f);const p=()=>{const h=n.indexOf(f);h>-1&&n.splice(h,1)};return i.push(p),p}function c(){const{history:f}=window;!f.state||f.replaceState(Xe({},f.state,{scroll:tl()}),"")}function u(){for(const f of i)f();i=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",c)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",c),{pauseListeners:s,listen:d,destroy:u}}function gu(e,t,r,o=!1,n=!1){return{back:e,current:t,forward:r,replaced:o,position:window.history.length,scroll:n?tl():null}}function SC(e){const{history:t,location:r}=window,o={value:Lp(e,r)},n={value:t.state};n.value||i(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(s,d,c){const u=e.indexOf("#"),f=u>-1?(r.host&&document.querySelector("base")?e:e.slice(u))+s:yC()+e+s;try{t[c?"replaceState":"pushState"](d,"",f),n.value=d}catch(p){console.error(p),r[c?"replace":"assign"](f)}}function a(s,d){const c=Xe({},t.state,gu(n.value.back,s,n.value.forward,!0),d,{position:n.value.position});i(s,c,!0),o.value=s}function l(s,d){const c=Xe({},n.value,t.state,{forward:s,scroll:tl()});i(c.current,c,!0);const u=Xe({},gu(o.value,s,null),{position:c.position+1},d);i(s,u,!1),o.value=s}return{location:o,state:n,push:l,replace:a}}function $C(e){e=pC(e);const t=SC(e),r=wC(e,t.state,t.location,t.replace);function o(i,a=!0){a||r.pauseListeners(),history.go(i)}const n=Xe({location:"",base:e,go:o,createHref:mC.bind(null,e)},t,r);return Object.defineProperty(n,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(n,"state",{enumerable:!0,get:()=>t.state.value}),n}function _C(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),$C(e)}function PC(e){return typeof e=="string"||e&&typeof e=="object"}function Hp(e){return typeof e=="string"||typeof e=="symbol"}const Xr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Dp=Symbol("");var bu;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(bu||(bu={}));function kn(e,t){return Xe(new Error,{type:e,[Dp]:!0},t)}function Or(e,t){return e instanceof Error&&Dp in e&&(t==null||!!(e.type&t))}const xu="[^/]+?",kC={sensitive:!1,strict:!1,start:!0,end:!0},TC=/[.+*?^${}()[\]/\\]/g;function zC(e,t){const r=Xe({},kC,t),o=[];let n=r.start?"^":"";const i=[];for(const d of e){const c=d.length?[]:[90];r.strict&&!d.length&&(n+="/");for(let u=0;ut.length?t.length===1&&t[0]===40+40?1:-1:0}function RC(e,t){let r=0;const o=e.score,n=t.score;for(;r0&&t[t.length-1]<0}const IC={type:0,value:""},OC=/[a-zA-Z0-9_]/;function AC(e){if(!e)return[[]];if(e==="/")return[[IC]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(p){throw new Error(`ERR (${r})/"${d}": ${p}`)}let r=0,o=r;const n=[];let i;function a(){i&&n.push(i),i=[]}let l=0,s,d="",c="";function u(){!d||(r===0?i.push({type:0,value:d}):r===1||r===2||r===3?(i.length>1&&(s==="*"||s==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:d,regexp:c,repeatable:s==="*"||s==="+",optional:s==="*"||s==="?"})):t("Invalid state to consume buffer"),d="")}function f(){d+=s}for(;l{a(y)}:si}function a(c){if(Hp(c)){const u=o.get(c);u&&(o.delete(c),r.splice(r.indexOf(u),1),u.children.forEach(a),u.alias.forEach(a))}else{const u=r.indexOf(c);u>-1&&(r.splice(u,1),c.record.name&&o.delete(c.record.name),c.children.forEach(a),c.alias.forEach(a))}}function l(){return r}function s(c){let u=0;for(;u=0&&(c.record.path!==r[u].record.path||!Fp(c,r[u]));)u++;r.splice(u,0,c),c.record.name&&!wu(c)&&o.set(c.record.name,c)}function d(c,u){let f,p={},h,g;if("name"in c&&c.name){if(f=o.get(c.name),!f)throw kn(1,{location:c});g=f.record.name,p=Xe(yu(u.params,f.keys.filter(y=>!y.optional).map(y=>y.name)),c.params&&yu(c.params,f.keys.map(y=>y.name))),h=f.stringify(p)}else if("path"in c)h=c.path,f=r.find(y=>y.re.test(h)),f&&(p=f.parse(h),g=f.record.name);else{if(f=u.name?o.get(u.name):r.find(y=>y.re.test(u.path)),!f)throw kn(1,{location:c,currentLocation:u});g=f.record.name,p=Xe({},u.params,c.params),h=f.stringify(p)}const b=[];let m=f;for(;m;)b.unshift(m.record),m=m.parent;return{name:g,path:h,params:p,matched:b,meta:DC(b)}}return e.forEach(c=>i(c)),{addRoute:i,resolve:d,removeRoute:a,getRoutes:l,getRecordMatcher:n}}function yu(e,t){const r={};for(const o of t)o in e&&(r[o]=e[o]);return r}function LC(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:HC(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function HC(e){const t={},r=e.props||!1;if("component"in e)t.default=r;else for(const o in e.components)t[o]=typeof r=="boolean"?r:r[o];return t}function wu(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function DC(e){return e.reduce((t,r)=>Xe(t,r.meta),{})}function Su(e,t){const r={};for(const o in e)r[o]=o in t?t[o]:e[o];return r}function Fp(e,t){return t.children.some(r=>r===e||Fp(e,r))}const jp=/#/g,FC=/&/g,jC=/\//g,NC=/=/g,WC=/\?/g,Np=/\+/g,VC=/%5B/g,UC=/%5D/g,Wp=/%5E/g,KC=/%60/g,Vp=/%7B/g,qC=/%7C/g,Up=/%7D/g,GC=/%20/g;function Ic(e){return encodeURI(""+e).replace(qC,"|").replace(VC,"[").replace(UC,"]")}function YC(e){return Ic(e).replace(Vp,"{").replace(Up,"}").replace(Wp,"^")}function Rs(e){return Ic(e).replace(Np,"%2B").replace(GC,"+").replace(jp,"%23").replace(FC,"%26").replace(KC,"`").replace(Vp,"{").replace(Up,"}").replace(Wp,"^")}function XC(e){return Rs(e).replace(NC,"%3D")}function ZC(e){return Ic(e).replace(jp,"%23").replace(WC,"%3F")}function JC(e){return e==null?"":ZC(e).replace(jC,"%2F")}function za(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function QC(e){const t={};if(e===""||e==="?")return t;const o=(e[0]==="?"?e.slice(1):e).split("&");for(let n=0;ni&&Rs(i)):[o&&Rs(o)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+r,i!=null&&(t+="="+i))})}return t}function ey(e){const t={};for(const r in e){const o=e[r];o!==void 0&&(t[r]=gr(o)?o.map(n=>n==null?null:""+n):o==null?o:""+o)}return t}const ty=Symbol(""),_u=Symbol(""),rl=Symbol(""),Oc=Symbol(""),Is=Symbol("");function qn(){let e=[];function t(o){return e.push(o),()=>{const n=e.indexOf(o);n>-1&&e.splice(n,1)}}function r(){e=[]}return{add:t,list:()=>e,reset:r}}function to(e,t,r,o,n){const i=o&&(o.enterCallbacks[n]=o.enterCallbacks[n]||[]);return()=>new Promise((a,l)=>{const s=u=>{u===!1?l(kn(4,{from:r,to:t})):u instanceof Error?l(u):PC(u)?l(kn(2,{from:t,to:u})):(i&&o.enterCallbacks[n]===i&&typeof u=="function"&&i.push(u),a())},d=e.call(o&&o.instances[n],t,r,s);let c=Promise.resolve(d);e.length<3&&(c=c.then(s)),c.catch(u=>l(u))})}function Dl(e,t,r,o){const n=[];for(const i of e)for(const a in i.components){let l=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(ry(l)){const d=(l.__vccOpts||l)[t];d&&n.push(to(d,r,o,i,a))}else{let s=l();n.push(()=>s.then(d=>{if(!d)return Promise.reject(new Error(`Couldn't resolve component "${a}" at "${i.path}"`));const c=lC(d)?d.default:d;i.components[a]=c;const f=(c.__vccOpts||c)[t];return f&&to(f,r,o,i,a)()}))}}return n}function ry(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Pu(e){const t=me(rl),r=me(Oc),o=H(()=>t.resolve(Ze(e.to))),n=H(()=>{const{matched:s}=o.value,{length:d}=s,c=s[d-1],u=r.matched;if(!c||!u.length)return-1;const f=u.findIndex(Pn.bind(null,c));if(f>-1)return f;const p=ku(s[d-2]);return d>1&&ku(c)===p&&u[u.length-1].path!==p?u.findIndex(Pn.bind(null,s[d-2])):f}),i=H(()=>n.value>-1&&ay(r.params,o.value.params)),a=H(()=>n.value>-1&&n.value===r.matched.length-1&&Bp(r.params,o.value.params));function l(s={}){return iy(s)?t[Ze(e.replace)?"replace":"push"](Ze(e.to)).catch(si):Promise.resolve()}return{route:o,href:H(()=>o.value.href),isActive:i,isExactActive:a,navigate:l}}const oy=ae({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Pu,setup(e,{slots:t}){const r=vr(Pu(e)),{options:o}=me(rl),n=H(()=>({[Tu(e.activeClass,o.linkActiveClass,"router-link-active")]:r.isActive,[Tu(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:r.isExactActive}));return()=>{const i=t.default&&t.default(r);return e.custom?i:v("a",{"aria-current":r.isExactActive?e.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:n.value},i)}}}),ny=oy;function iy(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function ay(e,t){for(const r in t){const o=t[r],n=e[r];if(typeof o=="string"){if(o!==n)return!1}else if(!gr(n)||n.length!==o.length||o.some((i,a)=>i!==n[a]))return!1}return!0}function ku(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Tu=(e,t,r)=>e!=null?e:t!=null?t:r,ly=ae({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:r}){const o=me(Is),n=H(()=>e.route||o.value),i=me(_u,0),a=H(()=>{let d=Ze(i);const{matched:c}=n.value;let u;for(;(u=c[d])&&!u.components;)d++;return d}),l=H(()=>n.value.matched[a.value]);Be(_u,H(()=>a.value+1)),Be(ty,l),Be(Is,n);const s=V();return De(()=>[s.value,l.value,e.name],([d,c,u],[f,p,h])=>{c&&(c.instances[u]=d,p&&p!==c&&d&&d===f&&(c.leaveGuards.size||(c.leaveGuards=p.leaveGuards),c.updateGuards.size||(c.updateGuards=p.updateGuards))),d&&c&&(!p||!Pn(c,p)||!f)&&(c.enterCallbacks[u]||[]).forEach(g=>g(d))},{flush:"post"}),()=>{const d=n.value,c=e.name,u=l.value,f=u&&u.components[c];if(!f)return zu(r.default,{Component:f,route:d});const p=u.props[c],h=p?p===!0?d.params:typeof p=="function"?p(d):p:null,b=v(f,Xe({},h,t,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(u.instances[c]=null)},ref:s}));return zu(r.default,{Component:b,route:d})||b}}});function zu(e,t){if(!e)return null;const r=e(t);return r.length===1?r[0]:r}const sy=ly;function cy(e){const t=BC(e.routes,e),r=e.parseQuery||QC,o=e.stringifyQuery||$u,n=e.history,i=qn(),a=qn(),l=qn(),s=u1(Xr);let d=Xr;sn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Ll.bind(null,U=>""+U),u=Ll.bind(null,JC),f=Ll.bind(null,za);function p(U,ee){let G,se;return Hp(U)?(G=t.getRecordMatcher(U),se=ee):se=U,t.addRoute(se,G)}function h(U){const ee=t.getRecordMatcher(U);ee&&t.removeRoute(ee)}function g(){return t.getRoutes().map(U=>U.record)}function b(U){return!!t.getRecordMatcher(U)}function m(U,ee){if(ee=Xe({},ee||s.value),typeof U=="string"){const C=Hl(r,U,ee.path),P=t.resolve({path:C.path},ee),I=n.createHref(C.fullPath);return Xe(C,P,{params:f(P.params),hash:za(C.hash),redirectedFrom:void 0,href:I})}let G;if("path"in U)G=Xe({},U,{path:Hl(r,U.path,ee.path).path});else{const C=Xe({},U.params);for(const P in C)C[P]==null&&delete C[P];G=Xe({},U,{params:u(U.params)}),ee.params=u(ee.params)}const se=t.resolve(G,ee),ce=U.hash||"";se.params=c(f(se.params));const Re=dC(o,Xe({},U,{hash:YC(ce),path:se.path})),ge=n.createHref(Re);return Xe({fullPath:Re,hash:ce,query:o===$u?ey(U.query):U.query||{}},se,{redirectedFrom:void 0,href:ge})}function y(U){return typeof U=="string"?Hl(r,U,s.value.path):Xe({},U)}function w(U,ee){if(d!==U)return kn(8,{from:ee,to:U})}function x(U){return S(U)}function k(U){return x(Xe(y(U),{replace:!0}))}function T(U){const ee=U.matched[U.matched.length-1];if(ee&&ee.redirect){const{redirect:G}=ee;let se=typeof G=="function"?G(U):G;return typeof se=="string"&&(se=se.includes("?")||se.includes("#")?se=y(se):{path:se},se.params={}),Xe({query:U.query,hash:U.hash,params:"path"in se?{}:U.params},se)}}function S(U,ee){const G=d=m(U),se=s.value,ce=U.state,Re=U.force,ge=U.replace===!0,C=T(G);if(C)return S(Xe(y(C),{state:typeof C=="object"?Xe({},ce,C.state):ce,force:Re,replace:ge}),ee||G);const P=G;P.redirectedFrom=ee;let I;return!Re&&uC(o,se,G)&&(I=kn(16,{to:P,from:se}),Ce(se,se,!0,!1)),(I?Promise.resolve(I):R(P,se)).catch(W=>Or(W)?Or(W,2)?W:pe(W):X(W,P,se)).then(W=>{if(W){if(Or(W,2))return S(Xe({replace:ge},y(W.to),{state:typeof W.to=="object"?Xe({},ce,W.to.state):ce,force:Re}),ee||P)}else W=N(P,se,!0,ge,ce);return _(P,se,W),W})}function $(U,ee){const G=w(U,ee);return G?Promise.reject(G):Promise.resolve()}function R(U,ee){let G;const[se,ce,Re]=dy(U,ee);G=Dl(se.reverse(),"beforeRouteLeave",U,ee);for(const C of se)C.leaveGuards.forEach(P=>{G.push(to(P,U,ee))});const ge=$.bind(null,U,ee);return G.push(ge),Xo(G).then(()=>{G=[];for(const C of i.list())G.push(to(C,U,ee));return G.push(ge),Xo(G)}).then(()=>{G=Dl(ce,"beforeRouteUpdate",U,ee);for(const C of ce)C.updateGuards.forEach(P=>{G.push(to(P,U,ee))});return G.push(ge),Xo(G)}).then(()=>{G=[];for(const C of U.matched)if(C.beforeEnter&&!ee.matched.includes(C))if(gr(C.beforeEnter))for(const P of C.beforeEnter)G.push(to(P,U,ee));else G.push(to(C.beforeEnter,U,ee));return G.push(ge),Xo(G)}).then(()=>(U.matched.forEach(C=>C.enterCallbacks={}),G=Dl(Re,"beforeRouteEnter",U,ee),G.push(ge),Xo(G))).then(()=>{G=[];for(const C of a.list())G.push(to(C,U,ee));return G.push(ge),Xo(G)}).catch(C=>Or(C,8)?C:Promise.reject(C))}function _(U,ee,G){for(const se of l.list())se(U,ee,G)}function N(U,ee,G,se,ce){const Re=w(U,ee);if(Re)return Re;const ge=ee===Xr,C=sn?history.state:{};G&&(se||ge?n.replace(U.fullPath,Xe({scroll:ge&&C&&C.scroll},ce)):n.push(U.fullPath,ce)),s.value=U,Ce(U,ee,G,ge),pe()}let E;function F(){E||(E=n.listen((U,ee,G)=>{if(!Le.listening)return;const se=m(U),ce=T(se);if(ce){S(Xe(ce,{replace:!0}),se).catch(si);return}d=se;const Re=s.value;sn&&xC(mu(Re.fullPath,G.delta),tl()),R(se,Re).catch(ge=>Or(ge,12)?ge:Or(ge,2)?(S(ge.to,se).then(C=>{Or(C,20)&&!G.delta&&G.type===$i.pop&&n.go(-1,!1)}).catch(si),Promise.reject()):(G.delta&&n.go(-G.delta,!1),X(ge,se,Re))).then(ge=>{ge=ge||N(se,Re,!1),ge&&(G.delta&&!Or(ge,8)?n.go(-G.delta,!1):G.type===$i.pop&&Or(ge,20)&&n.go(-1,!1)),_(se,Re,ge)}).catch(si)}))}let j=qn(),Q=qn(),A;function X(U,ee,G){pe(U);const se=Q.list();return se.length?se.forEach(ce=>ce(U,ee,G)):console.error(U),Promise.reject(U)}function ne(){return A&&s.value!==Xr?Promise.resolve():new Promise((U,ee)=>{j.add([U,ee])})}function pe(U){return A||(A=!U,F(),j.list().forEach(([ee,G])=>U?G(U):ee()),j.reset()),U}function Ce(U,ee,G,se){const{scrollBehavior:ce}=e;if(!sn||!ce)return Promise.resolve();const Re=!G&&CC(mu(U.fullPath,0))||(se||!G)&&history.state&&history.state.scroll||null;return Zt().then(()=>ce(U,ee,Re)).then(ge=>ge&&bC(ge)).catch(ge=>X(ge,U,ee))}const $e=U=>n.go(U);let _e;const Ge=new Set,Le={currentRoute:s,listening:!0,addRoute:p,removeRoute:h,hasRoute:b,getRoutes:g,resolve:m,options:e,push:x,replace:k,go:$e,back:()=>$e(-1),forward:()=>$e(1),beforeEach:i.add,beforeResolve:a.add,afterEach:l.add,onError:Q.add,isReady:ne,install(U){const ee=this;U.component("RouterLink",ny),U.component("RouterView",sy),U.config.globalProperties.$router=ee,Object.defineProperty(U.config.globalProperties,"$route",{enumerable:!0,get:()=>Ze(s)}),sn&&!_e&&s.value===Xr&&(_e=!0,x(n.location).catch(ce=>{}));const G={};for(const ce in Xr)G[ce]=H(()=>s.value[ce]);U.provide(rl,ee),U.provide(Oc,vr(G)),U.provide(Is,s);const se=U.unmount;Ge.add(U),U.unmount=function(){Ge.delete(U),Ge.size<1&&(d=Xr,E&&E(),E=null,s.value=Xr,_e=!1,A=!1),se()}}};return Le}function Xo(e){return e.reduce((t,r)=>t.then(()=>r()),Promise.resolve())}function dy(e,t){const r=[],o=[],n=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;aPn(d,l))?o.push(l):r.push(l));const s=e.matched[a];s&&(t.matched.find(d=>Pn(d,s))||n.push(s))}return[r,o,n]}function Kp(){return me(rl)}function uy(){return me(Oc)}const fy=[{path:"/",name:"home",meta:{title:"\u5E7F\u573A",keepAlive:!0},component:()=>rr(()=>import("./Home.d77fc36a.js"),["assets/Home.d77fc36a.js","assets/Home.07e73aab.css","assets/post-item.11c28084.js","assets/post-item.766f3250.css","assets/content.ed80294a.js","assets/content.93884ea1.css","assets/formatTime.e07969bb.js","assets/Thing.d394adea.js","assets/post-skeleton.38f0f247.js","assets/post-skeleton.328dfb67.css","assets/Skeleton.e1c16fcb.js","assets/List.a66e9ae7.js","assets/IEnum.032938cf.js","assets/Upload.6bcec76c.js","assets/main-nav.3167f221.js","assets/main-nav.b4a45e8a.css","assets/Pagination.c13c2d34.js"])},{path:"/post",name:"post",meta:{title:"\u8BDD\u9898\u8BE6\u60C5"},component:()=>rr(()=>import("./Post.3f5c561f.js"),["assets/Post.3f5c561f.js","assets/Post.4d9d6f83.css","assets/InputGroup.73d38f63.js","assets/formatTime.e07969bb.js","assets/content.ed80294a.js","assets/content.93884ea1.css","assets/Thing.d394adea.js","assets/post-skeleton.38f0f247.js","assets/post-skeleton.328dfb67.css","assets/Skeleton.e1c16fcb.js","assets/List.a66e9ae7.js","assets/IEnum.032938cf.js","assets/Upload.6bcec76c.js","assets/MoreHorizFilled.b0eea69d.js","assets/main-nav.3167f221.js","assets/main-nav.b4a45e8a.css"])},{path:"/topic",name:"topic",meta:{title:"\u8BDD\u9898"},component:()=>rr(()=>import("./Topic.691bac81.js"),["assets/Topic.691bac81.js","assets/Topic.909bef5a.css","assets/main-nav.3167f221.js","assets/main-nav.b4a45e8a.css","assets/List.a66e9ae7.js"])},{path:"/anouncement",name:"anouncement",meta:{title:"\u516C\u544A"},component:()=>rr(()=>import("./Anouncement.4c2503ee.js"),["assets/Anouncement.4c2503ee.js","assets/Anouncement.5f84f68f.css","assets/post-skeleton.38f0f247.js","assets/post-skeleton.328dfb67.css","assets/Skeleton.e1c16fcb.js","assets/List.a66e9ae7.js","assets/main-nav.3167f221.js","assets/main-nav.b4a45e8a.css","assets/formatTime.e07969bb.js","assets/Pagination.c13c2d34.js"])},{path:"/profile",name:"profile",meta:{title:"\u4E3B\u9875"},component:()=>rr(()=>import("./Profile.f583a607.js"),["assets/Profile.f583a607.js","assets/Profile.df0a7049.css","assets/post-item.11c28084.js","assets/post-item.766f3250.css","assets/content.ed80294a.js","assets/content.93884ea1.css","assets/formatTime.e07969bb.js","assets/Thing.d394adea.js","assets/post-skeleton.38f0f247.js","assets/post-skeleton.328dfb67.css","assets/Skeleton.e1c16fcb.js","assets/List.a66e9ae7.js","assets/main-nav.3167f221.js","assets/main-nav.b4a45e8a.css","assets/Pagination.c13c2d34.js"])},{path:"/user",name:"user",meta:{title:"\u7528\u6237\u8BE6\u60C5"},component:()=>rr(()=>import("./User.4a6c33cd.js"),["assets/User.4a6c33cd.js","assets/User.7b771241.css","assets/post-item.11c28084.js","assets/post-item.766f3250.css","assets/content.ed80294a.js","assets/content.93884ea1.css","assets/formatTime.e07969bb.js","assets/Thing.d394adea.js","assets/post-skeleton.38f0f247.js","assets/post-skeleton.328dfb67.css","assets/Skeleton.e1c16fcb.js","assets/List.a66e9ae7.js","assets/Alert.6cb9deb6.js","assets/main-nav.3167f221.js","assets/main-nav.b4a45e8a.css","assets/MoreHorizFilled.b0eea69d.js","assets/Pagination.c13c2d34.js"])},{path:"/messages",name:"messages",meta:{title:"\u6D88\u606F"},component:()=>rr(()=>import("./Messages.23db49c3.js"),["assets/Messages.23db49c3.js","assets/Messages.db382f03.css","assets/formatTime.e07969bb.js","assets/Alert.6cb9deb6.js","assets/Thing.d394adea.js","assets/Skeleton.e1c16fcb.js","assets/List.a66e9ae7.js","assets/main-nav.3167f221.js","assets/main-nav.b4a45e8a.css","assets/Pagination.c13c2d34.js"])},{path:"/collection",name:"collection",meta:{title:"\u6536\u85CF"},component:()=>rr(()=>import("./Collection.e823f1cf.js"),["assets/Collection.e823f1cf.js","assets/Collection.d63a34f0.css","assets/post-item.11c28084.js","assets/post-item.766f3250.css","assets/content.ed80294a.js","assets/content.93884ea1.css","assets/formatTime.e07969bb.js","assets/Thing.d394adea.js","assets/post-skeleton.38f0f247.js","assets/post-skeleton.328dfb67.css","assets/Skeleton.e1c16fcb.js","assets/List.a66e9ae7.js","assets/main-nav.3167f221.js","assets/main-nav.b4a45e8a.css","assets/Pagination.c13c2d34.js"])},{path:"/contacts",name:"contacts",meta:{title:"\u597D\u53CB"},component:()=>rr(()=>import("./Contacts.9d93fb1f.js"),["assets/Contacts.9d93fb1f.js","assets/Contacts.e16015c7.css","assets/post-skeleton.38f0f247.js","assets/post-skeleton.328dfb67.css","assets/Skeleton.e1c16fcb.js","assets/List.a66e9ae7.js","assets/main-nav.3167f221.js","assets/main-nav.b4a45e8a.css","assets/Pagination.c13c2d34.js"])},{path:"/wallet",name:"wallet",meta:{title:"\u94B1\u5305"},component:()=>rr(()=>import("./Wallet.0c985f96.js"),["assets/Wallet.0c985f96.js","assets/Wallet.e5757b5e.css","assets/post-skeleton.38f0f247.js","assets/post-skeleton.328dfb67.css","assets/Skeleton.e1c16fcb.js","assets/List.a66e9ae7.js","assets/main-nav.3167f221.js","assets/main-nav.b4a45e8a.css","assets/formatTime.e07969bb.js","assets/Pagination.c13c2d34.js"])},{path:"/setting",name:"setting",meta:{title:"\u8BBE\u7F6E"},component:()=>rr(()=>import("./Setting.67d59ade.js"),["assets/Setting.67d59ade.js","assets/Setting.a66de7b5.css","assets/main-nav.3167f221.js","assets/main-nav.b4a45e8a.css","assets/Upload.6bcec76c.js","assets/Alert.6cb9deb6.js","assets/InputGroup.73d38f63.js"])},{path:"/404",name:"404",meta:{title:"404"},component:()=>rr(()=>import("./404.dfeb5539.js"),["assets/404.dfeb5539.js","assets/404.9c166a4c.css","assets/main-nav.3167f221.js","assets/main-nav.b4a45e8a.css","assets/List.a66e9ae7.js"])},{path:"/:pathMatch(.*)",redirect:"/404"}],qp=cy({history:_C(),routes:fy});qp.beforeEach((e,t,r)=>{document.title=`${e.meta.title} | \u6CE1\u6CE1 - \u4E00\u4E2A\u6E05\u65B0\u6587\u827A\u7684\u5FAE\u793E\u533A`,r()});/*! - * vuex v4.1.0 - * (c) 2022 Evan You - * @license MIT - */var Gp="store";function ol(e){return e===void 0&&(e=null),me(e!==null?e:Gp)}function Bn(e,t){Object.keys(e).forEach(function(r){return t(e[r],r)})}function hy(e){return e!==null&&typeof e=="object"}function py(e){return e&&typeof e.then=="function"}function vy(e,t){return function(){return e(t)}}function Yp(e,t,r){return t.indexOf(e)<0&&(r&&r.prepend?t.unshift(e):t.push(e)),function(){var o=t.indexOf(e);o>-1&&t.splice(o,1)}}function Xp(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var r=e.state;nl(e,r,[],e._modules.root,!0),Ac(e,r,t)}function Ac(e,t,r){var o=e._state,n=e._scope;e.getters={},e._makeLocalGettersCache=Object.create(null);var i=e._wrappedGetters,a={},l={},s=L0(!0);s.run(function(){Bn(i,function(d,c){a[c]=vy(d,e),l[c]=H(function(){return a[c]()}),Object.defineProperty(e.getters,c,{get:function(){return l[c].value},enumerable:!0})})}),e._state=vr({data:t}),e._scope=s,e.strict&&Cy(e),o&&r&&e._withCommit(function(){o.data=null}),n&&n.stop()}function nl(e,t,r,o,n){var i=!r.length,a=e._modules.getNamespace(r);if(o.namespaced&&(e._modulesNamespaceMap[a],e._modulesNamespaceMap[a]=o),!i&&!n){var l=Mc(t,r.slice(0,-1)),s=r[r.length-1];e._withCommit(function(){l[s]=o.state})}var d=o.context=my(e,a,r);o.forEachMutation(function(c,u){var f=a+u;gy(e,f,c,d)}),o.forEachAction(function(c,u){var f=c.root?u:a+u,p=c.handler||c;by(e,f,p,d)}),o.forEachGetter(function(c,u){var f=a+u;xy(e,f,c,d)}),o.forEachChild(function(c,u){nl(e,t,r.concat(u),c,n)})}function my(e,t,r){var o=t==="",n={dispatch:o?e.dispatch:function(i,a,l){var s=Ea(i,a,l),d=s.payload,c=s.options,u=s.type;return(!c||!c.root)&&(u=t+u),e.dispatch(u,d)},commit:o?e.commit:function(i,a,l){var s=Ea(i,a,l),d=s.payload,c=s.options,u=s.type;(!c||!c.root)&&(u=t+u),e.commit(u,d,c)}};return Object.defineProperties(n,{getters:{get:o?function(){return e.getters}:function(){return Zp(e,t)}},state:{get:function(){return Mc(e.state,r)}}}),n}function Zp(e,t){if(!e._makeLocalGettersCache[t]){var r={},o=t.length;Object.keys(e.getters).forEach(function(n){if(n.slice(0,o)===t){var i=n.slice(o);Object.defineProperty(r,i,{get:function(){return e.getters[n]},enumerable:!0})}}),e._makeLocalGettersCache[t]=r}return e._makeLocalGettersCache[t]}function gy(e,t,r,o){var n=e._mutations[t]||(e._mutations[t]=[]);n.push(function(a){r.call(e,o.state,a)})}function by(e,t,r,o){var n=e._actions[t]||(e._actions[t]=[]);n.push(function(a){var l=r.call(e,{dispatch:o.dispatch,commit:o.commit,getters:o.getters,state:o.state,rootGetters:e.getters,rootState:e.state},a);return py(l)||(l=Promise.resolve(l)),e._devtoolHook?l.catch(function(s){throw e._devtoolHook.emit("vuex:error",s),s}):l})}function xy(e,t,r,o){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(i){return r(o.state,o.getters,i.state,i.getters)})}function Cy(e){De(function(){return e._state.data},function(){},{deep:!0,flush:"sync"})}function Mc(e,t){return t.reduce(function(r,o){return r[o]},e)}function Ea(e,t,r){return hy(e)&&e.type&&(r=t,t=e,e=e.type),{type:e,payload:t,options:r}}var yy="vuex bindings",Eu="vuex:mutations",Fl="vuex:actions",Zo="vuex",wy=0;function Sy(e,t){aC({id:"org.vuejs.vuex",app:e,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[yy]},function(r){r.addTimelineLayer({id:Eu,label:"Vuex Mutations",color:Ru}),r.addTimelineLayer({id:Fl,label:"Vuex Actions",color:Ru}),r.addInspector({id:Zo,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),r.on.getInspectorTree(function(o){if(o.app===e&&o.inspectorId===Zo)if(o.filter){var n=[];tv(n,t._modules.root,o.filter,""),o.rootNodes=n}else o.rootNodes=[ev(t._modules.root,"")]}),r.on.getInspectorState(function(o){if(o.app===e&&o.inspectorId===Zo){var n=o.nodeId;Zp(t,n),o.state=Py(Ty(t._modules,n),n==="root"?t.getters:t._makeLocalGettersCache,n)}}),r.on.editInspectorState(function(o){if(o.app===e&&o.inspectorId===Zo){var n=o.nodeId,i=o.path;n!=="root"&&(i=n.split("/").filter(Boolean).concat(i)),t._withCommit(function(){o.set(t._state.data,i,o.state.value)})}}),t.subscribe(function(o,n){var i={};o.payload&&(i.payload=o.payload),i.state=n,r.notifyComponentUpdate(),r.sendInspectorTree(Zo),r.sendInspectorState(Zo),r.addTimelineEvent({layerId:Eu,event:{time:Date.now(),title:o.type,data:i}})}),t.subscribeAction({before:function(o,n){var i={};o.payload&&(i.payload=o.payload),o._id=wy++,o._time=Date.now(),i.state=n,r.addTimelineEvent({layerId:Fl,event:{time:o._time,title:o.type,groupId:o._id,subtitle:"start",data:i}})},after:function(o,n){var i={},a=Date.now()-o._time;i.duration={_custom:{type:"duration",display:a+"ms",tooltip:"Action duration",value:a}},o.payload&&(i.payload=o.payload),i.state=n,r.addTimelineEvent({layerId:Fl,event:{time:Date.now(),title:o.type,groupId:o._id,subtitle:"end",data:i}})}})})}var Ru=8702998,$y=6710886,_y=16777215,Jp={label:"namespaced",textColor:_y,backgroundColor:$y};function Qp(e){return e&&e!=="root"?e.split("/").slice(-2,-1)[0]:"Root"}function ev(e,t){return{id:t||"root",label:Qp(t),tags:e.namespaced?[Jp]:[],children:Object.keys(e._children).map(function(r){return ev(e._children[r],t+r+"/")})}}function tv(e,t,r,o){o.includes(r)&&e.push({id:o||"root",label:o.endsWith("/")?o.slice(0,o.length-1):o||"Root",tags:t.namespaced?[Jp]:[]}),Object.keys(t._children).forEach(function(n){tv(e,t._children[n],r,o+n+"/")})}function Py(e,t,r){t=r==="root"?t:t[r];var o=Object.keys(t),n={state:Object.keys(e.state).map(function(a){return{key:a,editable:!0,value:e.state[a]}})};if(o.length){var i=ky(t);n.getters=Object.keys(i).map(function(a){return{key:a.endsWith("/")?Qp(a):a,editable:!1,value:Os(function(){return i[a]})}})}return n}function ky(e){var t={};return Object.keys(e).forEach(function(r){var o=r.split("/");if(o.length>1){var n=t,i=o.pop();o.forEach(function(a){n[a]||(n[a]={_custom:{value:{},display:a,tooltip:"Module",abstract:!0}}),n=n[a]._custom.value}),n[i]=Os(function(){return e[r]})}else t[r]=Os(function(){return e[r]})}),t}function Ty(e,t){var r=t.split("/").filter(function(o){return o});return r.reduce(function(o,n,i){var a=o[n];if(!a)throw new Error('Missing module "'+n+'" for path "'+t+'".');return i===r.length-1?a:a._children},t==="root"?e:e.root._children)}function Os(e){try{return e()}catch(t){return t}}var br=function(t,r){this.runtime=r,this._children=Object.create(null),this._rawModule=t;var o=t.state;this.state=(typeof o=="function"?o():o)||{}},rv={namespaced:{configurable:!0}};rv.namespaced.get=function(){return!!this._rawModule.namespaced};br.prototype.addChild=function(t,r){this._children[t]=r};br.prototype.removeChild=function(t){delete this._children[t]};br.prototype.getChild=function(t){return this._children[t]};br.prototype.hasChild=function(t){return t in this._children};br.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)};br.prototype.forEachChild=function(t){Bn(this._children,t)};br.prototype.forEachGetter=function(t){this._rawModule.getters&&Bn(this._rawModule.getters,t)};br.prototype.forEachAction=function(t){this._rawModule.actions&&Bn(this._rawModule.actions,t)};br.prototype.forEachMutation=function(t){this._rawModule.mutations&&Bn(this._rawModule.mutations,t)};Object.defineProperties(br.prototype,rv);var Do=function(t){this.register([],t,!1)};Do.prototype.get=function(t){return t.reduce(function(r,o){return r.getChild(o)},this.root)};Do.prototype.getNamespace=function(t){var r=this.root;return t.reduce(function(o,n){return r=r.getChild(n),o+(r.namespaced?n+"/":"")},"")};Do.prototype.update=function(t){ov([],this.root,t)};Do.prototype.register=function(t,r,o){var n=this;o===void 0&&(o=!0);var i=new br(r,o);if(t.length===0)this.root=i;else{var a=this.get(t.slice(0,-1));a.addChild(t[t.length-1],i)}r.modules&&Bn(r.modules,function(l,s){n.register(t.concat(s),l,o)})};Do.prototype.unregister=function(t){var r=this.get(t.slice(0,-1)),o=t[t.length-1],n=r.getChild(o);!n||!n.runtime||r.removeChild(o)};Do.prototype.isRegistered=function(t){var r=this.get(t.slice(0,-1)),o=t[t.length-1];return r?r.hasChild(o):!1};function ov(e,t,r){if(t.update(r),r.modules)for(var o in r.modules){if(!t.getChild(o))return;ov(e.concat(o),t.getChild(o),r.modules[o])}}function zy(e){return new Vt(e)}var Vt=function(t){var r=this;t===void 0&&(t={});var o=t.plugins;o===void 0&&(o=[]);var n=t.strict;n===void 0&&(n=!1);var i=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new Do(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=i;var a=this,l=this,s=l.dispatch,d=l.commit;this.dispatch=function(f,p){return s.call(a,f,p)},this.commit=function(f,p,h){return d.call(a,f,p,h)},this.strict=n;var c=this._modules.root.state;nl(this,c,[],this._modules.root),Ac(this,c),o.forEach(function(u){return u(r)})},Bc={state:{configurable:!0}};Vt.prototype.install=function(t,r){t.provide(r||Gp,this),t.config.globalProperties.$store=this;var o=this._devtools!==void 0?this._devtools:!1;o&&Sy(t,this)};Bc.state.get=function(){return this._state.data};Bc.state.set=function(e){};Vt.prototype.commit=function(t,r,o){var n=this,i=Ea(t,r,o),a=i.type,l=i.payload,s={type:a,payload:l},d=this._mutations[a];!d||(this._withCommit(function(){d.forEach(function(u){u(l)})}),this._subscribers.slice().forEach(function(c){return c(s,n.state)}))};Vt.prototype.dispatch=function(t,r){var o=this,n=Ea(t,r),i=n.type,a=n.payload,l={type:i,payload:a},s=this._actions[i];if(!!s){try{this._actionSubscribers.slice().filter(function(c){return c.before}).forEach(function(c){return c.before(l,o.state)})}catch{}var d=s.length>1?Promise.all(s.map(function(c){return c(a)})):s[0](a);return new Promise(function(c,u){d.then(function(f){try{o._actionSubscribers.filter(function(p){return p.after}).forEach(function(p){return p.after(l,o.state)})}catch{}c(f)},function(f){try{o._actionSubscribers.filter(function(p){return p.error}).forEach(function(p){return p.error(l,o.state,f)})}catch{}u(f)})})}};Vt.prototype.subscribe=function(t,r){return Yp(t,this._subscribers,r)};Vt.prototype.subscribeAction=function(t,r){var o=typeof t=="function"?{before:t}:t;return Yp(o,this._actionSubscribers,r)};Vt.prototype.watch=function(t,r,o){var n=this;return De(function(){return t(n.state,n.getters)},r,Object.assign({},o))};Vt.prototype.replaceState=function(t){var r=this;this._withCommit(function(){r._state.data=t})};Vt.prototype.registerModule=function(t,r,o){o===void 0&&(o={}),typeof t=="string"&&(t=[t]),this._modules.register(t,r),nl(this,this.state,t,this._modules.get(t),o.preserveState),Ac(this,this.state)};Vt.prototype.unregisterModule=function(t){var r=this;typeof t=="string"&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var o=Mc(r.state,t.slice(0,-1));delete o[t[t.length-1]]}),Xp(this)};Vt.prototype.hasModule=function(t){return typeof t=="string"&&(t=[t]),this._modules.isRegistered(t)};Vt.prototype.hotUpdate=function(t){this._modules.update(t),Xp(this,!0)};Vt.prototype._withCommit=function(t){var r=this._committing;this._committing=!0,t(),this._committing=r};Object.defineProperties(Vt.prototype,Bc);var Ey=zy({state:{refresh:Date.now(),theme:localStorage.getItem("PAOPAO_THEME"),collapsedLeft:document.body.clientWidth<=821,collapsedRight:document.body.clientWidth<=821,authModalShow:!1,authModelTab:"signin",userInfo:{id:0,username:"",nickname:""}},mutations:{refresh(e,t){e.refresh=t||Date.now()},triggerTheme(e,t){e.theme=t},triggerAuth(e,t){e.authModalShow=t},triggerAuthKey(e,t){e.authModelTab=t},triggerCollapsedLeft(e,t){e.collapsedLeft=t},triggerCollapsedRight(e,t){e.collapsedRight=t},updateUserinfo(e,t){e.userInfo=t},userLogout(e){localStorage.removeItem("PAOPAO_TOKEN"),e.userInfo={id:0,nickname:"",username:""}}},actions:{},modules:{}});let Ra=[];const nv=new WeakMap;function Ry(){Ra.forEach(e=>e(...nv.get(e))),Ra=[]}function iv(e,...t){nv.set(e,t),!Ra.includes(e)&&Ra.push(e)===1&&requestAnimationFrame(Ry)}function Iu(e,t){let{target:r}=e;for(;r;){if(r.dataset&&r.dataset[t]!==void 0)return!0;r=r.parentElement}return!1}function _i(e){return e.composedPath()[0]||null}function Ou(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function Iy(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function av(e,t){const r=e.trim().split(/\s+/g),o={top:r[0]};switch(r.length){case 1:o.right=r[0],o.bottom=r[0],o.left=r[0];break;case 2:o.right=r[1],o.left=r[1],o.bottom=r[0];break;case 3:o.right=r[1],o.bottom=r[2],o.left=r[1];break;case 4:o.right=r[1],o.bottom=r[2],o.left=r[3];break;default:throw new Error("[seemly/getMargin]:"+e+" is not a valid value.")}return t===void 0?o:o[t]}function Oy(e,t){const[r,o]=e.split(" ");return t?t==="row"?r:o:{row:r,col:o||r}}var Au={black:"#000",silver:"#C0C0C0",gray:"#808080",white:"#FFF",maroon:"#800000",red:"#F00",purple:"#800080",fuchsia:"#F0F",green:"#008000",lime:"#0F0",olive:"#808000",yellow:"#FF0",navy:"#000080",blue:"#00F",teal:"#008080",aqua:"#0FF",transparent:"#0000"};const Ln="^\\s*",Hn="\\s*$",To="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",zo="([0-9A-Fa-f])",Eo="([0-9A-Fa-f]{2})",Ay=new RegExp(`${Ln}rgb\\s*\\(${To},${To},${To}\\)${Hn}`),My=new RegExp(`${Ln}rgba\\s*\\(${To},${To},${To},${To}\\)${Hn}`),By=new RegExp(`${Ln}#${zo}${zo}${zo}${Hn}`),Ly=new RegExp(`${Ln}#${Eo}${Eo}${Eo}${Hn}`),Hy=new RegExp(`${Ln}#${zo}${zo}${zo}${zo}${Hn}`),Dy=new RegExp(`${Ln}#${Eo}${Eo}${Eo}${Eo}${Hn}`);function Nt(e){return parseInt(e,16)}function Dr(e){try{let t;if(t=Ly.exec(e))return[Nt(t[1]),Nt(t[2]),Nt(t[3]),1];if(t=Ay.exec(e))return[At(t[1]),At(t[5]),At(t[9]),1];if(t=My.exec(e))return[At(t[1]),At(t[5]),At(t[9]),di(t[13])];if(t=By.exec(e))return[Nt(t[1]+t[1]),Nt(t[2]+t[2]),Nt(t[3]+t[3]),1];if(t=Dy.exec(e))return[Nt(t[1]),Nt(t[2]),Nt(t[3]),di(Nt(t[4])/255)];if(t=Hy.exec(e))return[Nt(t[1]+t[1]),Nt(t[2]+t[2]),Nt(t[3]+t[3]),di(Nt(t[4]+t[4])/255)];if(e in Au)return Dr(Au[e]);throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function Fy(e){return e>1?1:e<0?0:e}function As(e,t,r,o){return`rgba(${At(e)}, ${At(t)}, ${At(r)}, ${Fy(o)})`}function jl(e,t,r,o,n){return At((e*t*(1-o)+r*o)/n)}function xe(e,t){Array.isArray(e)||(e=Dr(e)),Array.isArray(t)||(t=Dr(t));const r=e[3],o=t[3],n=di(r+o-r*o);return As(jl(e[0],r,t[0],o,n),jl(e[1],r,t[1],o,n),jl(e[2],r,t[2],o,n),n)}function oe(e,t){const[r,o,n,i=1]=Array.isArray(e)?e:Dr(e);return t.alpha?As(r,o,n,t.alpha):As(r,o,n,i)}function vt(e,t){const[r,o,n,i=1]=Array.isArray(e)?e:Dr(e),{lightness:a=1,alpha:l=1}=t;return jy([r*a,o*a,n*a,i*l])}function di(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function At(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function jy(e){const[t,r,o]=e;return 3 in e?`rgba(${At(t)}, ${At(r)}, ${At(o)}, ${di(e[3])})`:`rgba(${At(t)}, ${At(r)}, ${At(o)}, 1)`}function Tn(e=8){return Math.random().toString(16).slice(2,2+e)}function Ny(e,t="default",r=[]){const n=e.$slots[t];return n===void 0?r:n()}function Jt(e,t=[],r){const o={};return t.forEach(n=>{o[n]=e[n]}),Object.assign(o,r)}function Lc(e,t=[],r){const o={};return Object.getOwnPropertyNames(e).forEach(i=>{t.includes(i)||(o[i]=e[i])}),Object.assign(o,r)}function Ao(e,t=!0,r=[]){return e.forEach(o=>{if(o!==null){if(typeof o!="object"){(typeof o=="string"||typeof o=="number")&&r.push(mr(String(o)));return}if(Array.isArray(o)){Ao(o,t,r);return}if(o.type===Je){if(o.children===null)return;Array.isArray(o.children)&&Ao(o.children,t,r)}else o.type!==Dt&&r.push(o)}}),r}function Ae(e,...t){if(Array.isArray(e))e.forEach(r=>Ae(r,...t));else return e(...t)}function sr(e){return Object.keys(e)}const St=(e,...t)=>typeof e=="function"?e(...t):typeof e=="string"?mr(e):typeof e=="number"?mr(String(e)):null;function io(e,t){console.error(`[naive/${e}]: ${t}`)}function il(e,t){throw new Error(`[naive/${e}]: ${t}`)}function Wy(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function Ms(e,t="default",r=void 0){const o=e[t];if(!o)return io("getFirstSlotVNode",`slot[${t}] is empty`),null;const n=Ao(o(r));return n.length===1?n[0]:(io("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function Vy(e){return t=>{t?e.value=t.$el:e.value=null}}function MM(e){return e}function Li(e){return e.some(t=>$n(t)?!(t.type===Dt||t.type===Je&&!Li(t.children)):!0)?e:null}function Lr(e,t){return e&&Li(e())||t()}function Uy(e,t,r){return e&&Li(e(t))||r(t)}function dt(e,t){const r=e&&Li(e());return t(r||null)}function Ia(e){return!(e&&Li(e()))}const Mu=ae({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),Ky=/^(\d|\.)+$/,Bu=/(\d|\.)+/;function ar(e,{c:t=1,offset:r=0,attachPx:o=!0}={}){if(typeof e=="number"){const n=(e+r)*t;return n===0?"0":`${n}px`}else if(typeof e=="string")if(Ky.test(e)){const n=(Number(e)+r)*t;return o?n===0?"0":`${n}px`:`${n}`}else{const n=Bu.exec(e);return n?e.replace(Bu,String((Number(n[0])+r)*t)):e}return e}function zn(e){return e.replace(/#|\(|\)|,|\s/g,"_")}function qy(e){let t=0;for(let r=0;r{let n=qy(o);if(n){if(n===1){e.forEach(a=>{r.push(o.replace("&",a))});return}}else{e.forEach(a=>{r.push((a&&a+" ")+o)});return}let i=[o];for(;n--;){const a=[];i.forEach(l=>{e.forEach(s=>{a.push(l.replace("&",s))})}),i=a}i.forEach(a=>r.push(a))}),r}function Xy(e,t){const r=[];return t.split(lv).forEach(o=>{e.forEach(n=>{r.push((n&&n+" ")+o)})}),r}function Zy(e){let t=[""];return e.forEach(r=>{r=r&&r.trim(),r&&(r.includes("&")?t=Yy(t,r):t=Xy(t,r))}),t.join(", ").replace(Gy," ")}function Lu(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function al(e){return document.querySelector(`style[cssr-id="${e}"]`)}function Jy(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function ea(e){return e?/^\s*@(s|m)/.test(e):!1}const Qy=/[A-Z]/g;function sv(e){return e.replace(Qy,t=>"-"+t.toLowerCase())}function ew(e,t=" "){return typeof e=="object"&&e!==null?` { -`+Object.entries(e).map(r=>t+` ${sv(r[0])}: ${r[1]};`).join(` -`)+` -`+t+"}":`: ${e};`}function tw(e,t,r){return typeof e=="function"?e({context:t.context,props:r}):e}function Hu(e,t,r,o){if(!t)return"";const n=tw(t,r,o);if(!n)return"";if(typeof n=="string")return`${e} { -${n} -}`;const i=Object.keys(n);if(i.length===0)return r.config.keepEmptyBlock?e+` { -}`:"";const a=e?[e+" {"]:[];return i.forEach(l=>{const s=n[l];if(l==="raw"){a.push(` -`+s+` -`);return}l=sv(l),s!=null&&a.push(` ${l}${ew(s)}`)}),e&&a.push("}"),a.join(` -`)}function Bs(e,t,r){!e||e.forEach(o=>{if(Array.isArray(o))Bs(o,t,r);else if(typeof o=="function"){const n=o(t);Array.isArray(n)?Bs(n,t,r):n&&r(n)}else o&&r(o)})}function cv(e,t,r,o,n,i){const a=e.$;let l="";if(!a||typeof a=="string")ea(a)?l=a:t.push(a);else if(typeof a=="function"){const c=a({context:o.context,props:n});ea(c)?l=c:t.push(c)}else if(a.before&&a.before(o.context),!a.$||typeof a.$=="string")ea(a.$)?l=a.$:t.push(a.$);else if(a.$){const c=a.$({context:o.context,props:n});ea(c)?l=c:t.push(c)}const s=Zy(t),d=Hu(s,e.props,o,n);l?(r.push(`${l} {`),i&&d&&i.insertRule(`${l} { -${d} -} -`)):(i&&d&&i.insertRule(d),!i&&d.length&&r.push(d)),e.children&&Bs(e.children,{context:o.context,props:n},c=>{if(typeof c=="string"){const u=Hu(s,{raw:c},o,n);i?i.insertRule(u):r.push(u)}else cv(c,t,r,o,n,i)}),t.pop(),l&&r.push("}"),a&&a.after&&a.after(o.context)}function dv(e,t,r,o=!1){const n=[];return cv(e,[],n,t,r,o?e.instance.__styleSheet:void 0),o?"":n.join(` - -`)}function Pi(e){for(var t=0,r,o=0,n=e.length;n>=4;++o,n-=4)r=e.charCodeAt(o)&255|(e.charCodeAt(++o)&255)<<8|(e.charCodeAt(++o)&255)<<16|(e.charCodeAt(++o)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(n){case 3:t^=(e.charCodeAt(o+2)&255)<<16;case 2:t^=(e.charCodeAt(o+1)&255)<<8;case 1:t^=e.charCodeAt(o)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window!="undefined"&&(window.__cssrContext={});function rw(e,t,r){const{els:o}=t;if(r===void 0)o.forEach(Lu),t.els=[];else{const n=al(r);n&&o.includes(n)&&(Lu(n),t.els=o.filter(i=>i!==n))}}function Du(e,t){e.push(t)}function ow(e,t,r,o,n,i,a,l,s){if(i&&!s){if(r===void 0){console.error("[css-render/mount]: `id` is required in `silent` mode.");return}const f=window.__cssrContext;f[r]||(f[r]=!0,dv(t,e,o,i));return}let d;if(r===void 0&&(d=t.render(o),r=Pi(d)),s){s.adapter(r,d!=null?d:t.render(o));return}const c=al(r);if(c!==null&&!a)return c;const u=c!=null?c:Jy(r);if(d===void 0&&(d=t.render(o)),u.textContent=d,c!==null)return c;if(l){const f=document.head.querySelector(`meta[name="${l}"]`);if(f)return document.head.insertBefore(u,f),Du(t.els,u),u}return n?document.head.insertBefore(u,document.head.querySelector("style, link")):document.head.appendChild(u),Du(t.els,u),u}function nw(e){return dv(this,this.instance,e)}function iw(e={}){const{id:t,ssr:r,props:o,head:n=!1,silent:i=!1,force:a=!1,anchorMetaName:l}=e;return ow(this.instance,this,t,o,n,i,a,l,r)}function aw(e={}){const{id:t}=e;rw(this.instance,this,t)}const ta=function(e,t,r,o){return{instance:e,$:t,props:r,children:o,els:[],render:nw,mount:iw,unmount:aw}},lw=function(e,t,r,o){return Array.isArray(t)?ta(e,{$:null},null,t):Array.isArray(r)?ta(e,t,null,r):Array.isArray(o)?ta(e,t,r,o):ta(e,t,r,null)};function uv(e={}){let t=null;const r={c:(...o)=>lw(r,...o),use:(o,...n)=>o.install(r,...n),find:al,context:{},config:e,get __styleSheet(){if(!t){const o=document.createElement("style");return document.head.appendChild(o),t=document.styleSheets[document.styleSheets.length-1],t}return t}};return r}function sw(e,t){if(e===void 0)return!1;if(t){const{context:{ids:r}}=t;return r.has(e)}return al(e)!==null}function cw(e){let t=".",r="__",o="--",n;if(e){let h=e.blockPrefix;h&&(t=h),h=e.elementPrefix,h&&(r=h),h=e.modifierPrefix,h&&(o=h)}const i={install(h){n=h.c;const g=h.context;g.bem={},g.bem.b=null,g.bem.els=null}};function a(h){let g,b;return{before(m){g=m.bem.b,b=m.bem.els,m.bem.els=null},after(m){m.bem.b=g,m.bem.els=b},$({context:m,props:y}){return h=typeof h=="string"?h:h({context:m,props:y}),m.bem.b=h,`${(y==null?void 0:y.bPrefix)||t}${m.bem.b}`}}}function l(h){let g;return{before(b){g=b.bem.els},after(b){b.bem.els=g},$({context:b,props:m}){return h=typeof h=="string"?h:h({context:b,props:m}),b.bem.els=h.split(",").map(y=>y.trim()),b.bem.els.map(y=>`${(m==null?void 0:m.bPrefix)||t}${b.bem.b}${r}${y}`).join(", ")}}}function s(h){return{$({context:g,props:b}){h=typeof h=="string"?h:h({context:g,props:b});const m=h.split(",").map(x=>x.trim());function y(x){return m.map(k=>`&${(b==null?void 0:b.bPrefix)||t}${g.bem.b}${x!==void 0?`${r}${x}`:""}${o}${k}`).join(", ")}const w=g.bem.els;return w!==null?y(w[0]):y()}}}function d(h){return{$({context:g,props:b}){h=typeof h=="string"?h:h({context:g,props:b});const m=g.bem.els;return`&:not(${(b==null?void 0:b.bPrefix)||t}${g.bem.b}${m!==null&&m.length>0?`${r}${m[0]}`:""}${o}${h})`}}}return Object.assign(i,{cB:(...h)=>n(a(h[0]),h[1],h[2]),cE:(...h)=>n(l(h[0]),h[1],h[2]),cM:(...h)=>n(s(h[0]),h[1],h[2]),cNotM:(...h)=>n(d(h[0]),h[1],h[2])}),i}function ie(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,r=>r.toUpperCase()))}ie("abc","def");const dw="n",ki=`.${dw}-`,uw="__",fw="--",fv=uv(),hv=cw({blockPrefix:ki,elementPrefix:uw,modifierPrefix:fw});fv.use(hv);const{c:O,find:BM}=fv,{cB:M,cE:D,cM:K,cNotM:ut}=hv;function Hc(e){return O(({props:{bPrefix:t}})=>`${t||ki}modal, ${t||ki}drawer`,[e])}function pv(e){return O(({props:{bPrefix:t}})=>`${t||ki}popover`,[e])}function vv(e){return O(({props:{bPrefix:t}})=>`&${t||ki}modal`,e)}const hw=(...e)=>O(">",[M(...e)]);let Nl;function pw(){return Nl===void 0&&(Nl=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Nl}const Fo=typeof document!="undefined"&&typeof window!="undefined",mv=new WeakSet;function LM(e){mv.add(e)}function vw(e){return!mv.has(e)}function mw(e,t,r){var o;const n=me(e,null);if(n===null)return;const i=(o=Wr())===null||o===void 0?void 0:o.proxy;De(r,a),a(r.value),ht(()=>{a(void 0,r.value)});function a(d,c){const u=n[t];c!==void 0&&l(u,c),d!==void 0&&s(u,d)}function l(d,c){d[c]||(d[c]=[]),d[c].splice(d[c].findIndex(u=>u===i),1)}function s(d,c){d[c]||(d[c]=[]),~d[c].findIndex(u=>u===i)||d[c].push(i)}}function gw(e,t,r){if(!t)return e;const o=V(e.value);let n=null;return De(e,i=>{n!==null&&window.clearTimeout(n),i===!0?r&&!r.value?o.value=!0:n=window.setTimeout(()=>{o.value=!0},t):o.value=!1}),o}function bw(e){const t=V(!!e.value);if(t.value)return kr(t);const r=De(e,o=>{o&&(t.value=!0,r())});return kr(t)}function mt(e){const t=H(e),r=V(t.value);return De(t,o=>{r.value=o}),typeof e=="function"?r:{__v_isRef:!0,get value(){return r.value},set value(o){e.set(o)}}}function Dc(){return Wr()!==null}const Fc=typeof window!="undefined";let xn,ui;const xw=()=>{var e,t;xn=Fc?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,ui=!1,xn!==void 0?xn.then(()=>{ui=!0}):ui=!0};xw();function gv(e){if(ui)return;let t=!1;gt(()=>{ui||xn==null||xn.then(()=>{t||e()})}),ht(()=>{t=!0})}function xa(e){return e.composedPath()[0]}const Cw={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function yw(e,t,r){if(e==="mousemoveoutside"){const o=n=>{t.contains(xa(n))||r(n)};return{mousemove:o,touchstart:o}}else if(e==="clickoutside"){let o=!1;const n=a=>{o=!t.contains(xa(a))},i=a=>{!o||t.contains(xa(a))||r(a)};return{mousedown:n,mouseup:i,touchstart:n,touchend:i}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function bv(e,t,r){const o=Cw[e];let n=o.get(t);n===void 0&&o.set(t,n=new WeakMap);let i=n.get(r);return i===void 0&&n.set(r,i=yw(e,t,r)),i}function ww(e,t,r,o){if(e==="mousemoveoutside"||e==="clickoutside"){const n=bv(e,t,r);return Object.keys(n).forEach(i=>{Qe(i,document,n[i],o)}),!0}return!1}function Sw(e,t,r,o){if(e==="mousemoveoutside"||e==="clickoutside"){const n=bv(e,t,r);return Object.keys(n).forEach(i=>{Ue(i,document,n[i],o)}),!0}return!1}function $w(){if(typeof window=="undefined")return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function r(){e.set(this,!0)}function o(){e.set(this,!0),t.set(this,!0)}function n(S,$,R){const _=S[$];return S[$]=function(){return R.apply(S,arguments),_.apply(S,arguments)},S}function i(S,$){S[$]=Event.prototype[$]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function s(){var S;return(S=a.get(this))!==null&&S!==void 0?S:null}function d(S,$){l!==void 0&&Object.defineProperty(S,"currentTarget",{configurable:!0,enumerable:!0,get:$!=null?$:l.get})}const c={bubble:{},capture:{}},u={};function f(){const S=function($){const{type:R,eventPhase:_,bubbles:N}=$,E=xa($);if(_===2)return;const F=_===1?"capture":"bubble";let j=E;const Q=[];for(;j===null&&(j=window),Q.push(j),j!==window;)j=j.parentNode||null;const A=c.capture[R],X=c.bubble[R];if(n($,"stopPropagation",r),n($,"stopImmediatePropagation",o),d($,s),F==="capture"){if(A===void 0)return;for(let ne=Q.length-1;ne>=0&&!e.has($);--ne){const pe=Q[ne],Ce=A.get(pe);if(Ce!==void 0){a.set($,pe);for(const $e of Ce){if(t.has($))break;$e($)}}if(ne===0&&!N&&X!==void 0){const $e=X.get(pe);if($e!==void 0)for(const _e of $e){if(t.has($))break;_e($)}}}}else if(F==="bubble"){if(X===void 0)return;for(let ne=0;neE($))};return S.displayName="evtdUnifiedWindowEventHandler",S}const h=f(),g=p();function b(S,$){const R=c[S];return R[$]===void 0&&(R[$]=new Map,window.addEventListener($,h,S==="capture")),R[$]}function m(S){return u[S]===void 0&&(u[S]=new Set,window.addEventListener(S,g)),u[S]}function y(S,$){let R=S.get($);return R===void 0&&S.set($,R=new Set),R}function w(S,$,R,_){const N=c[$][R];if(N!==void 0){const E=N.get(S);if(E!==void 0&&E.has(_))return!0}return!1}function x(S,$){const R=u[S];return!!(R!==void 0&&R.has($))}function k(S,$,R,_){let N;if(typeof _=="object"&&_.once===!0?N=A=>{T(S,$,N,_),R(A)}:N=R,ww(S,$,N,_))return;const F=_===!0||typeof _=="object"&&_.capture===!0?"capture":"bubble",j=b(F,S),Q=y(j,$);if(Q.has(N)||Q.add(N),$===window){const A=m(S);A.has(N)||A.add(N)}}function T(S,$,R,_){if(Sw(S,$,R,_))return;const E=_===!0||typeof _=="object"&&_.capture===!0,F=E?"capture":"bubble",j=b(F,S),Q=y(j,$);if($===window&&!w($,E?"bubble":"capture",S,R)&&x(S,R)){const X=u[S];X.delete(R),X.size===0&&(window.removeEventListener(S,g),u[S]=void 0)}Q.has(R)&&Q.delete(R),Q.size===0&&j.delete($),j.size===0&&(window.removeEventListener(S,h,F==="capture"),c[F][S]=void 0)}return{on:k,off:T}}const{on:Qe,off:Ue}=$w(),oi=V(null);function Fu(e){if(e.clientX>0||e.clientY>0)oi.value={x:e.clientX,y:e.clientY};else{const{target:t}=e;if(t instanceof Element){const{left:r,top:o,width:n,height:i}=t.getBoundingClientRect();r>0||o>0?oi.value={x:r+n/2,y:o+i/2}:oi.value={x:0,y:0}}else oi.value=null}}let ra=0,ju=!0;function xv(){if(!Fc)return kr(V(null));ra===0&&Qe("click",document,Fu,!0);const e=()=>{ra+=1};return ju&&(ju=Dc())?(Nr(e),ht(()=>{ra-=1,ra===0&&Ue("click",document,Fu,!0)})):e(),kr(oi)}const _w=V(void 0);let oa=0;function Nu(){_w.value=Date.now()}let Wu=!0;function Cv(e){if(!Fc)return kr(V(!1));const t=V(!1);let r=null;function o(){r!==null&&window.clearTimeout(r)}function n(){o(),t.value=!0,r=window.setTimeout(()=>{t.value=!1},e)}oa===0&&Qe("click",window,Nu,!0);const i=()=>{oa+=1,Qe("click",window,n,!0)};return Wu&&(Wu=Dc())?(Nr(i),ht(()=>{oa-=1,oa===0&&Ue("click",window,Nu,!0),Ue("click",window,n,!0),o()})):i(),kr(t)}function En(e,t){return De(e,r=>{r!==void 0&&(t.value=r)}),H(()=>e.value===void 0?t.value:e.value)}function Hi(){const e=V(!1);return gt(()=>{e.value=!0}),kr(e)}function Ti(e,t){return H(()=>{for(const r of t)if(e[r]!==void 0)return e[r];return e[t[t.length-1]]})}const Pw=(typeof window=="undefined"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function kw(){return Pw}function Tw(e={},t){const r=vr({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:o,keyup:n}=e,i=s=>{switch(s.key){case"Control":r.ctrl=!0;break;case"Meta":r.command=!0,r.win=!0;break;case"Shift":r.shift=!0;break;case"Tab":r.tab=!0;break}o!==void 0&&Object.keys(o).forEach(d=>{if(d!==s.key)return;const c=o[d];if(typeof c=="function")c(s);else{const{stop:u=!1,prevent:f=!1}=c;u&&s.stopPropagation(),f&&s.preventDefault(),c.handler(s)}})},a=s=>{switch(s.key){case"Control":r.ctrl=!1;break;case"Meta":r.command=!1,r.win=!1;break;case"Shift":r.shift=!1;break;case"Tab":r.tab=!1;break}n!==void 0&&Object.keys(n).forEach(d=>{if(d!==s.key)return;const c=n[d];if(typeof c=="function")c(s);else{const{stop:u=!1,prevent:f=!1}=c;u&&s.stopPropagation(),f&&s.preventDefault(),c.handler(s)}})},l=()=>{(t===void 0||t.value)&&(Qe("keydown",document,i),Qe("keyup",document,a)),t!==void 0&&De(t,s=>{s?(Qe("keydown",document,i),Qe("keyup",document,a)):(Ue("keydown",document,i),Ue("keyup",document,a))})};return Dc()?(Nr(l),ht(()=>{(t===void 0||t.value)&&(Ue("keydown",document,i),Ue("keyup",document,a))})):l(),kr(r)}const HM="n-internal-select-menu",zw="n-internal-select-menu-body",ll="n-modal-body",yv="n-modal",sl="n-drawer-body",Di="n-popover-body",wv="__disabled__";function Rn(e){const t=me(ll,null),r=me(sl,null),o=me(Di,null),n=me(zw,null),i=V();if(typeof document!="undefined"){i.value=document.fullscreenElement;const a=()=>{i.value=document.fullscreenElement};gt(()=>{Qe("fullscreenchange",document,a)}),ht(()=>{Ue("fullscreenchange",document,a)})}return mt(()=>{var a;const{to:l}=e;return l!==void 0?l===!1?wv:l===!0?i.value||"body":l:t!=null&&t.value?(a=t.value.$el)!==null&&a!==void 0?a:t.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:n!=null&&n.value?n.value:l!=null?l:i.value||"body"})}Rn.tdkey=wv;Rn.propTo={type:[String,Object,Boolean],default:void 0};function Ls(e,t,r="default"){const o=t[r];if(o===void 0)throw new Error(`[vueuc/${e}]: slot[${r}] is empty.`);return o()}function Hs(e,t=!0,r=[]){return e.forEach(o=>{if(o!==null){if(typeof o!="object"){(typeof o=="string"||typeof o=="number")&&r.push(mr(String(o)));return}if(Array.isArray(o)){Hs(o,t,r);return}if(o.type===Je){if(o.children===null)return;Array.isArray(o.children)&&Hs(o.children,t,r)}else o.type!==Dt&&r.push(o)}}),r}function Vu(e,t,r="default"){const o=t[r];if(o===void 0)throw new Error(`[vueuc/${e}]: slot[${r}] is empty.`);const n=Hs(o());if(n.length===1)return n[0];throw new Error(`[vueuc/${e}]: slot[${r}] should have exactly one child.`)}let Zr=null;function Sv(){if(Zr===null&&(Zr=document.getElementById("v-binder-view-measurer"),Zr===null)){Zr=document.createElement("div"),Zr.id="v-binder-view-measurer";const{style:e}=Zr;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(Zr)}return Zr.getBoundingClientRect()}function Ew(e,t){const r=Sv();return{top:t,left:e,height:0,width:0,right:r.width-e,bottom:r.height-t}}function Wl(e){const t=e.getBoundingClientRect(),r=Sv();return{left:t.left-r.left,top:t.top-r.top,bottom:r.height+r.top-t.bottom,right:r.width+r.left-t.right,width:t.width,height:t.height}}function Rw(e){return e.nodeType===9?null:e.parentNode}function $v(e){if(e===null)return null;const t=Rw(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:r,overflowX:o,overflowY:n}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(r+n+o))return t}return $v(t)}const Iw=ae({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;Be("VBinder",(t=Wr())===null||t===void 0?void 0:t.proxy);const r=me("VBinder",null),o=V(null),n=m=>{o.value=m,r&&e.syncTargetWithParent&&r.setTargetRef(m)};let i=[];const a=()=>{let m=o.value;for(;m=$v(m),m!==null;)i.push(m);for(const y of i)Qe("scroll",y,u,!0)},l=()=>{for(const m of i)Ue("scroll",m,u,!0);i=[]},s=new Set,d=m=>{s.size===0&&a(),s.has(m)||s.add(m)},c=m=>{s.has(m)&&s.delete(m),s.size===0&&l()},u=()=>{iv(f)},f=()=>{s.forEach(m=>m())},p=new Set,h=m=>{p.size===0&&Qe("resize",window,b),p.has(m)||p.add(m)},g=m=>{p.has(m)&&p.delete(m),p.size===0&&Ue("resize",window,b)},b=()=>{p.forEach(m=>m())};return ht(()=>{Ue("resize",window,b),l()}),{targetRef:o,setTargetRef:n,addScrollListener:d,removeScrollListener:c,addResizeListener:h,removeResizeListener:g}},render(){return Ls("binder",this.$slots)}});var _v=Iw,Pv=ae({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=me("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?Tr(Vu("follower",this.$slots),[[t]]):Vu("follower",this.$slots)}});const Jo="@@mmoContext",Ow={mounted(e,{value:t}){e[Jo]={handler:void 0},typeof t=="function"&&(e[Jo].handler=t,Qe("mousemoveoutside",e,t))},updated(e,{value:t}){const r=e[Jo];typeof t=="function"?r.handler?r.handler!==t&&(Ue("mousemoveoutside",e,r.handler),r.handler=t,Qe("mousemoveoutside",e,t)):(e[Jo].handler=t,Qe("mousemoveoutside",e,t)):r.handler&&(Ue("mousemoveoutside",e,r.handler),r.handler=void 0)},unmounted(e){const{handler:t}=e[Jo];t&&Ue("mousemoveoutside",e,t),e[Jo].handler=void 0}};var Aw=Ow;const Qo="@@coContext",Mw={mounted(e,{value:t,modifiers:r}){e[Qo]={handler:void 0},typeof t=="function"&&(e[Qo].handler=t,Qe("clickoutside",e,t,{capture:r.capture}))},updated(e,{value:t,modifiers:r}){const o=e[Qo];typeof t=="function"?o.handler?o.handler!==t&&(Ue("clickoutside",e,o.handler,{capture:r.capture}),o.handler=t,Qe("clickoutside",e,t,{capture:r.capture})):(e[Qo].handler=t,Qe("clickoutside",e,t,{capture:r.capture})):o.handler&&(Ue("clickoutside",e,o.handler,{capture:r.capture}),o.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:r}=e[Qo];r&&Ue("clickoutside",e,r,{capture:t.capture}),e[Qo].handler=void 0}};var Ds=Mw;function Bw(e,t){console.error(`[vdirs/${e}]: ${t}`)}class Lw{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(t,r){const{elementZIndex:o}=this;if(r!==void 0){t.style.zIndex=`${r}`,o.delete(t);return}const{nextZIndex:n}=this;o.has(t)&&o.get(t)+1===this.nextZIndex||(t.style.zIndex=`${n}`,o.set(t,n),this.nextZIndex=n+1,this.squashState())}unregister(t,r){const{elementZIndex:o}=this;o.has(t)?o.delete(t):r===void 0&&Bw("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((r,o)=>r[1]-o[1]),this.nextZIndex=2e3,t.forEach(r=>{const o=r[0],n=this.nextZIndex++;`${n}`!==o.style.zIndex&&(o.style.zIndex=`${n}`)})}}var Vl=new Lw;const en="@@ziContext",Hw={mounted(e,t){const{value:r={}}=t,{zIndex:o,enabled:n}=r;e[en]={enabled:!!n,initialized:!1},n&&(Vl.ensureZIndex(e,o),e[en].initialized=!0)},updated(e,t){const{value:r={}}=t,{zIndex:o,enabled:n}=r,i=e[en].enabled;n&&!i&&(Vl.ensureZIndex(e,o),e[en].initialized=!0),e[en].enabled=!!n},unmounted(e,t){if(!e[en].initialized)return;const{value:r={}}=t,{zIndex:o}=r;Vl.unregister(e,o)}};var cl=Hw;const kv=Symbol("@css-render/vue3-ssr");function Dw(e,t){return``}function Fw(e,t){const r=me(kv,null);if(r===null){console.error("[css-render/vue3-ssr]: no ssr context found.");return}const{styles:o,ids:n}=r;n.has(e)||o!==null&&(n.add(e),o.push(Dw(e,t)))}const jw=typeof document!="undefined";function Dn(){if(jw)return;const e=me(kv,null);if(e!==null)return{adapter:Fw,context:e}}function Uu(e,t){console.error(`[vueuc/${e}]: ${t}`)}const{c:dn}=uv(),Tv="vueuc-style";function Ku(e){return typeof e=="string"?document.querySelector(e):e()}var jc=ae({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:bw(Te(e,"show")),mergedTo:H(()=>{const{to:t}=e;return t!=null?t:"body"})}},render(){return this.showTeleport?this.disabled?Ls("lazy-teleport",this.$slots):v(wp,{disabled:this.disabled,to:this.mergedTo},Ls("lazy-teleport",this.$slots)):null}});const na={top:"bottom",bottom:"top",left:"right",right:"left"},qu={start:"end",center:"center",end:"start"},Ul={top:"height",bottom:"height",left:"width",right:"width"},Nw={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},Ww={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},Vw={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Gu={top:!0,bottom:!1,left:!0,right:!1},Yu={top:"end",bottom:"start",left:"end",right:"start"};function Uw(e,t,r,o,n,i){if(!n||i)return{placement:e,top:0,left:0};const[a,l]=e.split("-");let s=l!=null?l:"center",d={top:0,left:0};const c=(p,h,g)=>{let b=0,m=0;const y=r[p]-t[h]-t[p];return y>0&&o&&(g?m=Gu[h]?y:-y:b=Gu[h]?y:-y),{left:b,top:m}},u=a==="left"||a==="right";if(s!=="center"){const p=Vw[e],h=na[p],g=Ul[p];if(r[g]>t[g]){if(t[p]+t[g]t[h]&&(s=qu[l])}else{const p=a==="bottom"||a==="top"?"left":"top",h=na[p],g=Ul[p],b=(r[g]-t[g])/2;(t[p]t[h]?(s=Yu[p],d=c(g,p,u)):(s=Yu[h],d=c(g,h,u)))}let f=a;return t[a] *",{pointerEvents:"all"})])]);var zv=ae({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){const t=me("VBinder"),r=mt(()=>e.enabled!==void 0?e.enabled:e.show),o=V(null),n=V(null),i=()=>{const{syncTrigger:f}=e;f.includes("scroll")&&t.addScrollListener(s),f.includes("resize")&&t.addResizeListener(s)},a=()=>{t.removeScrollListener(s),t.removeResizeListener(s)};gt(()=>{r.value&&(s(),i())});const l=Dn();Gw.mount({id:"vueuc/binder",head:!0,anchorMetaName:Tv,ssr:l}),ht(()=>{a()}),gv(()=>{r.value&&s()});const s=()=>{if(!r.value)return;const f=o.value;if(f===null)return;const p=t.targetRef,{x:h,y:g,overlap:b}=e,m=h!==void 0&&g!==void 0?Ew(h,g):Wl(p);f.style.setProperty("--v-target-width",`${Math.round(m.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(m.height)}px`);const{width:y,minWidth:w,placement:x,internalShift:k,flip:T}=e;f.setAttribute("v-placement",x),b?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:S}=f;y==="target"?S.width=`${m.width}px`:y!==void 0?S.width=y:S.width="",w==="target"?S.minWidth=`${m.width}px`:w!==void 0?S.minWidth=w:S.minWidth="";const $=Wl(f),R=Wl(n.value),{left:_,top:N,placement:E}=Uw(x,m,$,k,T,b),F=Kw(E,b),{left:j,top:Q,transform:A}=qw(E,R,m,N,_,b);f.setAttribute("v-placement",E),f.style.setProperty("--v-offset-left",`${Math.round(_)}px`),f.style.setProperty("--v-offset-top",`${Math.round(N)}px`),f.style.transform=`translateX(${j}) translateY(${Q}) ${A}`,f.style.setProperty("--v-transform-origin",F),f.style.transformOrigin=F};De(r,f=>{f?(i(),d()):a()});const d=()=>{Zt().then(s).catch(f=>console.error(f))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(f=>{De(Te(e,f),s)}),["teleportDisabled"].forEach(f=>{De(Te(e,f),d)}),De(Te(e,"syncTrigger"),f=>{f.includes("resize")?t.addResizeListener(s):t.removeResizeListener(s),f.includes("scroll")?t.addScrollListener(s):t.removeScrollListener(s)});const c=Hi(),u=mt(()=>{const{to:f}=e;if(f!==void 0)return f;c.value});return{VBinder:t,mergedEnabled:r,offsetContainerRef:n,followerRef:o,mergedTo:u,syncPosition:s}},render(){return v(jc,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const r=v("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[v("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?Tr(r,[[cl,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):r}})}}),Mo=[],Yw=function(){return Mo.some(function(e){return e.activeTargets.length>0})},Xw=function(){return Mo.some(function(e){return e.skippedTargets.length>0})},Xu="ResizeObserver loop completed with undelivered notifications.",Zw=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:Xu}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=Xu),window.dispatchEvent(e)},zi;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(zi||(zi={}));var Bo=function(e){return Object.freeze(e)},Jw=function(){function e(t,r){this.inlineSize=t,this.blockSize=r,Bo(this)}return e}(),Ev=function(){function e(t,r,o,n){return this.x=t,this.y=r,this.width=o,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Bo(this)}return e.prototype.toJSON=function(){var t=this,r=t.x,o=t.y,n=t.top,i=t.right,a=t.bottom,l=t.left,s=t.width,d=t.height;return{x:r,y:o,top:n,right:i,bottom:a,left:l,width:s,height:d}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Nc=function(e){return e instanceof SVGElement&&"getBBox"in e},Rv=function(e){if(Nc(e)){var t=e.getBBox(),r=t.width,o=t.height;return!r&&!o}var n=e,i=n.offsetWidth,a=n.offsetHeight;return!(i||a||e.getClientRects().length)},Zu=function(e){var t;if(e instanceof Element)return!0;var r=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},Qw=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},fi=typeof window!="undefined"?window:{},ia=new WeakMap,Ju=/auto|scroll/,eS=/^tb|vertical/,tS=/msie|trident/i.test(fi.navigator&&fi.navigator.userAgent),Cr=function(e){return parseFloat(e||"0")},Cn=function(e,t,r){return e===void 0&&(e=0),t===void 0&&(t=0),r===void 0&&(r=!1),new Jw((r?t:e)||0,(r?e:t)||0)},Qu=Bo({devicePixelContentBoxSize:Cn(),borderBoxSize:Cn(),contentBoxSize:Cn(),contentRect:new Ev(0,0,0,0)}),Iv=function(e,t){if(t===void 0&&(t=!1),ia.has(e)&&!t)return ia.get(e);if(Rv(e))return ia.set(e,Qu),Qu;var r=getComputedStyle(e),o=Nc(e)&&e.ownerSVGElement&&e.getBBox(),n=!tS&&r.boxSizing==="border-box",i=eS.test(r.writingMode||""),a=!o&&Ju.test(r.overflowY||""),l=!o&&Ju.test(r.overflowX||""),s=o?0:Cr(r.paddingTop),d=o?0:Cr(r.paddingRight),c=o?0:Cr(r.paddingBottom),u=o?0:Cr(r.paddingLeft),f=o?0:Cr(r.borderTopWidth),p=o?0:Cr(r.borderRightWidth),h=o?0:Cr(r.borderBottomWidth),g=o?0:Cr(r.borderLeftWidth),b=u+d,m=s+c,y=g+p,w=f+h,x=l?e.offsetHeight-w-e.clientHeight:0,k=a?e.offsetWidth-y-e.clientWidth:0,T=n?b+y:0,S=n?m+w:0,$=o?o.width:Cr(r.width)-T-k,R=o?o.height:Cr(r.height)-S-x,_=$+b+k+y,N=R+m+x+w,E=Bo({devicePixelContentBoxSize:Cn(Math.round($*devicePixelRatio),Math.round(R*devicePixelRatio),i),borderBoxSize:Cn(_,N,i),contentBoxSize:Cn($,R,i),contentRect:new Ev(u,s,$,R)});return ia.set(e,E),E},Ov=function(e,t,r){var o=Iv(e,r),n=o.borderBoxSize,i=o.contentBoxSize,a=o.devicePixelContentBoxSize;switch(t){case zi.DEVICE_PIXEL_CONTENT_BOX:return a;case zi.BORDER_BOX:return n;default:return i}},rS=function(){function e(t){var r=Iv(t);this.target=t,this.contentRect=r.contentRect,this.borderBoxSize=Bo([r.borderBoxSize]),this.contentBoxSize=Bo([r.contentBoxSize]),this.devicePixelContentBoxSize=Bo([r.devicePixelContentBoxSize])}return e}(),Av=function(e){if(Rv(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},oS=function(){var e=1/0,t=[];Mo.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var c=new rS(d.target),u=Av(d.target);l.push(c),d.lastReportedSize=Ov(d.target,d.observedBox),ue?r.activeTargets.push(n):r.skippedTargets.push(n))})})},nS=function(){var e=0;for(ef(e);Yw();)e=oS(),ef(e);return Xw()&&Zw(),e>0},Kl,Mv=[],iS=function(){return Mv.splice(0).forEach(function(e){return e()})},aS=function(e){if(!Kl){var t=0,r=document.createTextNode(""),o={characterData:!0};new MutationObserver(function(){return iS()}).observe(r,o),Kl=function(){r.textContent="".concat(t?t--:t++)}}Mv.push(e),Kl()},lS=function(e){aS(function(){requestAnimationFrame(e)})},Ca=0,sS=function(){return!!Ca},cS=250,dS={attributes:!0,characterData:!0,childList:!0,subtree:!0},tf=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],rf=function(e){return e===void 0&&(e=0),Date.now()+e},ql=!1,uS=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var r=this;if(t===void 0&&(t=cS),!ql){ql=!0;var o=rf(t);lS(function(){var n=!1;try{n=nS()}finally{if(ql=!1,t=o-rf(),!sS())return;n?r.run(1e3):t>0?r.run(t):r.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,r=function(){return t.observer&&t.observer.observe(document.body,dS)};document.body?r():fi.addEventListener("DOMContentLoaded",r)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),tf.forEach(function(r){return fi.addEventListener(r,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),tf.forEach(function(r){return fi.removeEventListener(r,t.listener,!0)}),this.stopped=!0)},e}(),Fs=new uS,of=function(e){!Ca&&e>0&&Fs.start(),Ca+=e,!Ca&&Fs.stop()},fS=function(e){return!Nc(e)&&!Qw(e)&&getComputedStyle(e).display==="inline"},hS=function(){function e(t,r){this.target=t,this.observedBox=r||zi.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Ov(this.target,this.observedBox,!0);return fS(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),pS=function(){function e(t,r){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=r}return e}(),aa=new WeakMap,nf=function(e,t){for(var r=0;r=0&&(i&&Mo.splice(Mo.indexOf(o),1),o.observationTargets.splice(n,1),of(-1))},e.disconnect=function(t){var r=this,o=aa.get(t);o.observationTargets.slice().forEach(function(n){return r.unobserve(t,n.target)}),o.activeTargets.splice(0,o.activeTargets.length)},e}(),vS=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");la.connect(this,t)}return e.prototype.observe=function(t,r){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Zu(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");la.observe(this,t,r)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Zu(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");la.unobserve(this,t)},e.prototype.disconnect=function(){la.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class mS{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window!="undefined"&&window.ResizeObserver||vS)(this.handleResize),this.elHandlersMap=new Map}handleResize(t){for(const r of t){const o=this.elHandlersMap.get(r.target);o!==void 0&&o(r)}}registerHandler(t,r){this.elHandlersMap.set(t,r),this.observer.observe(t)}unregisterHandler(t){!this.elHandlersMap.has(t)||(this.elHandlersMap.delete(t),this.observer.unobserve(t))}}var af=new mS,In=ae({name:"ResizeObserver",props:{onResize:Function},setup(e){let t=!1;const r=Wr().proxy;function o(n){const{onResize:i}=e;i!==void 0&&i(n)}gt(()=>{const n=r.$el;if(n===void 0){Uu("resize-observer","$el does not exist.");return}if(n.nextElementSibling!==n.nextSibling&&n.nodeType===3&&n.nodeValue!==""){Uu("resize-observer","$el can not be observed (it may be a text node).");return}n.nextElementSibling!==null&&(af.registerHandler(n.nextElementSibling,o),t=!0)}),ht(()=>{t&&af.unregisterHandler(r.$el.nextElementSibling)})},render(){return D1(this.$slots,"default")}});const gS=dn(".v-x-scroll",{overflow:"auto",scrollbarWidth:"none"},[dn("&::-webkit-scrollbar",{width:0,height:0})]);var bS=ae({name:"XScroll",props:{disabled:Boolean,onScroll:Function},setup(){const e=V(null);function t(n){!(n.currentTarget.offsetWidth=0;t--){const r=e.childNodes[t];if(Bv(r)&&(Dv(r)||Hv(r)))return!0}return!1}function Dv(e){if(!xS(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function xS(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.getAttribute("disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return e.type!=="hidden"&&e.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let Gn=[];const Fv=ae({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(e){const t=Tn(),r=V(null),o=V(null);let n=!1,i=!1;const a=typeof document=="undefined"?null:document.activeElement;function l(){return Gn[Gn.length-1]===t}function s(b){var m;b.code==="Escape"&&l()&&((m=e.onEsc)===null||m===void 0||m.call(e,b))}gt(()=>{De(()=>e.active,b=>{b?(u(),Qe("keydown",document,s)):(Ue("keydown",document,s),n&&f())},{immediate:!0})}),ht(()=>{Ue("keydown",document,s),n&&f()});function d(b){if(!i&&l()){const m=c();if(m===null||m.contains(_i(b)))return;p("first")}}function c(){const b=r.value;if(b===null)return null;let m=b;for(;m=m.nextSibling,!(m===null||m instanceof Element&&m.tagName==="DIV"););return m}function u(){var b;if(!e.disabled){if(Gn.push(t),e.autoFocus){const{initialFocusTo:m}=e;m===void 0?p("first"):(b=Ku(m))===null||b===void 0||b.focus({preventScroll:!0})}n=!0,document.addEventListener("focus",d,!0)}}function f(){var b;if(e.disabled||(document.removeEventListener("focus",d,!0),Gn=Gn.filter(y=>y!==t),l()))return;const{finalFocusTo:m}=e;m!==void 0?(b=Ku(m))===null||b===void 0||b.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&a instanceof HTMLElement&&(i=!0,a.focus({preventScroll:!0}),i=!1)}function p(b){if(!!l()&&e.active){const m=r.value,y=o.value;if(m!==null&&y!==null){const w=c();if(w==null||w===y){i=!0,m.focus({preventScroll:!0}),i=!1;return}i=!0;const x=b==="first"?Lv(w):Hv(w);i=!1,x||(i=!0,m.focus({preventScroll:!0}),i=!1)}}}function h(b){if(i)return;const m=c();m!==null&&(b.relatedTarget!==null&&m.contains(b.relatedTarget)?p("last"):p("first"))}function g(b){i||(b.relatedTarget!==null&&b.relatedTarget===r.value?p("last"):p("first"))}return{focusableStartRef:r,focusableEndRef:o,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:h,handleEndFocus:g}},render(){const{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();const{active:t,focusableStyle:r}=this;return v(Je,null,[v("div",{"aria-hidden":"true",tabindex:t?"0":"-1",ref:"focusableStartRef",style:r,onFocus:this.handleStartFocus}),e(),v("div",{"aria-hidden":"true",style:r,ref:"focusableEndRef",tabindex:t?"0":"-1",onFocus:this.handleEndFocus})])}});let tn=0,lf="",sf="",cf="",df="";const uf=V("0px");function CS(e){if(typeof document=="undefined")return;const t=document.documentElement;let r,o=!1;const n=()=>{t.style.marginRight=lf,t.style.overflow=sf,t.style.overflowX=cf,t.style.overflowY=df,uf.value="0px"};gt(()=>{r=De(e,i=>{if(i){if(!tn){const a=window.innerWidth-t.offsetWidth;a>0&&(lf=t.style.marginRight,t.style.marginRight=`${a}px`,uf.value=`${a}px`),sf=t.style.overflow,cf=t.style.overflowX,df=t.style.overflowY,t.style.overflow="hidden",t.style.overflowX="hidden",t.style.overflowY="hidden"}o=!0,tn++}else tn--,tn||n(),o=!1},{immediate:!0})}),ht(()=>{r==null||r(),o&&(tn--,tn||n(),o=!1)})}const Wc=V(!1),ff=()=>{Wc.value=!0},hf=()=>{Wc.value=!1};let Yn=0;const yS=()=>(Fo&&(Nr(()=>{Yn||(window.addEventListener("compositionstart",ff),window.addEventListener("compositionend",hf)),Yn++}),ht(()=>{Yn<=1?(window.removeEventListener("compositionstart",ff),window.removeEventListener("compositionend",hf),Yn=0):Yn--})),Wc);function wS(e){const t={isDeactivated:!1};let r=!1;return sp(()=>{if(t.isDeactivated=!1,!r){r=!0;return}e()}),cp(()=>{t.isDeactivated=!0,r||(r=!0)}),t}const js="n-form-item";function jv(e,{defaultSize:t="medium",mergedSize:r,mergedDisabled:o}={}){const n=me(js,null);Be(js,null);const i=H(r?()=>r(n):()=>{const{size:s}=e;if(s)return s;if(n){const{mergedSize:d}=n;if(d.value!==void 0)return d.value}return t}),a=H(o?()=>o(n):()=>{const{disabled:s}=e;return s!==void 0?s:n?n.disabled.value:!1}),l=H(()=>{const{status:s}=e;return s||(n==null?void 0:n.mergedValidationStatus.value)});return ht(()=>{n&&n.restoreValidation()}),{mergedSizeRef:i,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){n&&n.handleContentBlur()},nTriggerFormChange(){n&&n.handleContentChange()},nTriggerFormFocus(){n&&n.handleContentFocus()},nTriggerFormInput(){n&&n.handleContentInput()}}}var SS=typeof global=="object"&&global&&global.Object===Object&&global,Nv=SS,$S=typeof self=="object"&&self&&self.Object===Object&&self,_S=Nv||$S||Function("return this")(),xr=_S,PS=xr.Symbol,ao=PS,Wv=Object.prototype,kS=Wv.hasOwnProperty,TS=Wv.toString,Xn=ao?ao.toStringTag:void 0;function zS(e){var t=kS.call(e,Xn),r=e[Xn];try{e[Xn]=void 0;var o=!0}catch{}var n=TS.call(e);return o&&(t?e[Xn]=r:delete e[Xn]),n}var ES=Object.prototype,RS=ES.toString;function IS(e){return RS.call(e)}var OS="[object Null]",AS="[object Undefined]",pf=ao?ao.toStringTag:void 0;function jo(e){return e==null?e===void 0?AS:OS:pf&&pf in Object(e)?zS(e):IS(e)}function lo(e){return e!=null&&typeof e=="object"}var MS="[object Symbol]";function dl(e){return typeof e=="symbol"||lo(e)&&jo(e)==MS}function Vv(e,t){for(var r=-1,o=e==null?0:e.length,n=Array(o);++r0){if(++t>=p2)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function b2(e){return function(){return e}}var x2=function(){try{var e=Wo(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Oa=x2,C2=Oa?function(e,t){return Oa(e,"toString",{configurable:!0,enumerable:!1,value:b2(t),writable:!0})}:Vc,y2=C2,w2=g2(y2),S2=w2,$2=9007199254740991,_2=/^(?:0|[1-9]\d*)$/;function Kc(e,t){var r=typeof e;return t=t==null?$2:t,!!t&&(r=="number"||r!="symbol"&&_2.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=I2}function Fn(e){return e!=null&&Gc(e.length)&&!Uc(e)}function O2(e,t,r){if(!dr(r))return!1;var o=typeof t;return(o=="number"?Fn(r)&&Kc(t,r.length):o=="string"&&t in r)?Fi(r[t],e):!1}function A2(e){return R2(function(t,r){var o=-1,n=r.length,i=n>1?r[n-1]:void 0,a=n>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(n--,i):void 0,a&&O2(r[0],r[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++o-1}function Z5(e,t){var r=this.__data__,o=ul(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}function Vr(e){var t=-1,r=e==null?0:e.length;for(this.clear();++tn?0:n+t),r=r>n?n:r,r<0&&(r+=n),n=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(n);++o=o?e:y$(e,t,r)}var S$="\\ud800-\\udfff",$$="\\u0300-\\u036f",_$="\\ufe20-\\ufe2f",P$="\\u20d0-\\u20ff",k$=$$+_$+P$,T$="\\ufe0e\\ufe0f",z$="\\u200d",E$=RegExp("["+z$+S$+k$+T$+"]");function rm(e){return E$.test(e)}function R$(e){return e.split("")}var om="\\ud800-\\udfff",I$="\\u0300-\\u036f",O$="\\ufe20-\\ufe2f",A$="\\u20d0-\\u20ff",M$=I$+O$+A$,B$="\\ufe0e\\ufe0f",L$="["+om+"]",Ws="["+M$+"]",Vs="\\ud83c[\\udffb-\\udfff]",H$="(?:"+Ws+"|"+Vs+")",nm="[^"+om+"]",im="(?:\\ud83c[\\udde6-\\uddff]){2}",am="[\\ud800-\\udbff][\\udc00-\\udfff]",D$="\\u200d",lm=H$+"?",sm="["+B$+"]?",F$="(?:"+D$+"(?:"+[nm,im,am].join("|")+")"+sm+lm+")*",j$=sm+lm+F$,N$="(?:"+[nm+Ws+"?",Ws,im,am,L$].join("|")+")",W$=RegExp(Vs+"(?="+Vs+")|"+N$+j$,"g");function V$(e){return e.match(W$)||[]}function U$(e){return rm(e)?V$(e):R$(e)}function K$(e){return function(t){t=hl(t);var r=rm(t)?U$(t):void 0,o=r?r[0]:t.charAt(0),n=r?w$(r,1).join(""):t.slice(1);return o[e]()+n}}var q$=K$("toUpperCase"),G$=q$;function Y$(e,t,r,o){var n=-1,i=e==null?0:e.length;for(o&&i&&(r=e[++n]);++nl))return!1;var d=i.get(e),c=i.get(t);if(d&&c)return d==t&&c==e;var u=-1,f=!0,p=r&xP?new La:void 0;for(i.set(e,t),i.set(t,e);++u=t||S<0||u&&$>=i}function m(){var T=Zl();if(b(T))return y(T);l=setTimeout(m,g(T))}function y(T){return l=void 0,f&&o?p(T):(o=n=void 0,a)}function w(){l!==void 0&&clearTimeout(l),d=0,o=s=n=l=void 0}function x(){return l===void 0?a:y(Zl())}function k(){var T=Zl(),S=b(T);if(o=arguments,n=this,s=T,S){if(l===void 0)return h(s);if(u)return clearTimeout(l),l=setTimeout(m,t),p(s)}return l===void 0&&(l=setTimeout(m,t)),a}return k.cancel=w,k.flush=x,k}function Gs(e,t,r){(r!==void 0&&!Fi(e[t],r)||r===void 0&&!(t in e))&&qc(e,t,r)}function v3(e){return lo(e)&&Fn(e)}function Ys(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function m3(e){return z2(e,Zv(e))}function g3(e,t,r,o,n,i,a){var l=Ys(e,r),s=Ys(t,r),d=a.get(s);if(d){Gs(e,r,d);return}var c=i?i(l,s,r+"",e,t,a):void 0,u=c===void 0;if(u){var f=cr(s),p=!f&&Ma(s),h=!f&&!p&&Xc(s);c=s,f||p||h?cr(l)?c=l:v3(l)?c=h2(l):p?(u=!1,c=K_(s,!0)):h?(u=!1,c=uP(s,!0)):c=[]:C$(s)||Aa(s)?(c=l,Aa(l)?c=m3(l):(!dr(l)||Uc(l))&&(c=fP(s))):u=!1}u&&(a.set(s,c),n(c,s,o,i,a),a.delete(s)),Gs(e,r,c)}function km(e,t,r,o,n){e!==t&&Pm(t,function(i,a){if(n||(n=new _r),dr(i))g3(e,t,a,r,km,o,n);else{var l=o?o(Ys(e,a),i,a+"",e,t,n):void 0;l===void 0&&(l=i),Gs(e,a,l)}},Zv)}function b3(e,t){var r=-1,o=Fn(e)?Array(e.length):[];return c3(e,function(n,i,a){o[++r]=t(n,i,a)}),o}function x3(e,t){var r=cr(e)?Vv:b3;return r(e,o3(t))}var C3=H_(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),y3=C3,w3=A2(function(e,t,r){km(e,t,r)}),un=w3,S3="Expected a function";function Jl(e,t,r){var o=!0,n=!0;if(typeof e!="function")throw new TypeError(S3);return dr(r)&&(o="leading"in r?!!r.leading:o,n="trailing"in r?!!r.trailing:n),p3(e,t,{leading:o,maxWait:t,trailing:n})}var zr={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"};const{fontSize:$3,fontFamily:_3,lineHeight:P3}=zr;var Tm=O("body",` - margin: 0; - font-size: ${$3}; - font-family: ${_3}; - line-height: ${P3}; - -webkit-text-size-adjust: 100%; - -webkit-tap-highlight-color: transparent; -`,[O("input",` - font-family: inherit; - font-size: inherit; - `)]);const Fr="n-config-provider",Ii="naive-ui-style";function DM(e){return e}function Ee(e,t,r,o,n,i){const a=Dn(),l=me(Fr,null);if(r){const d=()=>{const c=i==null?void 0:i.value;r.mount({id:c===void 0?t:c+t,head:!0,props:{bPrefix:c?`.${c}-`:void 0},anchorMetaName:Ii,ssr:a}),l!=null&&l.preflightStyleDisabled||Tm.mount({id:"n-global",head:!0,anchorMetaName:Ii,ssr:a})};a?d():Nr(d)}return H(()=>{var d;const{theme:{common:c,self:u,peers:f={}}={},themeOverrides:p={},builtinThemeOverrides:h={}}=n,{common:g,peers:b}=p,{common:m=void 0,[e]:{common:y=void 0,self:w=void 0,peers:x={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:k=void 0,[e]:T={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:S,peers:$={}}=T,R=un({},c||y||m||o.common,k,S,g),_=un((d=u||w||o.self)===null||d===void 0?void 0:d(R),h,T,p);return{common:R,self:_,peers:un({},o.peers,x,f),peerOverrides:un({},h.peers,$,b)}})}Ee.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const zm="n";function st(e={},t={defaultBordered:!0}){const r=me(Fr,null);return{inlineThemeDisabled:r==null?void 0:r.inlineThemeDisabled,mergedRtlRef:r==null?void 0:r.mergedRtlRef,mergedComponentPropsRef:r==null?void 0:r.mergedComponentPropsRef,mergedBreakpointsRef:r==null?void 0:r.mergedBreakpointsRef,mergedBorderedRef:H(()=>{var o,n;const{bordered:i}=e;return i!==void 0?i:(n=(o=r==null?void 0:r.mergedBorderedRef.value)!==null&&o!==void 0?o:t.defaultBordered)!==null&&n!==void 0?n:!0}),mergedClsPrefixRef:H(()=>(r==null?void 0:r.mergedClsPrefixRef.value)||zm),namespaceRef:H(()=>r==null?void 0:r.mergedNamespaceRef.value)}}const k3={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (\u2190)",tipNext:"Next picture (\u2192)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}};var T3=k3;function Ql(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth,o=e.formats[r]||e.formats[e.defaultWidth];return o}}function Zn(e){return function(t,r){var o=r!=null&&r.context?String(r.context):"standalone",n;if(o==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=r!=null&&r.width?String(r.width):i;n=e.formattingValues[a]||e.formattingValues[i]}else{var l=e.defaultWidth,s=r!=null&&r.width?String(r.width):e.defaultWidth;n=e.values[s]||e.values[l]}var d=e.argumentCallback?e.argumentCallback(t):t;return n[d]}}function Jn(e){return function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=r.width,n=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;var a=i[0],l=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?E3(l,function(u){return u.test(a)}):z3(l,function(u){return u.test(a)}),d;d=e.valueCallback?e.valueCallback(s):s,d=r.valueCallback?r.valueCallback(d):d;var c=t.slice(a.length);return{value:d,rest:c}}}function z3(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}function E3(e,t){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},o=t.match(e.matchPattern);if(!o)return null;var n=o[0],i=t.match(e.parsePattern);if(!i)return null;var a=e.valueCallback?e.valueCallback(i[0]):i[0];a=r.valueCallback?r.valueCallback(a):a;var l=t.slice(n.length);return{value:a,rest:l}}}var I3={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},O3=function(t,r,o){var n,i=I3[t];return typeof i=="string"?n=i:r===1?n=i.one:n=i.other.replace("{{count}}",r.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+n:n+" ago":n},A3=O3,M3={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},B3={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},L3={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},H3={date:Ql({formats:M3,defaultWidth:"full"}),time:Ql({formats:B3,defaultWidth:"full"}),dateTime:Ql({formats:L3,defaultWidth:"full"})},D3=H3,F3={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},j3=function(t,r,o,n){return F3[t]},N3=j3,W3={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},V3={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},U3={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},K3={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},q3={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},G3={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Y3=function(t,r){var o=Number(t),n=o%100;if(n>20||n<10)switch(n%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},X3={ordinalNumber:Y3,era:Zn({values:W3,defaultWidth:"wide"}),quarter:Zn({values:V3,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Zn({values:U3,defaultWidth:"wide"}),day:Zn({values:K3,defaultWidth:"wide"}),dayPeriod:Zn({values:q3,defaultWidth:"wide",formattingValues:G3,defaultFormattingWidth:"wide"})},Z3=X3,J3=/^(\d+)(th|st|nd|rd)?/i,Q3=/\d+/i,e6={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},t6={any:[/^b/i,/^(a|c)/i]},r6={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},o6={any:[/1/i,/2/i,/3/i,/4/i]},n6={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},i6={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},a6={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},l6={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},s6={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},c6={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},d6={ordinalNumber:R3({matchPattern:J3,parsePattern:Q3,valueCallback:function(t){return parseInt(t,10)}}),era:Jn({matchPatterns:e6,defaultMatchWidth:"wide",parsePatterns:t6,defaultParseWidth:"any"}),quarter:Jn({matchPatterns:r6,defaultMatchWidth:"wide",parsePatterns:o6,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Jn({matchPatterns:n6,defaultMatchWidth:"wide",parsePatterns:i6,defaultParseWidth:"any"}),day:Jn({matchPatterns:a6,defaultMatchWidth:"wide",parsePatterns:l6,defaultParseWidth:"any"}),dayPeriod:Jn({matchPatterns:s6,defaultMatchWidth:"any",parsePatterns:c6,defaultParseWidth:"any"})},u6=d6,f6={code:"en-US",formatDistance:A3,formatLong:D3,formatRelative:N3,localize:Z3,match:u6,options:{weekStartsOn:0,firstWeekContainsDate:1}},h6=f6;const p6={name:"en-US",locale:h6};var v6=p6;function Em(e){const{mergedLocaleRef:t,mergedDateLocaleRef:r}=me(Fr,null)||{},o=H(()=>{var i,a;return(a=(i=t==null?void 0:t.value)===null||i===void 0?void 0:i[e])!==null&&a!==void 0?a:T3[e]});return{dateLocaleRef:H(()=>{var i;return(i=r==null?void 0:r.value)!==null&&i!==void 0?i:v6}),localeRef:o}}function co(e,t,r){if(!t)return;const o=Dn(),n=me(Fr,null),i=()=>{const a=r==null?void 0:r.value;t.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:Ii,props:{bPrefix:a?`.${a}-`:void 0},ssr:o}),n!=null&&n.preflightStyleDisabled||Tm.mount({id:"n-global",head:!0,anchorMetaName:Ii,ssr:o})};o?i():Nr(i)}function Pt(e,t,r,o){var n;r||il("useThemeClass","cssVarsRef is not passed");const i=(n=me(Fr,null))===null||n===void 0?void 0:n.mergedThemeHashRef,a=V(""),l=Dn();let s;const d=`__${e}`,c=()=>{let u=d;const f=t?t.value:void 0,p=i==null?void 0:i.value;p&&(u+="-"+p),f&&(u+="-"+f);const{themeOverrides:h,builtinThemeOverrides:g}=o;h&&(u+="-"+Pi(JSON.stringify(h))),g&&(u+="-"+Pi(JSON.stringify(g))),a.value=u,s=()=>{const b=r.value;let m="";for(const y in b)m+=`${y}: ${b[y]};`;O(`.${u}`,m).mount({id:u,ssr:l}),s=void 0}};return Wt(()=>{c()}),{themeClass:a,onRender:()=>{s==null||s()}}}function Kr(e,t,r){if(!t)return;const o=Dn(),n=H(()=>{const{value:a}=t;if(!a)return;const l=a[e];if(!!l)return l}),i=()=>{Wt(()=>{const{value:a}=r,l=`${a}${e}Rtl`;if(sw(l,o))return;const{value:s}=n;!s||s.style.mount({id:l,head:!0,anchorMetaName:Ii,props:{bPrefix:a?`.${a}-`:void 0},ssr:o})})};return o?i():Nr(i),n}var m6=ae({name:"Add",render(){return v("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}});function Er(e,t){return ae({name:G$(e),setup(){var r;const o=(r=me(Fr,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var n;const i=(n=o==null?void 0:o.value)===null||n===void 0?void 0:n[e];return i?i():t}}})}var g6=ae({name:"ChevronRight",render(){return v("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v("path",{d:"M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z",fill:"currentColor"}))}}),b6=Er("close",v("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},v("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},v("g",{fill:"currentColor","fill-rule":"nonzero"},v("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),x6=ae({name:"Eye",render(){return v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},v("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),v("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),C6=ae({name:"EyeOff",render(){return v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},v("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),v("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),v("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),v("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),v("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}}),Rm=Er("error",v("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},v("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},v("g",{"fill-rule":"nonzero"},v("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M17.8838835,16.1161165 L17.7823881,16.0249942 C17.3266086,15.6583353 16.6733914,15.6583353 16.2176119,16.0249942 L16.1161165,16.1161165 L16.0249942,16.2176119 C15.6583353,16.6733914 15.6583353,17.3266086 16.0249942,17.7823881 L16.1161165,17.8838835 L22.233,24 L16.1161165,30.1161165 L16.0249942,30.2176119 C15.6583353,30.6733914 15.6583353,31.3266086 16.0249942,31.7823881 L16.1161165,31.8838835 L16.2176119,31.9750058 C16.6733914,32.3416647 17.3266086,32.3416647 17.7823881,31.9750058 L17.8838835,31.8838835 L24,25.767 L30.1161165,31.8838835 L30.2176119,31.9750058 C30.6733914,32.3416647 31.3266086,32.3416647 31.7823881,31.9750058 L31.8838835,31.8838835 L31.9750058,31.7823881 C32.3416647,31.3266086 32.3416647,30.6733914 31.9750058,30.2176119 L31.8838835,30.1161165 L25.767,24 L31.8838835,17.8838835 L31.9750058,17.7823881 C32.3416647,17.3266086 32.3416647,16.6733914 31.9750058,16.2176119 L31.8838835,16.1161165 L31.7823881,16.0249942 C31.3266086,15.6583353 30.6733914,15.6583353 30.2176119,16.0249942 L30.1161165,16.1161165 L24,22.233 L17.8838835,16.1161165 L17.7823881,16.0249942 L17.8838835,16.1161165 Z"}))))),Xs=Er("info",v("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},v("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},v("g",{"fill-rule":"nonzero"},v("path",{d:"M14,2 C20.6274,2 26,7.37258 26,14 C26,20.6274 20.6274,26 14,26 C7.37258,26 2,20.6274 2,14 C2,7.37258 7.37258,2 14,2 Z M14,11 C13.4477,11 13,11.4477 13,12 L13,12 L13,20 C13,20.5523 13.4477,21 14,21 C14.5523,21 15,20.5523 15,20 L15,20 L15,12 C15,11.4477 14.5523,11 14,11 Z M14,6.75 C13.3096,6.75 12.75,7.30964 12.75,8 C12.75,8.69036 13.3096,9.25 14,9.25 C14.6904,9.25 15.25,8.69036 15.25,8 C15.25,7.30964 14.6904,6.75 14,6.75 Z"}))))),Im=Er("success",v("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},v("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},v("g",{"fill-rule":"nonzero"},v("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.6338835,17.6161165 C32.1782718,17.1605048 31.4584514,17.1301307 30.9676119,17.5249942 L30.8661165,17.6161165 L20.75,27.732233 L17.1338835,24.1161165 C16.6457281,23.6279612 15.8542719,23.6279612 15.3661165,24.1161165 C14.9105048,24.5717282 14.8801307,25.2915486 15.2749942,25.7823881 L15.3661165,25.8838835 L19.8661165,30.3838835 C20.3217282,30.8394952 21.0415486,30.8698693 21.5323881,30.4750058 L21.6338835,30.3838835 L32.6338835,19.3838835 C33.1220388,18.8957281 33.1220388,18.1042719 32.6338835,17.6161165 Z"}))))),Om=Er("warning",v("svg",{viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},v("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},v("g",{"fill-rule":"nonzero"},v("path",{d:"M12,2 C17.523,2 22,6.478 22,12 C22,17.522 17.523,22 12,22 C6.477,22 2,17.522 2,12 C2,6.478 6.477,2 12,2 Z M12.0018002,15.0037242 C11.450254,15.0037242 11.0031376,15.4508407 11.0031376,16.0023869 C11.0031376,16.553933 11.450254,17.0010495 12.0018002,17.0010495 C12.5533463,17.0010495 13.0004628,16.553933 13.0004628,16.0023869 C13.0004628,15.4508407 12.5533463,15.0037242 12.0018002,15.0037242 Z M11.99964,7 C11.4868042,7.00018474 11.0642719,7.38637706 11.0066858,7.8837365 L11,8.00036004 L11.0018003,13.0012393 L11.00857,13.117858 C11.0665141,13.6151758 11.4893244,14.0010638 12.0021602,14.0008793 C12.514996,14.0006946 12.9375283,13.6145023 12.9951144,13.1171428 L13.0018002,13.0005193 L13,7.99964009 L12.9932303,7.8830214 C12.9352861,7.38570354 12.5124758,6.99981552 11.99964,7 Z"}))))),y6=ae({name:"ChevronDown",render(){return v("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),w6=Er("clear",v("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},v("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},v("g",{fill:"currentColor","fill-rule":"nonzero"},v("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),S6=ae({name:"ChevronDownFilled",render(){return v("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v("path",{d:"M3.20041 5.73966C3.48226 5.43613 3.95681 5.41856 4.26034 5.70041L8 9.22652L11.7397 5.70041C12.0432 5.41856 12.5177 5.43613 12.7996 5.73966C13.0815 6.0432 13.0639 6.51775 12.7603 6.7996L8.51034 10.7996C8.22258 11.0668 7.77743 11.0668 7.48967 10.7996L3.23966 6.7996C2.93613 6.51775 2.91856 6.0432 3.20041 5.73966Z",fill:"currentColor"}))}}),$6=Er("rotateClockwise",v("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v("path",{d:"M3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 12.7916 15.3658 15.2026 13 16.3265V14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5V17.5C12 17.7761 12.2239 18 12.5 18H15.5C15.7761 18 16 17.7761 16 17.5C16 17.2239 15.7761 17 15.5 17H13.8758C16.3346 15.6357 18 13.0128 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 10.2761 2.22386 10.5 2.5 10.5C2.77614 10.5 3 10.2761 3 10Z",fill:"currentColor"}),v("path",{d:"M10 12C11.1046 12 12 11.1046 12 10C12 8.89543 11.1046 8 10 8C8.89543 8 8 8.89543 8 10C8 11.1046 8.89543 12 10 12ZM10 11C9.44772 11 9 10.5523 9 10C9 9.44772 9.44772 9 10 9C10.5523 9 11 9.44772 11 10C11 10.5523 10.5523 11 10 11Z",fill:"currentColor"}))),_6=Er("rotateClockwise",v("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v("path",{d:"M17 10C17 6.13401 13.866 3 10 3C6.13401 3 3 6.13401 3 10C3 12.7916 4.63419 15.2026 7 16.3265V14.5C7 14.2239 7.22386 14 7.5 14C7.77614 14 8 14.2239 8 14.5V17.5C8 17.7761 7.77614 18 7.5 18H4.5C4.22386 18 4 17.7761 4 17.5C4 17.2239 4.22386 17 4.5 17H6.12422C3.66539 15.6357 2 13.0128 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10C18 10.2761 17.7761 10.5 17.5 10.5C17.2239 10.5 17 10.2761 17 10Z",fill:"currentColor"}),v("path",{d:"M10 12C8.89543 12 8 11.1046 8 10C8 8.89543 8.89543 8 10 8C11.1046 8 12 8.89543 12 10C12 11.1046 11.1046 12 10 12ZM10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10C9 10.5523 9.44772 11 10 11Z",fill:"currentColor"}))),P6=Er("zoomIn",v("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v("path",{d:"M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5Z",fill:"currentColor"}),v("path",{d:"M8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z",fill:"currentColor"}))),k6=Er("zoomOut",v("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v("path",{d:"M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11Z",fill:"currentColor"}),v("path",{d:"M14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z",fill:"currentColor"}))),T6=ae({name:"ResizeSmall",render(){return v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},v("g",{fill:"none"},v("path",{d:"M5.5 4A1.5 1.5 0 0 0 4 5.5v1a.5.5 0 0 1-1 0v-1A2.5 2.5 0 0 1 5.5 3h1a.5.5 0 0 1 0 1h-1zM16 5.5A1.5 1.5 0 0 0 14.5 4h-1a.5.5 0 0 1 0-1h1A2.5 2.5 0 0 1 17 5.5v1a.5.5 0 0 1-1 0v-1zm0 9a1.5 1.5 0 0 1-1.5 1.5h-1a.5.5 0 0 0 0 1h1a2.5 2.5 0 0 0 2.5-2.5v-1a.5.5 0 0 0-1 0v1zm-12 0A1.5 1.5 0 0 0 5.5 16h1.25a.5.5 0 0 1 0 1H5.5A2.5 2.5 0 0 1 3 14.5v-1.25a.5.5 0 0 1 1 0v1.25zM8.5 7A1.5 1.5 0 0 0 7 8.5v3A1.5 1.5 0 0 0 8.5 13h3a1.5 1.5 0 0 0 1.5-1.5v-3A1.5 1.5 0 0 0 11.5 7h-3zM8 8.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-3z",fill:"currentColor"})))}}),vl=ae({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const r=Hi();return()=>v(Bt,{name:"icon-switch-transition",appear:r.value},t)}}),ml=ae({name:"FadeInExpandTransition",props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:t}){function r(l){e.width?l.style.maxWidth=`${l.offsetWidth}px`:l.style.maxHeight=`${l.offsetHeight}px`,l.offsetWidth}function o(l){e.width?l.style.maxWidth="0":l.style.maxHeight="0",l.offsetWidth;const{onLeave:s}=e;s&&s()}function n(l){e.width?l.style.maxWidth="":l.style.maxHeight="";const{onAfterLeave:s}=e;s&&s()}function i(l){if(l.style.transition="none",e.width){const s=l.offsetWidth;l.style.maxWidth="0",l.offsetWidth,l.style.transition="",l.style.maxWidth=`${s}px`}else if(e.reverse)l.style.maxHeight=`${l.offsetHeight}px`,l.offsetHeight,l.style.transition="",l.style.maxHeight="0";else{const s=l.offsetHeight;l.style.maxHeight="0",l.offsetWidth,l.style.transition="",l.style.maxHeight=`${s}px`}l.offsetWidth}function a(l){var s;e.width?l.style.maxWidth="":e.reverse||(l.style.maxHeight=""),(s=e.onAfterEnter)===null||s===void 0||s.call(e)}return()=>{const l=e.group?Rc:Bt;return v(l,{name:e.width?"fade-in-width-expand-transition":"fade-in-height-expand-transition",mode:e.mode,appear:e.appear,onEnter:i,onAfterEnter:a,onBeforeLeave:r,onLeave:o,onAfterLeave:n},t)}}}),z6=M("base-icon",` - height: 1em; - width: 1em; - line-height: 1em; - text-align: center; - display: inline-block; - position: relative; - fill: currentColor; - transform: translateZ(0); -`,[O("svg",` - height: 1em; - width: 1em; - `)]),zt=ae({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){co("-base-icon",z6,Te(e,"clsPrefix"))},render(){return v("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),E6=M("base-close",` - display: flex; - align-items: center; - justify-content: center; - cursor: pointer; - background-color: transparent; - color: var(--n-close-icon-color); - border-radius: var(--n-close-border-radius); - height: var(--n-close-size); - width: var(--n-close-size); - font-size: var(--n-close-icon-size); - outline: none; - border: none; - position: relative; - padding: 0; -`,[K("absolute",` - height: var(--n-close-icon-size); - width: var(--n-close-icon-size); - `),O("&::before",` - content: ""; - position: absolute; - width: var(--n-close-size); - height: var(--n-close-size); - left: 50%; - top: 50%; - transform: translateY(-50%) translateX(-50%); - transition: inherit; - border-radius: inherit; - `),ut("disabled",[O("&:hover",` - color: var(--n-close-icon-color-hover); - `),O("&:hover::before",` - background-color: var(--n-close-color-hover); - `),O("&:focus::before",` - background-color: var(--n-close-color-hover); - `),O("&:active",` - color: var(--n-close-icon-color-pressed); - `),O("&:active::before",` - background-color: var(--n-close-color-pressed); - `)]),K("disabled",` - cursor: not-allowed; - color: var(--n-close-icon-color-disabled); - background-color: transparent; - `),K("round",[O("&::before",` - border-radius: 50%; - `)])]),ji=ae({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return co("-base-close",E6,Te(e,"clsPrefix")),()=>{const{clsPrefix:t,disabled:r,absolute:o,round:n,isButtonTag:i}=e;return v(i?"button":"div",{type:i?"button":void 0,tabindex:r||!e.focusable?-1:0,"aria-disabled":r,"aria-label":"close",role:i?void 0:"button",disabled:r,class:[`${t}-base-close`,o&&`${t}-base-close--absolute`,r&&`${t}-base-close--disabled`,n&&`${t}-base-close--round`],onMousedown:l=>{e.focusable||l.preventDefault()},onClick:e.onClick},v(zt,{clsPrefix:t},{default:()=>v(b6,null)}))}}});const{cubicBezierEaseInOut:R6}=zr;function Oi({originalTransform:e="",left:t=0,top:r=0,transition:o=`all .3s ${R6} !important`}={}){return[O("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:e+" scale(0.75)",left:t,top:r,opacity:0}),O("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:t,top:r,opacity:1}),O("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:t,top:r,transition:o})]}var I6=O([O("@keyframes loading-container-rotate",` - to { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } - `),O("@keyframes loading-layer-rotate",` - 12.5% { - -webkit-transform: rotate(135deg); - transform: rotate(135deg); - } - 25% { - -webkit-transform: rotate(270deg); - transform: rotate(270deg); - } - 37.5% { - -webkit-transform: rotate(405deg); - transform: rotate(405deg); - } - 50% { - -webkit-transform: rotate(540deg); - transform: rotate(540deg); - } - 62.5% { - -webkit-transform: rotate(675deg); - transform: rotate(675deg); - } - 75% { - -webkit-transform: rotate(810deg); - transform: rotate(810deg); - } - 87.5% { - -webkit-transform: rotate(945deg); - transform: rotate(945deg); - } - 100% { - -webkit-transform: rotate(1080deg); - transform: rotate(1080deg); - } - `),O("@keyframes loading-left-spin",` - from { - -webkit-transform: rotate(265deg); - transform: rotate(265deg); - } - 50% { - -webkit-transform: rotate(130deg); - transform: rotate(130deg); - } - to { - -webkit-transform: rotate(265deg); - transform: rotate(265deg); - } - `),O("@keyframes loading-right-spin",` - from { - -webkit-transform: rotate(-265deg); - transform: rotate(-265deg); - } - 50% { - -webkit-transform: rotate(-130deg); - transform: rotate(-130deg); - } - to { - -webkit-transform: rotate(-265deg); - transform: rotate(-265deg); - } - `),M("base-loading",` - position: relative; - line-height: 0; - width: 1em; - height: 1em; - `,[D("transition-wrapper",` - position: absolute; - width: 100%; - height: 100%; - `,[Oi()]),D("container",` - display: inline-flex; - position: relative; - direction: ltr; - line-height: 0; - animation: loading-container-rotate 1568.2352941176ms linear infinite; - font-size: 0; - letter-spacing: 0; - white-space: nowrap; - opacity: 1; - width: 100%; - height: 100%; - `,[D("svg",` - stroke: var(--n-text-color); - fill: transparent; - position: absolute; - height: 100%; - overflow: hidden; - `),D("container-layer",` - position: absolute; - width: 100%; - height: 100%; - animation: loading-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; - `,[D("container-layer-left",` - display: inline-flex; - position: relative; - width: 50%; - height: 100%; - overflow: hidden; - `,[D("svg",` - animation: loading-left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; - width: 200%; - `)]),D("container-layer-patch",` - position: absolute; - top: 0; - left: 47.5%; - box-sizing: border-box; - width: 5%; - height: 100%; - overflow: hidden; - `,[D("svg",` - left: -900%; - width: 2000%; - transform: rotate(180deg); - `)]),D("container-layer-right",` - display: inline-flex; - position: relative; - width: 50%; - height: 100%; - overflow: hidden; - `,[D("svg",` - animation: loading-right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; - left: -100%; - width: 200%; - `)])])]),D("placeholder",` - position: absolute; - left: 50%; - top: 50%; - transform: translateX(-50%) translateY(-50%); - `,[Oi({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})])])]);const O6={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}};var gl=ae({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},O6),setup(e){co("-base-loading",I6,Te(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:t,strokeWidth:r,stroke:o,scale:n}=this,i=t/n;return v("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},v(vl,null,{default:()=>this.show?v("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},v("div",{class:`${e}-base-loading__container`},v("div",{class:`${e}-base-loading__container-layer`},v("div",{class:`${e}-base-loading__container-layer-left`},v("svg",{class:`${e}-base-loading__svg`,viewBox:`0 0 ${2*i} ${2*i}`,xmlns:"http://www.w3.org/2000/svg",style:{color:o}},v("circle",{fill:"none",stroke:"currentColor","stroke-width":r,"stroke-linecap":"round",cx:i,cy:i,r:t-r/2,"stroke-dasharray":4.91*t,"stroke-dashoffset":2.46*t}))),v("div",{class:`${e}-base-loading__container-layer-patch`},v("svg",{class:`${e}-base-loading__svg`,viewBox:`0 0 ${2*i} ${2*i}`,xmlns:"http://www.w3.org/2000/svg",style:{color:o}},v("circle",{fill:"none",stroke:"currentColor","stroke-width":r,"stroke-linecap":"round",cx:i,cy:i,r:t-r/2,"stroke-dasharray":4.91*t,"stroke-dashoffset":2.46*t}))),v("div",{class:`${e}-base-loading__container-layer-right`},v("svg",{class:`${e}-base-loading__svg`,viewBox:`0 0 ${2*i} ${2*i}`,xmlns:"http://www.w3.org/2000/svg",style:{color:o}},v("circle",{fill:"none",stroke:"currentColor","stroke-width":r,"stroke-linecap":"round",cx:i,cy:i,r:t-r/2,"stroke-dasharray":4.91*t,"stroke-dashoffset":2.46*t})))))):v("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}});function Kf(e){return Array.isArray(e)?e:[e]}const Zs={STOP:"STOP"};function Am(e,t){const r=t(e);e.children!==void 0&&r!==Zs.STOP&&e.children.forEach(o=>Am(o,t))}function A6(e,t={}){const{preserveGroup:r=!1}=t,o=[],n=r?a=>{a.isLeaf||(o.push(a.key),i(a.children))}:a=>{a.isLeaf||(a.isGroup||o.push(a.key),i(a.children))};function i(a){a.forEach(n)}return i(e),o}function M6(e,t){const{isLeaf:r}=e;return r!==void 0?r:!t(e)}function B6(e){return e.children}function L6(e){return e.key}function H6(){return!1}function D6(e,t){const{isLeaf:r}=e;return!(r===!1&&!Array.isArray(t(e)))}function F6(e){return e.disabled===!0}function j6(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function es(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function ts(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function N6(e,t){const r=new Set(e);return t.forEach(o=>{r.has(o)||r.add(o)}),Array.from(r)}function W6(e,t){const r=new Set(e);return t.forEach(o=>{r.has(o)&&r.delete(o)}),Array.from(r)}function V6(e){return(e==null?void 0:e.type)==="group"}function FM(e){const t=new Map;return e.forEach((r,o)=>{t.set(r.key,o)}),r=>{var o;return(o=t.get(r))!==null&&o!==void 0?o:null}}class U6 extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function K6(e,t,r,o){return Ha(t.concat(e),r,o,!1)}function q6(e,t){const r=new Set;return e.forEach(o=>{const n=t.treeNodeMap.get(o);if(n!==void 0){let i=n.parent;for(;i!==null&&!(i.disabled||r.has(i.key));)r.add(i.key),i=i.parent}}),r}function G6(e,t,r,o){const n=Ha(t,r,o,!1),i=Ha(e,r,o,!0),a=q6(e,r),l=[];return n.forEach(s=>{(i.has(s)||a.has(s))&&l.push(s)}),l.forEach(s=>n.delete(s)),n}function rs(e,t){const{checkedKeys:r,keysToCheck:o,keysToUncheck:n,indeterminateKeys:i,cascade:a,leafOnly:l,checkStrategy:s,allowNotLoaded:d}=e;if(!a)return o!==void 0?{checkedKeys:N6(r,o),indeterminateKeys:Array.from(i)}:n!==void 0?{checkedKeys:W6(r,n),indeterminateKeys:Array.from(i)}:{checkedKeys:Array.from(r),indeterminateKeys:Array.from(i)};const{levelTreeNodeMap:c}=t;let u;n!==void 0?u=G6(n,r,t,d):o!==void 0?u=K6(o,r,t,d):u=Ha(r,t,d,!1);const f=s==="parent",p=s==="child"||l,h=u,g=new Set,b=Math.max.apply(null,Array.from(c.keys()));for(let m=b;m>=0;m-=1){const y=m===0,w=c.get(m);for(const x of w){if(x.isLeaf)continue;const{key:k,shallowLoaded:T}=x;if(p&&T&&x.children.forEach(_=>{!_.disabled&&!_.isLeaf&&_.shallowLoaded&&h.has(_.key)&&h.delete(_.key)}),x.disabled||!T)continue;let S=!0,$=!1,R=!0;for(const _ of x.children){const N=_.key;if(!_.disabled){if(R&&(R=!1),h.has(N))$=!0;else if(g.has(N)){$=!0,S=!1;break}else if(S=!1,$)break}}S&&!R?(f&&x.children.forEach(_=>{!_.disabled&&h.has(_.key)&&h.delete(_.key)}),h.add(k)):$&&g.add(k),y&&p&&h.has(k)&&h.delete(k)}}return{checkedKeys:Array.from(h),indeterminateKeys:Array.from(g)}}function Ha(e,t,r,o){const{treeNodeMap:n,getChildren:i}=t,a=new Set,l=new Set(e);return e.forEach(s=>{const d=n.get(s);d!==void 0&&Am(d,c=>{if(c.disabled)return Zs.STOP;const{key:u}=c;if(!a.has(u)&&(a.add(u),l.add(u),j6(c.rawNode,i))){if(o)return Zs.STOP;if(!r)throw new U6}})}),l}function Y6(e,{includeGroup:t=!1,includeSelf:r=!0},o){var n;const i=o.treeNodeMap;let a=e==null?null:(n=i.get(e))!==null&&n!==void 0?n:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(t||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),r||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(s=>s.key),l}function X6(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function Z6(e,t){const r=e.siblings,o=r.length,{index:n}=e;return t?r[(n+1)%o]:n===r.length-1?null:r[n+1]}function qf(e,t,{loop:r=!1,includeDisabled:o=!1}={}){const n=t==="prev"?J6:Z6,i={reverse:t==="prev"};let a=!1,l=null;function s(d){if(d!==null){if(d===e){if(!a)a=!0;else if(!e.disabled&&!e.isGroup){l=e;return}}else if((!d.disabled||o)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const c=rd(d,i);c!==null?l=c:s(n(d,r))}else{const c=n(d,!1);if(c!==null)s(c);else{const u=Q6(d);u!=null&&u.isGroup?s(n(u,r)):r&&s(n(d,!0))}}}}return s(e),l}function J6(e,t){const r=e.siblings,o=r.length,{index:n}=e;return t?r[(n-1+o)%o]:n===0?null:r[n-1]}function Q6(e){return e.parent}function rd(e,t={}){const{reverse:r=!1}=t,{children:o}=e;if(o){const{length:n}=o,i=r?n-1:0,a=r?-1:n,l=r?-1:1;for(let s=i;s!==a;s+=l){const d=o[s];if(!d.disabled&&!d.ignored)if(d.isGroup){const c=rd(d,t);if(c!==null)return c}else return d}}return null}const e4={getChild(){return this.ignored?null:rd(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return qf(this,"next",e)},getPrev(e={}){return qf(this,"prev",e)}};function t4(e,t){const r=t?new Set(t):void 0,o=[];function n(i){i.forEach(a=>{o.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||r===void 0||r.has(a.key))&&n(a.children)})}return n(e),o}function r4(e,t){const r=e.key;for(;t;){if(t.key===r)return!0;t=t.parent}return!1}function Mm(e,t,r,o,n,i=null,a=0){const l=[];return e.forEach((s,d)=>{var c;const u=Object.create(o);if(u.rawNode=s,u.siblings=l,u.level=a,u.index=d,u.isFirstChild=d===0,u.isLastChild=d+1===e.length,u.parent=i,!u.ignored){const f=n(s);Array.isArray(f)&&(u.children=Mm(f,t,r,o,n,u,a+1))}l.push(u),t.set(u.key,u),r.has(a)||r.set(a,[]),(c=r.get(a))===null||c===void 0||c.push(u)}),l}function Bm(e,t={}){var r;const o=new Map,n=new Map,{getDisabled:i=F6,getIgnored:a=H6,getIsGroup:l=V6,getKey:s=L6}=t,d=(r=t.getChildren)!==null&&r!==void 0?r:B6,c=t.ignoreEmptyChildren?x=>{const k=d(x);return Array.isArray(k)?k.length?k:null:k}:d,u=Object.assign({get key(){return s(this.rawNode)},get disabled(){return i(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return M6(this.rawNode,c)},get shallowLoaded(){return D6(this.rawNode,c)},get ignored(){return a(this.rawNode)},contains(x){return r4(this,x)}},e4),f=Mm(e,o,n,u,c);function p(x){if(x==null)return null;const k=o.get(x);return k&&!k.isGroup&&!k.ignored?k:null}function h(x){if(x==null)return null;const k=o.get(x);return k&&!k.ignored?k:null}function g(x,k){const T=h(x);return T?T.getPrev(k):null}function b(x,k){const T=h(x);return T?T.getNext(k):null}function m(x){const k=h(x);return k?k.getParent():null}function y(x){const k=h(x);return k?k.getChild():null}const w={treeNodes:f,treeNodeMap:o,levelTreeNodeMap:n,maxLevel:Math.max(...n.keys()),getChildren:c,getFlattenedNodes(x){return t4(f,x)},getNode:p,getPrev:g,getNext:b,getParent:m,getChild:y,getFirstAvailableNode(){return X6(f)},getPath(x,k={}){return Y6(x,k,w)},getCheckedKeys(x,k={}){const{cascade:T=!0,leafOnly:S=!1,checkStrategy:$="all",allowNotLoaded:R=!1}=k;return rs({checkedKeys:es(x),indeterminateKeys:ts(x),cascade:T,leafOnly:S,checkStrategy:$,allowNotLoaded:R},w)},check(x,k,T={}){const{cascade:S=!0,leafOnly:$=!1,checkStrategy:R="all",allowNotLoaded:_=!1}=T;return rs({checkedKeys:es(k),indeterminateKeys:ts(k),keysToCheck:x==null?[]:Kf(x),cascade:S,leafOnly:$,checkStrategy:R,allowNotLoaded:_},w)},uncheck(x,k,T={}){const{cascade:S=!0,leafOnly:$=!1,checkStrategy:R="all",allowNotLoaded:_=!1}=T;return rs({checkedKeys:es(k),indeterminateKeys:ts(k),keysToUncheck:x==null?[]:Kf(x),cascade:S,leafOnly:$,checkStrategy:R,allowNotLoaded:_},w)},getNonLeafKeys(x={}){return A6(f,x)}};return w}const ue={neutralBase:"#000",neutralInvertBase:"#fff",neutralTextBase:"#fff",neutralPopover:"rgb(72, 72, 78)",neutralCard:"rgb(24, 24, 28)",neutralModal:"rgb(44, 44, 50)",neutralBody:"rgb(16, 16, 20)",alpha1:"0.9",alpha2:"0.82",alpha3:"0.52",alpha4:"0.38",alpha5:"0.28",alphaClose:"0.52",alphaDisabled:"0.38",alphaDisabledInput:"0.06",alphaPending:"0.09",alphaTablePending:"0.06",alphaTableStriped:"0.05",alphaPressed:"0.05",alphaAvatar:"0.18",alphaRail:"0.2",alphaProgressRail:"0.12",alphaBorder:"0.24",alphaDivider:"0.09",alphaInput:"0.1",alphaAction:"0.06",alphaTab:"0.04",alphaScrollbar:"0.2",alphaScrollbarHover:"0.3",alphaCode:"0.12",alphaTag:"0.2",primaryHover:"#7fe7c4",primaryDefault:"#63e2b7",primaryActive:"#5acea7",primarySuppl:"rgb(42, 148, 125)",infoHover:"#8acbec",infoDefault:"#70c0e8",infoActive:"#66afd3",infoSuppl:"rgb(56, 137, 197)",errorHover:"#e98b8b",errorDefault:"#e88080",errorActive:"#e57272",errorSuppl:"rgb(208, 58, 82)",warningHover:"#f5d599",warningDefault:"#f2c97d",warningActive:"#e6c260",warningSuppl:"rgb(240, 138, 0)",successHover:"#7fe7c4",successDefault:"#63e2b7",successActive:"#5acea7",successSuppl:"rgb(42, 148, 125)"},o4=Dr(ue.neutralBase),Lm=Dr(ue.neutralInvertBase),n4="rgba("+Lm.slice(0,3).join(", ")+", ";function We(e){return n4+String(e)+")"}function i4(e){const t=Array.from(Lm);return t[3]=Number(e),xe(o4,t)}const a4=Object.assign(Object.assign({name:"common"},zr),{baseColor:ue.neutralBase,primaryColor:ue.primaryDefault,primaryColorHover:ue.primaryHover,primaryColorPressed:ue.primaryActive,primaryColorSuppl:ue.primarySuppl,infoColor:ue.infoDefault,infoColorHover:ue.infoHover,infoColorPressed:ue.infoActive,infoColorSuppl:ue.infoSuppl,successColor:ue.successDefault,successColorHover:ue.successHover,successColorPressed:ue.successActive,successColorSuppl:ue.successSuppl,warningColor:ue.warningDefault,warningColorHover:ue.warningHover,warningColorPressed:ue.warningActive,warningColorSuppl:ue.warningSuppl,errorColor:ue.errorDefault,errorColorHover:ue.errorHover,errorColorPressed:ue.errorActive,errorColorSuppl:ue.errorSuppl,textColorBase:ue.neutralTextBase,textColor1:We(ue.alpha1),textColor2:We(ue.alpha2),textColor3:We(ue.alpha3),textColorDisabled:We(ue.alpha4),placeholderColor:We(ue.alpha4),placeholderColorDisabled:We(ue.alpha5),iconColor:We(ue.alpha4),iconColorDisabled:We(ue.alpha5),iconColorHover:We(Number(ue.alpha4)*1.25),iconColorPressed:We(Number(ue.alpha4)*.8),opacity1:ue.alpha1,opacity2:ue.alpha2,opacity3:ue.alpha3,opacity4:ue.alpha4,opacity5:ue.alpha5,dividerColor:We(ue.alphaDivider),borderColor:We(ue.alphaBorder),closeIconColorHover:We(Number(ue.alphaClose)),closeIconColor:We(Number(ue.alphaClose)),closeIconColorPressed:We(Number(ue.alphaClose)),closeColorHover:"rgba(255, 255, 255, .12)",closeColorPressed:"rgba(255, 255, 255, .08)",clearColor:We(ue.alpha4),clearColorHover:vt(We(ue.alpha4),{alpha:1.25}),clearColorPressed:vt(We(ue.alpha4),{alpha:.8}),scrollbarColor:We(ue.alphaScrollbar),scrollbarColorHover:We(ue.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:We(ue.alphaProgressRail),railColor:We(ue.alphaRail),popoverColor:ue.neutralPopover,tableColor:ue.neutralCard,cardColor:ue.neutralCard,modalColor:ue.neutralModal,bodyColor:ue.neutralBody,tagColor:i4(ue.alphaTag),avatarColor:We(ue.alphaAvatar),invertedColor:ue.neutralBase,inputColor:We(ue.alphaInput),codeColor:We(ue.alphaCode),tabColor:We(ue.alphaTab),actionColor:We(ue.alphaAction),tableHeaderColor:We(ue.alphaAction),hoverColor:We(ue.alphaPending),tableColorHover:We(ue.alphaTablePending),tableColorStriped:We(ue.alphaTableStriped),pressedColor:We(ue.alphaPressed),opacityDisabled:ue.alphaDisabled,inputColorDisabled:We(ue.alphaDisabledInput),buttonColor2:"rgba(255, 255, 255, .08)",buttonColor2Hover:"rgba(255, 255, 255, .12)",buttonColor2Pressed:"rgba(255, 255, 255, .08)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"});var le=a4;const ye={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaDisabledInput:"0.02",alphaPending:"0.05",alphaTablePending:"0.02",alphaPressed:"0.07",alphaAvatar:"0.2",alphaRail:"0.14",alphaProgressRail:".08",alphaBorder:"0.12",alphaDivider:"0.06",alphaInput:"0",alphaAction:"0.02",alphaTab:"0.04",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",alphaCode:"0.05",alphaTag:"0.02",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},l4=Dr(ye.neutralBase),Hm=Dr(ye.neutralInvertBase),s4="rgba("+Hm.slice(0,3).join(", ")+", ";function Gf(e){return s4+String(e)+")"}function Ot(e){const t=Array.from(Hm);return t[3]=Number(e),xe(l4,t)}const c4=Object.assign(Object.assign({name:"common"},zr),{baseColor:ye.neutralBase,primaryColor:ye.primaryDefault,primaryColorHover:ye.primaryHover,primaryColorPressed:ye.primaryActive,primaryColorSuppl:ye.primarySuppl,infoColor:ye.infoDefault,infoColorHover:ye.infoHover,infoColorPressed:ye.infoActive,infoColorSuppl:ye.infoSuppl,successColor:ye.successDefault,successColorHover:ye.successHover,successColorPressed:ye.successActive,successColorSuppl:ye.successSuppl,warningColor:ye.warningDefault,warningColorHover:ye.warningHover,warningColorPressed:ye.warningActive,warningColorSuppl:ye.warningSuppl,errorColor:ye.errorDefault,errorColorHover:ye.errorHover,errorColorPressed:ye.errorActive,errorColorSuppl:ye.errorSuppl,textColorBase:ye.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:Ot(ye.alpha4),placeholderColor:Ot(ye.alpha4),placeholderColorDisabled:Ot(ye.alpha5),iconColor:Ot(ye.alpha4),iconColorHover:vt(Ot(ye.alpha4),{lightness:.75}),iconColorPressed:vt(Ot(ye.alpha4),{lightness:.9}),iconColorDisabled:Ot(ye.alpha5),opacity1:ye.alpha1,opacity2:ye.alpha2,opacity3:ye.alpha3,opacity4:ye.alpha4,opacity5:ye.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:Ot(Number(ye.alphaClose)),closeIconColorHover:Ot(Number(ye.alphaClose)),closeIconColorPressed:Ot(Number(ye.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:Ot(ye.alpha4),clearColorHover:vt(Ot(ye.alpha4),{lightness:.75}),clearColorPressed:vt(Ot(ye.alpha4),{lightness:.9}),scrollbarColor:Gf(ye.alphaScrollbar),scrollbarColorHover:Gf(ye.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:Ot(ye.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:ye.neutralPopover,tableColor:ye.neutralCard,cardColor:ye.neutralCard,modalColor:ye.neutralModal,bodyColor:ye.neutralBody,tagColor:"#eee",avatarColor:Ot(ye.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:Ot(ye.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:ye.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"});var je=c4,d4={iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};const Dm=e=>{const{textColorDisabled:t,iconColor:r,textColor2:o,fontSizeSmall:n,fontSizeMedium:i,fontSizeLarge:a,fontSizeHuge:l}=e;return Object.assign(Object.assign({},d4),{fontSizeSmall:n,fontSizeMedium:i,fontSizeLarge:a,fontSizeHuge:l,textColor:t,iconColor:r,extraTextColor:o})},u4={name:"Empty",common:je,self:Dm};var Fm=u4;const f4={name:"Empty",common:le,self:Dm};var Vo=f4;const jm=e=>{const{scrollbarColor:t,scrollbarColorHover:r}=e;return{color:t,colorHover:r}},h4={name:"Scrollbar",common:je,self:jm};var od=h4;const p4={name:"Scrollbar",common:le,self:jm};var Ut=p4;const{cubicBezierEaseInOut:Yf}=zr;function Ai({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:r="0.2s",enterCubicBezier:o=Yf,leaveCubicBezier:n=Yf}={}){return[O(`&.${e}-transition-enter-active`,{transition:`all ${t} ${o}!important`}),O(`&.${e}-transition-leave-active`,{transition:`all ${r} ${n}!important`}),O(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),O(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}var v4=M("scrollbar",` - overflow: hidden; - position: relative; - z-index: auto; - height: 100%; - width: 100%; -`,[O(">",[M("scrollbar-container",` - width: 100%; - overflow: scroll; - height: 100%; - max-height: inherit; - scrollbar-width: none; - `,[O("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",` - width: 0; - height: 0; - display: none; - `),O(">",[M("scrollbar-content",` - box-sizing: border-box; - min-width: 100%; - `)])])]),O(">, +",[M("scrollbar-rail",` - position: absolute; - pointer-events: none; - user-select: none; - -webkit-user-select: none; - `,[K("horizontal",` - left: 2px; - right: 2px; - bottom: 4px; - height: var(--n-scrollbar-height); - `,[O(">",[D("scrollbar",` - height: var(--n-scrollbar-height); - border-radius: var(--n-scrollbar-border-radius); - right: 0; - `)])]),K("vertical",` - right: 4px; - top: 2px; - bottom: 2px; - width: var(--n-scrollbar-width); - `,[O(">",[D("scrollbar",` - width: var(--n-scrollbar-width); - border-radius: var(--n-scrollbar-border-radius); - bottom: 0; - `)])]),K("disabled",[O(">",[D("scrollbar",{pointerEvents:"none"})])]),O(">",[D("scrollbar",` - position: absolute; - cursor: pointer; - pointer-events: all; - background-color: var(--n-scrollbar-color); - transition: background-color .2s var(--n-scrollbar-bezier); - `,[Ai(),O("&:hover",{backgroundColor:"var(--n-scrollbar-color-hover)"})])])])])]);const m4=Object.assign(Object.assign({},Ee.props),{size:{type:Number,default:5},duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:String,contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean}),Nm=ae({name:"Scrollbar",props:m4,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:o}=st(e),n=Kr("Scrollbar",o,t),i=V(null),a=V(null),l=V(null),s=V(null),d=V(null),c=V(null),u=V(null),f=V(null),p=V(null),h=V(null),g=V(null),b=V(0),m=V(0),y=V(!1),w=V(!1);let x=!1,k=!1,T,S,$=0,R=0,_=0,N=0;const E=kw(),F=H(()=>{const{value:re}=f,{value:ve}=c,{value:Pe}=h;return re===null||ve===null||Pe===null?0:Math.min(re,Pe*re/ve+e.size*1.5)}),j=H(()=>`${F.value}px`),Q=H(()=>{const{value:re}=p,{value:ve}=u,{value:Pe}=g;return re===null||ve===null||Pe===null?0:Pe*re/ve+e.size*1.5}),A=H(()=>`${Q.value}px`),X=H(()=>{const{value:re}=f,{value:ve}=b,{value:Pe}=c,{value:Ye}=h;if(re===null||Pe===null||Ye===null)return 0;{const ct=Pe-re;return ct?ve/ct*(Ye-F.value):0}}),ne=H(()=>`${X.value}px`),pe=H(()=>{const{value:re}=p,{value:ve}=m,{value:Pe}=u,{value:Ye}=g;if(re===null||Pe===null||Ye===null)return 0;{const ct=Pe-re;return ct?ve/ct*(Ye-Q.value):0}}),Ce=H(()=>`${pe.value}px`),$e=H(()=>{const{value:re}=f,{value:ve}=c;return re!==null&&ve!==null&&ve>re}),_e=H(()=>{const{value:re}=p,{value:ve}=u;return re!==null&&ve!==null&&ve>re}),Ge=H(()=>{const{trigger:re}=e;return re==="none"||y.value}),Le=H(()=>{const{trigger:re}=e;return re==="none"||w.value}),U=H(()=>{const{container:re}=e;return re?re():a.value}),ee=H(()=>{const{content:re}=e;return re?re():l.value}),G=wS(()=>{e.container||Re({top:b.value,left:m.value})}),se=()=>{G.isDeactivated||he()},ce=re=>{if(G.isDeactivated)return;const{onResize:ve}=e;ve&&ve(re),he()},Re=(re,ve)=>{if(!e.scrollable)return;if(typeof re=="number"){C(ve!=null?ve:0,re,0,!1,"auto");return}const{left:Pe,top:Ye,index:ct,elSize:wt,position:Lt,behavior:tt,el:jt,debounce:Ir=!0}=re;(Pe!==void 0||Ye!==void 0)&&C(Pe!=null?Pe:0,Ye!=null?Ye:0,0,!1,tt),jt!==void 0?C(0,jt.offsetTop,jt.offsetHeight,Ir,tt):ct!==void 0&&wt!==void 0?C(0,ct*wt,wt,Ir,tt):Lt==="bottom"?C(0,Number.MAX_SAFE_INTEGER,0,!1,tt):Lt==="top"&&C(0,0,0,!1,tt)},ge=(re,ve)=>{if(!e.scrollable)return;const{value:Pe}=U;!Pe||(typeof re=="object"?Pe.scrollBy(re):Pe.scrollBy(re,ve||0))};function C(re,ve,Pe,Ye,ct){const{value:wt}=U;if(!!wt){if(Ye){const{scrollTop:Lt,offsetHeight:tt}=wt;if(ve>Lt){ve+Pe<=Lt+tt||wt.scrollTo({left:re,top:ve+Pe-tt,behavior:ct});return}}wt.scrollTo({left:re,top:ve,behavior:ct})}}function P(){Y(),q(),he()}function I(){W()}function W(){z(),L()}function z(){S!==void 0&&window.clearTimeout(S),S=window.setTimeout(()=>{w.value=!1},e.duration)}function L(){T!==void 0&&window.clearTimeout(T),T=window.setTimeout(()=>{y.value=!1},e.duration)}function Y(){T!==void 0&&window.clearTimeout(T),y.value=!0}function q(){S!==void 0&&window.clearTimeout(S),w.value=!0}function J(re){const{onScroll:ve}=e;ve&&ve(re),Z()}function Z(){const{value:re}=U;re&&(b.value=re.scrollTop,m.value=re.scrollLeft*(n!=null&&n.value?-1:1))}function fe(){const{value:re}=ee;re&&(c.value=re.offsetHeight,u.value=re.offsetWidth);const{value:ve}=U;ve&&(f.value=ve.offsetHeight,p.value=ve.offsetWidth);const{value:Pe}=d,{value:Ye}=s;Pe&&(g.value=Pe.offsetWidth),Ye&&(h.value=Ye.offsetHeight)}function de(){const{value:re}=U;re&&(b.value=re.scrollTop,m.value=re.scrollLeft*(n!=null&&n.value?-1:1),f.value=re.offsetHeight,p.value=re.offsetWidth,c.value=re.scrollHeight,u.value=re.scrollWidth);const{value:ve}=d,{value:Pe}=s;ve&&(g.value=ve.offsetWidth),Pe&&(h.value=Pe.offsetHeight)}function he(){!e.scrollable||(e.useUnifiedContainer?de():(fe(),Z()))}function we(re){var ve;return!(!((ve=i.value)===null||ve===void 0)&&ve.contains(_i(re)))}function Ie(re){re.preventDefault(),re.stopPropagation(),k=!0,Qe("mousemove",window,Ne,!0),Qe("mouseup",window,Fe,!0),R=m.value,_=n!=null&&n.value?window.innerWidth-re.clientX:re.clientX}function Ne(re){if(!k)return;T!==void 0&&window.clearTimeout(T),S!==void 0&&window.clearTimeout(S);const{value:ve}=p,{value:Pe}=u,{value:Ye}=Q;if(ve===null||Pe===null)return;const wt=(n!=null&&n.value?window.innerWidth-re.clientX-_:re.clientX-_)*(Pe-ve)/(ve-Ye),Lt=Pe-ve;let tt=R+wt;tt=Math.min(Lt,tt),tt=Math.max(tt,0);const{value:jt}=U;if(jt){jt.scrollLeft=tt*(n!=null&&n.value?-1:1);const{internalOnUpdateScrollLeft:Ir}=e;Ir&&Ir(tt)}}function Fe(re){re.preventDefault(),re.stopPropagation(),Ue("mousemove",window,Ne,!0),Ue("mouseup",window,Fe,!0),k=!1,he(),we(re)&&W()}function et(re){re.preventDefault(),re.stopPropagation(),x=!0,Qe("mousemove",window,xt,!0),Qe("mouseup",window,Ft,!0),$=b.value,N=re.clientY}function xt(re){if(!x)return;T!==void 0&&window.clearTimeout(T),S!==void 0&&window.clearTimeout(S);const{value:ve}=f,{value:Pe}=c,{value:Ye}=F;if(ve===null||Pe===null)return;const wt=(re.clientY-N)*(Pe-ve)/(ve-Ye),Lt=Pe-ve;let tt=$+wt;tt=Math.min(Lt,tt),tt=Math.max(tt,0);const{value:jt}=U;jt&&(jt.scrollTop=tt)}function Ft(re){re.preventDefault(),re.stopPropagation(),Ue("mousemove",window,xt,!0),Ue("mouseup",window,Ft,!0),x=!1,he(),we(re)&&W()}Wt(()=>{const{value:re}=_e,{value:ve}=$e,{value:Pe}=t,{value:Ye}=d,{value:ct}=s;Ye&&(re?Ye.classList.remove(`${Pe}-scrollbar-rail--disabled`):Ye.classList.add(`${Pe}-scrollbar-rail--disabled`)),ct&&(ve?ct.classList.remove(`${Pe}-scrollbar-rail--disabled`):ct.classList.add(`${Pe}-scrollbar-rail--disabled`))}),gt(()=>{e.container||he()}),ht(()=>{T!==void 0&&window.clearTimeout(T),S!==void 0&&window.clearTimeout(S),Ue("mousemove",window,xt,!0),Ue("mouseup",window,Ft,!0)});const qr=Ee("Scrollbar","-scrollbar",v4,od,e,t),er=H(()=>{const{common:{cubicBezierEaseInOut:re,scrollbarBorderRadius:ve,scrollbarHeight:Pe,scrollbarWidth:Ye},self:{color:ct,colorHover:wt}}=qr.value;return{"--n-scrollbar-bezier":re,"--n-scrollbar-color":ct,"--n-scrollbar-color-hover":wt,"--n-scrollbar-border-radius":ve,"--n-scrollbar-width":Ye,"--n-scrollbar-height":Pe}}),Gt=r?Pt("scrollbar",void 0,er,e):void 0;return Object.assign(Object.assign({},{scrollTo:Re,scrollBy:ge,sync:he,syncUnifiedContainer:de,handleMouseEnterWrapper:P,handleMouseLeaveWrapper:I}),{mergedClsPrefix:t,rtlEnabled:n,containerScrollTop:b,wrapperRef:i,containerRef:a,contentRef:l,yRailRef:s,xRailRef:d,needYBar:$e,needXBar:_e,yBarSizePx:j,xBarSizePx:A,yBarTopPx:ne,xBarLeftPx:Ce,isShowXBar:Ge,isShowYBar:Le,isIos:E,handleScroll:J,handleContentResize:se,handleContainerResize:ce,handleYScrollMouseDown:et,handleXScrollMouseDown:Ie,cssVars:r?void 0:er,themeClass:Gt==null?void 0:Gt.themeClass,onRender:Gt==null?void 0:Gt.onRender})},render(){var e;const{$slots:t,mergedClsPrefix:r,triggerDisplayManually:o,rtlEnabled:n,internalHoistYRail:i}=this;if(!this.scrollable)return(e=t.default)===null||e===void 0?void 0:e.call(t);const a=this.trigger==="none",l=()=>v("div",{ref:"yRailRef",class:[`${r}-scrollbar-rail`,`${r}-scrollbar-rail--vertical`],"data-scrollbar-rail":!0,style:this.verticalRailStyle,"aria-hidden":!0},v(a?Mu:Bt,a?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?v("div",{class:`${r}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),s=()=>{var c,u;return(c=this.onRender)===null||c===void 0||c.call(this),v("div",so(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${r}-scrollbar`,this.themeClass,n&&`${r}-scrollbar--rtl`],style:this.cssVars,onMouseenter:o?void 0:this.handleMouseEnterWrapper,onMouseleave:o?void 0:this.handleMouseLeaveWrapper}),[this.container?(u=t.default)===null||u===void 0?void 0:u.call(t):v("div",{role:"none",ref:"containerRef",class:[`${r}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},v(In,{onResize:this.handleContentResize},{default:()=>v("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${r}-scrollbar-content`,this.contentClass]},t)})),i?null:l(),this.xScrollable&&v("div",{ref:"xRailRef",class:[`${r}-scrollbar-rail`,`${r}-scrollbar-rail--horizontal`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},v(a?Mu:Bt,a?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?v("div",{class:`${r}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:n?this.xBarLeftPx:void 0,left:n?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},d=this.container?s():v(In,{onResize:this.handleContainerResize},{default:s});return i?v(Je,null,d,l()):d}});var Wm=Nm;const Vm=Nm;var g4={height:"calc(var(--n-option-height) * 7.6)",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};const Um=e=>{const{borderRadius:t,popoverColor:r,textColor3:o,dividerColor:n,textColor2:i,primaryColorPressed:a,textColorDisabled:l,primaryColor:s,opacityDisabled:d,hoverColor:c,fontSizeSmall:u,fontSizeMedium:f,fontSizeLarge:p,fontSizeHuge:h,heightSmall:g,heightMedium:b,heightLarge:m,heightHuge:y}=e;return Object.assign(Object.assign({},g4),{optionFontSizeSmall:u,optionFontSizeMedium:f,optionFontSizeLarge:p,optionFontSizeHuge:h,optionHeightSmall:g,optionHeightMedium:b,optionHeightLarge:m,optionHeightHuge:y,borderRadius:t,color:r,groupHeaderTextColor:o,actionDividerColor:n,optionTextColor:i,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:s,optionOpacityDisabled:d,optionCheckColor:s,optionColorPending:c,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:c,actionTextColor:i,loadingColor:s})},b4={name:"InternalSelectMenu",common:je,peers:{Scrollbar:od,Empty:Fm},self:Um};var Km=b4;const x4={name:"InternalSelectMenu",common:le,peers:{Scrollbar:Ut,Empty:Vo},self:Um};var Ni=x4;const{cubicBezierEaseIn:Xf,cubicBezierEaseOut:Zf}=zr;function Mi({transformOrigin:e="inherit",duration:t=".2s",enterScale:r=".9",originalTransform:o="",originalTransition:n=""}={}){return[O("&.fade-in-scale-up-transition-leave-active",{transformOrigin:e,transition:`opacity ${t} ${Xf}, transform ${t} ${Xf} ${n&&","+n}`}),O("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${t} ${Zf}, transform ${t} ${Zf} ${n&&","+n}`}),O("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${o} scale(${r})`}),O("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${o} scale(1)`})]}var C4=M("base-wave",` - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - border-radius: inherit; -`),qm=ae({name:"BaseWave",props:{clsPrefix:{type:String,required:!0}},setup(e){co("-base-wave",C4,Te(e,"clsPrefix"));const t=V(null),r=V(!1);let o=null;return ht(()=>{o!==null&&window.clearTimeout(o)}),{active:r,selfRef:t,play(){o!==null&&(window.clearTimeout(o),r.value=!1,o=null),Zt(()=>{var n;(n=t.value)===null||n===void 0||n.offsetHeight,r.value=!0,o=window.setTimeout(()=>{r.value=!1,o=null},1e3)})}}},render(){const{clsPrefix:e}=this;return v("div",{ref:"selfRef","aria-hidden":!0,class:[`${e}-base-wave`,this.active&&`${e}-base-wave--active`]})}}),y4={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};const Gm=e=>{const{boxShadow2:t,popoverColor:r,textColor2:o,borderRadius:n,fontSize:i,dividerColor:a}=e;return Object.assign(Object.assign({},y4),{fontSize:i,borderRadius:n,color:r,dividerColor:a,textColor:o,boxShadow:t})},w4={name:"Popover",common:je,self:Gm};var jn=w4;const S4={name:"Popover",common:le,self:Gm};var Uo=S4;const os={top:"bottom",bottom:"top",left:"right",right:"left"},Ct="var(--n-arrow-height) * 1.414";var $4=O([M("popover",` - transition: - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier), - color .3s var(--n-bezier); - position: relative; - font-size: var(--n-font-size); - color: var(--n-text-color); - box-shadow: var(--n-box-shadow); - word-break: break-word; - `,[O(">",[M("scrollbar",` - height: inherit; - max-height: inherit; - `)]),ut("raw",` - background-color: var(--n-color); - border-radius: var(--n-border-radius); - `,[ut("scrollable",[ut("show-header-or-footer","padding: var(--n-padding);")])]),D("header",` - padding: var(--n-padding); - border-bottom: 1px solid var(--n-divider-color); - transition: border-color .3s var(--n-bezier); - `),D("footer",` - padding: var(--n-padding); - border-top: 1px solid var(--n-divider-color); - transition: border-color .3s var(--n-bezier); - `),K("scrollable, show-header-or-footer",[D("content",` - padding: var(--n-padding); - `)])]),M("popover-shared",` - transform-origin: inherit; - `,[M("popover-arrow-wrapper",` - position: absolute; - overflow: hidden; - pointer-events: none; - `,[M("popover-arrow",` - transition: background-color .3s var(--n-bezier); - position: absolute; - display: block; - width: calc(${Ct}); - height: calc(${Ct}); - box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12); - transform: rotate(45deg); - background-color: var(--n-color); - pointer-events: all; - `)]),O("&.popover-transition-enter-from, &.popover-transition-leave-to",` - opacity: 0; - transform: scale(.85); - `),O("&.popover-transition-enter-to, &.popover-transition-leave-from",` - transform: scale(1); - opacity: 1; - `),O("&.popover-transition-enter-active",` - transition: - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier), - color .3s var(--n-bezier), - opacity .15s var(--n-bezier-ease-out), - transform .15s var(--n-bezier-ease-out); - `),O("&.popover-transition-leave-active",` - transition: - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier), - color .3s var(--n-bezier), - opacity .15s var(--n-bezier-ease-in), - transform .15s var(--n-bezier-ease-in); - `)]),or("top-start",` - top: calc(${Ct} / -2); - left: calc(${Ar("top-start")} - var(--v-offset-left)); - `),or("top",` - top: calc(${Ct} / -2); - transform: translateX(calc(${Ct} / -2)) rotate(45deg); - left: 50%; - `),or("top-end",` - top: calc(${Ct} / -2); - right: calc(${Ar("top-end")} + var(--v-offset-left)); - `),or("bottom-start",` - bottom: calc(${Ct} / -2); - left: calc(${Ar("bottom-start")} - var(--v-offset-left)); - `),or("bottom",` - bottom: calc(${Ct} / -2); - transform: translateX(calc(${Ct} / -2)) rotate(45deg); - left: 50%; - `),or("bottom-end",` - bottom: calc(${Ct} / -2); - right: calc(${Ar("bottom-end")} + var(--v-offset-left)); - `),or("left-start",` - left: calc(${Ct} / -2); - top: calc(${Ar("left-start")} - var(--v-offset-top)); - `),or("left",` - left: calc(${Ct} / -2); - transform: translateY(calc(${Ct} / -2)) rotate(45deg); - top: 50%; - `),or("left-end",` - left: calc(${Ct} / -2); - bottom: calc(${Ar("left-end")} + var(--v-offset-top)); - `),or("right-start",` - right: calc(${Ct} / -2); - top: calc(${Ar("right-start")} - var(--v-offset-top)); - `),or("right",` - right: calc(${Ct} / -2); - transform: translateY(calc(${Ct} / -2)) rotate(45deg); - top: 50%; - `),or("right-end",` - right: calc(${Ct} / -2); - bottom: calc(${Ar("right-end")} + var(--v-offset-top)); - `),...x3({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const r=["right","left"].includes(t),o=r?"width":"height";return e.map(n=>{const i=n.split("-")[1]==="end",l=`calc((${`var(--v-target-${o}, 0px)`} - ${Ct}) / 2)`,s=Ar(n);return O(`[v-placement="${n}"] >`,[M("popover-shared",[K("center-arrow",[M("popover-arrow",`${t}: calc(max(${l}, ${s}) ${i?"+":"-"} var(--v-offset-${r?"left":"top"}));`)])])])})})]);function Ar(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function or(e,t){const r=e.split("-")[0],o=["top","bottom"].includes(r)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return O(`[v-placement="${e}"] >`,[M("popover-shared",` - margin-${os[r]}: var(--n-space); - `,[K("show-arrow",` - margin-${os[r]}: var(--n-space-arrow); - `),K("overlap",` - margin: 0; - `),hw("popover-arrow-wrapper",` - right: 0; - left: 0; - top: 0; - bottom: 0; - ${r}: 100%; - ${os[r]}: auto; - ${o} - `,[M("popover-arrow",t)])])])}const Ym=Object.assign(Object.assign({},Ee.props),{to:Rn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number}),Xm=({arrowStyle:e,clsPrefix:t})=>v("div",{key:"__popover-arrow__",class:`${t}-popover-arrow-wrapper`},v("div",{class:`${t}-popover-arrow`,style:e}));var _4=ae({name:"PopoverBody",inheritAttrs:!1,props:Ym,setup(e,{slots:t,attrs:r}){const{namespaceRef:o,mergedClsPrefixRef:n,inlineThemeDisabled:i}=st(e),a=Ee("Popover","-popover",$4,jn,e,n),l=V(null),s=me("NPopover"),d=V(null),c=V(e.show),u=V(!1);Wt(()=>{const{show:S}=e;S&&!pw()&&!e.internalDeactivateImmediately&&(u.value=!0)});const f=H(()=>{const{trigger:S,onClickoutside:$}=e,R=[],{positionManuallyRef:{value:_}}=s;return _||(S==="click"&&!$&&R.push([Ds,x,void 0,{capture:!0}]),S==="hover"&&R.push([Aw,w])),$&&R.push([Ds,x,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&u.value)&&R.push([Si,e.show]),R}),p=H(()=>{const S=e.width==="trigger"?void 0:ar(e.width),$=[];S&&$.push({width:S});const{maxWidth:R,minWidth:_}=e;return R&&$.push({maxWidth:ar(R)}),_&&$.push({maxWidth:ar(_)}),i||$.push(h.value),$}),h=H(()=>{const{common:{cubicBezierEaseInOut:S,cubicBezierEaseIn:$,cubicBezierEaseOut:R},self:{space:_,spaceArrow:N,padding:E,fontSize:F,textColor:j,dividerColor:Q,color:A,boxShadow:X,borderRadius:ne,arrowHeight:pe,arrowOffset:Ce,arrowOffsetVertical:$e}}=a.value;return{"--n-box-shadow":X,"--n-bezier":S,"--n-bezier-ease-in":$,"--n-bezier-ease-out":R,"--n-font-size":F,"--n-text-color":j,"--n-color":A,"--n-divider-color":Q,"--n-border-radius":ne,"--n-arrow-height":pe,"--n-arrow-offset":Ce,"--n-arrow-offset-vertical":$e,"--n-padding":E,"--n-space":_,"--n-space-arrow":N}}),g=i?Pt("popover",void 0,h,e):void 0;s.setBodyInstance({syncPosition:b}),ht(()=>{s.setBodyInstance(null)}),De(Te(e,"show"),S=>{e.animated||(S?c.value=!0:c.value=!1)});function b(){var S;(S=l.value)===null||S===void 0||S.syncPosition()}function m(S){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&s.handleMouseEnter(S)}function y(S){e.trigger==="hover"&&e.keepAliveOnHover&&s.handleMouseLeave(S)}function w(S){e.trigger==="hover"&&!k().contains(_i(S))&&s.handleMouseMoveOutside(S)}function x(S){(e.trigger==="click"&&!k().contains(_i(S))||e.onClickoutside)&&s.handleClickOutside(S)}function k(){return s.getTriggerElement()}Be(Di,d),Be(sl,null),Be(ll,null);function T(){if(g==null||g.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&u.value))return null;let $;const R=s.internalRenderBodyRef.value,{value:_}=n;if(R)$=R([`${_}-popover-shared`,g==null?void 0:g.themeClass.value,e.overlap&&`${_}-popover-shared--overlap`,e.showArrow&&`${_}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${_}-popover-shared--center-arrow`],d,p.value,m,y);else{const{value:N}=s.extraClassRef,{internalTrapFocus:E}=e,F=!Ia(t.header)||!Ia(t.footer),j=()=>{var Q;const A=F?v(Je,null,dt(t.header,pe=>pe?v("div",{class:`${_}-popover__header`,style:e.headerStyle},pe):null),dt(t.default,pe=>pe?v("div",{class:`${_}-popover__content`,style:e.contentStyle},t):null),dt(t.footer,pe=>pe?v("div",{class:`${_}-popover__footer`,style:e.footerStyle},pe):null)):e.scrollable?(Q=t.default)===null||Q===void 0?void 0:Q.call(t):v("div",{class:`${_}-popover__content`,style:e.contentStyle},t),X=e.scrollable?v(Vm,{contentClass:F?void 0:`${_}-popover__content`,contentStyle:F?void 0:e.contentStyle},{default:()=>A}):A,ne=e.showArrow?Xm({arrowStyle:e.arrowStyle,clsPrefix:_}):null;return[X,ne]};$=v("div",so({class:[`${_}-popover`,`${_}-popover-shared`,g==null?void 0:g.themeClass.value,N.map(Q=>`${_}-${Q}`),{[`${_}-popover--scrollable`]:e.scrollable,[`${_}-popover--show-header-or-footer`]:F,[`${_}-popover--raw`]:e.raw,[`${_}-popover-shared--overlap`]:e.overlap,[`${_}-popover-shared--show-arrow`]:e.showArrow,[`${_}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:d,style:p.value,onKeydown:s.handleKeydown,onMouseenter:m,onMouseleave:y},r),E?v(Fv,{active:e.show,autoFocus:!0},{default:j}):j())}return Tr($,f.value)}return{displayed:u,namespace:o,isMounted:s.isMountedRef,zIndex:s.zIndexRef,followerRef:l,adjustedTo:Rn(e),followerEnabled:c,renderContentNode:T}},render(){return v(zv,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===Rn.tdkey},{default:()=>this.animated?v(Bt,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});const P4=Object.keys(Ym),k4={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function T4(e,t,r){k4[t].forEach(o=>{e.props?e.props=Object.assign({},e.props):e.props={};const n=e.props[o],i=r[o];n?e.props[o]=(...a)=>{n(...a),i(...a)}:e.props[o]=i})}const z4=mr("").type,bl={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:Rn.propTo,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},E4=Object.assign(Object.assign(Object.assign({},Ee.props),bl),{internalOnAfterLeave:Function,internalRenderBody:Function});var Zm=ae({name:"Popover",inheritAttrs:!1,props:E4,__popover__:!0,setup(e){const t=Hi(),r=V(null),o=H(()=>e.show),n=V(e.defaultShow),i=En(o,n),a=mt(()=>e.disabled?!1:i.value),l=()=>{if(e.disabled)return!0;const{getDisabled:j}=e;return!!(j!=null&&j())},s=()=>l()?!1:i.value,d=Ti(e,["arrow","showArrow"]),c=H(()=>e.overlap?!1:d.value);let u=null;const f=V(null),p=V(null),h=mt(()=>e.x!==void 0&&e.y!==void 0);function g(j){const{"onUpdate:show":Q,onUpdateShow:A,onShow:X,onHide:ne}=e;n.value=j,Q&&Ae(Q,j),A&&Ae(A,j),j&&X&&Ae(X,!0),j&&ne&&Ae(ne,!1)}function b(){u&&u.syncPosition()}function m(){const{value:j}=f;j&&(window.clearTimeout(j),f.value=null)}function y(){const{value:j}=p;j&&(window.clearTimeout(j),p.value=null)}function w(){const j=l();if(e.trigger==="focus"&&!j){if(s())return;g(!0)}}function x(){const j=l();if(e.trigger==="focus"&&!j){if(!s())return;g(!1)}}function k(){const j=l();if(e.trigger==="hover"&&!j){if(y(),f.value!==null||s())return;const Q=()=>{g(!0),f.value=null},{delay:A}=e;A===0?Q():f.value=window.setTimeout(Q,A)}}function T(){const j=l();if(e.trigger==="hover"&&!j){if(m(),p.value!==null||!s())return;const Q=()=>{g(!1),p.value=null},{duration:A}=e;A===0?Q():p.value=window.setTimeout(Q,A)}}function S(){T()}function $(j){var Q;!s()||(e.trigger==="click"&&(m(),y(),g(!1)),(Q=e.onClickoutside)===null||Q===void 0||Q.call(e,j))}function R(){if(e.trigger==="click"&&!l()){m(),y();const j=!s();g(j)}}function _(j){!e.internalTrapFocus||j.key==="Escape"&&(m(),y(),g(!1))}function N(j){n.value=j}function E(){var j;return(j=r.value)===null||j===void 0?void 0:j.targetRef}function F(j){u=j}return Be("NPopover",{getTriggerElement:E,handleKeydown:_,handleMouseEnter:k,handleMouseLeave:T,handleClickOutside:$,handleMouseMoveOutside:S,setBodyInstance:F,positionManuallyRef:h,isMountedRef:t,zIndexRef:Te(e,"zIndex"),extraClassRef:Te(e,"internalExtraClass"),internalRenderBodyRef:Te(e,"internalRenderBody")}),Wt(()=>{i.value&&l()&&g(!1)}),{binderInstRef:r,positionManually:h,mergedShowConsideringDisabledProp:a,uncontrolledShow:n,mergedShowArrow:c,getMergedShow:s,setShow:N,handleClick:R,handleMouseEnter:k,handleMouseLeave:T,handleFocus:w,handleBlur:x,syncPosition:b}},render(){var e;const{positionManually:t,$slots:r}=this;let o,n=!1;if(!t&&(r.activator?o=Ms(r,"activator"):o=Ms(r,"trigger"),o)){o=lr(o),o=o.type===z4?v("span",[o]):o;const i={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=o.type)===null||e===void 0)&&e.__popover__)n=!0,o.props||(o.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),o.props.internalSyncTargetWithParent=!0,o.props.internalInheritedEventHandlers?o.props.internalInheritedEventHandlers=[i,...o.props.internalInheritedEventHandlers]:o.props.internalInheritedEventHandlers=[i];else{const{internalInheritedEventHandlers:a}=this,l=[i,...a],s={onBlur:d=>{l.forEach(c=>{c.onBlur(d)})},onFocus:d=>{l.forEach(c=>{c.onFocus(d)})},onClick:d=>{l.forEach(c=>{c.onClick(d)})},onMouseenter:d=>{l.forEach(c=>{c.onMouseenter(d)})},onMouseleave:d=>{l.forEach(c=>{c.onMouseleave(d)})}};T4(o,a?"nested":t?"manual":this.trigger,s)}}return v(_v,{ref:"binderInstRef",syncTarget:!n,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const i=this.getMergedShow();return[this.internalTrapFocus&&i?Tr(v("div",{style:{position:"fixed",inset:0}}),[[cl,{enabled:i,zIndex:this.zIndex}]]):null,t?null:v(Pv,null,{default:()=>o}),v(_4,Jt(this.$props,P4,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:i})),{default:()=>{var a,l;return(l=(a=this.$slots).default)===null||l===void 0?void 0:l.call(a)},header:()=>{var a,l;return(l=(a=this.$slots).header)===null||l===void 0?void 0:l.call(a)},footer:()=>{var a,l;return(l=(a=this.$slots).footer)===null||l===void 0?void 0:l.call(a)}})]}})}}),Jm={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px",closeMarginRtl:"0 4px 0 0"};const R4={name:"Tag",common:le,self(e){const{textColor2:t,primaryColorHover:r,primaryColorPressed:o,primaryColor:n,infoColor:i,successColor:a,warningColor:l,errorColor:s,baseColor:d,borderColor:c,tagColor:u,opacityDisabled:f,closeIconColor:p,closeIconColorHover:h,closeIconColorPressed:g,closeColorHover:b,closeColorPressed:m,borderRadiusSmall:y,fontSizeMini:w,fontSizeTiny:x,fontSizeSmall:k,fontSizeMedium:T,heightMini:S,heightTiny:$,heightSmall:R,heightMedium:_,buttonColor2Hover:N,buttonColor2Pressed:E,fontWeightStrong:F}=e;return Object.assign(Object.assign({},Jm),{closeBorderRadius:y,heightTiny:S,heightSmall:$,heightMedium:R,heightLarge:_,borderRadius:y,opacityDisabled:f,fontSizeTiny:w,fontSizeSmall:x,fontSizeMedium:k,fontSizeLarge:T,fontWeightStrong:F,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:N,colorPressedCheckable:E,colorChecked:n,colorCheckedHover:r,colorCheckedPressed:o,border:`1px solid ${c}`,textColor:t,color:u,colorBordered:"#0000",closeIconColor:p,closeIconColorHover:h,closeIconColorPressed:g,closeColorHover:b,closeColorPressed:m,borderPrimary:`1px solid ${oe(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:oe(n,{alpha:.16}),colorBorderedPrimary:"#0000",closeIconColorPrimary:vt(n,{lightness:.7}),closeIconColorHoverPrimary:vt(n,{lightness:.7}),closeIconColorPressedPrimary:vt(n,{lightness:.7}),closeColorHoverPrimary:oe(n,{alpha:.16}),closeColorPressedPrimary:oe(n,{alpha:.12}),borderInfo:`1px solid ${oe(i,{alpha:.3})}`,textColorInfo:i,colorInfo:oe(i,{alpha:.16}),colorBorderedInfo:"#0000",closeIconColorInfo:vt(i,{alpha:.7}),closeIconColorHoverInfo:vt(i,{alpha:.7}),closeIconColorPressedInfo:vt(i,{alpha:.7}),closeColorHoverInfo:oe(i,{alpha:.16}),closeColorPressedInfo:oe(i,{alpha:.12}),borderSuccess:`1px solid ${oe(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:oe(a,{alpha:.16}),colorBorderedSuccess:"#0000",closeIconColorSuccess:vt(a,{alpha:.7}),closeIconColorHoverSuccess:vt(a,{alpha:.7}),closeIconColorPressedSuccess:vt(a,{alpha:.7}),closeColorHoverSuccess:oe(a,{alpha:.16}),closeColorPressedSuccess:oe(a,{alpha:.12}),borderWarning:`1px solid ${oe(l,{alpha:.3})}`,textColorWarning:l,colorWarning:oe(l,{alpha:.16}),colorBorderedWarning:"#0000",closeIconColorWarning:vt(l,{alpha:.7}),closeIconColorHoverWarning:vt(l,{alpha:.7}),closeIconColorPressedWarning:vt(l,{alpha:.7}),closeColorHoverWarning:oe(l,{alpha:.16}),closeColorPressedWarning:oe(l,{alpha:.11}),borderError:`1px solid ${oe(s,{alpha:.3})}`,textColorError:s,colorError:oe(s,{alpha:.16}),colorBorderedError:"#0000",closeIconColorError:vt(s,{alpha:.7}),closeIconColorHoverError:vt(s,{alpha:.7}),closeIconColorPressedError:vt(s,{alpha:.7}),closeColorHoverError:oe(s,{alpha:.16}),closeColorPressedError:oe(s,{alpha:.12})})}};var Qm=R4;const I4=e=>{const{textColor2:t,primaryColorHover:r,primaryColorPressed:o,primaryColor:n,infoColor:i,successColor:a,warningColor:l,errorColor:s,baseColor:d,borderColor:c,opacityDisabled:u,tagColor:f,closeIconColor:p,closeIconColorHover:h,closeIconColorPressed:g,borderRadiusSmall:b,fontSizeMini:m,fontSizeTiny:y,fontSizeSmall:w,fontSizeMedium:x,heightMini:k,heightTiny:T,heightSmall:S,heightMedium:$,closeColorHover:R,closeColorPressed:_,buttonColor2Hover:N,buttonColor2Pressed:E,fontWeightStrong:F}=e;return Object.assign(Object.assign({},Jm),{closeBorderRadius:b,heightTiny:k,heightSmall:T,heightMedium:S,heightLarge:$,borderRadius:b,opacityDisabled:u,fontSizeTiny:m,fontSizeSmall:y,fontSizeMedium:w,fontSizeLarge:x,fontWeightStrong:F,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:N,colorPressedCheckable:E,colorChecked:n,colorCheckedHover:r,colorCheckedPressed:o,border:`1px solid ${c}`,textColor:t,color:f,colorBordered:"rgb(250, 250, 252)",closeIconColor:p,closeIconColorHover:h,closeIconColorPressed:g,closeColorHover:R,closeColorPressed:_,borderPrimary:`1px solid ${oe(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:oe(n,{alpha:.12}),colorBorderedPrimary:oe(n,{alpha:.1}),closeIconColorPrimary:n,closeIconColorHoverPrimary:n,closeIconColorPressedPrimary:n,closeColorHoverPrimary:oe(n,{alpha:.12}),closeColorPressedPrimary:oe(n,{alpha:.18}),borderInfo:`1px solid ${oe(i,{alpha:.3})}`,textColorInfo:i,colorInfo:oe(i,{alpha:.12}),colorBorderedInfo:oe(i,{alpha:.1}),closeIconColorInfo:i,closeIconColorHoverInfo:i,closeIconColorPressedInfo:i,closeColorHoverInfo:oe(i,{alpha:.12}),closeColorPressedInfo:oe(i,{alpha:.18}),borderSuccess:`1px solid ${oe(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:oe(a,{alpha:.12}),colorBorderedSuccess:oe(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:oe(a,{alpha:.12}),closeColorPressedSuccess:oe(a,{alpha:.18}),borderWarning:`1px solid ${oe(l,{alpha:.35})}`,textColorWarning:l,colorWarning:oe(l,{alpha:.15}),colorBorderedWarning:oe(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:oe(l,{alpha:.12}),closeColorPressedWarning:oe(l,{alpha:.18}),borderError:`1px solid ${oe(s,{alpha:.23})}`,textColorError:s,colorError:oe(s,{alpha:.1}),colorBorderedError:oe(s,{alpha:.08}),closeIconColorError:s,closeIconColorHoverError:s,closeIconColorPressedError:s,closeColorHoverError:oe(s,{alpha:.12}),closeColorPressedError:oe(s,{alpha:.18})})},O4={name:"Tag",common:je,self:I4};var A4=O4,M4={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},B4=M("tag",` - white-space: nowrap; - position: relative; - box-sizing: border-box; - cursor: default; - display: inline-flex; - align-items: center; - flex-wrap: nowrap; - padding: var(--n-padding); - border-radius: var(--n-border-radius); - color: var(--n-text-color); - background-color: var(--n-color); - transition: - border-color .3s var(--n-bezier), - background-color .3s var(--n-bezier), - color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier), - opacity .3s var(--n-bezier); - line-height: 1; - height: var(--n-height); - font-size: var(--n-font-size); -`,[K("strong",` - font-weight: var(--n-font-weight-strong); - `),D("border",` - pointer-events: none; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - border-radius: inherit; - border: var(--n-border); - transition: border-color .3s var(--n-bezier); - `),D("icon",` - display: flex; - margin: 0 4px 0 0; - color: var(--n-text-color); - transition: color .3s var(--n-bezier); - font-size: var(--n-avatar-size-override); - `),D("avatar",` - display: flex; - margin: 0 6px 0 0; - `),D("close",` - margin: var(--n-close-margin); - transition: - background-color .3s var(--n-bezier), - color .3s var(--n-bezier); - `),K("round",` - padding: 0 calc(var(--n-height) / 3); - border-radius: calc(var(--n-height) / 2); - `,[D("icon",` - margin: 0 4px 0 calc((var(--n-height) - 8px) / -2); - `),D("avatar",` - margin: 0 6px 0 calc((var(--n-height) - 8px) / -2); - `),K("closable",` - padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3); - `)]),K("icon, avatar",[K("round",` - padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2); - `)]),K("disabled",` - cursor: not-allowed !important; - opacity: var(--n-opacity-disabled); - `),K("checkable",` - cursor: pointer; - box-shadow: none; - color: var(--n-text-color-checkable); - background-color: var(--n-color-checkable); - `,[ut("disabled",[O("&:hover","background-color: var(--n-color-hover-checkable);",[ut("checked","color: var(--n-text-color-hover-checkable);")]),O("&:active","background-color: var(--n-color-pressed-checkable);",[ut("checked","color: var(--n-text-color-pressed-checkable);")])]),K("checked",` - color: var(--n-text-color-checked); - background-color: var(--n-color-checked); - `,[ut("disabled",[O("&:hover","background-color: var(--n-color-checked-hover);"),O("&:active","background-color: var(--n-color-checked-pressed);")])])])]);const L4=Object.assign(Object.assign(Object.assign({},Ee.props),M4),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),eg="n-tag";var jM=ae({name:"Tag",props:L4,setup(e){const t=V(null),{mergedBorderedRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:n,mergedRtlRef:i}=st(e),a=Ee("Tag","-tag",B4,A4,e,o);Be(eg,{roundRef:Te(e,"round")});function l(p){if(!e.disabled&&e.checkable){const{checked:h,onCheckedChange:g,onUpdateChecked:b,"onUpdate:checked":m}=e;b&&b(!h),m&&m(!h),g&&g(!h)}}function s(p){if(e.triggerClickOnClose||p.stopPropagation(),!e.disabled){const{onClose:h}=e;h&&Ae(h,p)}}const d={setTextContent(p){const{value:h}=t;h&&(h.textContent=p)}},c=Kr("Tag",i,o),u=H(()=>{const{type:p,size:h,color:{color:g,textColor:b}={}}=e,{common:{cubicBezierEaseInOut:m},self:{padding:y,closeMargin:w,closeMarginRtl:x,borderRadius:k,opacityDisabled:T,textColorCheckable:S,textColorHoverCheckable:$,textColorPressedCheckable:R,textColorChecked:_,colorCheckable:N,colorHoverCheckable:E,colorPressedCheckable:F,colorChecked:j,colorCheckedHover:Q,colorCheckedPressed:A,closeBorderRadius:X,fontWeightStrong:ne,[ie("colorBordered",p)]:pe,[ie("closeSize",h)]:Ce,[ie("closeIconSize",h)]:$e,[ie("fontSize",h)]:_e,[ie("height",h)]:Ge,[ie("color",p)]:Le,[ie("textColor",p)]:U,[ie("border",p)]:ee,[ie("closeIconColor",p)]:G,[ie("closeIconColorHover",p)]:se,[ie("closeIconColorPressed",p)]:ce,[ie("closeColorHover",p)]:Re,[ie("closeColorPressed",p)]:ge}}=a.value;return{"--n-font-weight-strong":ne,"--n-avatar-size-override":`calc(${Ge} - 8px)`,"--n-bezier":m,"--n-border-radius":k,"--n-border":ee,"--n-close-icon-size":$e,"--n-close-color-pressed":ge,"--n-close-color-hover":Re,"--n-close-border-radius":X,"--n-close-icon-color":G,"--n-close-icon-color-hover":se,"--n-close-icon-color-pressed":ce,"--n-close-icon-color-disabled":G,"--n-close-margin":w,"--n-close-margin-rtl":x,"--n-close-size":Ce,"--n-color":g||(r.value?pe:Le),"--n-color-checkable":N,"--n-color-checked":j,"--n-color-checked-hover":Q,"--n-color-checked-pressed":A,"--n-color-hover-checkable":E,"--n-color-pressed-checkable":F,"--n-font-size":_e,"--n-height":Ge,"--n-opacity-disabled":T,"--n-padding":y,"--n-text-color":b||U,"--n-text-color-checkable":S,"--n-text-color-checked":_,"--n-text-color-hover-checkable":$,"--n-text-color-pressed-checkable":R}}),f=n?Pt("tag",H(()=>{let p="";const{type:h,size:g,color:{color:b,textColor:m}={}}=e;return p+=h[0],p+=g[0],b&&(p+=`a${zn(b)}`),m&&(p+=`b${zn(m)}`),r.value&&(p+="c"),p}),u,e):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:c,mergedClsPrefix:o,contentRef:t,mergedBordered:r,handleClick:l,handleCloseClick:s,cssVars:n?void 0:u,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender})},render(){var e,t;const{mergedClsPrefix:r,rtlEnabled:o,closable:n,color:{borderColor:i}={},round:a,onRender:l,$slots:s}=this;l==null||l();const d=dt(s.avatar,u=>u&&v("div",{class:`${r}-tag__avatar`},u)),c=dt(s.icon,u=>u&&v("div",{class:`${r}-tag__icon`},u));return v("div",{class:[`${r}-tag`,this.themeClass,{[`${r}-tag--rtl`]:o,[`${r}-tag--strong`]:this.strong,[`${r}-tag--disabled`]:this.disabled,[`${r}-tag--checkable`]:this.checkable,[`${r}-tag--checked`]:this.checkable&&this.checked,[`${r}-tag--round`]:a,[`${r}-tag--avatar`]:d,[`${r}-tag--icon`]:c,[`${r}-tag--closable`]:n}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},c||d,v("span",{class:`${r}-tag__content`,ref:"contentRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)),!this.checkable&&n?v(ji,{clsPrefix:r,class:`${r}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?v("div",{class:`${r}-tag__border`,style:{borderColor:i}}):null)}}),H4=M("base-clear",` - flex-shrink: 0; - height: 1em; - width: 1em; - position: relative; -`,[O(">",[D("clear",` - font-size: var(--n-clear-size); - height: 1em; - width: 1em; - cursor: pointer; - color: var(--n-clear-color); - transition: color .3s var(--n-bezier); - display: flex; - `,[O("&:hover",` - color: var(--n-clear-color-hover)!important; - `),O("&:active",` - color: var(--n-clear-color-pressed)!important; - `)]),D("placeholder",` - display: flex; - `),D("clear, placeholder",` - position: absolute; - left: 50%; - top: 50%; - transform: translateX(-50%) translateY(-50%); - `,[Oi({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),Js=ae({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return co("-base-clear",H4,Te(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return v("div",{class:`${e}-base-clear`},v(vl,null,{default:()=>{var t,r;return this.show?v("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Lr(this.$slots.icon,()=>[v(zt,{clsPrefix:e},{default:()=>v(w6,null)})])):v("div",{key:"icon",class:`${e}-base-clear__placeholder`},(r=(t=this.$slots).placeholder)===null||r===void 0?void 0:r.call(t))}}))}}),D4=ae({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:t}){return()=>{const{clsPrefix:r}=e;return v(gl,{clsPrefix:r,class:`${r}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?v(Js,{clsPrefix:r,show:e.showClear,onClear:e.onClear},{placeholder:()=>v(zt,{clsPrefix:r,class:`${r}-base-suffix__arrow`},{default:()=>Lr(t.default,()=>[v(y6,null)])})}):null})}}}),tg={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};const F4=e=>{const{borderRadius:t,textColor2:r,textColorDisabled:o,inputColor:n,inputColorDisabled:i,primaryColor:a,primaryColorHover:l,warningColor:s,warningColorHover:d,errorColor:c,errorColorHover:u,borderColor:f,iconColor:p,iconColorDisabled:h,clearColor:g,clearColorHover:b,clearColorPressed:m,placeholderColor:y,placeholderColorDisabled:w,fontSizeTiny:x,fontSizeSmall:k,fontSizeMedium:T,fontSizeLarge:S,heightTiny:$,heightSmall:R,heightMedium:_,heightLarge:N}=e;return Object.assign(Object.assign({},tg),{fontSizeTiny:x,fontSizeSmall:k,fontSizeMedium:T,fontSizeLarge:S,heightTiny:$,heightSmall:R,heightMedium:_,heightLarge:N,borderRadius:t,textColor:r,textColorDisabled:o,placeholderColor:y,placeholderColorDisabled:w,color:n,colorDisabled:i,colorActive:n,border:`1px solid ${f}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${oe(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${oe(a,{alpha:.2})}`,caretColor:a,arrowColor:p,arrowColorDisabled:h,loadingColor:a,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${oe(s,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${oe(s,{alpha:.2})}`,colorActiveWarning:n,caretColorWarning:s,borderError:`1px solid ${c}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${c}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${oe(c,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${oe(c,{alpha:.2})}`,colorActiveError:n,caretColorError:c,clearColor:g,clearColorHover:b,clearColorPressed:m})},j4={name:"InternalSelection",common:je,peers:{Popover:jn},self:F4};var N4=j4;const W4={name:"InternalSelection",common:le,peers:{Popover:Uo},self(e){const{borderRadius:t,textColor2:r,textColorDisabled:o,inputColor:n,inputColorDisabled:i,primaryColor:a,primaryColorHover:l,warningColor:s,warningColorHover:d,errorColor:c,errorColorHover:u,iconColor:f,iconColorDisabled:p,clearColor:h,clearColorHover:g,clearColorPressed:b,placeholderColor:m,placeholderColorDisabled:y,fontSizeTiny:w,fontSizeSmall:x,fontSizeMedium:k,fontSizeLarge:T,heightTiny:S,heightSmall:$,heightMedium:R,heightLarge:_}=e;return Object.assign(Object.assign({},tg),{fontSizeTiny:w,fontSizeSmall:x,fontSizeMedium:k,fontSizeLarge:T,heightTiny:S,heightSmall:$,heightMedium:R,heightLarge:_,borderRadius:t,textColor:r,textColorDisabled:o,placeholderColor:m,placeholderColorDisabled:y,color:n,colorDisabled:i,colorActive:oe(a,{alpha:.1}),border:"1px solid #0000",borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 8px 0 ${oe(a,{alpha:.4})}`,boxShadowFocus:`0 0 8px 0 ${oe(a,{alpha:.4})}`,caretColor:a,arrowColor:f,arrowColorDisabled:p,loadingColor:a,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 8px 0 ${oe(s,{alpha:.4})}`,boxShadowFocusWarning:`0 0 8px 0 ${oe(s,{alpha:.4})}`,colorActiveWarning:oe(s,{alpha:.1}),caretColorWarning:s,borderError:`1px solid ${c}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${c}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 8px 0 ${oe(c,{alpha:.4})}`,boxShadowFocusError:`0 0 8px 0 ${oe(c,{alpha:.4})}`,colorActiveError:oe(c,{alpha:.1}),caretColorError:c,clearColor:h,clearColorHover:g,clearColorPressed:b})}};var nd=W4,Jf=ae({name:"SlotMachineNumber",props:{clsPrefix:{type:String,required:!0},value:{type:[Number,String],required:!0},oldOriginalNumber:{type:Number,default:void 0},newOriginalNumber:{type:Number,default:void 0}},setup(e){const t=V(null),r=V(e.value),o=V(e.value),n=V("up"),i=V(!1),a=H(()=>i.value?`${e.clsPrefix}-base-slot-machine-current-number--${n.value}-scroll`:null),l=H(()=>i.value?`${e.clsPrefix}-base-slot-machine-old-number--${n.value}-scroll`:null);De(Te(e,"value"),(c,u)=>{r.value=u,o.value=c,Zt(s)});function s(){const c=e.newOriginalNumber,u=e.oldOriginalNumber;u===void 0||c===void 0||(c>u?d("up"):u>c&&d("down"))}function d(c){n.value=c,i.value=!1,Zt(()=>{var u;(u=t.value)===null||u===void 0||u.offsetWidth,i.value=!0})}return()=>{const{clsPrefix:c}=e;return v("span",{ref:t,class:`${c}-base-slot-machine-number`},r.value!==null?v("span",{class:[`${c}-base-slot-machine-old-number ${c}-base-slot-machine-old-number--top`,l.value]},r.value):null,v("span",{class:[`${c}-base-slot-machine-current-number`,a.value]},v("span",{ref:"numberWrapper",class:[`${c}-base-slot-machine-current-number__inner`,typeof e.value!="number"&&`${c}-base-slot-machine-current-number__inner--not-number`]},o.value)),r.value!==null?v("span",{class:[`${c}-base-slot-machine-old-number ${c}-base-slot-machine-old-number--bottom`,l.value]},r.value):null)}}});const{cubicBezierEaseInOut:Jr}=zr;function rg({duration:e=".2s",delay:t=".1s"}={}){return[O("&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to",{opacity:1}),O("&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from",` - opacity: 0!important; - margin-left: 0!important; - margin-right: 0!important; - `),O("&.fade-in-width-expand-transition-leave-active",` - overflow: hidden; - transition: - opacity ${e} ${Jr}, - max-width ${e} ${Jr} ${t}, - margin-left ${e} ${Jr} ${t}, - margin-right ${e} ${Jr} ${t}; - `),O("&.fade-in-width-expand-transition-enter-active",` - overflow: hidden; - transition: - opacity ${e} ${Jr} ${t}, - max-width ${e} ${Jr}, - margin-left ${e} ${Jr}, - margin-right ${e} ${Jr}; - `)]}const{cubicBezierEaseOut:rn}=zr;function V4({duration:e=".2s"}={}){return[O("&.fade-up-width-expand-transition-leave-active",{transition:` - opacity ${e} ${rn}, - max-width ${e} ${rn}, - transform ${e} ${rn} - `}),O("&.fade-up-width-expand-transition-enter-active",{transition:` - opacity ${e} ${rn}, - max-width ${e} ${rn}, - transform ${e} ${rn} - `}),O("&.fade-up-width-expand-transition-enter-to",{opacity:1,transform:"translateX(0) translateY(0)"}),O("&.fade-up-width-expand-transition-enter-from",{maxWidth:"0 !important",opacity:0,transform:"translateY(60%)"}),O("&.fade-up-width-expand-transition-leave-from",{opacity:1,transform:"translateY(0)"}),O("&.fade-up-width-expand-transition-leave-to",{maxWidth:"0 !important",opacity:0,transform:"translateY(60%)"})]}var U4=O([O("@keyframes n-base-slot-machine-fade-up-in",` - from { - transform: translateY(60%); - opacity: 0; - } - to { - transform: translateY(0); - opacity: 1; - } - `),O("@keyframes n-base-slot-machine-fade-down-in",` - from { - transform: translateY(-60%); - opacity: 0; - } - to { - transform: translateY(0); - opacity: 1; - } - `),O("@keyframes n-base-slot-machine-fade-up-out",` - from { - transform: translateY(0%); - opacity: 1; - } - to { - transform: translateY(-60%); - opacity: 0; - } - `),O("@keyframes n-base-slot-machine-fade-down-out",` - from { - transform: translateY(0%); - opacity: 1; - } - to { - transform: translateY(60%); - opacity: 0; - } - `),M("base-slot-machine",` - overflow: hidden; - white-space: nowrap; - display: inline-block; - height: 18px; - line-height: 18px; - `,[M("base-slot-machine-number",` - display: inline-block; - position: relative; - height: 18px; - width: .6em; - max-width: .6em; - `,[V4({duration:".2s"}),rg({duration:".2s",delay:"0s"}),M("base-slot-machine-old-number",` - display: inline-block; - opacity: 0; - position: absolute; - left: 0; - right: 0; - `,[K("top",{transform:"translateY(-100%)"}),K("bottom",{transform:"translateY(100%)"}),K("down-scroll",{animation:"n-base-slot-machine-fade-down-out .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),K("up-scroll",{animation:"n-base-slot-machine-fade-up-out .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1})]),M("base-slot-machine-current-number",` - display: inline-block; - position: absolute; - left: 0; - top: 0; - bottom: 0; - right: 0; - opacity: 1; - transform: translateY(0); - width: .6em; - `,[K("down-scroll",{animation:"n-base-slot-machine-fade-down-in .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),K("up-scroll",{animation:"n-base-slot-machine-fade-up-in .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),D("inner",` - display: inline-block; - position: absolute; - right: 0; - top: 0; - width: .6em; - `,[K("not-number",` - right: unset; - left: 0; - `)])])])])]),K4=ae({name:"BaseSlotMachine",props:{clsPrefix:{type:String,required:!0},value:{type:[Number,String],default:0},max:{type:Number,default:void 0},appeared:{type:Boolean,required:!0}},setup(e){co("-base-slot-machine",U4,Te(e,"clsPrefix"));const t=V(),r=V(),o=H(()=>{if(typeof e.value=="string")return[];if(e.value<1)return[0];const n=[];let i=e.value;for(e.max!==void 0&&(i=Math.min(e.max,i));i>=1;)n.push(i%10),i/=10,i=Math.floor(i);return n.reverse(),n});return De(Te(e,"value"),(n,i)=>{typeof n=="string"?(r.value=void 0,t.value=void 0):typeof i=="string"?(r.value=n,t.value=void 0):(r.value=n,t.value=i)}),()=>{const{value:n,clsPrefix:i}=e;return typeof n=="number"?v("span",{class:`${i}-base-slot-machine`},v(Rc,{name:"fade-up-width-expand-transition",tag:"span"},{default:()=>o.value.map((a,l)=>v(Jf,{clsPrefix:i,key:o.value.length-l-1,oldOriginalNumber:t.value,newOriginalNumber:r.value,value:a}))}),v(ml,{key:"+",width:!0},{default:()=>e.max!==void 0&&e.max{const{borderRadius:t,railColor:r,primaryColor:o,primaryColorHover:n,primaryColorPressed:i,textColor2:a}=e;return Object.assign(Object.assign({},J4),{borderRadius:t,railColor:r,railColorActive:o,linkColor:oe(o,{alpha:.15}),linkTextColor:a,linkTextColorHover:n,linkTextColorPressed:i,linkTextColorActive:o})},ek={name:"Anchor",common:le,self:Q4};var tk=ek;const rk=Fo&&"chrome"in window;Fo&&navigator.userAgent.includes("Firefox");const ng=Fo&&navigator.userAgent.includes("Safari")&&!rk;var ig={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"};const ok={name:"Input",common:le,self(e){const{textColor2:t,textColor3:r,textColorDisabled:o,primaryColor:n,primaryColorHover:i,inputColor:a,inputColorDisabled:l,warningColor:s,warningColorHover:d,errorColor:c,errorColorHover:u,borderRadius:f,lineHeight:p,fontSizeTiny:h,fontSizeSmall:g,fontSizeMedium:b,fontSizeLarge:m,heightTiny:y,heightSmall:w,heightMedium:x,heightLarge:k,clearColor:T,clearColorHover:S,clearColorPressed:$,placeholderColor:R,placeholderColorDisabled:_,iconColor:N,iconColorDisabled:E,iconColorHover:F,iconColorPressed:j}=e;return Object.assign(Object.assign({},ig),{countTextColorDisabled:o,countTextColor:r,heightTiny:y,heightSmall:w,heightMedium:x,heightLarge:k,fontSizeTiny:h,fontSizeSmall:g,fontSizeMedium:b,fontSizeLarge:m,lineHeight:p,lineHeightTextarea:p,borderRadius:f,iconSize:"16px",groupLabelColor:a,textColor:t,textColorDisabled:o,textDecorationColor:t,groupLabelTextColor:t,caretColor:n,placeholderColor:R,placeholderColorDisabled:_,color:a,colorDisabled:l,colorFocus:oe(n,{alpha:.1}),groupLabelBorder:"1px solid #0000",border:"1px solid #0000",borderHover:`1px solid ${i}`,borderDisabled:"1px solid #0000",borderFocus:`1px solid ${i}`,boxShadowFocus:`0 0 8px 0 ${oe(n,{alpha:.3})}`,loadingColor:n,loadingColorWarning:s,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${d}`,colorFocusWarning:oe(s,{alpha:.1}),borderFocusWarning:`1px solid ${d}`,boxShadowFocusWarning:`0 0 8px 0 ${oe(s,{alpha:.3})}`,caretColorWarning:s,loadingColorError:c,borderError:`1px solid ${c}`,borderHoverError:`1px solid ${u}`,colorFocusError:oe(c,{alpha:.1}),borderFocusError:`1px solid ${u}`,boxShadowFocusError:`0 0 8px 0 ${oe(c,{alpha:.3})}`,caretColorError:c,clearColor:T,clearColorHover:S,clearColorPressed:$,iconColor:N,iconColorDisabled:E,iconColorHover:F,iconColorPressed:j,suffixTextColor:t})}};var ur=ok;const nk=e=>{const{textColor2:t,textColor3:r,textColorDisabled:o,primaryColor:n,primaryColorHover:i,inputColor:a,inputColorDisabled:l,borderColor:s,warningColor:d,warningColorHover:c,errorColor:u,errorColorHover:f,borderRadius:p,lineHeight:h,fontSizeTiny:g,fontSizeSmall:b,fontSizeMedium:m,fontSizeLarge:y,heightTiny:w,heightSmall:x,heightMedium:k,heightLarge:T,actionColor:S,clearColor:$,clearColorHover:R,clearColorPressed:_,placeholderColor:N,placeholderColorDisabled:E,iconColor:F,iconColorDisabled:j,iconColorHover:Q,iconColorPressed:A}=e;return Object.assign(Object.assign({},ig),{countTextColorDisabled:o,countTextColor:r,heightTiny:w,heightSmall:x,heightMedium:k,heightLarge:T,fontSizeTiny:g,fontSizeSmall:b,fontSizeMedium:m,fontSizeLarge:y,lineHeight:h,lineHeightTextarea:h,borderRadius:p,iconSize:"16px",groupLabelColor:S,groupLabelTextColor:t,textColor:t,textColorDisabled:o,textDecorationColor:t,caretColor:n,placeholderColor:N,placeholderColorDisabled:E,color:a,colorDisabled:l,colorFocus:a,groupLabelBorder:`1px solid ${s}`,border:`1px solid ${s}`,borderHover:`1px solid ${i}`,borderDisabled:`1px solid ${s}`,borderFocus:`1px solid ${i}`,boxShadowFocus:`0 0 0 2px ${oe(n,{alpha:.2})}`,loadingColor:n,loadingColorWarning:d,borderWarning:`1px solid ${d}`,borderHoverWarning:`1px solid ${c}`,colorFocusWarning:a,borderFocusWarning:`1px solid ${c}`,boxShadowFocusWarning:`0 0 0 2px ${oe(d,{alpha:.2})}`,caretColorWarning:d,loadingColorError:u,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${f}`,colorFocusError:a,borderFocusError:`1px solid ${f}`,boxShadowFocusError:`0 0 0 2px ${oe(u,{alpha:.2})}`,caretColorError:u,clearColor:$,clearColorHover:R,clearColorPressed:_,iconColor:F,iconColorDisabled:j,iconColorHover:Q,iconColorPressed:A,suffixTextColor:t})},ik={name:"Input",common:je,self:nk};var ag=ik;const lg="n-input";function ak(e){let t=0;for(const r of e)t++;return t}function ca(e){return e===""||e==null}function lk(e){const t=V(null);function r(){const{value:i}=e;if(!(i!=null&&i.focus)){n();return}const{selectionStart:a,selectionEnd:l,value:s}=i;if(a==null||l==null){n();return}t.value={start:a,end:l,beforeText:s.slice(0,a),afterText:s.slice(l)}}function o(){var i;const{value:a}=t,{value:l}=e;if(!a||!l)return;const{value:s}=l,{start:d,beforeText:c,afterText:u}=a;let f=s.length;if(s.endsWith(u))f=s.length-u.length;else if(s.startsWith(c))f=c.length;else{const p=c[d-1],h=s.indexOf(p,d-1);h!==-1&&(f=h+1)}(i=l.setSelectionRange)===null||i===void 0||i.call(l,f,f)}function n(){t.value=null}return De(e,n),{recordCursor:r,restoreCursor:o}}var Qf=ae({name:"InputWordCount",setup(e,{slots:t}){const{mergedValueRef:r,maxlengthRef:o,mergedClsPrefixRef:n,countGraphemesRef:i}=me(lg),a=H(()=>{const{value:l}=r;return l===null||Array.isArray(l)?0:(i.value||ak)(l)});return()=>{const{value:l}=o,{value:s}=r;return v("span",{class:`${n.value}-input-word-count`},Uy(t.default,{value:s===null||Array.isArray(s)?"":s},()=>[l===void 0?a.value:`${a.value} / ${l}`]))}}}),sk=M("input",` - max-width: 100%; - cursor: text; - line-height: 1.5; - z-index: auto; - outline: none; - box-sizing: border-box; - position: relative; - display: inline-flex; - border-radius: var(--n-border-radius); - background-color: var(--n-color); - transition: background-color .3s var(--n-bezier); - font-size: var(--n-font-size); - --n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2); -`,[D("input, textarea",` - overflow: hidden; - flex-grow: 1; - position: relative; - `),D("input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder",` - box-sizing: border-box; - font-size: inherit; - line-height: 1.5; - font-family: inherit; - border: none; - outline: none; - background-color: #0000; - text-align: inherit; - transition: - -webkit-text-fill-color .3s var(--n-bezier), - caret-color .3s var(--n-bezier), - color .3s var(--n-bezier), - text-decoration-color .3s var(--n-bezier); - `),D("input-el, textarea-el",` - -webkit-appearance: none; - scrollbar-width: none; - width: 100%; - min-width: 0; - text-decoration-color: var(--n-text-decoration-color); - color: var(--n-text-color); - caret-color: var(--n-caret-color); - background-color: transparent; - `,[O("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",` - width: 0; - height: 0; - display: none; - `),O("&::placeholder",` - color: #0000; - -webkit-text-fill-color: transparent !important; - `),O("&:-webkit-autofill ~",[D("placeholder","display: none;")])]),K("round",[ut("textarea","border-radius: calc(var(--n-height) / 2);")]),D("placeholder",` - pointer-events: none; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - overflow: hidden; - color: var(--n-placeholder-color); - `,[O("span",` - width: 100%; - display: inline-block; - `)]),K("textarea",[D("placeholder","overflow: visible;")]),ut("autosize","width: 100%;"),K("autosize",[D("textarea-el, input-el",` - position: absolute; - top: 0; - left: 0; - height: 100%; - `)]),M("input-wrapper",` - overflow: hidden; - display: inline-flex; - flex-grow: 1; - position: relative; - padding-left: var(--n-padding-left); - padding-right: var(--n-padding-right); - `),D("input-mirror",` - padding: 0; - height: var(--n-height); - line-height: var(--n-height); - overflow: hidden; - visibility: hidden; - position: static; - white-space: pre; - pointer-events: none; - `),D("input-el",` - padding: 0; - height: var(--n-height); - line-height: var(--n-height); - `,[O("+",[D("placeholder",` - display: flex; - align-items: center; - `)])]),ut("textarea",[D("placeholder","white-space: nowrap;")]),D("eye",` - transition: color .3s var(--n-bezier); - `),K("textarea","width: 100%;",[M("input-word-count",` - position: absolute; - right: var(--n-padding-right); - bottom: var(--n-padding-vertical); - `),K("resizable",[M("input-wrapper",` - resize: vertical; - min-height: var(--n-height); - `)]),D("textarea-el, textarea-mirror, placeholder",` - height: 100%; - padding-left: 0; - padding-right: 0; - padding-top: var(--n-padding-vertical); - padding-bottom: var(--n-padding-vertical); - word-break: break-word; - display: inline-block; - vertical-align: bottom; - box-sizing: border-box; - line-height: var(--n-line-height-textarea); - margin: 0; - resize: none; - white-space: pre-wrap; - `),D("textarea-mirror",` - width: 100%; - pointer-events: none; - overflow: hidden; - visibility: hidden; - position: static; - white-space: pre-wrap; - overflow-wrap: break-word; - `)]),K("pair",[D("input-el, placeholder","text-align: center;"),D("separator",` - display: flex; - align-items: center; - transition: color .3s var(--n-bezier); - color: var(--n-text-color); - white-space: nowrap; - `,[M("icon",` - color: var(--n-icon-color); - `),M("base-icon",` - color: var(--n-icon-color); - `)])]),K("disabled",` - cursor: not-allowed; - background-color: var(--n-color-disabled); - `,[D("border","border: var(--n-border-disabled);"),D("input-el, textarea-el",` - cursor: not-allowed; - color: var(--n-text-color-disabled); - text-decoration-color: var(--n-text-color-disabled); - `),D("placeholder","color: var(--n-placeholder-color-disabled);"),D("separator","color: var(--n-text-color-disabled);",[M("icon",` - color: var(--n-icon-color-disabled); - `),M("base-icon",` - color: var(--n-icon-color-disabled); - `)]),M("input-word-count",` - color: var(--n-count-text-color-disabled); - `),D("suffix, prefix","color: var(--n-text-color-disabled);",[M("icon",` - color: var(--n-icon-color-disabled); - `),M("internal-icon",` - color: var(--n-icon-color-disabled); - `)])]),ut("disabled",[D("eye",` - display: flex; - align-items: center; - justify-content: center; - color: var(--n-icon-color); - cursor: pointer; - `,[O("&:hover",` - color: var(--n-icon-color-hover); - `),O("&:active",` - color: var(--n-icon-color-pressed); - `)]),O("&:hover",[D("state-border","border: var(--n-border-hover);")]),K("focus","background-color: var(--n-color-focus);",[D("state-border",` - border: var(--n-border-focus); - box-shadow: var(--n-box-shadow-focus); - `)])]),D("border, state-border",` - box-sizing: border-box; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - pointer-events: none; - border-radius: inherit; - border: var(--n-border); - transition: - box-shadow .3s var(--n-bezier), - border-color .3s var(--n-bezier); - `),D("state-border",` - border-color: #0000; - z-index: 1; - `),D("prefix","margin-right: 4px;"),D("suffix",` - margin-left: 4px; - `),D("suffix, prefix",` - transition: color .3s var(--n-bezier); - flex-wrap: nowrap; - flex-shrink: 0; - line-height: var(--n-height); - white-space: nowrap; - display: inline-flex; - align-items: center; - justify-content: center; - color: var(--n-suffix-text-color); - `,[M("base-loading",` - font-size: var(--n-icon-size); - margin: 0 2px; - color: var(--n-loading-color); - `),M("base-clear",` - font-size: var(--n-icon-size); - `,[D("placeholder",[M("base-icon",` - transition: color .3s var(--n-bezier); - color: var(--n-icon-color); - font-size: var(--n-icon-size); - `)])]),O(">",[M("icon",` - transition: color .3s var(--n-bezier); - color: var(--n-icon-color); - font-size: var(--n-icon-size); - `)]),M("base-icon",` - font-size: var(--n-icon-size); - `)]),M("input-word-count",` - pointer-events: none; - line-height: 1.5; - font-size: .85em; - color: var(--n-count-text-color); - transition: color .3s var(--n-bezier); - margin-left: 4px; - font-variant: tabular-nums; - `),["warning","error"].map(e=>K(`${e}-status`,[ut("disabled",[M("base-loading",` - color: var(--n-loading-color-${e}) - `),D("input-el, textarea-el",` - caret-color: var(--n-caret-color-${e}); - `),D("state-border",` - border: var(--n-border-${e}); - `),O("&:hover",[D("state-border",` - border: var(--n-border-hover-${e}); - `)]),O("&:focus",` - background-color: var(--n-color-focus-${e}); - `,[D("state-border",` - box-shadow: var(--n-box-shadow-focus-${e}); - border: var(--n-border-focus-${e}); - `)]),K("focus",` - background-color: var(--n-color-focus-${e}); - `,[D("state-border",` - box-shadow: var(--n-box-shadow-focus-${e}); - border: var(--n-border-focus-${e}); - `)])])]))]);const ck=M("input",[K("disabled",[D("input-el, textarea-el",` - -webkit-text-fill-color: var(--n-text-color-disabled); - `)])]),dk=Object.assign(Object.assign({},Ee.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:Function,onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:Boolean,showPasswordToggle:Boolean});var sg=ae({name:"Input",props:dk,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:r,inlineThemeDisabled:o,mergedRtlRef:n}=st(e),i=Ee("Input","-input",sk,ag,e,t);ng&&co("-input-safari",ck,t);const a=V(null),l=V(null),s=V(null),d=V(null),c=V(null),u=V(null),f=V(null),p=lk(f),h=V(null),{localeRef:g}=Em("Input"),b=V(e.defaultValue),m=Te(e,"value"),y=En(m,b),w=jv(e),{mergedSizeRef:x,mergedDisabledRef:k,mergedStatusRef:T}=w,S=V(!1),$=V(!1),R=V(!1),_=V(!1);let N=null;const E=H(()=>{const{placeholder:B,pair:te}=e;return te?Array.isArray(B)?B:B===void 0?["",""]:[B,B]:B===void 0?[g.value.placeholder]:[B]}),F=H(()=>{const{value:B}=R,{value:te}=y,{value:Se}=E;return!B&&(ca(te)||Array.isArray(te)&&ca(te[0]))&&Se[0]}),j=H(()=>{const{value:B}=R,{value:te}=y,{value:Se}=E;return!B&&Se[1]&&(ca(te)||Array.isArray(te)&&ca(te[1]))}),Q=mt(()=>e.internalForceFocus||S.value),A=mt(()=>{if(k.value||e.readonly||!e.clearable||!Q.value&&!$.value)return!1;const{value:B}=y,{value:te}=Q;return e.pair?!!(Array.isArray(B)&&(B[0]||B[1]))&&($.value||te):!!B&&($.value||te)}),X=H(()=>{const{showPasswordOn:B}=e;if(B)return B;if(e.showPasswordToggle)return"click"}),ne=V(!1),pe=H(()=>{const{textDecoration:B}=e;return B?Array.isArray(B)?B.map(te=>({textDecoration:te})):[{textDecoration:B}]:["",""]}),Ce=V(void 0),$e=()=>{var B,te;if(e.type==="textarea"){const{autosize:Se}=e;if(Se&&(Ce.value=(te=(B=h.value)===null||B===void 0?void 0:B.$el)===null||te===void 0?void 0:te.offsetWidth),!l.value||typeof Se=="boolean")return;const{paddingTop:at,paddingBottom:pt,lineHeight:rt}=window.getComputedStyle(l.value),fo=Number(at.slice(0,-2)),ho=Number(pt.slice(0,-2)),po=Number(rt.slice(0,-2)),{value:Wn}=s;if(!Wn)return;if(Se.minRows){const Vn=Math.max(Se.minRows,1),kl=`${fo+ho+po*Vn}px`;Wn.style.minHeight=kl}if(Se.maxRows){const Vn=`${fo+ho+po*Se.maxRows}px`;Wn.style.maxHeight=Vn}}},_e=H(()=>{const{maxlength:B}=e;return B===void 0?void 0:Number(B)});gt(()=>{const{value:B}=y;Array.isArray(B)||Lt(B)});const Ge=Wr().proxy;function Le(B){const{onUpdateValue:te,"onUpdate:value":Se,onInput:at}=e,{nTriggerFormInput:pt}=w;te&&Ae(te,B),Se&&Ae(Se,B),at&&Ae(at,B),b.value=B,pt()}function U(B){const{onChange:te}=e,{nTriggerFormChange:Se}=w;te&&Ae(te,B),b.value=B,Se()}function ee(B){const{onBlur:te}=e,{nTriggerFormBlur:Se}=w;te&&Ae(te,B),Se()}function G(B){const{onFocus:te}=e,{nTriggerFormFocus:Se}=w;te&&Ae(te,B),Se()}function se(B){const{onClear:te}=e;te&&Ae(te,B)}function ce(B){const{onInputBlur:te}=e;te&&Ae(te,B)}function Re(B){const{onInputFocus:te}=e;te&&Ae(te,B)}function ge(){const{onDeactivate:B}=e;B&&Ae(B)}function C(){const{onActivate:B}=e;B&&Ae(B)}function P(B){const{onClick:te}=e;te&&Ae(te,B)}function I(B){const{onWrapperFocus:te}=e;te&&Ae(te,B)}function W(B){const{onWrapperBlur:te}=e;te&&Ae(te,B)}function z(){R.value=!0}function L(B){R.value=!1,B.target===u.value?Y(B,1):Y(B,0)}function Y(B,te=0,Se="input"){const at=B.target.value;if(Lt(at),B instanceof InputEvent&&!B.isComposing&&(R.value=!1),e.type==="textarea"){const{value:rt}=h;rt&&rt.syncUnifiedContainer()}if(N=at,R.value)return;p.recordCursor();const pt=q(at);if(pt)if(!e.pair)Se==="input"?Le(at):U(at);else{let{value:rt}=y;Array.isArray(rt)?rt=[rt[0],rt[1]]:rt=["",""],rt[te]=at,Se==="input"?Le(rt):U(rt)}Ge.$forceUpdate(),pt||Zt(p.restoreCursor)}function q(B){const{countGraphemes:te,maxlength:Se,minlength:at}=e;if(te){let rt;if(Se!==void 0&&(rt===void 0&&(rt=te(B)),rt>Number(Se))||at!==void 0&&(rt===void 0&&(rt=te(B)),rt{at.preventDefault(),Ue("mouseup",document,te)};if(Qe("mouseup",document,te),X.value!=="mousedown")return;ne.value=!0;const Se=()=>{ne.value=!1,Ue("mouseup",document,Se)};Qe("mouseup",document,Se)}function er(B){var te;switch((te=e.onKeydown)===null||te===void 0||te.call(e,B),B.key){case"Escape":bt();break;case"Enter":Gt(B);break}}function Gt(B){var te,Se;if(e.passivelyActivated){const{value:at}=_;if(at){e.internalDeactivateOnEnter&&bt();return}B.preventDefault(),e.type==="textarea"?(te=l.value)===null||te===void 0||te.focus():(Se=c.value)===null||Se===void 0||Se.focus()}}function bt(){e.passivelyActivated&&(_.value=!1,Zt(()=>{var B;(B=a.value)===null||B===void 0||B.focus()}))}function re(){var B,te,Se;k.value||(e.passivelyActivated?(B=a.value)===null||B===void 0||B.focus():((te=l.value)===null||te===void 0||te.focus(),(Se=c.value)===null||Se===void 0||Se.focus()))}function ve(){var B;!((B=a.value)===null||B===void 0)&&B.contains(document.activeElement)&&document.activeElement.blur()}function Pe(){var B,te;(B=l.value)===null||B===void 0||B.select(),(te=c.value)===null||te===void 0||te.select()}function Ye(){k.value||(l.value?l.value.focus():c.value&&c.value.focus())}function ct(){const{value:B}=a;(B==null?void 0:B.contains(document.activeElement))&&B!==document.activeElement&&bt()}function wt(B){if(e.type==="textarea"){const{value:te}=l;te==null||te.scrollTo(B)}else{const{value:te}=c;te==null||te.scrollTo(B)}}function Lt(B){const{type:te,pair:Se,autosize:at}=e;if(!Se&&at)if(te==="textarea"){const{value:pt}=s;pt&&(pt.textContent=(B!=null?B:"")+`\r -`)}else{const{value:pt}=d;pt&&(B?pt.textContent=B:pt.innerHTML=" ")}}function tt(){$e()}const jt=V({top:"0"});function Ir(B){var te;const{scrollTop:Se}=B.target;jt.value.top=`${-Se}px`,(te=h.value)===null||te===void 0||te.syncUnifiedContainer()}let Ko=null;Wt(()=>{const{autosize:B,type:te}=e;B&&te==="textarea"?Ko=De(y,Se=>{!Array.isArray(Se)&&Se!==N&&Lt(Se)}):Ko==null||Ko()});let qo=null;Wt(()=>{e.type==="textarea"?qo=De(y,B=>{var te;!Array.isArray(B)&&B!==N&&((te=h.value)===null||te===void 0||te.syncUnifiedContainer())}):qo==null||qo()}),Be(lg,{mergedValueRef:y,maxlengthRef:_e,mergedClsPrefixRef:t,countGraphemesRef:Te(e,"countGraphemes")});const Lb={wrapperElRef:a,inputElRef:c,textareaElRef:l,isCompositing:R,focus:re,blur:ve,select:Pe,deactivate:ct,activate:Ye,scrollTo:wt},Hb=Kr("Input",n,t),zd=H(()=>{const{value:B}=x,{common:{cubicBezierEaseInOut:te},self:{color:Se,borderRadius:at,textColor:pt,caretColor:rt,caretColorError:fo,caretColorWarning:ho,textDecorationColor:po,border:Wn,borderDisabled:Vn,borderHover:kl,borderFocus:Db,placeholderColor:Fb,placeholderColorDisabled:jb,lineHeightTextarea:Nb,colorDisabled:Wb,colorFocus:Vb,textColorDisabled:Ub,boxShadowFocus:Kb,iconSize:qb,colorFocusWarning:Gb,boxShadowFocusWarning:Yb,borderWarning:Xb,borderFocusWarning:Zb,borderHoverWarning:Jb,colorFocusError:Qb,boxShadowFocusError:e0,borderError:t0,borderFocusError:r0,borderHoverError:o0,clearSize:n0,clearColor:i0,clearColorHover:a0,clearColorPressed:l0,iconColor:s0,iconColorDisabled:c0,suffixTextColor:d0,countTextColor:u0,countTextColorDisabled:f0,iconColorHover:h0,iconColorPressed:p0,loadingColor:v0,loadingColorError:m0,loadingColorWarning:g0,[ie("padding",B)]:b0,[ie("fontSize",B)]:x0,[ie("height",B)]:C0}}=i.value,{left:y0,right:w0}=av(b0);return{"--n-bezier":te,"--n-count-text-color":u0,"--n-count-text-color-disabled":f0,"--n-color":Se,"--n-font-size":x0,"--n-border-radius":at,"--n-height":C0,"--n-padding-left":y0,"--n-padding-right":w0,"--n-text-color":pt,"--n-caret-color":rt,"--n-text-decoration-color":po,"--n-border":Wn,"--n-border-disabled":Vn,"--n-border-hover":kl,"--n-border-focus":Db,"--n-placeholder-color":Fb,"--n-placeholder-color-disabled":jb,"--n-icon-size":qb,"--n-line-height-textarea":Nb,"--n-color-disabled":Wb,"--n-color-focus":Vb,"--n-text-color-disabled":Ub,"--n-box-shadow-focus":Kb,"--n-loading-color":v0,"--n-caret-color-warning":ho,"--n-color-focus-warning":Gb,"--n-box-shadow-focus-warning":Yb,"--n-border-warning":Xb,"--n-border-focus-warning":Zb,"--n-border-hover-warning":Jb,"--n-loading-color-warning":g0,"--n-caret-color-error":fo,"--n-color-focus-error":Qb,"--n-box-shadow-focus-error":e0,"--n-border-error":t0,"--n-border-focus-error":r0,"--n-border-hover-error":o0,"--n-loading-color-error":m0,"--n-clear-color":i0,"--n-clear-size":n0,"--n-clear-color-hover":a0,"--n-clear-color-pressed":l0,"--n-icon-color":s0,"--n-icon-color-hover":h0,"--n-icon-color-pressed":p0,"--n-icon-color-disabled":c0,"--n-suffix-text-color":d0}}),Go=o?Pt("input",H(()=>{const{value:B}=x;return B[0]}),zd,e):void 0;return Object.assign(Object.assign({},Lb),{wrapperElRef:a,inputElRef:c,inputMirrorElRef:d,inputEl2Ref:u,textareaElRef:l,textareaMirrorElRef:s,textareaScrollbarInstRef:h,rtlEnabled:Hb,uncontrolledValue:b,mergedValue:y,passwordVisible:ne,mergedPlaceholder:E,showPlaceholder1:F,showPlaceholder2:j,mergedFocus:Q,isComposing:R,activated:_,showClearButton:A,mergedSize:x,mergedDisabled:k,textDecorationStyle:pe,mergedClsPrefix:t,mergedBordered:r,mergedShowPasswordOn:X,placeholderStyle:jt,mergedStatus:T,textAreaScrollContainerWidth:Ce,handleTextAreaScroll:Ir,handleCompositionStart:z,handleCompositionEnd:L,handleInput:Y,handleInputBlur:J,handleInputFocus:Z,handleWrapperBlur:fe,handleWrapperFocus:de,handleMouseEnter:et,handleMouseLeave:xt,handleMouseDown:Fe,handleChange:we,handleClick:Ie,handleClear:Ne,handlePasswordToggleClick:Ft,handlePasswordToggleMousedown:qr,handleWrapperKeydown:er,handleTextAreaMirrorResize:tt,getTextareaScrollContainer:()=>l.value,mergedTheme:i,cssVars:o?void 0:zd,themeClass:Go==null?void 0:Go.themeClass,onRender:Go==null?void 0:Go.onRender})},render(){var e,t;const{mergedClsPrefix:r,mergedStatus:o,themeClass:n,type:i,countGraphemes:a,onRender:l}=this,s=this.$slots;return l==null||l(),v("div",{ref:"wrapperElRef",class:[`${r}-input`,n,o&&`${r}-input--${o}-status`,{[`${r}-input--rtl`]:this.rtlEnabled,[`${r}-input--disabled`]:this.mergedDisabled,[`${r}-input--textarea`]:i==="textarea",[`${r}-input--resizable`]:this.resizable&&!this.autosize,[`${r}-input--autosize`]:this.autosize,[`${r}-input--round`]:this.round&&i!=="textarea",[`${r}-input--pair`]:this.pair,[`${r}-input--focus`]:this.mergedFocus,[`${r}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.onKeyup,onKeydown:this.handleWrapperKeydown},v("div",{class:`${r}-input-wrapper`},dt(s.prefix,d=>d&&v("div",{class:`${r}-input__prefix`},d)),i==="textarea"?v(Wm,{ref:"textareaScrollbarInstRef",class:`${r}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var d,c;const{textAreaScrollContainerWidth:u}=this,f={width:this.autosize&&u&&`${u}px`};return v(Je,null,v("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${r}-input__textarea-el`,(d=this.inputProps)===null||d===void 0?void 0:d.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(c=this.inputProps)===null||c===void 0?void 0:c.style,f],onBlur:this.handleInputBlur,onFocus:p=>this.handleInputFocus(p,2),onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?v("div",{class:`${r}-input__placeholder`,style:[this.placeholderStyle,f],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?v(In,{onResize:this.handleTextAreaMirrorResize},{default:()=>v("div",{ref:"textareaMirrorElRef",class:`${r}-input__textarea-mirror`,key:"mirror"})}):null)}}):v("div",{class:`${r}-input__input`},v("input",Object.assign({type:i==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":i},this.inputProps,{ref:"inputElRef",class:[`${r}-input__input-el`,(e=this.inputProps)===null||e===void 0?void 0:e.class],style:[this.textDecorationStyle[0],(t=this.inputProps)===null||t===void 0?void 0:t.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:d=>this.handleInputFocus(d,0),onInput:d=>this.handleInput(d,0),onChange:d=>this.handleChange(d,0)})),this.showPlaceholder1?v("div",{class:`${r}-input__placeholder`},v("span",null,this.mergedPlaceholder[0])):null,this.autosize?v("div",{class:`${r}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"},"\xA0"):null),!this.pair&&dt(s.suffix,d=>d||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?v("div",{class:`${r}-input__suffix`},[dt(s["clear-icon-placeholder"],c=>(this.clearable||c)&&v(Js,{clsPrefix:r,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>c,icon:()=>{var u,f;return(f=(u=this.$slots)["clear-icon"])===null||f===void 0?void 0:f.call(u)}})),this.internalLoadingBeforeSuffix?null:d,this.loading!==void 0?v(D4,{clsPrefix:r,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?d:null,this.showCount&&this.type!=="textarea"?v(Qf,null,{default:c=>{var u;return(u=s.count)===null||u===void 0?void 0:u.call(s,c)}}):null,this.mergedShowPasswordOn&&this.type==="password"?v("div",{class:`${r}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?Lr(s["password-visible-icon"],()=>[v(zt,{clsPrefix:r},{default:()=>v(x6,null)})]):Lr(s["password-invisible-icon"],()=>[v(zt,{clsPrefix:r},{default:()=>v(C6,null)})])):null]):null)),this.pair?v("span",{class:`${r}-input__separator`},Lr(s.separator,()=>[this.separator])):null,this.pair?v("div",{class:`${r}-input-wrapper`},v("div",{class:`${r}-input__input`},v("input",{ref:"inputEl2Ref",type:this.type,class:`${r}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:d=>this.handleInputFocus(d,1),onInput:d=>this.handleInput(d,1),onChange:d=>this.handleChange(d,1)}),this.showPlaceholder2?v("div",{class:`${r}-input__placeholder`},v("span",null,this.mergedPlaceholder[1])):null),dt(s.suffix,d=>(this.clearable||d)&&v("div",{class:`${r}-input__suffix`},[this.clearable&&v(Js,{clsPrefix:r,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var c;return(c=s["clear-icon"])===null||c===void 0?void 0:c.call(s)},placeholder:()=>{var c;return(c=s["clear-icon-placeholder"])===null||c===void 0?void 0:c.call(s)}}),d]))):null,this.mergedBordered?v("div",{class:`${r}-input__border`}):null,this.mergedBordered?v("div",{class:`${r}-input__state-border`}):null,this.showCount&&i==="textarea"?v(Qf,null,{default:d=>{var c;const{renderCount:u}=this;return u?u(d):(c=s.count)===null||c===void 0?void 0:c.call(s,d)}}):null)}});function uk(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const fk={name:"AutoComplete",common:le,peers:{InternalSelectMenu:Ni,Input:ur},self:uk};var hk=fk;const yn=Fo&&"loading"in document.createElement("img"),pk=(e={})=>{var t;const{root:r=null}=e;return{hash:`${e.rootMargin||"0px 0px 0px 0px"}-${Array.isArray(e.threshold)?e.threshold.join(","):(t=e.threshold)!==null&&t!==void 0?t:"0"}`,options:Object.assign(Object.assign({},e),{root:(typeof r=="string"?document.querySelector(r):r)||document.documentElement})}},ns=new WeakMap,is=new WeakMap,as=new WeakMap,cg=(e,t,r)=>{if(!e)return()=>{};const o=pk(t),{root:n}=o.options;let i;const a=ns.get(n);a?i=a:(i=new Map,ns.set(n,i));let l,s;i.has(o.hash)?(s=i.get(o.hash),s[1].has(e)||(l=s[0],s[1].add(e),l.observe(e))):(l=new IntersectionObserver(u=>{u.forEach(f=>{if(f.isIntersecting){const p=is.get(f.target),h=as.get(f.target);p&&p(),h&&(h.value=!0)}})},o.options),l.observe(e),s=[l,new Set([e])],i.set(o.hash,s));let d=!1;const c=()=>{d||(is.delete(e),as.delete(e),d=!0,s[1].has(e)&&(s[0].unobserve(e),s[1].delete(e)),s[1].size<=0&&i.delete(o.hash),i.size||ns.delete(n))};return is.set(e,c),as.set(e,r),c},dg=e=>{const{borderRadius:t,avatarColor:r,cardColor:o,fontSize:n,heightTiny:i,heightSmall:a,heightMedium:l,heightLarge:s,heightHuge:d,modalColor:c,popoverColor:u}=e;return{borderRadius:t,fontSize:n,border:`2px solid ${o}`,heightTiny:i,heightSmall:a,heightMedium:l,heightLarge:s,heightHuge:d,color:xe(o,r),colorModal:xe(c,r),colorPopover:xe(u,r)}},vk={name:"Avatar",common:je,self:dg};var mk=vk;const gk={name:"Avatar",common:le,self:dg};var ug=gk;const bk="n-avatar-group";var xk=M("avatar",` - width: var(--n-merged-size); - height: var(--n-merged-size); - color: #FFF; - font-size: var(--n-font-size); - display: inline-flex; - position: relative; - overflow: hidden; - text-align: center; - border: var(--n-border); - border-radius: var(--n-border-radius); - --n-merged-color: var(--n-color); - background-color: var(--n-merged-color); - transition: - border-color .3s var(--n-bezier), - background-color .3s var(--n-bezier), - color .3s var(--n-bezier); -`,[Hc(O("&","--n-merged-color: var(--n-color-modal);")),pv(O("&","--n-merged-color: var(--n-color-popover);")),O("img",` - width: 100%; - height: 100%; - `),D("text",` - white-space: nowrap; - display: inline-block; - position: absolute; - left: 50%; - top: 50%; - `),M("icon",` - vertical-align: bottom; - font-size: calc(var(--n-merged-size) - 6px); - `),D("text","line-height: 1.25")]);const Ck=Object.assign(Object.assign({},Ee.props),{size:[String,Number],src:String,circle:{type:Boolean,default:void 0},objectFit:String,round:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},onError:Function,fallbackSrc:String,intersectionObserverOptions:Object,lazy:Boolean,onLoad:Function,renderPlaceholder:Function,renderFallback:Function,imgProps:Object,color:String});var yk=ae({name:"Avatar",props:Ck,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=st(e),o=V(!1);let n=null;const i=V(null),a=V(null),l=()=>{const{value:w}=i;if(w&&(n===null||n!==w.innerHTML)){n=w.innerHTML;const{value:x}=a;if(x){const{offsetWidth:k,offsetHeight:T}=x,{offsetWidth:S,offsetHeight:$}=w,R=.9,_=Math.min(k/S*R,T/$*R,1);w.style.transform=`translateX(-50%) translateY(-50%) scale(${_})`}}},s=me(bk,null),d=H(()=>{const{size:w}=e;if(w)return w;const{size:x}=s||{};return x||"medium"}),c=Ee("Avatar","-avatar",xk,mk,e,t),u=me(eg,null),f=H(()=>{if(s)return!0;const{round:w,circle:x}=e;return w!==void 0||x!==void 0?w||x:u?u.roundRef.value:!1}),p=H(()=>s?!0:e.bordered||!1),h=w=>{var x;if(!m.value)return;o.value=!0;const{onError:k,imgProps:T}=e;(x=T==null?void 0:T.onError)===null||x===void 0||x.call(T,w),k&&k(w)};De(()=>e.src,()=>o.value=!1);const g=H(()=>{const w=d.value,x=f.value,k=p.value,{color:T}=e,{self:{borderRadius:S,fontSize:$,color:R,border:_,colorModal:N,colorPopover:E},common:{cubicBezierEaseInOut:F}}=c.value;let j;return typeof w=="number"?j=`${w}px`:j=c.value.self[ie("height",w)],{"--n-font-size":$,"--n-border":k?_:"none","--n-border-radius":x?"50%":S,"--n-color":T||R,"--n-color-modal":T||N,"--n-color-popover":T||E,"--n-bezier":F,"--n-merged-size":`var(--n-avatar-size-override, ${j})`}}),b=r?Pt("avatar",H(()=>{const w=d.value,x=f.value,k=p.value,{color:T}=e;let S="";return w&&(typeof w=="number"?S+=`a${w}`:S+=w[0]),x&&(S+="b"),k&&(S+="c"),T&&(S+=zn(T)),S}),g,e):void 0,m=V(!e.lazy);gt(()=>{if(yn)return;let w;const x=Wt(()=>{w==null||w(),w=void 0,e.lazy&&(w=cg(a.value,e.intersectionObserverOptions,m))});ht(()=>{x(),w==null||w()})});const y=V(!e.lazy);return{textRef:i,selfRef:a,mergedRoundRef:f,mergedClsPrefix:t,fitTextTransform:l,cssVars:r?void 0:g,themeClass:b==null?void 0:b.themeClass,onRender:b==null?void 0:b.onRender,hasLoadError:o,handleError:h,shouldStartLoading:m,loaded:y,mergedOnLoad:w=>{var x;const{onLoad:k,imgProps:T}=e;k==null||k(w),(x=T==null?void 0:T.onLoad)===null||x===void 0||x.call(T,w),y.value=!0}}},render(){var e,t;const{$slots:r,src:o,mergedClsPrefix:n,lazy:i,onRender:a,mergedOnLoad:l,shouldStartLoading:s,loaded:d,hasLoadError:c}=this;a==null||a();let u;const f=!d&&!c&&(this.renderPlaceholder?this.renderPlaceholder():(t=(e=this.$slots).placeholder)===null||t===void 0?void 0:t.call(e));return this.hasLoadError?u=this.renderFallback?this.renderFallback():Lr(r.fallback,()=>[v("img",{src:this.fallbackSrc,style:{objectFit:this.objectFit}})]):u=dt(r.default,p=>{if(p)return v(In,{onResize:this.fitTextTransform},{default:()=>v("span",{ref:"textRef",class:`${n}-avatar__text`},p)});if(o){const{imgProps:h}=this;return v("img",Object.assign(Object.assign({},h),{loading:yn&&!this.intersectionObserverOptions&&i?"lazy":"eager",src:yn||s||d?o:void 0,onLoad:l,"data-image-src":o,onError:this.handleError,style:[h==null?void 0:h.style,{objectFit:this.objectFit},f?{height:"0",width:"0",visibility:"hidden",position:"absolute"}:""]}))}}),v("span",{ref:"selfRef",class:[`${n}-avatar`,this.themeClass],style:this.cssVars},u,i&&f)}});const wk=()=>({gap:"-12px"}),Sk={name:"AvatarGroup",common:le,peers:{Avatar:ug},self:wk};var $k=Sk,_k={width:"44px",height:"44px",borderRadius:"22px",iconSize:"26px"};const Pk={name:"BackTop",common:le,self(e){const{popoverColor:t,textColor2:r,primaryColorHover:o,primaryColorPressed:n}=e;return Object.assign(Object.assign({},_k),{color:t,textColor:r,iconColor:r,iconColorHover:o,iconColorPressed:n,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})}};var kk=Pk;const Tk={name:"Badge",common:le,self(e){const{errorColorSuppl:t,infoColorSuppl:r,successColorSuppl:o,warningColorSuppl:n,fontFamily:i}=e;return{color:t,colorInfo:r,colorSuccess:o,colorError:t,colorWarning:n,fontSize:"12px",fontFamily:i}}};var zk=Tk;const Ek=e=>{const{errorColor:t,infoColor:r,successColor:o,warningColor:n,fontFamily:i}=e;return{color:t,colorInfo:r,colorSuccess:o,colorError:t,colorWarning:n,fontSize:"12px",fontFamily:i}},Rk={name:"Badge",common:je,self:Ek};var Ik=Rk,Ok=O([O("@keyframes badge-wave-spread",{from:{boxShadow:"0 0 0.5px 0px var(--n-ripple-color)",opacity:.6},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)",opacity:0}}),M("badge",` - display: inline-flex; - position: relative; - vertical-align: middle; - color: var(--n-color); - font-family: var(--n-font-family); - `,[K("as-is",[M("badge-sup",{position:"static",transform:"translateX(0)"},[Mi({transformOrigin:"left bottom",originalTransform:"translateX(0)"})])]),K("dot",[M("badge-sup",` - height: 8px; - width: 8px; - padding: 0; - min-width: 8px; - left: 100%; - bottom: calc(100% - 4px); - `,[O("::before","border-radius: 4px;")])]),M("badge-sup",` - background: var(--n-color); - transition: - background-color .3s var(--n-bezier), - color .3s var(--n-bezier); - color: #FFF; - position: absolute; - height: 18px; - line-height: 18px; - border-radius: 9px; - padding: 0 6px; - text-align: center; - font-size: var(--n-font-size); - transform: translateX(-50%); - left: 100%; - bottom: calc(100% - 9px); - font-variant-numeric: tabular-nums; - z-index: 1; - display: flex; - align-items: center; - `,[Mi({transformOrigin:"left bottom",originalTransform:"translateX(-50%)"}),M("base-wave",{zIndex:1,animationDuration:"2s",animationIterationCount:"infinite",animationDelay:"1s",animationTimingFunction:"var(--n-ripple-bezier)",animationName:"badge-wave-spread"}),O("&::before",` - opacity: 0; - transform: scale(1); - border-radius: 9px; - content: ""; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - `)])])]);const Ak=Object.assign(Object.assign({},Ee.props),{value:[String,Number],max:Number,dot:Boolean,type:{type:String,default:"default"},show:{type:Boolean,default:!0},showZero:Boolean,processing:Boolean,color:String,offset:Array});var Mk=ae({name:"Badge",props:Ak,setup(e,{slots:t}){const{mergedClsPrefixRef:r,inlineThemeDisabled:o,mergedRtlRef:n}=st(e),i=Ee("Badge","-badge",Ok,Ik,e,r),a=V(!1),l=()=>{a.value=!0},s=()=>{a.value=!1},d=H(()=>e.show&&(e.dot||e.value!==void 0&&!(!e.showZero&&e.value<=0)||!Ia(t.value)));gt(()=>{d.value&&(a.value=!0)});const c=Kr("Badge",n,r),u=H(()=>{const{type:h,color:g}=e,{common:{cubicBezierEaseInOut:b,cubicBezierEaseOut:m},self:{[ie("color",h)]:y,fontFamily:w,fontSize:x}}=i.value;return{"--n-font-size":x,"--n-font-family":w,"--n-color":g||y,"--n-ripple-color":g||y,"--n-bezier":b,"--n-ripple-bezier":m}}),f=o?Pt("badge",H(()=>{let h="";const{type:g,color:b}=e;return g&&(h+=g[0]),b&&(h+=zn(b)),h}),u,e):void 0,p=H(()=>{const{offset:h}=e;if(!h)return;const[g,b]=h,m=typeof g=="number"?`${g}px`:g,y=typeof b=="number"?`${b}px`:b;return{transform:`translate(calc(${c!=null&&c.value?"50%":"-50%"} + ${m}), ${y})`}});return{rtlEnabled:c,mergedClsPrefix:r,appeared:a,showBadge:d,handleAfterEnter:l,handleAfterLeave:s,cssVars:o?void 0:u,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender,offsetStyle:p}},render(){var e;const{mergedClsPrefix:t,onRender:r,themeClass:o,$slots:n}=this;r==null||r();const i=(e=n.default)===null||e===void 0?void 0:e.call(n);return v("div",{class:[`${t}-badge`,this.rtlEnabled&&`${t}-badge--rtl`,o,{[`${t}-badge--dot`]:this.dot,[`${t}-badge--as-is`]:!i}],style:this.cssVars},i,v(Bt,{name:"fade-in-scale-up-transition",onAfterEnter:this.handleAfterEnter,onAfterLeave:this.handleAfterLeave},{default:()=>this.showBadge?v("sup",{class:`${t}-badge-sup`,title:Wy(this.value),style:this.offsetStyle},Lr(n.value,()=>[this.dot?null:v(K4,{clsPrefix:t,appeared:this.appeared,max:this.max,value:this.value})]),this.processing?v(qm,{clsPrefix:t}):null):null}))}}),Bk={fontWeightActive:"400"};const Lk=e=>{const{fontSize:t,textColor3:r,textColor2:o,borderRadius:n,buttonColor2Hover:i,buttonColor2Pressed:a}=e;return Object.assign(Object.assign({},Bk),{fontSize:t,itemLineHeight:"1.25",itemTextColor:r,itemTextColorHover:o,itemTextColorPressed:o,itemTextColorActive:o,itemBorderRadius:n,itemColorHover:i,itemColorPressed:a,separatorColor:r})},Hk={name:"Breadcrumb",common:le,self:Lk};var Dk=Hk;function bo(e){return xe(e,[255,255,255,.16])}function da(e){return xe(e,[0,0,0,.12])}const Fk="n-button-group";var jk={paddingTiny:"0 6px",paddingSmall:"0 10px",paddingMedium:"0 14px",paddingLarge:"0 18px",paddingRoundTiny:"0 10px",paddingRoundSmall:"0 14px",paddingRoundMedium:"0 18px",paddingRoundLarge:"0 22px",iconMarginTiny:"6px",iconMarginSmall:"6px",iconMarginMedium:"6px",iconMarginLarge:"6px",iconSizeTiny:"14px",iconSizeSmall:"18px",iconSizeMedium:"18px",iconSizeLarge:"20px",rippleDuration:".6s"};const fg=e=>{const{heightTiny:t,heightSmall:r,heightMedium:o,heightLarge:n,borderRadius:i,fontSizeTiny:a,fontSizeSmall:l,fontSizeMedium:s,fontSizeLarge:d,opacityDisabled:c,textColor2:u,textColor3:f,primaryColorHover:p,primaryColorPressed:h,borderColor:g,primaryColor:b,baseColor:m,infoColor:y,infoColorHover:w,infoColorPressed:x,successColor:k,successColorHover:T,successColorPressed:S,warningColor:$,warningColorHover:R,warningColorPressed:_,errorColor:N,errorColorHover:E,errorColorPressed:F,fontWeight:j,buttonColor2:Q,buttonColor2Hover:A,buttonColor2Pressed:X,fontWeightStrong:ne}=e;return Object.assign(Object.assign({},jk),{heightTiny:t,heightSmall:r,heightMedium:o,heightLarge:n,borderRadiusTiny:i,borderRadiusSmall:i,borderRadiusMedium:i,borderRadiusLarge:i,fontSizeTiny:a,fontSizeSmall:l,fontSizeMedium:s,fontSizeLarge:d,opacityDisabled:c,colorOpacitySecondary:"0.16",colorOpacitySecondaryHover:"0.22",colorOpacitySecondaryPressed:"0.28",colorSecondary:Q,colorSecondaryHover:A,colorSecondaryPressed:X,colorTertiary:Q,colorTertiaryHover:A,colorTertiaryPressed:X,colorQuaternary:"#0000",colorQuaternaryHover:A,colorQuaternaryPressed:X,color:"#0000",colorHover:"#0000",colorPressed:"#0000",colorFocus:"#0000",colorDisabled:"#0000",textColor:u,textColorTertiary:f,textColorHover:p,textColorPressed:h,textColorFocus:p,textColorDisabled:u,textColorText:u,textColorTextHover:p,textColorTextPressed:h,textColorTextFocus:p,textColorTextDisabled:u,textColorGhost:u,textColorGhostHover:p,textColorGhostPressed:h,textColorGhostFocus:p,textColorGhostDisabled:u,border:`1px solid ${g}`,borderHover:`1px solid ${p}`,borderPressed:`1px solid ${h}`,borderFocus:`1px solid ${p}`,borderDisabled:`1px solid ${g}`,rippleColor:b,colorPrimary:b,colorHoverPrimary:p,colorPressedPrimary:h,colorFocusPrimary:p,colorDisabledPrimary:b,textColorPrimary:m,textColorHoverPrimary:m,textColorPressedPrimary:m,textColorFocusPrimary:m,textColorDisabledPrimary:m,textColorTextPrimary:b,textColorTextHoverPrimary:p,textColorTextPressedPrimary:h,textColorTextFocusPrimary:p,textColorTextDisabledPrimary:u,textColorGhostPrimary:b,textColorGhostHoverPrimary:p,textColorGhostPressedPrimary:h,textColorGhostFocusPrimary:p,textColorGhostDisabledPrimary:b,borderPrimary:`1px solid ${b}`,borderHoverPrimary:`1px solid ${p}`,borderPressedPrimary:`1px solid ${h}`,borderFocusPrimary:`1px solid ${p}`,borderDisabledPrimary:`1px solid ${b}`,rippleColorPrimary:b,colorInfo:y,colorHoverInfo:w,colorPressedInfo:x,colorFocusInfo:w,colorDisabledInfo:y,textColorInfo:m,textColorHoverInfo:m,textColorPressedInfo:m,textColorFocusInfo:m,textColorDisabledInfo:m,textColorTextInfo:y,textColorTextHoverInfo:w,textColorTextPressedInfo:x,textColorTextFocusInfo:w,textColorTextDisabledInfo:u,textColorGhostInfo:y,textColorGhostHoverInfo:w,textColorGhostPressedInfo:x,textColorGhostFocusInfo:w,textColorGhostDisabledInfo:y,borderInfo:`1px solid ${y}`,borderHoverInfo:`1px solid ${w}`,borderPressedInfo:`1px solid ${x}`,borderFocusInfo:`1px solid ${w}`,borderDisabledInfo:`1px solid ${y}`,rippleColorInfo:y,colorSuccess:k,colorHoverSuccess:T,colorPressedSuccess:S,colorFocusSuccess:T,colorDisabledSuccess:k,textColorSuccess:m,textColorHoverSuccess:m,textColorPressedSuccess:m,textColorFocusSuccess:m,textColorDisabledSuccess:m,textColorTextSuccess:k,textColorTextHoverSuccess:T,textColorTextPressedSuccess:S,textColorTextFocusSuccess:T,textColorTextDisabledSuccess:u,textColorGhostSuccess:k,textColorGhostHoverSuccess:T,textColorGhostPressedSuccess:S,textColorGhostFocusSuccess:T,textColorGhostDisabledSuccess:k,borderSuccess:`1px solid ${k}`,borderHoverSuccess:`1px solid ${T}`,borderPressedSuccess:`1px solid ${S}`,borderFocusSuccess:`1px solid ${T}`,borderDisabledSuccess:`1px solid ${k}`,rippleColorSuccess:k,colorWarning:$,colorHoverWarning:R,colorPressedWarning:_,colorFocusWarning:R,colorDisabledWarning:$,textColorWarning:m,textColorHoverWarning:m,textColorPressedWarning:m,textColorFocusWarning:m,textColorDisabledWarning:m,textColorTextWarning:$,textColorTextHoverWarning:R,textColorTextPressedWarning:_,textColorTextFocusWarning:R,textColorTextDisabledWarning:u,textColorGhostWarning:$,textColorGhostHoverWarning:R,textColorGhostPressedWarning:_,textColorGhostFocusWarning:R,textColorGhostDisabledWarning:$,borderWarning:`1px solid ${$}`,borderHoverWarning:`1px solid ${R}`,borderPressedWarning:`1px solid ${_}`,borderFocusWarning:`1px solid ${R}`,borderDisabledWarning:`1px solid ${$}`,rippleColorWarning:$,colorError:N,colorHoverError:E,colorPressedError:F,colorFocusError:E,colorDisabledError:N,textColorError:m,textColorHoverError:m,textColorPressedError:m,textColorFocusError:m,textColorDisabledError:m,textColorTextError:N,textColorTextHoverError:E,textColorTextPressedError:F,textColorTextFocusError:E,textColorTextDisabledError:u,textColorGhostError:N,textColorGhostHoverError:E,textColorGhostPressedError:F,textColorGhostFocusError:E,textColorGhostDisabledError:N,borderError:`1px solid ${N}`,borderHoverError:`1px solid ${E}`,borderPressedError:`1px solid ${F}`,borderFocusError:`1px solid ${E}`,borderDisabledError:`1px solid ${N}`,rippleColorError:N,waveOpacity:"0.6",fontWeight:j,fontWeightStrong:ne})},Nk={name:"Button",common:je,self:fg};var xl=Nk;const Wk={name:"Button",common:le,self(e){const t=fg(e);return t.waveOpacity="0.8",t.colorOpacitySecondary="0.16",t.colorOpacitySecondaryHover="0.2",t.colorOpacitySecondaryPressed="0.12",t}};var Kt=Wk,Vk=O([M("button",` - margin: 0; - font-weight: var(--n-font-weight); - line-height: 1; - font-family: inherit; - padding: var(--n-padding); - height: var(--n-height); - font-size: var(--n-font-size); - border-radius: var(--n-border-radius); - color: var(--n-text-color); - background-color: var(--n-color); - width: var(--n-width); - white-space: nowrap; - outline: none; - position: relative; - z-index: auto; - border: none; - display: inline-flex; - flex-wrap: nowrap; - flex-shrink: 0; - align-items: center; - justify-content: center; - user-select: none; - -webkit-user-select: none; - text-align: center; - cursor: pointer; - text-decoration: none; - transition: - color .3s var(--n-bezier), - background-color .3s var(--n-bezier), - opacity .3s var(--n-bezier), - border-color .3s var(--n-bezier); - `,[K("color",[D("border",{borderColor:"var(--n-border-color)"}),K("disabled",[D("border",{borderColor:"var(--n-border-color-disabled)"})]),ut("disabled",[O("&:focus",[D("state-border",{borderColor:"var(--n-border-color-focus)"})]),O("&:hover",[D("state-border",{borderColor:"var(--n-border-color-hover)"})]),O("&:active",[D("state-border",{borderColor:"var(--n-border-color-pressed)"})]),K("pressed",[D("state-border",{borderColor:"var(--n-border-color-pressed)"})])])]),K("disabled",{backgroundColor:"var(--n-color-disabled)",color:"var(--n-text-color-disabled)"},[D("border",{border:"var(--n-border-disabled)"})]),ut("disabled",[O("&:focus",{backgroundColor:"var(--n-color-focus)",color:"var(--n-text-color-focus)"},[D("state-border",{border:"var(--n-border-focus)"})]),O("&:hover",{backgroundColor:"var(--n-color-hover)",color:"var(--n-text-color-hover)"},[D("state-border",{border:"var(--n-border-hover)"})]),O("&:active",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[D("state-border",{border:"var(--n-border-pressed)"})]),K("pressed",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[D("state-border",{border:"var(--n-border-pressed)"})])]),K("loading","cursor: wait;"),M("base-wave",` - pointer-events: none; - top: 0; - right: 0; - bottom: 0; - left: 0; - animation-iteration-count: 1; - animation-duration: var(--n-ripple-duration); - animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out); - `,[K("active",{zIndex:1,animationName:"button-wave-spread, button-wave-opacity"})]),Fo&&"MozBoxSizing"in document.createElement("div").style?O("&::moz-focus-inner",{border:0}):null,D("border, state-border",` - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - border-radius: inherit; - transition: border-color .3s var(--n-bezier); - pointer-events: none; - `),D("border",{border:"var(--n-border)"}),D("state-border",{border:"var(--n-border)",borderColor:"#0000",zIndex:1}),D("icon",` - margin: var(--n-icon-margin); - margin-left: 0; - height: var(--n-icon-size); - width: var(--n-icon-size); - max-width: var(--n-icon-size); - font-size: var(--n-icon-size); - position: relative; - flex-shrink: 0; - `,[M("icon-slot",` - height: var(--n-icon-size); - width: var(--n-icon-size); - position: absolute; - left: 0; - top: 50%; - transform: translateY(-50%); - display: flex; - align-items: center; - justify-content: center; - `,[Oi({top:"50%",originalTransform:"translateY(-50%)"})]),rg()]),D("content",` - display: flex; - align-items: center; - flex-wrap: nowrap; - min-width: 0; - `,[O("~",[D("icon",{margin:"var(--n-icon-margin)",marginRight:0})])]),K("block",` - display: flex; - width: 100%; - `),K("dashed",[D("border, state-border",{borderStyle:"dashed !important"})]),K("disabled",{cursor:"not-allowed",opacity:"var(--n-opacity-disabled)"})]),O("@keyframes button-wave-spread",{from:{boxShadow:"0 0 0.5px 0 var(--n-ripple-color)"},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)"}}),O("@keyframes button-wave-opacity",{from:{opacity:"var(--n-wave-opacity)"},to:{opacity:0}})]);const Uk=Object.assign(Object.assign({},Ee.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:"button"},type:{type:String,default:"default"},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:"left"},attrType:{type:String,default:"button"},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!ng}}),hg=ae({name:"Button",props:Uk,setup(e){const t=V(null),r=V(null),o=V(!1),n=mt(()=>!e.quaternary&&!e.tertiary&&!e.secondary&&!e.text&&(!e.color||e.ghost||e.dashed)&&e.bordered),i=me(Fk,{}),{mergedSizeRef:a}=jv({},{defaultSize:"medium",mergedSize:x=>{const{size:k}=e;if(k)return k;const{size:T}=i;if(T)return T;const{mergedSize:S}=x||{};return S?S.value:"medium"}}),l=H(()=>e.focusable&&!e.disabled),s=x=>{var k;l.value||x.preventDefault(),!e.nativeFocusBehavior&&(x.preventDefault(),!e.disabled&&l.value&&((k=t.value)===null||k===void 0||k.focus({preventScroll:!0})))},d=x=>{var k;if(!e.disabled&&!e.loading){const{onClick:T}=e;T&&Ae(T,x),e.text||(k=r.value)===null||k===void 0||k.play()}},c=x=>{switch(x.key){case"Enter":if(!e.keyboard)return;o.value=!1}},u=x=>{switch(x.key){case"Enter":if(!e.keyboard||e.loading){x.preventDefault();return}o.value=!0}},f=()=>{o.value=!1},{inlineThemeDisabled:p,mergedClsPrefixRef:h,mergedRtlRef:g}=st(e),b=Ee("Button","-button",Vk,xl,e,h),m=Kr("Button",g,h),y=H(()=>{const x=b.value,{common:{cubicBezierEaseInOut:k,cubicBezierEaseOut:T},self:S}=x,{rippleDuration:$,opacityDisabled:R,fontWeight:_,fontWeightStrong:N}=S,E=a.value,{dashed:F,type:j,ghost:Q,text:A,color:X,round:ne,circle:pe,textColor:Ce,secondary:$e,tertiary:_e,quaternary:Ge,strong:Le}=e,U={"font-weight":Le?N:_};let ee={"--n-color":"initial","--n-color-hover":"initial","--n-color-pressed":"initial","--n-color-focus":"initial","--n-color-disabled":"initial","--n-ripple-color":"initial","--n-text-color":"initial","--n-text-color-hover":"initial","--n-text-color-pressed":"initial","--n-text-color-focus":"initial","--n-text-color-disabled":"initial"};const G=j==="tertiary",se=j==="default",ce=G?"default":j;if(A){const J=Ce||X,Z=J||S[ie("textColorText",ce)];ee={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":"#0000","--n-text-color":Z,"--n-text-color-hover":J?bo(J):S[ie("textColorTextHover",ce)],"--n-text-color-pressed":J?da(J):S[ie("textColorTextPressed",ce)],"--n-text-color-focus":J?bo(J):S[ie("textColorTextHover",ce)],"--n-text-color-disabled":J||S[ie("textColorTextDisabled",ce)]}}else if(Q||F){const J=Ce||X;ee={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":X||S[ie("rippleColor",ce)],"--n-text-color":J||S[ie("textColorGhost",ce)],"--n-text-color-hover":J?bo(J):S[ie("textColorGhostHover",ce)],"--n-text-color-pressed":J?da(J):S[ie("textColorGhostPressed",ce)],"--n-text-color-focus":J?bo(J):S[ie("textColorGhostHover",ce)],"--n-text-color-disabled":J||S[ie("textColorGhostDisabled",ce)]}}else if($e){const J=se?S.textColor:G?S.textColorTertiary:S[ie("color",ce)],Z=X||J,fe=j!=="default"&&j!=="tertiary";ee={"--n-color":fe?oe(Z,{alpha:Number(S.colorOpacitySecondary)}):S.colorSecondary,"--n-color-hover":fe?oe(Z,{alpha:Number(S.colorOpacitySecondaryHover)}):S.colorSecondaryHover,"--n-color-pressed":fe?oe(Z,{alpha:Number(S.colorOpacitySecondaryPressed)}):S.colorSecondaryPressed,"--n-color-focus":fe?oe(Z,{alpha:Number(S.colorOpacitySecondaryHover)}):S.colorSecondaryHover,"--n-color-disabled":S.colorSecondary,"--n-ripple-color":"#0000","--n-text-color":Z,"--n-text-color-hover":Z,"--n-text-color-pressed":Z,"--n-text-color-focus":Z,"--n-text-color-disabled":Z}}else if(_e||Ge){const J=se?S.textColor:G?S.textColorTertiary:S[ie("color",ce)],Z=X||J;_e?(ee["--n-color"]=S.colorTertiary,ee["--n-color-hover"]=S.colorTertiaryHover,ee["--n-color-pressed"]=S.colorTertiaryPressed,ee["--n-color-focus"]=S.colorSecondaryHover,ee["--n-color-disabled"]=S.colorTertiary):(ee["--n-color"]=S.colorQuaternary,ee["--n-color-hover"]=S.colorQuaternaryHover,ee["--n-color-pressed"]=S.colorQuaternaryPressed,ee["--n-color-focus"]=S.colorQuaternaryHover,ee["--n-color-disabled"]=S.colorQuaternary),ee["--n-ripple-color"]="#0000",ee["--n-text-color"]=Z,ee["--n-text-color-hover"]=Z,ee["--n-text-color-pressed"]=Z,ee["--n-text-color-focus"]=Z,ee["--n-text-color-disabled"]=Z}else ee={"--n-color":X||S[ie("color",ce)],"--n-color-hover":X?bo(X):S[ie("colorHover",ce)],"--n-color-pressed":X?da(X):S[ie("colorPressed",ce)],"--n-color-focus":X?bo(X):S[ie("colorFocus",ce)],"--n-color-disabled":X||S[ie("colorDisabled",ce)],"--n-ripple-color":X||S[ie("rippleColor",ce)],"--n-text-color":Ce||(X?S.textColorPrimary:G?S.textColorTertiary:S[ie("textColor",ce)]),"--n-text-color-hover":Ce||(X?S.textColorHoverPrimary:S[ie("textColorHover",ce)]),"--n-text-color-pressed":Ce||(X?S.textColorPressedPrimary:S[ie("textColorPressed",ce)]),"--n-text-color-focus":Ce||(X?S.textColorFocusPrimary:S[ie("textColorFocus",ce)]),"--n-text-color-disabled":Ce||(X?S.textColorDisabledPrimary:S[ie("textColorDisabled",ce)])};let Re={"--n-border":"initial","--n-border-hover":"initial","--n-border-pressed":"initial","--n-border-focus":"initial","--n-border-disabled":"initial"};A?Re={"--n-border":"none","--n-border-hover":"none","--n-border-pressed":"none","--n-border-focus":"none","--n-border-disabled":"none"}:Re={"--n-border":S[ie("border",ce)],"--n-border-hover":S[ie("borderHover",ce)],"--n-border-pressed":S[ie("borderPressed",ce)],"--n-border-focus":S[ie("borderFocus",ce)],"--n-border-disabled":S[ie("borderDisabled",ce)]};const{[ie("height",E)]:ge,[ie("fontSize",E)]:C,[ie("padding",E)]:P,[ie("paddingRound",E)]:I,[ie("iconSize",E)]:W,[ie("borderRadius",E)]:z,[ie("iconMargin",E)]:L,waveOpacity:Y}=S,q={"--n-width":pe&&!A?ge:"initial","--n-height":A?"initial":ge,"--n-font-size":C,"--n-padding":pe||A?"initial":ne?I:P,"--n-icon-size":W,"--n-icon-margin":L,"--n-border-radius":A?"initial":pe||ne?ge:z};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":k,"--n-bezier-ease-out":T,"--n-ripple-duration":$,"--n-opacity-disabled":R,"--n-wave-opacity":Y},U),ee),Re),q)}),w=p?Pt("button",H(()=>{let x="";const{dashed:k,type:T,ghost:S,text:$,color:R,round:_,circle:N,textColor:E,secondary:F,tertiary:j,quaternary:Q,strong:A}=e;k&&(x+="a"),S&&(x+="b"),$&&(x+="c"),_&&(x+="d"),N&&(x+="e"),F&&(x+="f"),j&&(x+="g"),Q&&(x+="h"),A&&(x+="i"),R&&(x+="j"+zn(R)),E&&(x+="k"+zn(E));const{value:X}=a;return x+="l"+X[0],x+="m"+T[0],x}),y,e):void 0;return{selfElRef:t,waveElRef:r,mergedClsPrefix:h,mergedFocusable:l,mergedSize:a,showBorder:n,enterPressed:o,rtlEnabled:m,handleMousedown:s,handleKeydown:u,handleBlur:f,handleKeyup:c,handleClick:d,customColorCssVars:H(()=>{const{color:x}=e;if(!x)return null;const k=bo(x);return{"--n-border-color":x,"--n-border-color-hover":k,"--n-border-color-pressed":da(x),"--n-border-color-focus":k,"--n-border-color-disabled":x}}),cssVars:p?void 0:y,themeClass:w==null?void 0:w.themeClass,onRender:w==null?void 0:w.onRender}},render(){const{mergedClsPrefix:e,tag:t,onRender:r}=this;r==null||r();const o=dt(this.$slots.default,n=>n&&v("span",{class:`${e}-button__content`},n));return v(t,{ref:"selfElRef",class:[this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`],tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:this.cssVars,disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},this.iconPlacement==="right"&&o,v(ml,{width:!0},{default:()=>dt(this.$slots.icon,n=>(this.loading||this.renderIcon||n)&&v("span",{class:`${e}-button__icon`,style:{margin:Ia(this.$slots.default)?"0":""}},v(vl,null,{default:()=>this.loading?v(gl,{clsPrefix:e,key:"loading",class:`${e}-icon-slot`,strokeWidth:20}):v("div",{key:"icon",class:`${e}-icon-slot`,role:"none"},this.renderIcon?this.renderIcon():n)})))}),this.iconPlacement==="left"&&o,this.text?null:v(qm,{ref:"waveElRef",clsPrefix:e}),this.showBorder?v("div",{"aria-hidden":!0,class:`${e}-button__border`,style:this.customColorCssVars}):null,this.showBorder?v("div",{"aria-hidden":!0,class:`${e}-button__state-border`,style:this.customColorCssVars}):null)}});var Da=hg;const NM=hg;var Kk={titleFontSize:"22px"};const qk=e=>{const{borderRadius:t,fontSize:r,lineHeight:o,textColor2:n,textColor1:i,textColorDisabled:a,dividerColor:l,fontWeightStrong:s,primaryColor:d,baseColor:c,hoverColor:u,cardColor:f,modalColor:p,popoverColor:h}=e;return Object.assign(Object.assign({},Kk),{borderRadius:t,borderColor:xe(f,l),borderColorModal:xe(p,l),borderColorPopover:xe(h,l),textColor:n,titleFontWeight:s,titleTextColor:i,dayTextColor:a,fontSize:r,lineHeight:o,dateColorCurrent:d,dateTextColorCurrent:c,cellColorHover:xe(f,u),cellColorHoverModal:xe(p,u),cellColorHoverPopover:xe(h,u),cellColor:f,cellColorModal:p,cellColorPopover:h,barColor:d})},Gk={name:"Calendar",common:le,peers:{Button:Kt},self:qk};var Yk=Gk;const Xk=e=>{const{fontSize:t,boxShadow2:r,popoverColor:o,textColor2:n,borderRadius:i,borderColor:a,heightSmall:l,heightMedium:s,heightLarge:d,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:f,dividerColor:p}=e;return{panelFontSize:t,boxShadow:r,color:o,textColor:n,borderRadius:i,border:`1px solid ${a}`,heightSmall:l,heightMedium:s,heightLarge:d,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:f,dividerColor:p}},Zk={name:"ColorPicker",common:le,peers:{Input:ur,Button:Kt},self:Xk};var Jk=Zk,Qk={paddingSmall:"12px 16px 12px",paddingMedium:"19px 24px 20px",paddingLarge:"23px 32px 24px",paddingHuge:"27px 40px 28px",titleFontSizeSmall:"16px",titleFontSizeMedium:"18px",titleFontSizeLarge:"18px",titleFontSizeHuge:"18px",closeIconSize:"18px",closeSize:"22px"};const pg=e=>{const{primaryColor:t,borderRadius:r,lineHeight:o,fontSize:n,cardColor:i,textColor2:a,textColor1:l,dividerColor:s,fontWeightStrong:d,closeIconColor:c,closeIconColorHover:u,closeIconColorPressed:f,closeColorHover:p,closeColorPressed:h,modalColor:g,boxShadow1:b,popoverColor:m,actionColor:y}=e;return Object.assign(Object.assign({},Qk),{lineHeight:o,color:i,colorModal:g,colorPopover:m,colorTarget:t,colorEmbedded:y,colorEmbeddedModal:y,colorEmbeddedPopover:y,textColor:a,titleTextColor:l,borderColor:s,actionColor:y,titleFontWeight:d,closeColorHover:p,closeColorPressed:h,closeBorderRadius:r,closeIconColor:c,closeIconColorHover:u,closeIconColorPressed:f,fontSizeSmall:n,fontSizeMedium:n,fontSizeLarge:n,fontSizeHuge:n,boxShadow:b,borderRadius:r})},e8={name:"Card",common:je,self:pg};var vg=e8;const t8={name:"Card",common:le,self(e){const t=pg(e),{cardColor:r,modalColor:o,popoverColor:n}=e;return t.colorEmbedded=r,t.colorEmbeddedModal=o,t.colorEmbeddedPopover=n,t}};var mg=t8,r8=O([M("card",` - font-size: var(--n-font-size); - line-height: var(--n-line-height); - display: flex; - flex-direction: column; - width: 100%; - box-sizing: border-box; - position: relative; - border-radius: var(--n-border-radius); - background-color: var(--n-color); - color: var(--n-text-color); - word-break: break-word; - transition: - color .3s var(--n-bezier), - background-color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier), - border-color .3s var(--n-bezier); - `,[vv({background:"var(--n-color-modal)"}),K("hoverable",[O("&:hover","box-shadow: var(--n-box-shadow);")]),K("content-segmented",[O(">",[D("content",{paddingTop:"var(--n-padding-bottom)"})])]),K("content-soft-segmented",[O(">",[D("content",` - margin: 0 var(--n-padding-left); - padding: var(--n-padding-bottom) 0; - `)])]),K("footer-segmented",[O(">",[D("footer",{paddingTop:"var(--n-padding-bottom)"})])]),K("footer-soft-segmented",[O(">",[D("footer",` - padding: var(--n-padding-bottom) 0; - margin: 0 var(--n-padding-left); - `)])]),O(">",[M("card-header",` - box-sizing: border-box; - display: flex; - align-items: center; - font-size: var(--n-title-font-size); - padding: - var(--n-padding-top) - var(--n-padding-left) - var(--n-padding-bottom) - var(--n-padding-left); - `,[D("main",` - font-weight: var(--n-title-font-weight); - transition: color .3s var(--n-bezier); - flex: 1; - min-width: 0; - color: var(--n-title-text-color); - `),D("extra",` - display: flex; - align-items: center; - font-size: var(--n-font-size); - font-weight: 400; - transition: color .3s var(--n-bezier); - color: var(--n-text-color); - `),D("close",` - margin: 0 0 0 8px; - transition: - background-color .3s var(--n-bezier), - color .3s var(--n-bezier); - `)]),D("action",` - box-sizing: border-box; - transition: - background-color .3s var(--n-bezier), - border-color .3s var(--n-bezier); - background-clip: padding-box; - background-color: var(--n-action-color); - `),D("content","flex: 1; min-width: 0;"),D("content, footer",` - box-sizing: border-box; - padding: 0 var(--n-padding-left) var(--n-padding-bottom) var(--n-padding-left); - font-size: var(--n-font-size); - `,[O("&:first-child",{paddingTop:"var(--n-padding-bottom)"})]),D("action",` - background-color: var(--n-action-color); - padding: var(--n-padding-bottom) var(--n-padding-left); - border-bottom-left-radius: var(--n-border-radius); - border-bottom-right-radius: var(--n-border-radius); - `)]),M("card-cover",` - overflow: hidden; - width: 100%; - border-radius: var(--n-border-radius) var(--n-border-radius) 0 0; - `,[O("img",` - display: block; - width: 100%; - `)]),K("bordered",` - border: 1px solid var(--n-border-color); - `,[O("&:target","border-color: var(--n-color-target);")]),K("action-segmented",[O(">",[D("action",[O("&:not(:first-child)",{borderTop:"1px solid var(--n-border-color)"})])])]),K("content-segmented, content-soft-segmented",[O(">",[D("content",{transition:"border-color 0.3s var(--n-bezier)"},[O("&:not(:first-child)",{borderTop:"1px solid var(--n-border-color)"})])])]),K("footer-segmented, footer-soft-segmented",[O(">",[D("footer",{transition:"border-color 0.3s var(--n-bezier)"},[O("&:not(:first-child)",{borderTop:"1px solid var(--n-border-color)"})])])]),K("embedded",` - background-color: var(--n-color-embedded); - `)]),Hc(M("card",` - background: var(--n-color-modal); - `,[K("embedded",` - background-color: var(--n-color-embedded-modal); - `)])),pv(M("card",` - background: var(--n-color-popover); - `,[K("embedded",` - background-color: var(--n-color-embedded-popover); - `)]))]);const id={title:String,contentStyle:[Object,String],headerStyle:[Object,String],headerExtraStyle:[Object,String],footerStyle:[Object,String],embedded:Boolean,segmented:{type:[Boolean,Object],default:!1},size:{type:String,default:"medium"},bordered:{type:Boolean,default:!0},closable:Boolean,hoverable:Boolean,role:String,onClose:[Function,Array],tag:{type:String,default:"div"}},o8=sr(id),n8=Object.assign(Object.assign({},Ee.props),id);var ad=ae({name:"Card",props:n8,setup(e){const t=()=>{const{onClose:d}=e;d&&Ae(d)},{inlineThemeDisabled:r,mergedClsPrefixRef:o,mergedRtlRef:n}=st(e),i=Ee("Card","-card",r8,vg,e,o),a=Kr("Card",n,o),l=H(()=>{const{size:d}=e,{self:{color:c,colorModal:u,colorTarget:f,textColor:p,titleTextColor:h,titleFontWeight:g,borderColor:b,actionColor:m,borderRadius:y,lineHeight:w,closeIconColor:x,closeIconColorHover:k,closeIconColorPressed:T,closeColorHover:S,closeColorPressed:$,closeBorderRadius:R,closeIconSize:_,closeSize:N,boxShadow:E,colorPopover:F,colorEmbedded:j,colorEmbeddedModal:Q,colorEmbeddedPopover:A,[ie("padding",d)]:X,[ie("fontSize",d)]:ne,[ie("titleFontSize",d)]:pe},common:{cubicBezierEaseInOut:Ce}}=i.value,{top:$e,left:_e,bottom:Ge}=av(X);return{"--n-bezier":Ce,"--n-border-radius":y,"--n-color":c,"--n-color-modal":u,"--n-color-popover":F,"--n-color-embedded":j,"--n-color-embedded-modal":Q,"--n-color-embedded-popover":A,"--n-color-target":f,"--n-text-color":p,"--n-line-height":w,"--n-action-color":m,"--n-title-text-color":h,"--n-title-font-weight":g,"--n-close-icon-color":x,"--n-close-icon-color-hover":k,"--n-close-icon-color-pressed":T,"--n-close-color-hover":S,"--n-close-color-pressed":$,"--n-border-color":b,"--n-box-shadow":E,"--n-padding-top":$e,"--n-padding-bottom":Ge,"--n-padding-left":_e,"--n-font-size":ne,"--n-title-font-size":pe,"--n-close-size":N,"--n-close-icon-size":_,"--n-close-border-radius":R}}),s=r?Pt("card",H(()=>e.size[0]),l,e):void 0;return{rtlEnabled:a,mergedClsPrefix:o,mergedTheme:i,handleCloseClick:t,cssVars:r?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){const{segmented:e,bordered:t,hoverable:r,mergedClsPrefix:o,rtlEnabled:n,onRender:i,embedded:a,tag:l,$slots:s}=this;return i==null||i(),v(l,{class:[`${o}-card`,this.themeClass,a&&`${o}-card--embedded`,{[`${o}-card--rtl`]:n,[`${o}-card--content${typeof e!="boolean"&&e.content==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.content,[`${o}-card--footer${typeof e!="boolean"&&e.footer==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.footer,[`${o}-card--action-segmented`]:e===!0||e!==!1&&e.action,[`${o}-card--bordered`]:t,[`${o}-card--hoverable`]:r}],style:this.cssVars,role:this.role},dt(s.cover,d=>d&&v("div",{class:`${o}-card-cover`,role:"none"},d)),dt(s.header,d=>d||this.title||this.closable?v("div",{class:`${o}-card-header`,style:this.headerStyle},v("div",{class:`${o}-card-header__main`,role:"heading"},d||this.title),dt(s["header-extra"],c=>c&&v("div",{class:`${o}-card-header__extra`,style:this.headerExtraStyle},c)),this.closable?v(ji,{clsPrefix:o,class:`${o}-card-header__close`,onClick:this.handleCloseClick,absolute:!0}):null):null),dt(s.default,d=>d&&v("div",{class:`${o}-card__content`,style:this.contentStyle,role:"none"},d)),dt(s.footer,d=>d&&[v("div",{class:`${o}-card__footer`,style:this.footerStyle,role:"none"},d)]),dt(s.action,d=>d&&v("div",{class:`${o}-card__action`,role:"none"},d)))}});const i8=e=>({dotSize:"8px",dotColor:"rgba(255, 255, 255, .3)",dotColorActive:"rgba(255, 255, 255, 1)",dotColorFocus:"rgba(255, 255, 255, .5)",dotLineWidth:"16px",dotLineWidthActive:"24px",arrowColor:"#eee"}),a8={name:"Carousel",common:le,self:i8};var l8=a8,s8={sizeSmall:"14px",sizeMedium:"16px",sizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"};const c8=e=>{const{baseColor:t,inputColorDisabled:r,cardColor:o,modalColor:n,popoverColor:i,textColorDisabled:a,borderColor:l,primaryColor:s,textColor2:d,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:f,borderRadiusSmall:p,lineHeight:h}=e;return Object.assign(Object.assign({},s8),{labelLineHeight:h,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:f,borderRadius:p,color:t,colorChecked:s,colorDisabled:r,colorDisabledChecked:r,colorTableHeader:o,colorTableHeaderModal:n,colorTableHeaderPopover:i,checkMarkColor:t,checkMarkColorDisabled:a,checkMarkColorDisabledChecked:a,border:`1px solid ${l}`,borderDisabled:`1px solid ${l}`,borderDisabledChecked:`1px solid ${l}`,borderChecked:`1px solid ${s}`,borderFocus:`1px solid ${s}`,boxShadowFocus:`0 0 0 2px ${oe(s,{alpha:.3})}`,textColor:d,textColorDisabled:a})},d8={name:"Checkbox",common:le,self(e){const{cardColor:t}=e,r=c8(e);return r.color="#0000",r.checkMarkColor=t,r}};var Nn=d8;const u8=e=>{const{borderRadius:t,boxShadow2:r,popoverColor:o,textColor2:n,textColor3:i,primaryColor:a,textColorDisabled:l,dividerColor:s,hoverColor:d,fontSizeMedium:c,heightMedium:u}=e;return{menuBorderRadius:t,menuColor:o,menuBoxShadow:r,menuDividerColor:s,menuHeight:"calc(var(--n-option-height) * 6.6)",optionArrowColor:i,optionHeight:u,optionFontSize:c,optionColorHover:d,optionTextColor:n,optionTextColorActive:a,optionTextColorDisabled:l,optionCheckMarkColor:a,loadingColor:a,columnWidth:"180px"}},f8={name:"Cascader",common:le,peers:{InternalSelectMenu:Ni,InternalSelection:nd,Scrollbar:Ut,Checkbox:Nn,Empty:Fm},self:u8};var h8=f8;const p8={name:"Code",common:le,self(e){const{textColor2:t,fontSize:r,fontWeightStrong:o,textColor3:n}=e;return{textColor:t,fontSize:r,fontWeightStrong:o,"mono-3":"#5c6370","hue-1":"#56b6c2","hue-2":"#61aeee","hue-3":"#c678dd","hue-4":"#98c379","hue-5":"#e06c75","hue-5-2":"#be5046","hue-6":"#d19a66","hue-6-2":"#e6c07b",lineNumberTextColor:n}}};var gg=p8;const v8=e=>{const{fontWeight:t,textColor1:r,textColor2:o,textColorDisabled:n,dividerColor:i,fontSize:a}=e;return{titleFontSize:a,titleFontWeight:t,dividerColor:i,titleTextColor:r,titleTextColorDisabled:n,fontSize:a,textColor:o,arrowColor:o,arrowColorDisabled:n,itemMargin:"16px 0 0 0"}},m8={name:"Collapse",common:le,self:v8};var g8=m8;const b8=e=>{const{cubicBezierEaseInOut:t}=e;return{bezier:t}},x8={name:"CollapseTransition",common:le,self:b8};var C8=x8;const y8={abstract:Boolean,bordered:{type:Boolean,default:void 0},clsPrefix:String,locale:Object,dateLocale:Object,namespace:String,rtl:Array,tag:{type:String,default:"div"},hljs:Object,katex:Object,theme:Object,themeOverrides:Object,componentOptions:Object,icons:Object,breakpoints:Object,preflightStyleDisabled:Boolean,inlineThemeDisabled:{type:Boolean,default:void 0},as:{type:String,validator:()=>(io("config-provider","`as` is deprecated, please use `tag` instead."),!0),default:void 0}};var w8=ae({name:"ConfigProvider",alias:["App"],props:y8,setup(e){const t=me(Fr,null),r=H(()=>{const{theme:h}=e;if(h===null)return;const g=t==null?void 0:t.mergedThemeRef.value;return h===void 0?g:g===void 0?h:Object.assign({},g,h)}),o=H(()=>{const{themeOverrides:h}=e;if(h!==null){if(h===void 0)return t==null?void 0:t.mergedThemeOverridesRef.value;{const g=t==null?void 0:t.mergedThemeOverridesRef.value;return g===void 0?h:un({},g,h)}}}),n=mt(()=>{const{namespace:h}=e;return h===void 0?t==null?void 0:t.mergedNamespaceRef.value:h}),i=mt(()=>{const{bordered:h}=e;return h===void 0?t==null?void 0:t.mergedBorderedRef.value:h}),a=H(()=>{const{icons:h}=e;return h===void 0?t==null?void 0:t.mergedIconsRef.value:h}),l=H(()=>{const{componentOptions:h}=e;return h!==void 0?h:t==null?void 0:t.mergedComponentPropsRef.value}),s=H(()=>{const{clsPrefix:h}=e;return h!==void 0?h:t==null?void 0:t.mergedClsPrefixRef.value}),d=H(()=>{var h;const{rtl:g}=e;if(g===void 0)return t==null?void 0:t.mergedRtlRef.value;const b={};for(const m of g)b[m.name]=Pa(m),(h=m.peers)===null||h===void 0||h.forEach(y=>{y.name in b||(b[y.name]=Pa(y))});return b}),c=H(()=>e.breakpoints||(t==null?void 0:t.mergedBreakpointsRef.value)),u=e.inlineThemeDisabled||(t==null?void 0:t.inlineThemeDisabled),f=e.preflightStyleDisabled||(t==null?void 0:t.preflightStyleDisabled),p=H(()=>{const{value:h}=r,{value:g}=o,b=g&&Object.keys(g).length!==0,m=h==null?void 0:h.name;return m?b?`${m}-${Pi(JSON.stringify(o.value))}`:m:b?Pi(JSON.stringify(o.value)):""});return Be(Fr,{mergedThemeHashRef:p,mergedBreakpointsRef:c,mergedRtlRef:d,mergedIconsRef:a,mergedComponentPropsRef:l,mergedBorderedRef:i,mergedNamespaceRef:n,mergedClsPrefixRef:s,mergedLocaleRef:H(()=>{const{locale:h}=e;if(h!==null)return h===void 0?t==null?void 0:t.mergedLocaleRef.value:h}),mergedDateLocaleRef:H(()=>{const{dateLocale:h}=e;if(h!==null)return h===void 0?t==null?void 0:t.mergedDateLocaleRef.value:h}),mergedHljsRef:H(()=>{const{hljs:h}=e;return h===void 0?t==null?void 0:t.mergedHljsRef.value:h}),mergedKatexRef:H(()=>{const{katex:h}=e;return h===void 0?t==null?void 0:t.mergedKatexRef.value:h}),mergedThemeRef:r,mergedThemeOverridesRef:o,inlineThemeDisabled:u||!1,preflightStyleDisabled:f||!1}),{mergedClsPrefix:s,mergedBordered:i,mergedNamespace:n,mergedTheme:r,mergedThemeOverrides:o}},render(){var e,t,r,o;return this.abstract?(o=(r=this.$slots).default)===null||o===void 0?void 0:o.call(r):v(this.as||this.tag,{class:`${this.mergedClsPrefix||zm}-config-provider`},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))}});const S8={name:"Popselect",common:le,peers:{Popover:Uo,InternalSelectMenu:Ni}};var bg=S8;function $8(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const _8={name:"Popselect",common:je,peers:{Popover:jn,InternalSelectMenu:Km},self:$8};var P8=_8;function xg(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const k8={name:"Select",common:je,peers:{InternalSelection:N4,InternalSelectMenu:Km},self:xg};var T8=k8;const z8={name:"Select",common:le,peers:{InternalSelection:nd,InternalSelectMenu:Ni},self:xg};var Cg=z8,E8={itemPaddingSmall:"0 4px",itemMarginSmall:"0 0 0 8px",itemMarginSmallRtl:"0 8px 0 0",itemPaddingMedium:"0 4px",itemMarginMedium:"0 0 0 8px",itemMarginMediumRtl:"0 8px 0 0",itemPaddingLarge:"0 4px",itemMarginLarge:"0 0 0 8px",itemMarginLargeRtl:"0 8px 0 0",buttonIconSizeSmall:"14px",buttonIconSizeMedium:"16px",buttonIconSizeLarge:"18px",inputWidthSmall:"60px",selectWidthSmall:"unset",inputMarginSmall:"0 0 0 8px",inputMarginSmallRtl:"0 8px 0 0",selectMarginSmall:"0 0 0 8px",prefixMarginSmall:"0 8px 0 0",suffixMarginSmall:"0 0 0 8px",inputWidthMedium:"60px",selectWidthMedium:"unset",inputMarginMedium:"0 0 0 8px",inputMarginMediumRtl:"0 8px 0 0",selectMarginMedium:"0 0 0 8px",prefixMarginMedium:"0 8px 0 0",suffixMarginMedium:"0 0 0 8px",inputWidthLarge:"60px",selectWidthLarge:"unset",inputMarginLarge:"0 0 0 8px",inputMarginLargeRtl:"0 8px 0 0",selectMarginLarge:"0 0 0 8px",prefixMarginLarge:"0 8px 0 0",suffixMarginLarge:"0 0 0 8px"};const yg=e=>{const{textColor2:t,primaryColor:r,primaryColorHover:o,primaryColorPressed:n,inputColorDisabled:i,textColorDisabled:a,borderColor:l,borderRadius:s,fontSizeTiny:d,fontSizeSmall:c,fontSizeMedium:u,heightTiny:f,heightSmall:p,heightMedium:h}=e;return Object.assign(Object.assign({},E8),{buttonColor:"#0000",buttonColorHover:"#0000",buttonColorPressed:"#0000",buttonBorder:`1px solid ${l}`,buttonBorderHover:`1px solid ${l}`,buttonBorderPressed:`1px solid ${l}`,buttonIconColor:t,buttonIconColorHover:t,buttonIconColorPressed:t,itemTextColor:t,itemTextColorHover:o,itemTextColorPressed:n,itemTextColorActive:r,itemTextColorDisabled:a,itemColor:"#0000",itemColorHover:"#0000",itemColorPressed:"#0000",itemColorActive:"#0000",itemColorActiveHover:"#0000",itemColorDisabled:i,itemBorder:"1px solid #0000",itemBorderHover:"1px solid #0000",itemBorderPressed:"1px solid #0000",itemBorderActive:`1px solid ${r}`,itemBorderDisabled:`1px solid ${l}`,itemBorderRadius:s,itemSizeSmall:f,itemSizeMedium:p,itemSizeLarge:h,itemFontSizeSmall:d,itemFontSizeMedium:c,itemFontSizeLarge:u,jumperFontSizeSmall:d,jumperFontSizeMedium:c,jumperFontSizeLarge:u,jumperTextColor:t,jumperTextColorDisabled:a})},R8={name:"Pagination",common:je,peers:{Select:T8,Input:ag,Popselect:P8},self:yg};var WM=R8;const I8={name:"Pagination",common:le,peers:{Select:Cg,Input:ur,Popselect:bg},self(e){const{primaryColor:t,opacity3:r}=e,o=oe(t,{alpha:Number(r)}),n=yg(e);return n.itemBorderActive=`1px solid ${o}`,n.itemBorderDisabled="1px solid #0000",n}};var wg=I8,Sg={padding:"8px 14px"};const O8={name:"Tooltip",common:le,peers:{Popover:Uo},self(e){const{borderRadius:t,boxShadow2:r,popoverColor:o,textColor2:n}=e;return Object.assign(Object.assign({},Sg),{borderRadius:t,boxShadow:r,color:o,textColor:n})}};var Cl=O8;const A8=e=>{const{borderRadius:t,boxShadow2:r,baseColor:o}=e;return Object.assign(Object.assign({},Sg),{borderRadius:t,boxShadow:r,color:xe(o,"rgba(0, 0, 0, .85)"),textColor:o})},M8={name:"Tooltip",common:je,peers:{Popover:jn},self:A8};var ld=M8;const B8={name:"Ellipsis",common:le,peers:{Tooltip:Cl}};var $g=B8,L8={radioSizeSmall:"14px",radioSizeMedium:"16px",radioSizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"};const H8={name:"Radio",common:le,self(e){const{borderColor:t,primaryColor:r,baseColor:o,textColorDisabled:n,inputColorDisabled:i,textColor2:a,opacityDisabled:l,borderRadius:s,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,heightSmall:f,heightMedium:p,heightLarge:h,lineHeight:g}=e;return Object.assign(Object.assign({},L8),{labelLineHeight:g,buttonHeightSmall:f,buttonHeightMedium:p,buttonHeightLarge:h,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${t}`,boxShadowActive:`inset 0 0 0 1px ${r}`,boxShadowFocus:`inset 0 0 0 1px ${r}, 0 0 0 2px ${oe(r,{alpha:.3})}`,boxShadowHover:`inset 0 0 0 1px ${r}`,boxShadowDisabled:`inset 0 0 0 1px ${t}`,color:"#0000",colorDisabled:i,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:r,dotColorDisabled:t,buttonBorderColor:t,buttonBorderColorActive:r,buttonBorderColorHover:r,buttonColor:"#0000",buttonColorActive:r,buttonTextColor:a,buttonTextColorActive:o,buttonTextColorHover:r,opacityDisabled:l,buttonBoxShadowFocus:`inset 0 0 0 1px ${r}, 0 0 0 2px ${oe(r,{alpha:.3})}`,buttonBoxShadowHover:`inset 0 0 0 1px ${r}`,buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}};var _g=H8,D8={padding:"4px 0",optionIconSizeSmall:"14px",optionIconSizeMedium:"16px",optionIconSizeLarge:"16px",optionIconSizeHuge:"18px",optionSuffixWidthSmall:"14px",optionSuffixWidthMedium:"14px",optionSuffixWidthLarge:"16px",optionSuffixWidthHuge:"16px",optionIconSuffixWidthSmall:"32px",optionIconSuffixWidthMedium:"32px",optionIconSuffixWidthLarge:"36px",optionIconSuffixWidthHuge:"36px",optionPrefixWidthSmall:"14px",optionPrefixWidthMedium:"14px",optionPrefixWidthLarge:"16px",optionPrefixWidthHuge:"16px",optionIconPrefixWidthSmall:"36px",optionIconPrefixWidthMedium:"36px",optionIconPrefixWidthLarge:"40px",optionIconPrefixWidthHuge:"40px"};const Pg=e=>{const{primaryColor:t,textColor2:r,dividerColor:o,hoverColor:n,popoverColor:i,invertedColor:a,borderRadius:l,fontSizeSmall:s,fontSizeMedium:d,fontSizeLarge:c,fontSizeHuge:u,heightSmall:f,heightMedium:p,heightLarge:h,heightHuge:g,textColor3:b,opacityDisabled:m}=e;return Object.assign(Object.assign({},D8),{optionHeightSmall:f,optionHeightMedium:p,optionHeightLarge:h,optionHeightHuge:g,borderRadius:l,fontSizeSmall:s,fontSizeMedium:d,fontSizeLarge:c,fontSizeHuge:u,optionTextColor:r,optionTextColorHover:r,optionTextColorActive:t,optionTextColorChildActive:t,color:i,dividerColor:o,suffixColor:r,prefixColor:r,optionColorHover:n,optionColorActive:oe(t,{alpha:.1}),groupHeaderTextColor:b,optionTextColorInverted:"#BBB",optionTextColorHoverInverted:"#FFF",optionTextColorActiveInverted:"#FFF",optionTextColorChildActiveInverted:"#FFF",colorInverted:a,dividerColorInverted:"#BBB",suffixColorInverted:"#BBB",prefixColorInverted:"#BBB",optionColorHoverInverted:t,optionColorActiveInverted:t,groupHeaderTextColorInverted:"#AAA",optionOpacityDisabled:m})},F8={name:"Dropdown",common:je,peers:{Popover:jn},self:Pg};var kg=F8;const j8={name:"Dropdown",common:le,peers:{Popover:Uo},self(e){const{primaryColorSuppl:t,primaryColor:r,popoverColor:o}=e,n=Pg(e);return n.colorInverted=o,n.optionColorActive=oe(r,{alpha:.15}),n.optionColorActiveInverted=t,n.optionColorHoverInverted=t,n}};var sd=j8,N8={thPaddingSmall:"8px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"8px",tdPaddingMedium:"12px",tdPaddingLarge:"12px",sorterSize:"15px",resizableContainerSize:"8px",resizableSize:"2px",filterSize:"15px",paginationMargin:"12px 0 0 0",emptyPadding:"48px 0",actionPadding:"8px 12px",actionButtonMargin:"0 8px 0 0"};const W8=e=>{const{cardColor:t,modalColor:r,popoverColor:o,textColor2:n,textColor1:i,tableHeaderColor:a,tableColorHover:l,iconColor:s,primaryColor:d,fontWeightStrong:c,borderRadius:u,lineHeight:f,fontSizeSmall:p,fontSizeMedium:h,fontSizeLarge:g,dividerColor:b,heightSmall:m,opacityDisabled:y,tableColorStriped:w}=e;return Object.assign(Object.assign({},N8),{actionDividerColor:b,lineHeight:f,borderRadius:u,fontSizeSmall:p,fontSizeMedium:h,fontSizeLarge:g,borderColor:xe(t,b),tdColorHover:xe(t,l),tdColorStriped:xe(t,w),thColor:xe(t,a),thColorHover:xe(xe(t,a),l),tdColor:t,tdTextColor:n,thTextColor:i,thFontWeight:c,thButtonColorHover:l,thIconColor:s,thIconColorActive:d,borderColorModal:xe(r,b),tdColorHoverModal:xe(r,l),tdColorStripedModal:xe(r,w),thColorModal:xe(r,a),thColorHoverModal:xe(xe(r,a),l),tdColorModal:r,borderColorPopover:xe(o,b),tdColorHoverPopover:xe(o,l),tdColorStripedPopover:xe(o,w),thColorPopover:xe(o,a),thColorHoverPopover:xe(xe(o,a),l),tdColorPopover:o,boxShadowBefore:"inset -12px 0 8px -12px rgba(0, 0, 0, .18)",boxShadowAfter:"inset 12px 0 8px -12px rgba(0, 0, 0, .18)",loadingColor:d,loadingSize:m,opacityLoading:y})},V8={name:"DataTable",common:le,peers:{Button:Kt,Checkbox:Nn,Radio:_g,Pagination:wg,Scrollbar:Ut,Empty:Vo,Popover:Uo,Ellipsis:$g,Dropdown:sd},self(e){const t=W8(e);return t.boxShadowAfter="inset 12px 0 8px -12px rgba(0, 0, 0, .36)",t.boxShadowBefore="inset -12px 0 8px -12px rgba(0, 0, 0, .36)",t}};var U8=V8;const K8=Object.assign(Object.assign({},bl),Ee.props);var Tg=ae({name:"Tooltip",props:K8,__popover__:!0,setup(e){const t=Ee("Tooltip","-tooltip",void 0,ld,e),r=V(null);return Object.assign(Object.assign({},{syncPosition(){r.value.syncPosition()},setShow(n){r.value.setShow(n)}}),{popoverRef:r,mergedTheme:t,popoverThemeOverrides:H(()=>t.value.self)})},render(){const{mergedTheme:e,internalExtraClass:t}=this;return v(Zm,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:t.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),zg=ae({name:"DropdownDivider",props:{clsPrefix:{type:String,required:!0}},render(){return v("div",{class:`${this.clsPrefix}-dropdown-divider`})}});const Eg=e=>{const{textColorBase:t,opacity1:r,opacity2:o,opacity3:n,opacity4:i,opacity5:a}=e;return{color:t,opacity1Depth:r,opacity2Depth:o,opacity3Depth:n,opacity4Depth:i,opacity5Depth:a}},q8={name:"Icon",common:je,self:Eg};var G8=q8;const Y8={name:"Icon",common:le,self:Eg};var X8=Y8,Z8=M("icon",` - height: 1em; - width: 1em; - line-height: 1em; - text-align: center; - display: inline-block; - position: relative; - fill: currentColor; - transform: translateZ(0); -`,[K("color-transition",{transition:"color .3s var(--n-bezier)"}),K("depth",{color:"var(--n-color)"},[O("svg",{opacity:"var(--n-opacity)",transition:"opacity .3s var(--n-bezier)"})]),O("svg",{height:"1em",width:"1em"})]);const J8=Object.assign(Object.assign({},Ee.props),{depth:[String,Number],size:[Number,String],color:String,component:Object}),fn=ae({_n_icon__:!0,name:"Icon",inheritAttrs:!1,props:J8,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=st(e),o=Ee("Icon","-icon",Z8,G8,e,t),n=H(()=>{const{depth:a}=e,{common:{cubicBezierEaseInOut:l},self:s}=o.value;if(a!==void 0){const{color:d,[`opacity${a}Depth`]:c}=s;return{"--n-bezier":l,"--n-color":d,"--n-opacity":c}}return{"--n-bezier":l,"--n-color":"","--n-opacity":""}}),i=r?Pt("icon",H(()=>`${e.depth||"d"}`),n,e):void 0;return{mergedClsPrefix:t,mergedStyle:H(()=>{const{size:a,color:l}=e;return{fontSize:ar(a),color:l}}),cssVars:r?void 0:n,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e;const{$parent:t,depth:r,mergedClsPrefix:o,component:n,onRender:i,themeClass:a}=this;return!((e=t==null?void 0:t.$options)===null||e===void 0)&&e._n_icon__&&io("icon","don't wrap `n-icon` inside `n-icon`"),i==null||i(),v("i",so(this.$attrs,{role:"img",class:[`${o}-icon`,a,{[`${o}-icon--depth`]:r,[`${o}-icon--color-transition`]:r!==void 0}],style:[this.cssVars,this.mergedStyle]}),n?v(n):this.$slots)}}),cd="n-dropdown-menu",yl="n-dropdown",eh="n-dropdown-option";function Qs(e,t){return e.type==="submenu"||e.type===void 0&&e[t]!==void 0}function Q8(e){return e.type==="group"}function Rg(e){return e.type==="divider"}function eT(e){return e.type==="render"}var Ig=ae({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(e){const t=me(yl),{hoverKeyRef:r,keyboardKeyRef:o,lastToggledSubmenuKeyRef:n,pendingKeyPathRef:i,activeKeyPathRef:a,animatedRef:l,mergedShowRef:s,renderLabelRef:d,renderIconRef:c,labelFieldRef:u,childrenFieldRef:f,renderOptionRef:p,nodePropsRef:h,menuPropsRef:g}=t,b=me(eh,null),m=me(cd),y=me(Di),w=H(()=>e.tmNode.rawNode),x=H(()=>{const{value:X}=f;return Qs(e.tmNode.rawNode,X)}),k=H(()=>{const{disabled:X}=e.tmNode;return X}),T=H(()=>{if(!x.value)return!1;const{key:X,disabled:ne}=e.tmNode;if(ne)return!1;const{value:pe}=r,{value:Ce}=o,{value:$e}=n,{value:_e}=i;return pe!==null?_e.includes(X):Ce!==null?_e.includes(X)&&_e[_e.length-1]!==X:$e!==null?_e.includes(X):!1}),S=H(()=>o.value===null&&!l.value),$=gw(T,300,S),R=H(()=>!!(b!=null&&b.enteringSubmenuRef.value)),_=V(!1);Be(eh,{enteringSubmenuRef:_});function N(){_.value=!0}function E(){_.value=!1}function F(){const{parentKey:X,tmNode:ne}=e;ne.disabled||!s.value||(n.value=X,o.value=null,r.value=ne.key)}function j(){const{tmNode:X}=e;X.disabled||!s.value||r.value!==X.key&&F()}function Q(X){if(e.tmNode.disabled||!s.value)return;const{relatedTarget:ne}=X;ne&&!Iu({target:ne},"dropdownOption")&&!Iu({target:ne},"scrollbarRail")&&(r.value=null)}function A(){const{value:X}=x,{tmNode:ne}=e;!s.value||!X&&!ne.disabled&&(t.doSelect(ne.key,ne.rawNode),t.doUpdateShow(!1))}return{labelField:u,renderLabel:d,renderIcon:c,siblingHasIcon:m.showIconRef,siblingHasSubmenu:m.hasSubmenuRef,menuProps:g,popoverBody:y,animated:l,mergedShowSubmenu:H(()=>$.value&&!R.value),rawNode:w,hasSubmenu:x,pending:mt(()=>{const{value:X}=i,{key:ne}=e.tmNode;return X.includes(ne)}),childActive:mt(()=>{const{value:X}=a,{key:ne}=e.tmNode,pe=X.findIndex(Ce=>ne===Ce);return pe===-1?!1:pe{const{value:X}=a,{key:ne}=e.tmNode,pe=X.findIndex(Ce=>ne===Ce);return pe===-1?!1:pe===X.length-1}),mergedDisabled:k,renderOption:p,nodeProps:h,handleClick:A,handleMouseMove:j,handleMouseEnter:F,handleMouseLeave:Q,handleSubmenuBeforeEnter:N,handleSubmenuAfterEnter:E}},render(){var e,t;const{animated:r,rawNode:o,mergedShowSubmenu:n,clsPrefix:i,siblingHasIcon:a,siblingHasSubmenu:l,renderLabel:s,renderIcon:d,renderOption:c,nodeProps:u,props:f,scrollable:p}=this;let h=null;if(n){const y=(e=this.menuProps)===null||e===void 0?void 0:e.call(this,o,o.children);h=v(Og,Object.assign({},y,{clsPrefix:i,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const g={class:[`${i}-dropdown-option-body`,this.pending&&`${i}-dropdown-option-body--pending`,this.active&&`${i}-dropdown-option-body--active`,this.childActive&&`${i}-dropdown-option-body--child-active`,this.mergedDisabled&&`${i}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},b=u==null?void 0:u(o),m=v("div",Object.assign({class:[`${i}-dropdown-option`,b==null?void 0:b.class],"data-dropdown-option":!0},b),v("div",so(g,f),[v("div",{class:[`${i}-dropdown-option-body__prefix`,a&&`${i}-dropdown-option-body__prefix--show-icon`]},[d?d(o):St(o.icon)]),v("div",{"data-dropdown-option":!0,class:`${i}-dropdown-option-body__label`},s?s(o):St((t=o[this.labelField])!==null&&t!==void 0?t:o.title)),v("div",{"data-dropdown-option":!0,class:[`${i}-dropdown-option-body__suffix`,l&&`${i}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?v(fn,null,{default:()=>v(g6,null)}):null)]),this.hasSubmenu?v(_v,null,{default:()=>[v(Pv,null,{default:()=>v("div",{class:`${i}-dropdown-offset-container`},v(zv,{show:this.mergedShowSubmenu,placement:this.placement,to:p&&this.popoverBody||void 0,teleportDisabled:!p},{default:()=>v("div",{class:`${i}-dropdown-menu-wrapper`},r?v(Bt,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>h}):h)}))})]}):null);return c?c({node:m,option:o}):m}}),tT=ae({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:e,hasSubmenuRef:t}=me(cd),{renderLabelRef:r,labelFieldRef:o,nodePropsRef:n,renderOptionRef:i}=me(yl);return{labelField:o,showIcon:e,hasSubmenu:t,renderLabel:r,nodeProps:n,renderOption:i}},render(){var e;const{clsPrefix:t,hasSubmenu:r,showIcon:o,nodeProps:n,renderLabel:i,renderOption:a}=this,{rawNode:l}=this.tmNode,s=v("div",Object.assign({class:`${t}-dropdown-option`},n==null?void 0:n(l)),v("div",{class:`${t}-dropdown-option-body ${t}-dropdown-option-body--group`},v("div",{"data-dropdown-option":!0,class:[`${t}-dropdown-option-body__prefix`,o&&`${t}-dropdown-option-body__prefix--show-icon`]},St(l.icon)),v("div",{class:`${t}-dropdown-option-body__label`,"data-dropdown-option":!0},i?i(l):St((e=l.title)!==null&&e!==void 0?e:l[this.labelField])),v("div",{class:[`${t}-dropdown-option-body__suffix`,r&&`${t}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return a?a({node:s,option:l}):s}}),rT=ae({name:"NDropdownGroup",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){const{tmNode:e,parentKey:t,clsPrefix:r}=this,{children:o}=e;return v(Je,null,v(tT,{clsPrefix:r,tmNode:e,key:e.key}),o==null?void 0:o.map(n=>{const{rawNode:i}=n;return i.show===!1?null:Rg(i)?v(zg,{clsPrefix:r,key:n.key}):n.isGroup?(io("dropdown","`group` node is not allowed to be put in `group` node."),null):v(Ig,{clsPrefix:r,tmNode:n,parentKey:t,key:n.key})}))}}),oT=ae({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:e,props:t}}=this.tmNode;return v("div",t,[e==null?void 0:e()])}}),Og=ae({name:"DropdownMenu",props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(e){const{renderIconRef:t,childrenFieldRef:r}=me(yl);Be(cd,{showIconRef:H(()=>{const n=t.value;return e.tmNodes.some(i=>{var a;if(i.isGroup)return(a=i.children)===null||a===void 0?void 0:a.some(({rawNode:s})=>n?n(s):s.icon);const{rawNode:l}=i;return n?n(l):l.icon})}),hasSubmenuRef:H(()=>{const{value:n}=r;return e.tmNodes.some(i=>{var a;if(i.isGroup)return(a=i.children)===null||a===void 0?void 0:a.some(({rawNode:s})=>Qs(s,n));const{rawNode:l}=i;return Qs(l,n)})})});const o=V(null);return Be(ll,null),Be(sl,null),Be(Di,o),{bodyRef:o}},render(){const{parentKey:e,clsPrefix:t,scrollable:r}=this,o=this.tmNodes.map(n=>{const{rawNode:i}=n;return i.show===!1?null:eT(i)?v(oT,{tmNode:n,key:n.key}):Rg(i)?v(zg,{clsPrefix:t,key:n.key}):Q8(i)?v(rT,{clsPrefix:t,tmNode:n,parentKey:e,key:n.key}):v(Ig,{clsPrefix:t,tmNode:n,parentKey:e,key:n.key,props:i.props,scrollable:r})});return v("div",{class:[`${t}-dropdown-menu`,r&&`${t}-dropdown-menu--scrollable`],ref:"bodyRef"},r?v(Vm,{contentClass:`${t}-dropdown-menu__content`},{default:()=>o}):o,this.showArrow?Xm({clsPrefix:t,arrowStyle:this.arrowStyle}):null)}}),nT=M("dropdown-menu",` - transform-origin: var(--v-transform-origin); - background-color: var(--n-color); - border-radius: var(--n-border-radius); - box-shadow: var(--n-box-shadow); - position: relative; - transition: - background-color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier); -`,[Mi(),M("dropdown-option",` - position: relative; - `,[O("a",` - text-decoration: none; - color: inherit; - outline: none; - `,[O("&::before",` - content: ""; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - `)]),M("dropdown-option-body",` - display: flex; - cursor: pointer; - position: relative; - height: var(--n-option-height); - line-height: var(--n-option-height); - font-size: var(--n-font-size); - color: var(--n-option-text-color); - transition: color .3s var(--n-bezier); - `,[O("&::before",` - content: ""; - position: absolute; - top: 0; - bottom: 0; - left: 4px; - right: 4px; - transition: background-color .3s var(--n-bezier); - border-radius: var(--n-border-radius); - `),ut("disabled",[K("pending",` - color: var(--n-option-text-color-hover); - `,[D("prefix, suffix",` - color: var(--n-option-text-color-hover); - `),O("&::before","background-color: var(--n-option-color-hover);")]),K("active",` - color: var(--n-option-text-color-active); - `,[D("prefix, suffix",` - color: var(--n-option-text-color-active); - `),O("&::before","background-color: var(--n-option-color-active);")]),K("child-active",` - color: var(--n-option-text-color-child-active); - `,[D("prefix, suffix",` - color: var(--n-option-text-color-child-active); - `)])]),K("disabled",` - cursor: not-allowed; - opacity: var(--n-option-opacity-disabled); - `),K("group",` - font-size: calc(var(--n-font-size) - 1px); - color: var(--n-group-header-text-color); - `,[D("prefix",` - width: calc(var(--n-option-prefix-width) / 2); - `,[K("show-icon",` - width: calc(var(--n-option-icon-prefix-width) / 2); - `)])]),D("prefix",` - width: var(--n-option-prefix-width); - display: flex; - justify-content: center; - align-items: center; - color: var(--n-prefix-color); - transition: color .3s var(--n-bezier); - z-index: 1; - `,[K("show-icon",` - width: var(--n-option-icon-prefix-width); - `),M("icon",` - font-size: var(--n-option-icon-size); - `)]),D("label",` - white-space: nowrap; - flex: 1; - z-index: 1; - `),D("suffix",` - box-sizing: border-box; - flex-grow: 0; - flex-shrink: 0; - display: flex; - justify-content: flex-end; - align-items: center; - min-width: var(--n-option-suffix-width); - padding: 0 8px; - transition: color .3s var(--n-bezier); - color: var(--n-suffix-color); - z-index: 1; - `,[K("has-submenu",` - width: var(--n-option-icon-suffix-width); - `),M("icon",` - font-size: var(--n-option-icon-size); - `)]),M("dropdown-menu","pointer-events: all;")]),M("dropdown-offset-container",` - pointer-events: none; - position: absolute; - left: 0; - right: 0; - top: -4px; - bottom: -4px; - `)]),M("dropdown-divider",` - transition: background-color .3s var(--n-bezier); - background-color: var(--n-divider-color); - height: 1px; - margin: 4px 0; - `),M("dropdown-menu-wrapper",` - transform-origin: var(--v-transform-origin); - width: fit-content; - `),O(">",[M("scrollbar",` - height: inherit; - max-height: inherit; - `)]),ut("scrollable",` - padding: var(--n-padding); - `),K("scrollable",[D("content",` - padding: var(--n-padding); - `)])]);const iT={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:{type:String,default:"medium"},inverted:Boolean,placement:{type:String,default:"bottom"},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},value:[String,Number]},aT=Object.keys(bl),lT=Object.assign(Object.assign(Object.assign({},bl),iT),Ee.props);var sT=ae({name:"Dropdown",inheritAttrs:!1,props:lT,setup(e){const t=V(!1),r=En(Te(e,"show"),t),o=H(()=>{const{keyField:E,childrenField:F}=e;return Bm(e.options,{getKey(j){return j[E]},getDisabled(j){return j.disabled===!0},getIgnored(j){return j.type==="divider"||j.type==="render"},getChildren(j){return j[F]}})}),n=H(()=>o.value.treeNodes),i=V(null),a=V(null),l=V(null),s=H(()=>{var E,F,j;return(j=(F=(E=i.value)!==null&&E!==void 0?E:a.value)!==null&&F!==void 0?F:l.value)!==null&&j!==void 0?j:null}),d=H(()=>o.value.getPath(s.value).keyPath),c=H(()=>o.value.getPath(e.value).keyPath),u=mt(()=>e.keyboard&&r.value);Tw({keydown:{ArrowUp:{prevent:!0,handler:k},ArrowRight:{prevent:!0,handler:x},ArrowDown:{prevent:!0,handler:T},ArrowLeft:{prevent:!0,handler:w},Enter:{prevent:!0,handler:S},Escape:y}},u);const{mergedClsPrefixRef:f,inlineThemeDisabled:p}=st(e),h=Ee("Dropdown","-dropdown",nT,kg,e,f);Be(yl,{labelFieldRef:Te(e,"labelField"),childrenFieldRef:Te(e,"childrenField"),renderLabelRef:Te(e,"renderLabel"),renderIconRef:Te(e,"renderIcon"),hoverKeyRef:i,keyboardKeyRef:a,lastToggledSubmenuKeyRef:l,pendingKeyPathRef:d,activeKeyPathRef:c,animatedRef:Te(e,"animated"),mergedShowRef:r,nodePropsRef:Te(e,"nodeProps"),renderOptionRef:Te(e,"renderOption"),menuPropsRef:Te(e,"menuProps"),doSelect:g,doUpdateShow:b}),De(r,E=>{!e.animated&&!E&&m()});function g(E,F){const{onSelect:j}=e;j&&Ae(j,E,F)}function b(E){const{"onUpdate:show":F,onUpdateShow:j}=e;F&&Ae(F,E),j&&Ae(j,E),t.value=E}function m(){i.value=null,a.value=null,l.value=null}function y(){b(!1)}function w(){R("left")}function x(){R("right")}function k(){R("up")}function T(){R("down")}function S(){const E=$();(E==null?void 0:E.isLeaf)&&r.value&&(g(E.key,E.rawNode),b(!1))}function $(){var E;const{value:F}=o,{value:j}=s;return!F||j===null?null:(E=F.getNode(j))!==null&&E!==void 0?E:null}function R(E){const{value:F}=s,{value:{getFirstAvailableNode:j}}=o;let Q=null;if(F===null){const A=j();A!==null&&(Q=A.key)}else{const A=$();if(A){let X;switch(E){case"down":X=A.getNext();break;case"up":X=A.getPrev();break;case"right":X=A.getChild();break;case"left":X=A.getParent();break}X&&(Q=X.key)}}Q!==null&&(i.value=null,a.value=Q)}const _=H(()=>{const{size:E,inverted:F}=e,{common:{cubicBezierEaseInOut:j},self:Q}=h.value,{padding:A,dividerColor:X,borderRadius:ne,optionOpacityDisabled:pe,[ie("optionIconSuffixWidth",E)]:Ce,[ie("optionSuffixWidth",E)]:$e,[ie("optionIconPrefixWidth",E)]:_e,[ie("optionPrefixWidth",E)]:Ge,[ie("fontSize",E)]:Le,[ie("optionHeight",E)]:U,[ie("optionIconSize",E)]:ee}=Q,G={"--n-bezier":j,"--n-font-size":Le,"--n-padding":A,"--n-border-radius":ne,"--n-option-height":U,"--n-option-prefix-width":Ge,"--n-option-icon-prefix-width":_e,"--n-option-suffix-width":$e,"--n-option-icon-suffix-width":Ce,"--n-option-icon-size":ee,"--n-divider-color":X,"--n-option-opacity-disabled":pe};return F?(G["--n-color"]=Q.colorInverted,G["--n-option-color-hover"]=Q.optionColorHoverInverted,G["--n-option-color-active"]=Q.optionColorActiveInverted,G["--n-option-text-color"]=Q.optionTextColorInverted,G["--n-option-text-color-hover"]=Q.optionTextColorHoverInverted,G["--n-option-text-color-active"]=Q.optionTextColorActiveInverted,G["--n-option-text-color-child-active"]=Q.optionTextColorChildActiveInverted,G["--n-prefix-color"]=Q.prefixColorInverted,G["--n-suffix-color"]=Q.suffixColorInverted,G["--n-group-header-text-color"]=Q.groupHeaderTextColorInverted):(G["--n-color"]=Q.color,G["--n-option-color-hover"]=Q.optionColorHover,G["--n-option-color-active"]=Q.optionColorActive,G["--n-option-text-color"]=Q.optionTextColor,G["--n-option-text-color-hover"]=Q.optionTextColorHover,G["--n-option-text-color-active"]=Q.optionTextColorActive,G["--n-option-text-color-child-active"]=Q.optionTextColorChildActive,G["--n-prefix-color"]=Q.prefixColor,G["--n-suffix-color"]=Q.suffixColor,G["--n-group-header-text-color"]=Q.groupHeaderTextColor),G}),N=p?Pt("dropdown",H(()=>`${e.size[0]}${e.inverted?"i":""}`),_,e):void 0;return{mergedClsPrefix:f,mergedTheme:h,tmNodes:n,mergedShow:r,handleAfterLeave:()=>{!e.animated||m()},doUpdateShow:b,cssVars:p?void 0:_,themeClass:N==null?void 0:N.themeClass,onRender:N==null?void 0:N.onRender}},render(){const e=(o,n,i,a,l)=>{var s;const{mergedClsPrefix:d,menuProps:c}=this;(s=this.onRender)===null||s===void 0||s.call(this);const u=(c==null?void 0:c(void 0,this.tmNodes.map(p=>p.rawNode)))||{},f={ref:Vy(n),class:[o,`${d}-dropdown`,this.themeClass],clsPrefix:d,tmNodes:this.tmNodes,style:[i,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:a,onMouseleave:l};return v(Og,so(this.$attrs,f,u))},{mergedTheme:t}=this,r={show:this.mergedShow,theme:t.peers.Popover,themeOverrides:t.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:e,onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return v(Zm,Object.assign({},Jt(this.$props,aT),r),{trigger:()=>{var o,n;return(n=(o=this.$slots).default)===null||n===void 0?void 0:n.call(o)}})}}),cT={itemFontSize:"12px",itemHeight:"36px",itemWidth:"52px",panelActionPadding:"8px 0"};const dT=e=>{const{popoverColor:t,textColor2:r,primaryColor:o,hoverColor:n,dividerColor:i,opacityDisabled:a,boxShadow2:l,borderRadius:s,iconColor:d,iconColorDisabled:c}=e;return Object.assign(Object.assign({},cT),{panelColor:t,panelBoxShadow:l,panelDividerColor:i,itemTextColor:r,itemTextColorActive:o,itemColorHover:n,itemOpacityDisabled:a,itemBorderRadius:s,borderRadius:s,iconColor:d,iconColorDisabled:c})},uT={name:"TimePicker",common:le,peers:{Scrollbar:Ut,Button:Kt,Input:ur},self:dT};var Ag=uT,fT={itemSize:"24px",itemCellWidth:"38px",itemCellHeight:"32px",scrollItemWidth:"80px",scrollItemHeight:"40px",panelExtraFooterPadding:"8px 12px",panelActionPadding:"8px 12px",calendarTitlePadding:"0",calendarTitleHeight:"28px",arrowSize:"14px",panelHeaderPadding:"8px 12px",calendarDaysHeight:"32px",calendarTitleGridTempateColumns:"28px 28px 1fr 28px 28px",calendarLeftPaddingDate:"6px 12px 4px 12px",calendarLeftPaddingDatetime:"4px 12px",calendarLeftPaddingDaterange:"6px 12px 4px 12px",calendarLeftPaddingDatetimerange:"4px 12px",calendarLeftPaddingMonth:"0",calendarLeftPaddingYear:"0",calendarLeftPaddingQuarter:"0",calendarLeftPaddingMonthrange:"0",calendarLeftPaddingQuarterrange:"0",calendarLeftPaddingYearrange:"0",calendarRightPaddingDate:"6px 12px 4px 12px",calendarRightPaddingDatetime:"4px 12px",calendarRightPaddingDaterange:"6px 12px 4px 12px",calendarRightPaddingDatetimerange:"4px 12px",calendarRightPaddingMonth:"0",calendarRightPaddingYear:"0",calendarRightPaddingQuarter:"0",calendarRightPaddingMonthrange:"0",calendarRightPaddingQuarterrange:"0",calendarRightPaddingYearrange:"0"};const hT=e=>{const{hoverColor:t,fontSize:r,textColor2:o,textColorDisabled:n,popoverColor:i,primaryColor:a,borderRadiusSmall:l,iconColor:s,iconColorDisabled:d,textColor1:c,dividerColor:u,boxShadow2:f,borderRadius:p,fontWeightStrong:h}=e;return Object.assign(Object.assign({},fT),{itemFontSize:r,calendarDaysFontSize:r,calendarTitleFontSize:r,itemTextColor:o,itemTextColorDisabled:n,itemTextColorActive:i,itemTextColorCurrent:a,itemColorIncluded:oe(a,{alpha:.1}),itemColorHover:t,itemColorDisabled:t,itemColorActive:a,itemBorderRadius:l,panelColor:i,panelTextColor:o,arrowColor:s,calendarTitleTextColor:c,calendarTitleColorHover:t,calendarDaysTextColor:o,panelHeaderDividerColor:u,calendarDaysDividerColor:u,calendarDividerColor:u,panelActionDividerColor:u,panelBoxShadow:f,panelBorderRadius:p,calendarTitleFontWeight:h,scrollItemBorderRadius:p,iconColor:s,iconColorDisabled:d})},pT={name:"DatePicker",common:le,peers:{Input:ur,Button:Kt,TimePicker:Ag,Scrollbar:Ut},self(e){const{popoverColor:t,hoverColor:r,primaryColor:o}=e,n=hT(e);return n.itemColorDisabled=xe(t,r),n.itemColorIncluded=oe(o,{alpha:.15}),n.itemColorHover=xe(t,r),n}};var vT=pT,mT={thPaddingBorderedSmall:"8px 12px",thPaddingBorderedMedium:"12px 16px",thPaddingBorderedLarge:"16px 24px",thPaddingSmall:"0",thPaddingMedium:"0",thPaddingLarge:"0",tdPaddingBorderedSmall:"8px 12px",tdPaddingBorderedMedium:"12px 16px",tdPaddingBorderedLarge:"16px 24px",tdPaddingSmall:"0 0 8px 0",tdPaddingMedium:"0 0 12px 0",tdPaddingLarge:"0 0 16px 0"};const gT=e=>{const{tableHeaderColor:t,textColor2:r,textColor1:o,cardColor:n,modalColor:i,popoverColor:a,dividerColor:l,borderRadius:s,fontWeightStrong:d,lineHeight:c,fontSizeSmall:u,fontSizeMedium:f,fontSizeLarge:p}=e;return Object.assign(Object.assign({},mT),{lineHeight:c,fontSizeSmall:u,fontSizeMedium:f,fontSizeLarge:p,titleTextColor:o,thColor:xe(n,t),thColorModal:xe(i,t),thColorPopover:xe(a,t),thTextColor:o,thFontWeight:d,tdTextColor:r,tdColor:n,tdColorModal:i,tdColorPopover:a,borderColor:xe(n,l),borderColorModal:xe(i,l),borderColorPopover:xe(a,l),borderRadius:s})},bT={name:"Descriptions",common:le,self:gT};var xT=bT,CT={titleFontSize:"18px",padding:"16px 28px 20px 28px",iconSize:"28px",actionSpace:"12px",contentMargin:"8px 0 16px 0",iconMargin:"0 4px 0 0",iconMarginIconTop:"4px 0 8px 0",closeSize:"22px",closeIconSize:"18px",closeMargin:"20px 26px 0 0",closeMarginIconTop:"10px 16px 0 0"};const Mg=e=>{const{textColor1:t,textColor2:r,modalColor:o,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,infoColor:d,successColor:c,warningColor:u,errorColor:f,primaryColor:p,dividerColor:h,borderRadius:g,fontWeightStrong:b,lineHeight:m,fontSize:y}=e;return Object.assign(Object.assign({},CT),{fontSize:y,lineHeight:m,border:`1px solid ${h}`,titleTextColor:t,textColor:r,color:o,closeColorHover:l,closeColorPressed:s,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeBorderRadius:g,iconColor:p,iconColorInfo:d,iconColorSuccess:c,iconColorWarning:u,iconColorError:f,borderRadius:g,titleFontWeight:b})},yT={name:"Dialog",common:je,peers:{Button:xl},self:Mg};var Bg=yT;const wT={name:"Dialog",common:le,peers:{Button:Kt},self:Mg};var Lg=wT;const wl={icon:Function,type:{type:String,default:"default"},title:[String,Function],closable:{type:Boolean,default:!0},negativeText:String,positiveText:String,positiveButtonProps:Object,negativeButtonProps:Object,content:[String,Function],action:Function,showIcon:{type:Boolean,default:!0},loading:Boolean,bordered:Boolean,iconPlacement:String,onPositiveClick:Function,onNegativeClick:Function,onClose:Function},Hg=sr(wl);var ST=O([M("dialog",` - word-break: break-word; - line-height: var(--n-line-height); - position: relative; - background: var(--n-color); - color: var(--n-text-color); - box-sizing: border-box; - margin: auto; - border-radius: var(--n-border-radius); - padding: var(--n-padding); - transition: - border-color .3s var(--n-bezier), - background-color .3s var(--n-bezier), - color .3s var(--n-bezier); - `,[D("icon",{color:"var(--n-icon-color)"}),K("bordered",{border:"var(--n-border)"}),K("icon-top",[D("close",{margin:"var(--n-close-margin)"}),D("icon",{margin:"var(--n-icon-margin)"}),D("content",{textAlign:"center"}),D("title",{justifyContent:"center"}),D("action",{justifyContent:"center"})]),K("icon-left",[D("icon",{margin:"var(--n-icon-margin)"}),K("closable",[D("title",` - padding-right: calc(var(--n-close-size) + 6px); - `)])]),D("close",` - position: absolute; - right: 0; - top: 0; - margin: var(--n-close-margin); - transition: - background-color .3s var(--n-bezier), - color .3s var(--n-bezier); - z-index: 1; - `),D("content",` - font-size: var(--n-font-size); - margin: var(--n-content-margin); - position: relative; - word-break: break-word; - `,[K("last","margin-bottom: 0;")]),D("action",` - display: flex; - justify-content: flex-end; - `,[O("> *:not(:last-child)",{marginRight:"var(--n-action-space)"})]),D("icon",{fontSize:"var(--n-icon-size)",transition:"color .3s var(--n-bezier)"}),D("title",` - transition: color .3s var(--n-bezier); - display: flex; - align-items: center; - font-size: var(--n-title-font-size); - font-weight: var(--n-title-font-weight); - color: var(--n-title-text-color); - `),M("dialog-icon-container",{display:"flex",justifyContent:"center"})]),Hc(M("dialog",` - width: 446px; - max-width: calc(100vw - 32px); - `)),M("dialog",[vv(` - width: 446px; - max-width: calc(100vw - 32px); - `)])]);const $T={default:()=>v(Xs,null),info:()=>v(Xs,null),success:()=>v(Im,null),warning:()=>v(Om,null),error:()=>v(Rm,null)},Dg=ae({name:"Dialog",alias:["NimbusConfirmCard","Confirm"],props:Object.assign(Object.assign({},Ee.props),wl),setup(e){const{mergedComponentPropsRef:t,mergedClsPrefixRef:r,inlineThemeDisabled:o}=st(e),n=H(()=>{var u,f;const{iconPlacement:p}=e;return p||((f=(u=t==null?void 0:t.value)===null||u===void 0?void 0:u.Dialog)===null||f===void 0?void 0:f.iconPlacement)||"left"});function i(u){const{onPositiveClick:f}=e;f&&f(u)}function a(u){const{onNegativeClick:f}=e;f&&f(u)}function l(){const{onClose:u}=e;u&&u()}const s=Ee("Dialog","-dialog",ST,Bg,e,r),d=H(()=>{const{type:u}=e,f=n.value,{common:{cubicBezierEaseInOut:p},self:{fontSize:h,lineHeight:g,border:b,titleTextColor:m,textColor:y,color:w,closeBorderRadius:x,closeColorHover:k,closeColorPressed:T,closeIconColor:S,closeIconColorHover:$,closeIconColorPressed:R,closeIconSize:_,borderRadius:N,titleFontWeight:E,titleFontSize:F,padding:j,iconSize:Q,actionSpace:A,contentMargin:X,closeSize:ne,[f==="top"?"iconMarginIconTop":"iconMargin"]:pe,[f==="top"?"closeMarginIconTop":"closeMargin"]:Ce,[ie("iconColor",u)]:$e}}=s.value;return{"--n-font-size":h,"--n-icon-color":$e,"--n-bezier":p,"--n-close-margin":Ce,"--n-icon-margin":pe,"--n-icon-size":Q,"--n-close-size":ne,"--n-close-icon-size":_,"--n-close-border-radius":x,"--n-close-color-hover":k,"--n-close-color-pressed":T,"--n-close-icon-color":S,"--n-close-icon-color-hover":$,"--n-close-icon-color-pressed":R,"--n-color":w,"--n-text-color":y,"--n-border-radius":N,"--n-padding":j,"--n-line-height":g,"--n-border":b,"--n-content-margin":X,"--n-title-font-size":F,"--n-title-font-weight":E,"--n-title-text-color":m,"--n-action-space":A}}),c=o?Pt("dialog",H(()=>`${e.type[0]}${n.value[0]}`),d,e):void 0;return{mergedClsPrefix:r,mergedIconPlacement:n,mergedTheme:s,handlePositiveClick:i,handleNegativeClick:a,handleCloseClick:l,cssVars:o?void 0:d,themeClass:c==null?void 0:c.themeClass,onRender:c==null?void 0:c.onRender}},render(){var e;const{bordered:t,mergedIconPlacement:r,cssVars:o,closable:n,showIcon:i,title:a,content:l,action:s,negativeText:d,positiveText:c,positiveButtonProps:u,negativeButtonProps:f,handlePositiveClick:p,handleNegativeClick:h,mergedTheme:g,loading:b,type:m,mergedClsPrefix:y}=this;(e=this.onRender)===null||e===void 0||e.call(this);const w=i?v(zt,{clsPrefix:y,class:`${y}-dialog__icon`},{default:()=>dt(this.$slots.icon,k=>k||(this.icon?St(this.icon):$T[this.type]()))}):null,x=dt(this.$slots.action,k=>k||c||d||s?v("div",{class:`${y}-dialog__action`},k||(s?[St(s)]:[this.negativeText&&v(Da,Object.assign({theme:g.peers.Button,themeOverrides:g.peerOverrides.Button,ghost:!0,size:"small",onClick:h},f),{default:()=>St(this.negativeText)}),this.positiveText&&v(Da,Object.assign({theme:g.peers.Button,themeOverrides:g.peerOverrides.Button,size:"small",type:m==="default"?"primary":m,disabled:b,loading:b,onClick:p},u),{default:()=>St(this.positiveText)})])):null);return v("div",{class:[`${y}-dialog`,this.themeClass,this.closable&&`${y}-dialog--closable`,`${y}-dialog--icon-${r}`,t&&`${y}-dialog--bordered`],style:o,role:"dialog"},n?v(ji,{clsPrefix:y,class:`${y}-dialog__close`,onClick:this.handleCloseClick}):null,i&&r==="top"?v("div",{class:`${y}-dialog-icon-container`},w):null,v("div",{class:`${y}-dialog__title`},i&&r==="left"?w:null,Lr(this.$slots.header,()=>[St(a)])),v("div",{class:[`${y}-dialog__content`,x?"":`${y}-dialog__content--last`]},Lr(this.$slots.default,()=>[St(l)])),x)}}),Fg="n-dialog-provider",_T="n-dialog-api",PT="n-dialog-reactive-list",jg=e=>{const{modalColor:t,textColor2:r,boxShadow3:o}=e;return{color:t,textColor:r,boxShadow:o}},kT={name:"Modal",common:je,peers:{Scrollbar:od,Dialog:Bg,Card:vg},self:jg};var TT=kT;const zT={name:"Modal",common:le,peers:{Scrollbar:Ut,Dialog:Lg,Card:mg},self:jg};var ET=zT;const dd=Object.assign(Object.assign({},id),wl),RT=sr(dd);var IT=ae({name:"ModalBody",inheritAttrs:!1,props:Object.assign(Object.assign({show:{type:Boolean,required:!0},preset:String,displayDirective:{type:String,required:!0},trapFocus:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},blockScroll:Boolean},dd),{renderMask:Function,onClickoutside:Function,onBeforeLeave:{type:Function,required:!0},onAfterLeave:{type:Function,required:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0},onClose:{type:Function,required:!0},onAfterEnter:Function,onEsc:Function}),setup(e){const t=V(null),r=V(null),o=V(e.show),n=V(null),i=V(null);De(Te(e,"show"),b=>{b&&(o.value=!0)}),CS(H(()=>e.blockScroll&&o.value));const a=me(yv);function l(){if(a.transformOriginRef.value==="center")return"";const{value:b}=n,{value:m}=i;if(b===null||m===null)return"";if(r.value){const y=r.value.containerScrollTop;return`${b}px ${m+y}px`}return""}function s(b){if(a.transformOriginRef.value==="center")return;const m=a.getMousePosition();if(!m||!r.value)return;const y=r.value.containerScrollTop,{offsetLeft:w,offsetTop:x}=b;if(m){const k=m.y,T=m.x;n.value=-(w-T),i.value=-(x-k-y)}b.style.transformOrigin=l()}function d(b){Zt(()=>{s(b)})}function c(b){b.style.transformOrigin=l(),e.onBeforeLeave()}function u(){o.value=!1,n.value=null,i.value=null,e.onAfterLeave()}function f(){const{onClose:b}=e;b&&b()}function p(){e.onNegativeClick()}function h(){e.onPositiveClick()}const g=V(null);return De(g,b=>{b&&Zt(()=>{const m=b.el;m&&t.value!==m&&(t.value=m)})}),Be(ll,t),Be(sl,null),Be(Di,null),{mergedTheme:a.mergedThemeRef,appear:a.appearRef,isMounted:a.isMountedRef,mergedClsPrefix:a.mergedClsPrefixRef,bodyRef:t,scrollbarRef:r,displayed:o,childNodeRef:g,handlePositiveClick:h,handleNegativeClick:p,handleCloseClick:f,handleAfterLeave:u,handleBeforeLeave:c,handleEnter:d}},render(){const{$slots:e,$attrs:t,handleEnter:r,handleAfterLeave:o,handleBeforeLeave:n,preset:i,mergedClsPrefix:a}=this;let l=null;if(!i){if(l=Ms(e),!l){io("modal","default slot is empty");return}l=lr(l),l.props=so({class:`${a}-modal`},t,l.props||{})}return this.displayDirective==="show"||this.displayed||this.show?Tr(v("div",{role:"none",class:`${a}-modal-body-wrapper`},v(Wm,{ref:"scrollbarRef",theme:this.mergedTheme.peers.Scrollbar,themeOverrides:this.mergedTheme.peerOverrides.Scrollbar,contentClass:`${a}-modal-scroll-content`},{default:()=>{var s;return[(s=this.renderMask)===null||s===void 0?void 0:s.call(this),v(Fv,{disabled:!this.trapFocus,active:this.show,onEsc:this.onEsc,autoFocus:this.autoFocus},{default:()=>{var d;return v(Bt,{name:"fade-in-scale-up-transition",appear:(d=this.appear)!==null&&d!==void 0?d:this.isMounted,onEnter:r,onAfterEnter:this.onAfterEnter,onAfterLeave:o,onBeforeLeave:n},{default:()=>{const c=[[Si,this.show]],{onClickoutside:u}=this;return u&&c.push([Ds,this.onClickoutside,void 0,{capture:!0}]),Tr(this.preset==="confirm"||this.preset==="dialog"?v(Dg,Object.assign({},this.$attrs,{class:[`${a}-modal`,this.$attrs.class],ref:"bodyRef",theme:this.mergedTheme.peers.Dialog,themeOverrides:this.mergedTheme.peerOverrides.Dialog},Jt(this.$props,Hg),{"aria-modal":"true"}),e):this.preset==="card"?v(ad,Object.assign({},this.$attrs,{ref:"bodyRef",class:[`${a}-modal`,this.$attrs.class],theme:this.mergedTheme.peers.Card,themeOverrides:this.mergedTheme.peerOverrides.Card},Jt(this.$props,o8),{"aria-modal":"true",role:"dialog"}),e):this.childNodeRef=l,c)}})}})]}})),[[Si,this.displayDirective==="if"||this.displayed||this.show]]):null}}),OT=O([M("modal-container",` - position: fixed; - left: 0; - top: 0; - height: 0; - width: 0; - display: flex; - `),M("modal-mask",` - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - background-color: rgba(0, 0, 0, .4); - `,[Ai({enterDuration:".25s",leaveDuration:".25s",enterCubicBezier:"var(--n-bezier-ease-out)",leaveCubicBezier:"var(--n-bezier-ease-out)"})]),M("modal-body-wrapper",` - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - overflow: visible; - `,[M("modal-scroll-content",` - min-height: 100%; - display: flex; - position: relative; - `)]),M("modal",` - position: relative; - align-self: center; - color: var(--n-text-color); - margin: auto; - box-shadow: var(--n-box-shadow); - `,[Mi({duration:".25s",enterScale:".5"})])]);const AT=Object.assign(Object.assign(Object.assign(Object.assign({},Ee.props),{show:Boolean,unstableShowMask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},preset:String,to:[String,Object],displayDirective:{type:String,default:"if"},transformOrigin:{type:String,default:"mouse"},zIndex:Number,autoFocus:{type:Boolean,default:!0},trapFocus:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!0}}),dd),{onEsc:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onAfterEnter:Function,onBeforeLeave:Function,onAfterLeave:Function,onClose:Function,onPositiveClick:Function,onNegativeClick:Function,onMaskClick:Function,internalDialog:Boolean,internalAppear:{type:Boolean,default:void 0},overlayStyle:[String,Object],onBeforeHide:Function,onAfterHide:Function,onHide:Function});var Ng=ae({name:"Modal",inheritAttrs:!1,props:AT,setup(e){const t=V(null),{mergedClsPrefixRef:r,namespaceRef:o,inlineThemeDisabled:n}=st(e),i=Ee("Modal","-modal",OT,TT,e,r),a=Cv(64),l=xv(),s=Hi(),d=e.internalDialog?me(Fg,null):null,c=yS();function u(k){const{onUpdateShow:T,"onUpdate:show":S,onHide:$}=e;T&&Ae(T,k),S&&Ae(S,k),$&&!k&&$(k)}function f(){const{onClose:k}=e;k?Promise.resolve(k()).then(T=>{T!==!1&&u(!1)}):u(!1)}function p(){const{onPositiveClick:k}=e;k?Promise.resolve(k()).then(T=>{T!==!1&&u(!1)}):u(!1)}function h(){const{onNegativeClick:k}=e;k?Promise.resolve(k()).then(T=>{T!==!1&&u(!1)}):u(!1)}function g(){const{onBeforeLeave:k,onBeforeHide:T}=e;k&&Ae(k),T&&T()}function b(){const{onAfterLeave:k,onAfterHide:T}=e;k&&Ae(k),T&&T()}function m(k){var T;const{onMaskClick:S}=e;S&&S(k),e.maskClosable&&!((T=t.value)===null||T===void 0)&&T.contains(_i(k))&&u(!1)}function y(k){var T;(T=e.onEsc)===null||T===void 0||T.call(e),e.show&&e.closeOnEsc&&vw(k)&&!c.value&&u(!1)}Be(yv,{getMousePosition:()=>{if(d){const{clickedRef:k,clickPositionRef:T}=d;if(k.value&&T.value)return T.value}return a.value?l.value:null},mergedClsPrefixRef:r,mergedThemeRef:i,isMountedRef:s,appearRef:Te(e,"internalAppear"),transformOriginRef:Te(e,"transformOrigin")});const w=H(()=>{const{common:{cubicBezierEaseOut:k},self:{boxShadow:T,color:S,textColor:$}}=i.value;return{"--n-bezier-ease-out":k,"--n-box-shadow":T,"--n-color":S,"--n-text-color":$}}),x=n?Pt("theme-class",void 0,w,e):void 0;return{mergedClsPrefix:r,namespace:o,isMounted:s,containerRef:t,presetProps:H(()=>Jt(e,RT)),handleEsc:y,handleAfterLeave:b,handleClickoutside:m,handleBeforeLeave:g,doUpdateShow:u,handleNegativeClick:h,handlePositiveClick:p,handleCloseClick:f,cssVars:n?void 0:w,themeClass:x==null?void 0:x.themeClass,onRender:x==null?void 0:x.onRender}},render(){const{mergedClsPrefix:e}=this;return v(jc,{to:this.to,show:this.show},{default:()=>{var t;(t=this.onRender)===null||t===void 0||t.call(this);const{unstableShowMask:r}=this;return Tr(v("div",{role:"none",ref:"containerRef",class:[`${e}-modal-container`,this.themeClass,this.namespace],style:this.cssVars},v(IT,Object.assign({style:this.overlayStyle},this.$attrs,{ref:"bodyWrapper",displayDirective:this.displayDirective,show:this.show,preset:this.preset,autoFocus:this.autoFocus,trapFocus:this.trapFocus,blockScroll:this.blockScroll},this.presetProps,{onEsc:this.handleEsc,onClose:this.handleCloseClick,onNegativeClick:this.handleNegativeClick,onPositiveClick:this.handlePositiveClick,onBeforeLeave:this.handleBeforeLeave,onAfterEnter:this.onAfterEnter,onAfterLeave:this.handleAfterLeave,onClickoutside:r?void 0:this.handleClickoutside,renderMask:r?()=>{var o;return v(Bt,{name:"fade-in-transition",key:"mask",appear:(o=this.internalAppear)!==null&&o!==void 0?o:this.isMounted},{default:()=>this.show?v("div",{"aria-hidden":!0,ref:"containerRef",class:`${e}-modal-mask`,onClick:this.handleClickoutside}):null})}:void 0}),this.$slots)),[[cl,{zIndex:this.zIndex,enabled:this.show}]])}})}});const MT=Object.assign(Object.assign({},wl),{onAfterEnter:Function,onAfterLeave:Function,transformOrigin:String,blockScroll:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},internalStyle:[String,Object],maskClosable:{type:Boolean,default:!0},onPositiveClick:Function,onNegativeClick:Function,onClose:Function,onMaskClick:Function}),BT=ae({name:"DialogEnvironment",props:Object.assign(Object.assign({},MT),{internalKey:{type:String,required:!0},to:[String,Object],onInternalAfterLeave:{type:Function,required:!0}}),setup(e){const t=V(!0);function r(){const{onInternalAfterLeave:c,internalKey:u,onAfterLeave:f}=e;c&&c(u),f&&f()}function o(c){const{onPositiveClick:u}=e;u?Promise.resolve(u(c)).then(f=>{f!==!1&&s()}):s()}function n(c){const{onNegativeClick:u}=e;u?Promise.resolve(u(c)).then(f=>{f!==!1&&s()}):s()}function i(){const{onClose:c}=e;c?Promise.resolve(c()).then(u=>{u!==!1&&s()}):s()}function a(c){const{onMaskClick:u,maskClosable:f}=e;u&&(u(c),f&&s())}function l(){const{onEsc:c}=e;c&&c()}function s(){t.value=!1}function d(c){t.value=c}return{show:t,hide:s,handleUpdateShow:d,handleAfterLeave:r,handleCloseClick:i,handleNegativeClick:n,handlePositiveClick:o,handleMaskClick:a,handleEsc:l}},render(){const{handlePositiveClick:e,handleUpdateShow:t,handleNegativeClick:r,handleCloseClick:o,handleAfterLeave:n,handleMaskClick:i,handleEsc:a,to:l,maskClosable:s,show:d}=this;return v(Ng,{show:d,onUpdateShow:t,onMaskClick:i,onEsc:a,to:l,maskClosable:s,onAfterEnter:this.onAfterEnter,onAfterLeave:n,closeOnEsc:this.closeOnEsc,blockScroll:this.blockScroll,autoFocus:this.autoFocus,transformOrigin:this.transformOrigin,internalAppear:!0,internalDialog:!0},{default:()=>v(Dg,Object.assign({},Jt(this.$props,Hg),{style:this.internalStyle,onClose:o,onNegativeClick:r,onPositiveClick:e}))})}}),LT={injectionKey:String,to:[String,Object]},HT=ae({name:"DialogProvider",props:LT,setup(){const e=V([]),t={};function r(l={}){const s=Tn(),d=vr(Object.assign(Object.assign({},l),{key:s,destroy:()=>{t[`n-dialog-${s}`].hide()}}));return e.value.push(d),d}const o=["info","success","warning","error"].map(l=>s=>r(Object.assign(Object.assign({},s),{type:l})));function n(l){const{value:s}=e;s.splice(s.findIndex(d=>d.key===l),1)}function i(){Object.values(t).forEach(l=>l.hide())}const a={create:r,destroyAll:i,info:o[0],success:o[1],warning:o[2],error:o[3]};return Be(_T,a),Be(Fg,{clickedRef:Cv(64),clickPositionRef:xv()}),Be(PT,e),Object.assign(Object.assign({},a),{dialogList:e,dialogInstRefs:t,handleAfterLeave:n})},render(){var e,t;return v(Je,null,[this.dialogList.map(r=>v(BT,Lc(r,["destroy","style"],{internalStyle:r.style,to:this.to,ref:o=>{o===null?delete this.dialogInstRefs[`n-dialog-${r.key}`]:this.dialogInstRefs[`n-dialog-${r.key}`]=o},internalKey:r.key,onInternalAfterLeave:this.handleAfterLeave}))),(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)])}}),Wg=e=>{const{textColor1:t,dividerColor:r,fontWeightStrong:o}=e;return{textColor:t,color:r,fontWeight:o}},DT={name:"Divider",common:je,self:Wg};var VM=DT;const FT={name:"Divider",common:le,self:Wg};var jT=FT;const NT=e=>{const{modalColor:t,textColor1:r,textColor2:o,boxShadow3:n,lineHeight:i,fontWeightStrong:a,dividerColor:l,closeColorHover:s,closeColorPressed:d,closeIconColor:c,closeIconColorHover:u,closeIconColorPressed:f,borderRadius:p,primaryColorHover:h}=e;return{bodyPadding:"16px 24px",headerPadding:"16px 24px",footerPadding:"16px 24px",color:t,textColor:o,titleTextColor:r,titleFontSize:"18px",titleFontWeight:a,boxShadow:n,lineHeight:i,headerBorderBottom:`1px solid ${l}`,footerBorderTop:`1px solid ${l}`,closeIconColor:c,closeIconColorHover:u,closeIconColorPressed:f,closeSize:"22px",closeIconSize:"18px",closeColorHover:s,closeColorPressed:d,closeBorderRadius:p,resizableTriggerColorHover:h}},WT={name:"Drawer",common:le,peers:{Scrollbar:Ut},self:NT};var VT=WT,UT={actionMargin:"0 0 0 20px",actionMarginRtl:"0 20px 0 0"};const KT={name:"DynamicInput",common:le,peers:{Input:ur,Button:Kt},self(){return UT}};var qT=KT,Vg={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"};const GT={name:"Space",self(){return Vg}};var Ug=GT;const YT=()=>Vg,XT={name:"Space",self:YT};var ZT=XT;let ls;const JT=()=>{if(!Fo)return!0;if(ls===void 0){const e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e);const t=e.scrollHeight===1;return document.body.removeChild(e),ls=t}return ls},QT=Object.assign(Object.assign({},Ee.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,size:{type:[String,Number,Array],default:"medium"},wrapItem:{type:Boolean,default:!0},itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}});var ez=ae({name:"Space",props:QT,setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:r}=st(e),o=Ee("Space","-space",void 0,ZT,e,t),n=Kr("Space",r,t);return{useGap:JT(),rtlEnabled:n,mergedClsPrefix:t,margin:H(()=>{const{size:i}=e;if(Array.isArray(i))return{horizontal:i[0],vertical:i[1]};if(typeof i=="number")return{horizontal:i,vertical:i};const{self:{[ie("gap",i)]:a}}=o.value,{row:l,col:s}=Oy(a);return{horizontal:Ou(s),vertical:Ou(l)}})}},render(){const{vertical:e,align:t,inline:r,justify:o,itemStyle:n,margin:i,wrap:a,mergedClsPrefix:l,rtlEnabled:s,useGap:d,wrapItem:c,internalUseGap:u}=this,f=Ao(Ny(this));if(!f.length)return null;const p=`${i.horizontal}px`,h=`${i.horizontal/2}px`,g=`${i.vertical}px`,b=`${i.vertical/2}px`,m=f.length-1,y=o.startsWith("space-");return v("div",{role:"none",class:[`${l}-space`,s&&`${l}-space--rtl`],style:{display:r?"inline-flex":"flex",flexDirection:e?"column":"row",justifyContent:["start","end"].includes(o)?"flex-"+o:o,flexWrap:!a||e?"nowrap":"wrap",marginTop:d||e?"":`-${b}`,marginBottom:d||e?"":`-${b}`,alignItems:t,gap:d?`${i.vertical}px ${i.horizontal}px`:""}},!c&&(d||u)?f:f.map((w,x)=>v("div",{role:"none",style:[n,{maxWidth:"100%"},d?"":e?{marginBottom:x!==m?g:""}:s?{marginLeft:y?o==="space-between"&&x===m?"":h:x!==m?p:"",marginRight:y?o==="space-between"&&x===0?"":h:"",paddingTop:b,paddingBottom:b}:{marginRight:y?o==="space-between"&&x===m?"":h:x!==m?p:"",marginLeft:y?o==="space-between"&&x===0?"":h:"",paddingTop:b,paddingBottom:b}]},w)))}});const tz={name:"DynamicTags",common:le,peers:{Input:ur,Button:Kt,Tag:Qm,Space:Ug},self(){return{inputWidth:"64px"}}};var rz=tz;const oz={name:"Element",common:le};var nz=oz,iz={feedbackPadding:"4px 0 0 2px",feedbackHeightSmall:"24px",feedbackHeightMedium:"24px",feedbackHeightLarge:"26px",feedbackFontSizeSmall:"13px",feedbackFontSizeMedium:"14px",feedbackFontSizeLarge:"14px",labelFontSizeLeftSmall:"14px",labelFontSizeLeftMedium:"14px",labelFontSizeLeftLarge:"15px",labelFontSizeTopSmall:"13px",labelFontSizeTopMedium:"14px",labelFontSizeTopLarge:"14px",labelHeightSmall:"24px",labelHeightMedium:"26px",labelHeightLarge:"28px",labelPaddingVertical:"0 0 6px 2px",labelPaddingHorizontal:"0 12px 0 0",labelTextAlignVertical:"left",labelTextAlignHorizontal:"right",labelFontWeight:"400"};const Kg=e=>{const{heightSmall:t,heightMedium:r,heightLarge:o,textColor1:n,errorColor:i,warningColor:a,lineHeight:l,textColor3:s}=e;return Object.assign(Object.assign({},iz),{blankHeightSmall:t,blankHeightMedium:r,blankHeightLarge:o,lineHeight:l,labelTextColor:n,asteriskColor:i,feedbackTextColorError:i,feedbackTextColorWarning:a,feedbackTextColor:s})},az={name:"Form",common:je,self:Kg};var qg=az;const lz={name:"Form",common:le,self:Kg};var sz=lz,cz=M("form",[K("inline",` - width: 100%; - display: inline-flex; - align-items: flex-start; - align-content: space-around; - `,[M("form-item",{width:"auto",marginRight:"18px"},[O("&:last-child",{marginRight:0})])])]);const Wi="n-form",Gg="n-form-item-insts";var dz=globalThis&&globalThis.__awaiter||function(e,t,r,o){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(c){try{d(o.next(c))}catch(u){a(u)}}function s(c){try{d(o.throw(c))}catch(u){a(u)}}function d(c){c.done?i(c.value):n(c.value).then(l,s)}d((o=o.apply(e,t||[])).next())})};const uz=Object.assign(Object.assign({},Ee.props),{inline:Boolean,labelWidth:[Number,String],labelAlign:String,labelPlacement:{type:String,default:"top"},model:{type:Object,default:()=>{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:e=>e.preventDefault()},showLabel:{type:Boolean,default:void 0},validateMessages:Object});var fz=ae({name:"Form",props:uz,setup(e){const{mergedClsPrefixRef:t}=st(e);Ee("Form","-form",cz,qg,e,t);const r={},o=V(void 0),n=s=>{const d=o.value;(d===void 0||s>=d)&&(o.value=s)};function i(s,d=()=>!0){return dz(this,void 0,void 0,function*(){return yield new Promise((c,u)=>{const f=[];for(const p of sr(r)){const h=r[p];for(const g of h)g.path&&f.push(g.internalValidate(null,d))}Promise.all(f).then(p=>{if(p.some(h=>!h.valid)){const h=p.filter(g=>g.errors).map(g=>g.errors);s&&s(h),u(h)}else s&&s(),c()})})})}function a(){for(const s of sr(r)){const d=r[s];for(const c of d)c.restoreValidation()}}return Be(Wi,{props:e,maxChildLabelWidthRef:o,deriveMaxChildLabelWidth:n}),Be(Gg,{formItems:r}),Object.assign({validate:i,restoreValidation:a},{mergedClsPrefix:t})},render(){const{mergedClsPrefix:e}=this;return v("form",{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function Ro(){return Ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?t-1:0),o=1;o=i)return l;switch(l){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch{return"[Circular]"}break;default:return l}});return a}return e}function bz(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function yt(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||bz(t)&&typeof e=="string"&&!e)}function xz(e,t,r){var o=[],n=0,i=e.length;function a(l){o.push.apply(o,l||[]),n++,n===i&&r(o)}e.forEach(function(l){t(l,a)})}function th(e,t,r){var o=0,n=e.length;function i(a){if(a&&a.length){r(a);return}var l=o;o=o+1,l()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},ni={integer:function(t){return ni.number(t)&&parseInt(t,10)===t},float:function(t){return ni.number(t)&&!ni.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!ni.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(ih.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(_z())},hex:function(t){return typeof t=="string"&&!!t.match(ih.hex)}},Pz=function(t,r,o,n,i){if(t.required&&r===void 0){Yg(t,r,o,n,i);return}var a=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=t.type;a.indexOf(l)>-1?ni[l](r)||n.push(Xt(i.messages.types[l],t.fullField,t.type)):l&&typeof r!==t.type&&n.push(Xt(i.messages.types[l],t.fullField,t.type))},kz=function(t,r,o,n,i){var a=typeof t.len=="number",l=typeof t.min=="number",s=typeof t.max=="number",d=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=r,u=null,f=typeof r=="number",p=typeof r=="string",h=Array.isArray(r);if(f?u="number":p?u="string":h&&(u="array"),!u)return!1;h&&(c=r.length),p&&(c=r.replace(d,"_").length),a?c!==t.len&&n.push(Xt(i.messages[u].len,t.fullField,t.len)):l&&!s&&ct.max?n.push(Xt(i.messages[u].max,t.fullField,t.max)):l&&s&&(ct.max)&&n.push(Xt(i.messages[u].range,t.fullField,t.min,t.max))},on="enum",Tz=function(t,r,o,n,i){t[on]=Array.isArray(t[on])?t[on]:[],t[on].indexOf(r)===-1&&n.push(Xt(i.messages[on],t.fullField,t[on].join(", ")))},zz=function(t,r,o,n,i){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(r)||n.push(Xt(i.messages.pattern.mismatch,t.fullField,r,t.pattern));else if(typeof t.pattern=="string"){var a=new RegExp(t.pattern);a.test(r)||n.push(Xt(i.messages.pattern.mismatch,t.fullField,r,t.pattern))}}},He={required:Yg,whitespace:$z,type:Pz,range:kz,enum:Tz,pattern:zz},Ez=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(yt(r,"string")&&!t.required)return o();He.required(t,r,n,a,i,"string"),yt(r,"string")||(He.type(t,r,n,a,i),He.range(t,r,n,a,i),He.pattern(t,r,n,a,i),t.whitespace===!0&&He.whitespace(t,r,n,a,i))}o(a)},Rz=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(yt(r)&&!t.required)return o();He.required(t,r,n,a,i),r!==void 0&&He.type(t,r,n,a,i)}o(a)},Iz=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(r===""&&(r=void 0),yt(r)&&!t.required)return o();He.required(t,r,n,a,i),r!==void 0&&(He.type(t,r,n,a,i),He.range(t,r,n,a,i))}o(a)},Oz=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(yt(r)&&!t.required)return o();He.required(t,r,n,a,i),r!==void 0&&He.type(t,r,n,a,i)}o(a)},Az=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(yt(r)&&!t.required)return o();He.required(t,r,n,a,i),yt(r)||He.type(t,r,n,a,i)}o(a)},Mz=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(yt(r)&&!t.required)return o();He.required(t,r,n,a,i),r!==void 0&&(He.type(t,r,n,a,i),He.range(t,r,n,a,i))}o(a)},Bz=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(yt(r)&&!t.required)return o();He.required(t,r,n,a,i),r!==void 0&&(He.type(t,r,n,a,i),He.range(t,r,n,a,i))}o(a)},Lz=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(r==null&&!t.required)return o();He.required(t,r,n,a,i,"array"),r!=null&&(He.type(t,r,n,a,i),He.range(t,r,n,a,i))}o(a)},Hz=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(yt(r)&&!t.required)return o();He.required(t,r,n,a,i),r!==void 0&&He.type(t,r,n,a,i)}o(a)},Dz="enum",Fz=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(yt(r)&&!t.required)return o();He.required(t,r,n,a,i),r!==void 0&&He[Dz](t,r,n,a,i)}o(a)},jz=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(yt(r,"string")&&!t.required)return o();He.required(t,r,n,a,i),yt(r,"string")||He.pattern(t,r,n,a,i)}o(a)},Nz=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(yt(r,"date")&&!t.required)return o();if(He.required(t,r,n,a,i),!yt(r,"date")){var s;r instanceof Date?s=r:s=new Date(r),He.type(t,s,n,a,i),s&&He.range(t,s.getTime(),n,a,i)}}o(a)},Wz=function(t,r,o,n,i){var a=[],l=Array.isArray(r)?"array":typeof r;He.required(t,r,n,a,i,l),o(a)},ss=function(t,r,o,n,i){var a=t.type,l=[],s=t.required||!t.required&&n.hasOwnProperty(t.field);if(s){if(yt(r,a)&&!t.required)return o();He.required(t,r,n,l,i,a),yt(r,a)||He.type(t,r,n,l,i)}o(l)},Vz=function(t,r,o,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(yt(r)&&!t.required)return o();He.required(t,r,n,a,i)}o(a)},pi={string:Ez,method:Rz,number:Iz,boolean:Oz,regexp:Az,integer:Mz,float:Bz,array:Lz,object:Hz,enum:Fz,pattern:jz,date:Nz,url:ss,hex:ss,email:ss,required:Wz,any:Vz};function oc(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var nc=oc(),Vi=function(){function e(r){this.rules=null,this._messages=nc,this.define(r)}var t=e.prototype;return t.define=function(o){var n=this;if(!o)throw new Error("Cannot configure a schema with no rules");if(typeof o!="object"||Array.isArray(o))throw new Error("Rules must be an object");this.rules={},Object.keys(o).forEach(function(i){var a=o[i];n.rules[i]=Array.isArray(a)?a:[a]})},t.messages=function(o){return o&&(this._messages=nh(oc(),o)),this._messages},t.validate=function(o,n,i){var a=this;n===void 0&&(n={}),i===void 0&&(i=function(){});var l=o,s=n,d=i;if(typeof s=="function"&&(d=s,s={}),!this.rules||Object.keys(this.rules).length===0)return d&&d(null,l),Promise.resolve(l);function c(g){var b=[],m={};function y(x){if(Array.isArray(x)){var k;b=(k=b).concat.apply(k,x)}else b.push(x)}for(var w=0;we.size!==void 0?e.size:(t==null?void 0:t.props.size)!==void 0?t.props.size:"medium")}}function Kz(e){const t=me(Wi,null),r=H(()=>{const{labelPlacement:p}=e;return p!==void 0?p:t!=null&&t.props.labelPlacement?t.props.labelPlacement:"top"}),o=H(()=>r.value==="left"&&(e.labelWidth==="auto"||(t==null?void 0:t.props.labelWidth)==="auto")),n=H(()=>{if(r.value==="top")return;const{labelWidth:p}=e;if(p!==void 0&&p!=="auto")return ar(p);if(o.value){const h=t==null?void 0:t.maxChildLabelWidthRef.value;return h!==void 0?ar(h):void 0}if((t==null?void 0:t.props.labelWidth)!==void 0)return ar(t.props.labelWidth)}),i=H(()=>{const{labelAlign:p}=e;if(p)return p;if(t!=null&&t.props.labelAlign)return t.props.labelAlign}),a=H(()=>{var p;return[(p=e.labelProps)===null||p===void 0?void 0:p.style,e.labelStyle,{width:n.value}]}),l=H(()=>{const{showRequireMark:p}=e;return p!==void 0?p:t==null?void 0:t.props.showRequireMark}),s=H(()=>{const{requireMarkPlacement:p}=e;return p!==void 0?p:(t==null?void 0:t.props.requireMarkPlacement)||"right"}),d=V(!1),c=H(()=>{const{validationStatus:p}=e;if(p!==void 0)return p;if(d.value)return"error"}),u=H(()=>{const{showFeedback:p}=e;return p!==void 0?p:(t==null?void 0:t.props.showFeedback)!==void 0?t.props.showFeedback:!0}),f=H(()=>{const{showLabel:p}=e;return p!==void 0?p:(t==null?void 0:t.props.showLabel)!==void 0?t.props.showLabel:!0});return{validationErrored:d,mergedLabelStyle:a,mergedLabelPlacement:r,mergedLabelAlign:i,mergedShowRequireMark:l,mergedRequireMarkPlacement:s,mergedValidationStatus:c,mergedShowFeedback:u,mergedShowLabel:f,isAutoLabelWidth:o}}function qz(e){const t=me(Wi,null),r=H(()=>{const{rulePath:a}=e;if(a!==void 0)return a;const{path:l}=e;if(l!==void 0)return l}),o=H(()=>{const a=[],{rule:l}=e;if(l!==void 0&&(Array.isArray(l)?a.push(...l):a.push(l)),t){const{rules:s}=t.props,{value:d}=r;if(s!==void 0&&d!==void 0){const c=ed(s,d);c!==void 0&&(Array.isArray(c)?a.push(...c):a.push(c))}}return a}),n=H(()=>o.value.some(a=>a.required)),i=H(()=>n.value||e.required);return{mergedRules:o,mergedRequired:i}}const{cubicBezierEaseInOut:ah}=zr;function Gz({name:e="fade-down",fromOffset:t="-4px",enterDuration:r=".3s",leaveDuration:o=".3s",enterCubicBezier:n=ah,leaveCubicBezier:i=ah}={}){return[O(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0,transform:`translateY(${t})`}),O(`&.${e}-transition-enter-to, &.${e}-transition-leave-from`,{opacity:1,transform:"translateY(0)"}),O(`&.${e}-transition-leave-active`,{transition:`opacity ${o} ${i}, transform ${o} ${i}`}),O(`&.${e}-transition-enter-active`,{transition:`opacity ${r} ${n}, transform ${r} ${n}`})]}var Yz=M("form-item",` - display: grid; - line-height: var(--n-line-height); -`,[M("form-item-label",` - grid-area: label; - align-items: center; - line-height: 1.25; - text-align: var(--n-label-text-align); - font-size: var(--n-label-font-size); - min-height: var(--n-label-height); - padding: var(--n-label-padding); - color: var(--n-label-text-color); - transition: color .3s var(--n-bezier); - box-sizing: border-box; - font-weight: var(--n-label-font-weight); - `,[D("asterisk",` - white-space: nowrap; - user-select: none; - -webkit-user-select: none; - color: var(--n-asterisk-color); - transition: color .3s var(--n-bezier); - `),D("asterisk-placeholder",` - grid-area: mark; - user-select: none; - -webkit-user-select: none; - visibility: hidden; - `)]),M("form-item-blank",` - grid-area: blank; - min-height: var(--n-blank-height); - `),K("auto-label-width",[M("form-item-label","white-space: nowrap;")]),K("left-labelled",` - grid-template-areas: - "label blank" - "label feedback"; - grid-template-columns: auto minmax(0, 1fr); - grid-template-rows: auto 1fr; - align-items: start; - `,[M("form-item-label",` - display: grid; - grid-template-columns: 1fr auto; - min-height: var(--n-blank-height); - height: auto; - box-sizing: border-box; - flex-shrink: 0; - flex-grow: 0; - `,[K("reverse-columns-space",` - grid-template-columns: auto 1fr; - `),K("left-mark",` - grid-template-areas: - "mark text" - ". text"; - `),K("right-mark",` - grid-template-areas: - "text mark" - "text ."; - `),K("right-hanging-mark",` - grid-template-areas: - "text mark" - "text ."; - `),D("text",` - grid-area: text; - `),D("asterisk",` - grid-area: mark; - align-self: end; - `)])]),K("top-labelled",` - grid-template-areas: - "label" - "blank" - "feedback"; - grid-template-rows: minmax(var(--n-label-height), auto) 1fr; - grid-template-columns: minmax(0, 100%); - `,[K("no-label",` - grid-template-areas: - "blank" - "feedback"; - grid-template-rows: 1fr; - `),M("form-item-label",` - display: flex; - align-items: flex-start; - justify-content: var(--n-label-text-align); - `)]),M("form-item-blank",` - box-sizing: border-box; - display: flex; - align-items: center; - position: relative; - `),M("form-item-feedback-wrapper",` - grid-area: feedback; - box-sizing: border-box; - min-height: var(--n-feedback-height); - font-size: var(--n-feedback-font-size); - line-height: 1.25; - transform-origin: top left; - `,[O("&:not(:empty)",` - padding: var(--n-feedback-padding); - `),M("form-item-feedback",{transition:"color .3s var(--n-bezier)",color:"var(--n-feedback-text-color)"},[K("warning",{color:"var(--n-feedback-text-color-warning)"}),K("error",{color:"var(--n-feedback-text-color-error)"}),Gz({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]),lh=globalThis&&globalThis.__awaiter||function(e,t,r,o){function n(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function l(c){try{d(o.next(c))}catch(u){a(u)}}function s(c){try{d(o.throw(c))}catch(u){a(u)}}function d(c){c.done?i(c.value):n(c.value).then(l,s)}d((o=o.apply(e,t||[])).next())})};const ud=Object.assign(Object.assign({},Ee.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,showLabel:{type:Boolean,default:void 0},labelProps:Object}),Xz=sr(ud);function sh(e,t){return(...r)=>{try{const o=e(...r);return!t&&(typeof o=="boolean"||o instanceof Error||Array.isArray(o))||(o==null?void 0:o.then)?o:(o===void 0||io("form-item/validate",`You return a ${typeof o} typed value in the validator method, which is not recommended. Please use `+(t?"`Promise`":"`boolean`, `Error` or `Promise`")+" typed value instead."),!0)}catch(o){io("form-item/validate","An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation."),console.error(o);return}}}var Zz=ae({name:"FormItem",props:ud,setup(e){mw(Gg,"formItems",Te(e,"path"));const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=st(e),o=me(Wi,null),n=Uz(e),i=Kz(e),{validationErrored:a}=i,{mergedRequired:l,mergedRules:s}=qz(e),{mergedSize:d}=n,{mergedLabelPlacement:c,mergedLabelAlign:u,mergedRequireMarkPlacement:f}=i,p=V([]),h=V(Tn()),g=o?Te(o.props,"disabled"):V(!1),b=Ee("Form","-form-item",Yz,qg,e,t);De(Te(e,"path"),()=>{e.ignorePathChange||m()});function m(){p.value=[],a.value=!1,e.feedback&&(h.value=Tn())}function y(){S("blur")}function w(){S("change")}function x(){S("focus")}function k(){S("input")}function T(F,j){return lh(this,void 0,void 0,function*(){let Q,A,X,ne;return typeof F=="string"?(Q=F,A=j):F!==null&&typeof F=="object"&&(Q=F.trigger,A=F.callback,X=F.shouldRuleBeApplied,ne=F.options),yield new Promise((pe,Ce)=>{S(Q,X,ne).then(({valid:$e,errors:_e})=>{$e?(A&&A(),pe()):(A&&A(_e),Ce(_e))})})})}const S=(F=null,j=()=>!0,Q={suppressWarning:!0})=>lh(this,void 0,void 0,function*(){const{path:A}=e;Q?Q.first||(Q.first=e.first):Q={};const{value:X}=s,ne=o?ed(o.props.model,A||""):void 0,pe={},Ce={},$e=(F?X.filter(U=>Array.isArray(U.trigger)?U.trigger.includes(F):U.trigger===F):X).filter(j).map((U,ee)=>{const G=Object.assign({},U);if(G.validator&&(G.validator=sh(G.validator,!1)),G.asyncValidator&&(G.asyncValidator=sh(G.asyncValidator,!0)),G.renderMessage){const se=`__renderMessage__${ee}`;Ce[se]=G.message,G.message=se,pe[se]=G.renderMessage}return G});if(!$e.length)return{valid:!0};const _e=A!=null?A:"__n_no_path__",Ge=new Vi({[_e]:$e}),{validateMessages:Le}=(o==null?void 0:o.props)||{};return Le&&Ge.messages(Le),yield new Promise(U=>{Ge.validate({[_e]:ne},Q,ee=>{ee!=null&&ee.length?(p.value=ee.map(G=>{const se=(G==null?void 0:G.message)||"";return{key:se,render:()=>se.startsWith("__renderMessage__")?pe[se]():se}}),ee.forEach(G=>{var se;!((se=G.message)===null||se===void 0)&&se.startsWith("__renderMessage__")&&(G.message=Ce[G.message])}),a.value=!0,U({valid:!1,errors:ee})):(m(),U({valid:!0}))})})});Be(js,{path:Te(e,"path"),disabled:g,mergedSize:n.mergedSize,mergedValidationStatus:i.mergedValidationStatus,restoreValidation:m,handleContentBlur:y,handleContentChange:w,handleContentFocus:x,handleContentInput:k});const $={validate:T,restoreValidation:m,internalValidate:S},R=V(null);gt(()=>{if(!i.isAutoLabelWidth.value)return;const F=R.value;if(F!==null){const j=F.style.whiteSpace;F.style.whiteSpace="nowrap",F.style.width="",o==null||o.deriveMaxChildLabelWidth(Number(getComputedStyle(F).width.slice(0,-2))),F.style.whiteSpace=j}});const _=H(()=>{var F;const{value:j}=d,{value:Q}=c,A=Q==="top"?"vertical":"horizontal",{common:{cubicBezierEaseInOut:X},self:{labelTextColor:ne,asteriskColor:pe,lineHeight:Ce,feedbackTextColor:$e,feedbackTextColorWarning:_e,feedbackTextColorError:Ge,feedbackPadding:Le,labelFontWeight:U,[ie("labelHeight",j)]:ee,[ie("blankHeight",j)]:G,[ie("feedbackFontSize",j)]:se,[ie("feedbackHeight",j)]:ce,[ie("labelPadding",A)]:Re,[ie("labelTextAlign",A)]:ge,[ie(ie("labelFontSize",Q),j)]:C}}=b.value;let P=(F=u.value)!==null&&F!==void 0?F:ge;return Q==="top"&&(P=P==="right"?"flex-end":"flex-start"),{"--n-bezier":X,"--n-line-height":Ce,"--n-blank-height":G,"--n-label-font-size":C,"--n-label-text-align":P,"--n-label-height":ee,"--n-label-padding":Re,"--n-label-font-weight":U,"--n-asterisk-color":pe,"--n-label-text-color":ne,"--n-feedback-padding":Le,"--n-feedback-font-size":se,"--n-feedback-height":ce,"--n-feedback-text-color":$e,"--n-feedback-text-color-warning":_e,"--n-feedback-text-color-error":Ge}}),N=r?Pt("form-item",H(()=>{var F;return`${d.value[0]}${c.value[0]}${((F=u.value)===null||F===void 0?void 0:F[0])||""}`}),_,e):void 0,E=H(()=>c.value==="left"&&f.value==="left"&&u.value==="left");return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:R,mergedClsPrefix:t,mergedRequired:l,feedbackId:h,renderExplains:p,reverseColSpace:E},i),n),$),{cssVars:r?void 0:_,themeClass:N==null?void 0:N.themeClass,onRender:N==null?void 0:N.onRender})},render(){const{$slots:e,mergedClsPrefix:t,mergedShowLabel:r,mergedShowRequireMark:o,mergedRequireMarkPlacement:n,onRender:i}=this,a=o!==void 0?o:this.mergedRequired;i==null||i();const l=()=>{const s=this.$slots.label?this.$slots.label():this.label;if(!s)return null;const d=v("span",{class:`${t}-form-item-label__text`},s),c=a?v("span",{class:`${t}-form-item-label__asterisk`},n!=="left"?"\xA0*":"*\xA0"):n==="right-hanging"&&v("span",{class:`${t}-form-item-label__asterisk-placeholder`},"\xA0*"),{labelProps:u}=this;return v("label",Object.assign({},u,{class:[u==null?void 0:u.class,`${t}-form-item-label`,`${t}-form-item-label--${n}-mark`,this.reverseColSpace&&`${t}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:"labelElementRef"}),n==="left"?[c,d]:[d,c])};return v("div",{class:[`${t}-form-item`,this.themeClass,`${t}-form-item--${this.mergedSize}-size`,`${t}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${t}-form-item--auto-label-width`,!r&&`${t}-form-item--no-label`],style:this.cssVars},r&&l(),v("div",{class:[`${t}-form-item-blank`,this.mergedValidationStatus&&`${t}-form-item-blank--${this.mergedValidationStatus}`]},e),this.mergedShowFeedback?v("div",{key:this.feedbackId,class:`${t}-form-item-feedback-wrapper`},v(Bt,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:s}=this;return dt(e.feedback,d=>{var c;const{feedback:u}=this,f=d||u?v("div",{key:"__feedback__",class:`${t}-form-item-feedback__line`},d||u):this.renderExplains.length?(c=this.renderExplains)===null||c===void 0?void 0:c.map(({key:p,render:h})=>v("div",{key:p,class:`${t}-form-item-feedback__line`},h())):null;return f?s==="warning"?v("div",{key:"controlled-warning",class:`${t}-form-item-feedback ${t}-form-item-feedback--warning`},f):s==="error"?v("div",{key:"controlled-error",class:`${t}-form-item-feedback ${t}-form-item-feedback--error`},f):s==="success"?v("div",{key:"controlled-success",class:`${t}-form-item-feedback ${t}-form-item-feedback--success`},f):v("div",{key:"controlled-default",class:`${t}-form-item-feedback`},f):null})}})):null)}});const Jz=Array.apply(null,{length:24}).map((e,t)=>{const r=t+1,o=`calc(100% / 24 * ${r})`;return[K(`${r}-span`,{width:o}),K(`${r}-offset`,{marginLeft:o}),K(`${r}-push`,{left:o}),K(`${r}-pull`,{right:o})]});var Qz=O([M("row",{width:"100%",display:"flex",flexWrap:"wrap"}),M("col",{verticalAlign:"top",boxSizing:"border-box",display:"inline-block",position:"relative",zIndex:"auto"},[D("box",{position:"relative",zIndex:"auto",width:"100%",height:"100%"}),Jz])]);const Xg="n-row",fd={gutter:{type:[Array,Number,String],default:0},alignItems:String,justifyContent:String},eE=sr(fd);var tE=ae({name:"Row",props:fd,setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:r}=st(e);co("-legacy-grid",Qz,t);const o=Kr("Row",r,t),n=mt(()=>{const{gutter:a}=e;return Array.isArray(a)&&a[1]||0}),i=mt(()=>{const{gutter:a}=e;return Array.isArray(a)?a[0]:Number(a)});return Be(Xg,{mergedClsPrefixRef:t,gutterRef:Te(e,"gutter"),verticalGutterRef:n,horizontalGutterRef:i}),{mergedClsPrefix:t,rtlEnabled:o,styleMargin:mt(()=>`-${ar(n.value,{c:.5})} -${ar(i.value,{c:.5})}`),styleWidth:mt(()=>`calc(100% + ${ar(i.value)})`)}},render(){return v("div",{class:[`${this.mergedClsPrefix}-row`,this.rtlEnabled&&`${this.mergedClsPrefix}-row--rtl`],style:{margin:this.styleMargin,width:this.styleWidth,alignItems:this.alignItems,justifyContent:this.justifyContent}},this.$slots)}});const hd={span:{type:[String,Number],default:1},push:{type:[String,Number],default:0},pull:{type:[String,Number],default:0},offset:{type:[String,Number],default:0}},rE=sr(hd);var oE=ae({name:"Col",props:hd,setup(e){const t=me(Xg,null);return t||il("col","`n-col` must be placed inside `n-row`."),{mergedClsPrefix:t.mergedClsPrefixRef,gutter:t.gutterRef,stylePadding:H(()=>`${ar(t.verticalGutterRef.value,{c:.5})} ${ar(t.horizontalGutterRef.value,{c:.5})}`),mergedPush:H(()=>Number(e.push)-Number(e.pull))}},render(){const{$slots:e,span:t,mergedPush:r,offset:o,stylePadding:n,gutter:i,mergedClsPrefix:a}=this;return v("div",{class:[`${a}-col`,{[`${a}-col--${t}-span`]:!0,[`${a}-col--${r}-push`]:r>0,[`${a}-col--${-r}-pull`]:r<0,[`${a}-col--${o}-offset`]:o}],style:{padding:n}},i?v("div",null,e):e)}});const pd=Object.assign(Object.assign({},hd),ud),nE=sr(pd);var iE=ae({name:"FormItemCol",props:pd,setup(){const e=V(null);return{formItemInstRef:e,validate:(...o)=>{const{value:n}=e;if(n)return n.validate(...o)},restoreValidation:()=>{const{value:o}=e;if(o)return o.restoreValidation()}}},render(){return v(oE,Jt(this.$props,rE),{default:()=>{const e=Jt(this.$props,Xz);return v(Zz,Object.assign({ref:"formItemInstRef"},e),this.$slots)}})}});const aE=Object.assign(Object.assign({},fd),pd);var lE=ae({name:"FormItemRow",props:aE,setup(){const e=V(null);return{formItemColInstRef:e,validate:(...o)=>{const{value:n}=e;if(n)return n.validate(...o)},restoreValidation:()=>{const{value:o}=e;if(o)return o.restoreValidation()}}},render(){return v(tE,Jt(this.$props,eE),{default:()=>{const e=Jt(this.$props,nE);return v(iE,Object.assign(Object.assign({ref:"formItemColInstRef"},e),{span:24}),this.$slots)}})}}),sE=ae({name:"GlobalStyle",setup(){if(typeof document=="undefined")return;const e=me(Fr,null),{body:t}=document,{style:r}=t;let o=!1,n=!0;Nr(()=>{Wt(()=>{var i,a;const{textColor2:l,fontSize:s,fontFamily:d,bodyColor:c,cubicBezierEaseInOut:u,lineHeight:f}=e?un({},((i=e.mergedThemeRef.value)===null||i===void 0?void 0:i.common)||je,(a=e.mergedThemeOverridesRef.value)===null||a===void 0?void 0:a.common):je;if(o||!t.hasAttribute("n-styled")){r.setProperty("-webkit-text-size-adjust","100%"),r.setProperty("-webkit-tap-highlight-color","transparent"),r.padding="0",r.margin="0",r.backgroundColor=c,r.color=l,r.fontSize=s,r.fontFamily=d,r.lineHeight=f;const p=`color .3s ${u}, background-color .3s ${u}`;n?setTimeout(()=>{r.transition=p},0):r.transition=p,t.setAttribute("n-styled",""),o=!0,n=!1}})}),_c(()=>{o&&t.removeAttribute("n-styled")})},render(){return null}});const cE={name:"GradientText",common:le,self(e){const{primaryColor:t,successColor:r,warningColor:o,errorColor:n,infoColor:i,primaryColorSuppl:a,successColorSuppl:l,warningColorSuppl:s,errorColorSuppl:d,infoColorSuppl:c,fontWeightStrong:u}=e;return{fontWeight:u,rotate:"252deg",colorStartPrimary:t,colorEndPrimary:a,colorStartInfo:i,colorEndInfo:c,colorStartWarning:o,colorEndWarning:s,colorStartError:n,colorEndError:d,colorStartSuccess:r,colorEndSuccess:l}}};var dE=cE;const uE=e=>{const{primaryColor:t,baseColor:r}=e;return{color:t,iconColor:r}},fE={name:"IconWrapper",common:le,self:uE};var hE=fE;const vd=Object.assign(Object.assign({},Ee.props),{showToolbar:{type:Boolean,default:!0},showToolbarTooltip:Boolean}),Zg="n-image";function pE(){return{toolbarIconColor:"rgba(255, 255, 255, .9)",toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}const vE={name:"Image",common:je,peers:{Tooltip:ld},self:pE};var mE={closeMargin:"16px 12px",closeSize:"20px",closeIconSize:"16px",width:"365px",padding:"16px",titleFontSize:"16px",metaFontSize:"12px",descriptionFontSize:"12px"};const gE=e=>{const{textColor2:t,successColor:r,infoColor:o,warningColor:n,errorColor:i,popoverColor:a,closeIconColor:l,closeIconColorHover:s,closeIconColorPressed:d,closeColorHover:c,closeColorPressed:u,textColor1:f,textColor3:p,borderRadius:h,fontWeightStrong:g,boxShadow2:b,lineHeight:m,fontSize:y}=e;return Object.assign(Object.assign({},mE),{borderRadius:h,lineHeight:m,fontSize:y,headerFontWeight:g,iconColor:t,iconColorSuccess:r,iconColorInfo:o,iconColorWarning:n,iconColorError:i,color:a,textColor:t,closeIconColor:l,closeIconColorHover:s,closeIconColorPressed:d,closeBorderRadius:h,closeColorHover:c,closeColorPressed:u,headerTextColor:f,descriptionTextColor:p,actionTextColor:t,boxShadow:b})},bE={name:"Notification",common:le,peers:{Scrollbar:Ut},self:gE};var xE=bE,CE={margin:"0 0 8px 0",padding:"10px 20px",maxWidth:"720px",minWidth:"420px",iconMargin:"0 10px 0 0",closeMargin:"0 0 0 10px",closeSize:"20px",closeIconSize:"16px",iconSize:"20px",fontSize:"14px"};const Jg=e=>{const{textColor2:t,closeIconColor:r,closeIconColorHover:o,closeIconColorPressed:n,infoColor:i,successColor:a,errorColor:l,warningColor:s,popoverColor:d,boxShadow2:c,primaryColor:u,lineHeight:f,borderRadius:p,closeColorHover:h,closeColorPressed:g}=e;return Object.assign(Object.assign({},CE),{closeBorderRadius:p,textColor:t,textColorInfo:t,textColorSuccess:t,textColorError:t,textColorWarning:t,textColorLoading:t,color:d,colorInfo:d,colorSuccess:d,colorError:d,colorWarning:d,colorLoading:d,boxShadow:c,boxShadowInfo:c,boxShadowSuccess:c,boxShadowError:c,boxShadowWarning:c,boxShadowLoading:c,iconColor:t,iconColorInfo:i,iconColorSuccess:a,iconColorWarning:s,iconColorError:l,iconColorLoading:u,closeColorHover:h,closeColorPressed:g,closeIconColor:r,closeIconColorHover:o,closeIconColorPressed:n,closeColorHoverInfo:h,closeColorPressedInfo:g,closeIconColorInfo:r,closeIconColorHoverInfo:o,closeIconColorPressedInfo:n,closeColorHoverSuccess:h,closeColorPressedSuccess:g,closeIconColorSuccess:r,closeIconColorHoverSuccess:o,closeIconColorPressedSuccess:n,closeColorHoverError:h,closeColorPressedError:g,closeIconColorError:r,closeIconColorHoverError:o,closeIconColorPressedError:n,closeColorHoverWarning:h,closeColorPressedWarning:g,closeIconColorWarning:r,closeIconColorHoverWarning:o,closeIconColorPressedWarning:n,closeColorHoverLoading:h,closeColorPressedLoading:g,closeIconColorLoading:r,closeIconColorHoverLoading:o,closeIconColorPressedLoading:n,loadingColor:u,lineHeight:f,borderRadius:p})},yE={name:"Message",common:je,self:Jg};var wE=yE;const SE={name:"Message",common:le,self:Jg};var $E=SE;const _E={name:"ButtonGroup",common:le};var PE=_E;const kE={name:"InputNumber",common:le,peers:{Button:Kt,Input:ur},self(e){const{textColorDisabled:t}=e;return{iconColorDisabled:t}}};var TE=kE;const zE={name:"Layout",common:le,peers:{Scrollbar:Ut},self(e){const{textColor2:t,bodyColor:r,popoverColor:o,cardColor:n,dividerColor:i,scrollbarColor:a,scrollbarColorHover:l}=e;return{textColor:t,textColorInverted:t,color:r,colorEmbedded:r,headerColor:n,headerColorInverted:n,footerColor:n,footerColorInverted:n,headerBorderColor:i,headerBorderColorInverted:i,footerBorderColor:i,footerBorderColorInverted:i,siderBorderColor:i,siderBorderColorInverted:i,siderColor:n,siderColorInverted:n,siderToggleButtonBorder:"1px solid transparent",siderToggleButtonColor:o,siderToggleButtonIconColor:t,siderToggleButtonIconColorInverted:t,siderToggleBarColor:xe(r,a),siderToggleBarColorHover:xe(r,l),__invertScrollbar:"false"}}};var EE=zE;const Qg=e=>{const{textColor2:t,cardColor:r,modalColor:o,popoverColor:n,dividerColor:i,borderRadius:a,fontSize:l,hoverColor:s}=e;return{textColor:t,color:r,colorHover:s,colorModal:o,colorHoverModal:xe(o,s),colorPopover:n,colorHoverPopover:xe(n,s),borderColor:i,borderColorModal:xe(o,i),borderColorPopover:xe(n,i),borderRadius:a,fontSize:l}},RE={name:"List",common:je,self:Qg};var UM=RE;const IE={name:"List",common:le,self:Qg};var OE=IE;const AE={name:"LoadingBar",common:le,self(e){const{primaryColor:t}=e;return{colorError:"red",colorLoading:t,height:"2px"}}};var ME=AE;const BE={name:"Log",common:le,peers:{Scrollbar:Ut,Code:gg},self(e){const{textColor2:t,inputColor:r,fontSize:o,primaryColor:n}=e;return{loaderFontSize:o,loaderTextColor:t,loaderColor:r,loaderBorder:"1px solid #0000",loadingColor:n}}};var LE=BE;const HE={name:"Mention",common:le,peers:{InternalSelectMenu:Ni,Input:ur},self(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}};var DE=HE;function FE(e,t,r,o){return{itemColorHoverInverted:"#0000",itemColorActiveInverted:t,itemColorActiveHoverInverted:t,itemColorActiveCollapsedInverted:t,itemTextColorInverted:e,itemTextColorHoverInverted:r,itemTextColorChildActiveInverted:r,itemTextColorChildActiveHoverInverted:r,itemTextColorActiveInverted:r,itemTextColorActiveHoverInverted:r,itemTextColorHorizontalInverted:e,itemTextColorHoverHorizontalInverted:r,itemTextColorChildActiveHorizontalInverted:r,itemTextColorChildActiveHoverHorizontalInverted:r,itemTextColorActiveHorizontalInverted:r,itemTextColorActiveHoverHorizontalInverted:r,itemIconColorInverted:e,itemIconColorHoverInverted:r,itemIconColorActiveInverted:r,itemIconColorActiveHoverInverted:r,itemIconColorChildActiveInverted:r,itemIconColorChildActiveHoverInverted:r,itemIconColorCollapsedInverted:e,itemIconColorHorizontalInverted:e,itemIconColorHoverHorizontalInverted:r,itemIconColorActiveHorizontalInverted:r,itemIconColorActiveHoverHorizontalInverted:r,itemIconColorChildActiveHorizontalInverted:r,itemIconColorChildActiveHoverHorizontalInverted:r,arrowColorInverted:e,arrowColorHoverInverted:r,arrowColorActiveInverted:r,arrowColorActiveHoverInverted:r,arrowColorChildActiveInverted:r,arrowColorChildActiveHoverInverted:r,groupTextColorInverted:o}}const eb=e=>{const{borderRadius:t,textColor3:r,primaryColor:o,textColor2:n,textColor1:i,fontSize:a,dividerColor:l,hoverColor:s,primaryColorHover:d}=e;return Object.assign({borderRadius:t,color:"#0000",groupTextColor:r,itemColorHover:s,itemColorActive:oe(o,{alpha:.1}),itemColorActiveHover:oe(o,{alpha:.1}),itemColorActiveCollapsed:oe(o,{alpha:.1}),itemTextColor:n,itemTextColorHover:n,itemTextColorActive:o,itemTextColorActiveHover:o,itemTextColorChildActive:o,itemTextColorChildActiveHover:o,itemTextColorHorizontal:n,itemTextColorHoverHorizontal:d,itemTextColorActiveHorizontal:o,itemTextColorActiveHoverHorizontal:o,itemTextColorChildActiveHorizontal:o,itemTextColorChildActiveHoverHorizontal:o,itemIconColor:i,itemIconColorHover:i,itemIconColorActive:o,itemIconColorActiveHover:o,itemIconColorChildActive:o,itemIconColorChildActiveHover:o,itemIconColorCollapsed:i,itemIconColorHorizontal:i,itemIconColorHoverHorizontal:d,itemIconColorActiveHorizontal:o,itemIconColorActiveHoverHorizontal:o,itemIconColorChildActiveHorizontal:o,itemIconColorChildActiveHoverHorizontal:o,itemHeight:"42px",arrowColor:n,arrowColorHover:n,arrowColorActive:o,arrowColorActiveHover:o,arrowColorChildActive:o,arrowColorChildActiveHover:o,colorInverted:"#0000",borderColorHorizontal:"#0000",fontSize:a,dividerColor:l},FE("#BBB",o,"#FFF","#AAA"))},jE={name:"Menu",common:je,peers:{Tooltip:ld,Dropdown:kg},self:eb};var NE=jE;const WE={name:"Menu",common:le,peers:{Tooltip:Cl,Dropdown:sd},self(e){const{primaryColor:t,primaryColorSuppl:r}=e,o=eb(e);return o.itemColorActive=oe(t,{alpha:.15}),o.itemColorActiveHover=oe(t,{alpha:.15}),o.itemColorActiveCollapsed=oe(t,{alpha:.15}),o.itemColorActiveInverted=r,o.itemColorActiveHoverInverted=r,o.itemColorActiveCollapsedInverted=r,o}};var VE=WE,UE={titleFontSize:"18px",backSize:"22px"};function KE(e){const{textColor1:t,textColor2:r,textColor3:o,fontSize:n,fontWeightStrong:i,primaryColorHover:a,primaryColorPressed:l}=e;return Object.assign(Object.assign({},UE),{titleFontWeight:i,fontSize:n,titleTextColor:t,backColor:r,backColorHover:a,backColorPressed:l,subtitleTextColor:o})}const qE={name:"PageHeader",common:le,self:KE};var GE={iconSize:"22px"};const tb=e=>{const{fontSize:t,warningColor:r}=e;return Object.assign(Object.assign({},GE),{fontSize:t,iconColor:r})},KM={name:"Popconfirm",common:je,peers:{Button:xl,Popover:jn},self:tb},YE={name:"Popconfirm",common:le,peers:{Button:Kt,Popover:Uo},self:tb};var XE=YE;const rb=e=>{const{infoColor:t,successColor:r,warningColor:o,errorColor:n,textColor2:i,progressRailColor:a,fontSize:l,fontWeight:s}=e;return{fontSize:l,fontSizeCircle:"28px",fontWeightCircle:s,railColor:a,railHeight:"8px",iconSizeCircle:"36px",iconSizeLine:"18px",iconColor:t,iconColorInfo:t,iconColorSuccess:r,iconColorWarning:o,iconColorError:n,textColorCircle:i,textColorLineInner:"rgb(255, 255, 255)",textColorLineOuter:i,fillColor:t,fillColorInfo:t,fillColorSuccess:r,fillColorWarning:o,fillColorError:n,lineBgProcessing:"linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)"}},ZE={name:"Progress",common:je,self:rb};var JE=ZE;const QE={name:"Progress",common:le,self(e){const t=rb(e);return t.textColorLineInner="rgb(0, 0, 0)",t.lineBgProcessing="linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)",t}};var ob=QE;const eR={name:"Rate",common:le,self(e){const{railColor:t}=e;return{itemColor:t,itemColorActive:"#CCAA33",itemSize:"20px",sizeSmall:"16px",sizeMedium:"20px",sizeLarge:"24px"}}};var tR=eR,rR={titleFontSizeSmall:"26px",titleFontSizeMedium:"32px",titleFontSizeLarge:"40px",titleFontSizeHuge:"48px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",iconSizeSmall:"64px",iconSizeMedium:"80px",iconSizeLarge:"100px",iconSizeHuge:"125px",iconColor418:void 0,iconColor404:void 0,iconColor403:void 0,iconColor500:void 0};const nb=e=>{const{textColor2:t,textColor1:r,errorColor:o,successColor:n,infoColor:i,warningColor:a,lineHeight:l,fontWeightStrong:s}=e;return Object.assign(Object.assign({},rR),{lineHeight:l,titleFontWeight:s,titleTextColor:r,textColor:t,iconColorError:o,iconColorSuccess:n,iconColorInfo:i,iconColorWarning:a})},oR={name:"Result",common:je,self:nb};var qM=oR;const nR={name:"Result",common:le,self:nb};var iR=nR,aR={railHeight:"4px",railWidthVertical:"4px",handleSize:"18px",dotHeight:"8px",dotWidth:"8px",dotBorderRadius:"4px"};const lR={name:"Slider",common:le,self(e){const t="0 2px 8px 0 rgba(0, 0, 0, 0.12)",{railColor:r,modalColor:o,primaryColorSuppl:n,popoverColor:i,textColor2:a,cardColor:l,borderRadius:s,fontSize:d,opacityDisabled:c}=e;return Object.assign(Object.assign({},aR),{fontSize:d,markFontSize:d,railColor:r,railColorHover:r,fillColor:n,fillColorHover:n,opacityDisabled:c,handleColor:"#FFF",dotColor:l,dotColorModal:o,dotColorPopover:i,handleBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowHover:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowActive:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowFocus:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",indicatorColor:i,indicatorBoxShadow:t,indicatorTextColor:a,indicatorBorderRadius:s,dotBorder:`2px solid ${r}`,dotBorderActive:`2px solid ${n}`,dotBoxShadow:""})}};var sR=lR;const ib=e=>{const{opacityDisabled:t,heightTiny:r,heightSmall:o,heightMedium:n,heightLarge:i,heightHuge:a,primaryColor:l,fontSize:s}=e;return{fontSize:s,textColor:l,sizeTiny:r,sizeSmall:o,sizeMedium:n,sizeLarge:i,sizeHuge:a,color:l,opacitySpinning:t}},cR={name:"Spin",common:je,self:ib};var dR=cR;const uR={name:"Spin",common:le,self:ib};var fR=uR;const ab=e=>{const{textColor2:t,textColor3:r,fontSize:o,fontWeight:n}=e;return{labelFontSize:o,labelFontWeight:n,valueFontWeight:n,valueFontSize:"24px",labelTextColor:r,valuePrefixTextColor:t,valueSuffixTextColor:t,valueTextColor:t}},hR={name:"Statistic",common:je,self:ab};var GM=hR;const pR={name:"Statistic",common:le,self:ab};var vR=pR,mR={stepHeaderFontSizeSmall:"14px",stepHeaderFontSizeMedium:"16px",indicatorIndexFontSizeSmall:"14px",indicatorIndexFontSizeMedium:"16px",indicatorSizeSmall:"22px",indicatorSizeMedium:"28px",indicatorIconSizeSmall:"14px",indicatorIconSizeMedium:"18px"};const gR=e=>{const{fontWeightStrong:t,baseColor:r,textColorDisabled:o,primaryColor:n,errorColor:i,textColor1:a,textColor2:l}=e;return Object.assign(Object.assign({},mR),{stepHeaderFontWeight:t,indicatorTextColorProcess:r,indicatorTextColorWait:o,indicatorTextColorFinish:n,indicatorTextColorError:i,indicatorBorderColorProcess:n,indicatorBorderColorWait:o,indicatorBorderColorFinish:n,indicatorBorderColorError:i,indicatorColorProcess:n,indicatorColorWait:"#0000",indicatorColorFinish:"#0000",indicatorColorError:"#0000",splitorColorProcess:o,splitorColorWait:o,splitorColorFinish:n,splitorColorError:o,headerTextColorProcess:a,headerTextColorWait:o,headerTextColorFinish:o,headerTextColorError:i,descriptionTextColorProcess:l,descriptionTextColorWait:o,descriptionTextColorFinish:o,descriptionTextColorError:i})},bR={name:"Steps",common:le,self:gR};var xR=bR,CR={buttonHeightSmall:"14px",buttonHeightMedium:"18px",buttonHeightLarge:"22px",buttonWidthSmall:"14px",buttonWidthMedium:"18px",buttonWidthLarge:"22px",buttonWidthPressedSmall:"20px",buttonWidthPressedMedium:"24px",buttonWidthPressedLarge:"28px",railHeightSmall:"18px",railHeightMedium:"22px",railHeightLarge:"26px",railWidthSmall:"32px",railWidthMedium:"40px",railWidthLarge:"48px"};const yR={name:"Switch",common:le,self(e){const{primaryColorSuppl:t,opacityDisabled:r,borderRadius:o,primaryColor:n,textColor2:i,baseColor:a}=e,l="rgba(255, 255, 255, .20)";return Object.assign(Object.assign({},CR),{iconColor:a,textColor:i,loadingColor:t,opacityDisabled:r,railColor:l,railColorActive:t,buttonBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",buttonColor:"#FFF",railBorderRadiusSmall:o,railBorderRadiusMedium:o,railBorderRadiusLarge:o,buttonBorderRadiusSmall:o,buttonBorderRadiusMedium:o,buttonBorderRadiusLarge:o,boxShadowFocus:`0 0 8px 0 ${oe(n,{alpha:.3})}`})}};var wR=yR,SR={thPaddingSmall:"6px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"6px",tdPaddingMedium:"12px",tdPaddingLarge:"12px"};const $R=e=>{const{dividerColor:t,cardColor:r,modalColor:o,popoverColor:n,tableHeaderColor:i,tableColorStriped:a,textColor1:l,textColor2:s,borderRadius:d,fontWeightStrong:c,lineHeight:u,fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:h}=e;return Object.assign(Object.assign({},SR),{fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:h,lineHeight:u,borderRadius:d,borderColor:xe(r,t),borderColorModal:xe(o,t),borderColorPopover:xe(n,t),tdColor:r,tdColorModal:o,tdColorPopover:n,tdColorStriped:xe(r,a),tdColorStripedModal:xe(o,a),tdColorStripedPopover:xe(n,a),thColor:xe(r,i),thColorModal:xe(o,i),thColorPopover:xe(n,i),thTextColor:l,tdTextColor:s,thFontWeight:c})},_R={name:"Table",common:le,self:$R};var PR=_R,kR={tabFontSizeSmall:"14px",tabFontSizeMedium:"14px",tabFontSizeLarge:"16px",tabGapSmallLine:"36px",tabGapMediumLine:"36px",tabGapLargeLine:"36px",tabPaddingSmallLine:"6px 0",tabPaddingMediumLine:"10px 0",tabPaddingLargeLine:"14px 0",tabPaddingVerticalSmallLine:"0 6px",tabPaddingVerticalMediumLine:"0 10px",tabPaddingVerticalLargeLine:"0 14px",tabGapSmallBar:"36px",tabGapMediumBar:"36px",tabGapLargeBar:"36px",tabPaddingSmallBar:"4px 0",tabPaddingMediumBar:"6px 0",tabPaddingLargeBar:"10px 0",tabPaddingVerticalSmallBar:"0 4px",tabPaddingVerticalMediumBar:"0 6px ",tabPaddingVerticalLargeBar:"0 10px ",tabGapSmallCard:"4px",tabGapMediumCard:"4px",tabGapLargeCard:"4px",tabPaddingSmallCard:"6px 10px",tabPaddingMediumCard:"8px 12px",tabPaddingLargeCard:"8px 16px",tabPaddingSmallSegment:"4px 0",tabPaddingMediumSegment:"6px 0",tabPaddingLargeSegment:"8px 0",tabPaddingVerticalLargeSegment:"0 8px",tabPaddingVerticalSmallCard:"10px 6px",tabPaddingVerticalMediumCard:"12px 8px",tabPaddingVerticalLargeCard:"16px 8px",tabPaddingVerticalSmallSegment:"0 4px",tabPaddingVerticalMediumSegment:"0 6px",tabGapSmallSegment:"0",tabGapMediumSegment:"0",tabGapLargeSegment:"0",panePaddingSmall:"8px 0 0 0",panePaddingMedium:"12px 0 0 0",panePaddingLarge:"16px 0 0 0",closeSize:"18px",closeIconSize:"14px"};const lb=e=>{const{textColor2:t,primaryColor:r,textColorDisabled:o,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,tabColor:d,baseColor:c,dividerColor:u,fontWeight:f,textColor1:p,borderRadius:h,fontSize:g,fontWeightStrong:b}=e;return Object.assign(Object.assign({},kR),{colorSegment:d,tabFontSizeCard:g,tabTextColorLine:p,tabTextColorActiveLine:r,tabTextColorHoverLine:r,tabTextColorDisabledLine:o,tabTextColorSegment:p,tabTextColorActiveSegment:t,tabTextColorHoverSegment:t,tabTextColorDisabledSegment:o,tabTextColorBar:p,tabTextColorActiveBar:r,tabTextColorHoverBar:r,tabTextColorDisabledBar:o,tabTextColorCard:p,tabTextColorHoverCard:p,tabTextColorActiveCard:r,tabTextColorDisabledCard:o,barColor:r,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,closeBorderRadius:h,tabColor:d,tabColorSegment:c,tabBorderColor:u,tabFontWeightActive:f,tabFontWeight:f,tabBorderRadius:h,paneTextColor:t,fontWeightStrong:b})},TR={name:"Tabs",common:je,self:lb};var zR=TR;const ER={name:"Tabs",common:le,self(e){const t=lb(e),{inputColor:r}=e;return t.colorSegment=r,t.tabColorSegment=r,t}};var RR=ER;const sb=e=>{const{textColor1:t,textColor2:r,fontWeightStrong:o,fontSize:n}=e;return{fontSize:n,titleTextColor:t,textColor:r,titleFontWeight:o}},IR={name:"Thing",common:je,self:sb};var YM=IR;const OR={name:"Thing",common:le,self:sb};var AR=OR,MR={titleMarginMedium:"0 0 6px 0",titleMarginLarge:"-2px 0 6px 0",titleFontSizeMedium:"14px",titleFontSizeLarge:"16px",iconSizeMedium:"14px",iconSizeLarge:"14px"};const BR={name:"Timeline",common:le,self(e){const{textColor3:t,infoColorSuppl:r,errorColorSuppl:o,successColorSuppl:n,warningColorSuppl:i,textColor1:a,textColor2:l,railColor:s,fontWeightStrong:d,fontSize:c}=e;return Object.assign(Object.assign({},MR),{contentFontSize:c,titleFontWeight:d,circleBorder:`2px solid ${t}`,circleBorderInfo:`2px solid ${r}`,circleBorderError:`2px solid ${o}`,circleBorderSuccess:`2px solid ${n}`,circleBorderWarning:`2px solid ${i}`,iconColor:t,iconColorInfo:r,iconColorError:o,iconColorSuccess:n,iconColorWarning:i,titleTextColor:a,contentTextColor:l,metaTextColor:t,lineColor:s})}};var LR=BR,HR={extraFontSizeSmall:"12px",extraFontSizeMedium:"12px",extraFontSizeLarge:"14px",titleFontSizeSmall:"14px",titleFontSizeMedium:"16px",titleFontSizeLarge:"16px",closeSize:"20px",closeIconSize:"16px",headerHeightSmall:"44px",headerHeightMedium:"44px",headerHeightLarge:"50px"};const DR={name:"Transfer",common:le,peers:{Checkbox:Nn,Scrollbar:Ut,Input:ur,Empty:Vo,Button:Kt},self(e){const{fontWeight:t,fontSizeLarge:r,fontSizeMedium:o,fontSizeSmall:n,heightLarge:i,heightMedium:a,borderRadius:l,inputColor:s,tableHeaderColor:d,textColor1:c,textColorDisabled:u,textColor2:f,textColor3:p,hoverColor:h,closeColorHover:g,closeColorPressed:b,closeIconColor:m,closeIconColorHover:y,closeIconColorPressed:w,dividerColor:x}=e;return Object.assign(Object.assign({},HR),{itemHeightSmall:a,itemHeightMedium:a,itemHeightLarge:i,fontSizeSmall:n,fontSizeMedium:o,fontSizeLarge:r,borderRadius:l,dividerColor:x,borderColor:"#0000",listColor:s,headerColor:d,titleTextColor:c,titleTextColorDisabled:u,extraTextColor:p,extraTextColorDisabled:u,itemTextColor:f,itemTextColorDisabled:u,itemColorPending:h,titleFontWeight:t,closeColorHover:g,closeColorPressed:b,closeIconColor:m,closeIconColorHover:y,closeIconColorPressed:w})}};var FR=DR;const jR=e=>{const{borderRadiusSmall:t,hoverColor:r,pressedColor:o,primaryColor:n,textColor3:i,textColor2:a,textColorDisabled:l,fontSize:s}=e;return{fontSize:s,nodeBorderRadius:t,nodeColorHover:r,nodeColorPressed:o,nodeColorActive:oe(n,{alpha:.1}),arrowColor:i,nodeTextColor:a,nodeTextColorDisabled:l,loadingColor:n,dropMarkColor:n}},NR={name:"Tree",common:le,peers:{Checkbox:Nn,Scrollbar:Ut,Empty:Vo},self(e){const{primaryColor:t}=e,r=jR(e);return r.nodeColorActive=oe(t,{alpha:.15}),r}};var cb=NR;const WR={name:"TreeSelect",common:le,peers:{Tree:cb,Empty:Vo,InternalSelection:nd}};var VR=WR,UR={headerFontSize1:"30px",headerFontSize2:"22px",headerFontSize3:"18px",headerFontSize4:"16px",headerFontSize5:"16px",headerFontSize6:"16px",headerMargin1:"28px 0 20px 0",headerMargin2:"28px 0 20px 0",headerMargin3:"28px 0 20px 0",headerMargin4:"28px 0 18px 0",headerMargin5:"28px 0 18px 0",headerMargin6:"28px 0 18px 0",headerPrefixWidth1:"16px",headerPrefixWidth2:"16px",headerPrefixWidth3:"12px",headerPrefixWidth4:"12px",headerPrefixWidth5:"12px",headerPrefixWidth6:"12px",headerBarWidth1:"4px",headerBarWidth2:"4px",headerBarWidth3:"3px",headerBarWidth4:"3px",headerBarWidth5:"3px",headerBarWidth6:"3px",pMargin:"16px 0 16px 0",liMargin:".25em 0 0 0",olPadding:"0 0 0 2em",ulPadding:"0 0 0 2em"};const KR=e=>{const{primaryColor:t,textColor2:r,borderColor:o,lineHeight:n,fontSize:i,borderRadiusSmall:a,dividerColor:l,fontWeightStrong:s,textColor1:d,textColor3:c,infoColor:u,warningColor:f,errorColor:p,successColor:h,codeColor:g}=e;return Object.assign(Object.assign({},UR),{aTextColor:t,blockquoteTextColor:r,blockquotePrefixColor:o,blockquoteLineHeight:n,blockquoteFontSize:i,codeBorderRadius:a,liTextColor:r,liLineHeight:n,liFontSize:i,hrColor:l,headerFontWeight:s,headerTextColor:d,pTextColor:r,pTextColor1Depth:d,pTextColor2Depth:r,pTextColor3Depth:c,pLineHeight:n,pFontSize:i,headerBarColor:t,headerBarColorPrimary:t,headerBarColorInfo:u,headerBarColorError:p,headerBarColorWarning:f,headerBarColorSuccess:h,textColor:r,textColor1Depth:d,textColor2Depth:r,textColor3Depth:c,textColorPrimary:t,textColorInfo:u,textColorSuccess:h,textColorWarning:f,textColorError:p,codeTextColor:r,codeColor:g,codeBorder:"1px solid #0000"})},qR={name:"Typography",common:le,self:KR};var GR=qR;const db=e=>{const{iconColor:t,primaryColor:r,errorColor:o,textColor2:n,successColor:i,opacityDisabled:a,actionColor:l,borderColor:s,hoverColor:d,lineHeight:c,borderRadius:u,fontSize:f}=e;return{fontSize:f,lineHeight:c,borderRadius:u,draggerColor:l,draggerBorder:`1px dashed ${s}`,draggerBorderHover:`1px dashed ${r}`,itemColorHover:d,itemColorHoverError:oe(o,{alpha:.06}),itemTextColor:n,itemTextColorError:o,itemTextColorSuccess:i,itemIconColor:t,itemDisabledOpacity:a,itemBorderImageCardError:`1px solid ${o}`,itemBorderImageCard:`1px solid ${s}`}},YR={name:"Upload",common:je,peers:{Button:xl,Progress:JE},self:db};var XM=YR;const XR={name:"Upload",common:le,peers:{Button:Kt,Progress:ob},self(e){const{errorColor:t}=e,r=db(e);return r.itemColorHoverError=oe(t,{alpha:.09}),r}};var ZR=XR;const JR={name:"Watermark",common:le,self(e){const{fontFamily:t}=e;return{fontFamily:t}}};var QR=JR;const eI={name:"Row",common:le};var tI=eI;const rI={name:"Image",common:le,peers:{Tooltip:Cl},self:e=>{const{textColor2:t}=e;return{toolbarIconColor:t,toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}},oI=v("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v("path",{d:"M6 5C5.75454 5 5.55039 5.17688 5.50806 5.41012L5.5 5.5V14.5C5.5 14.7761 5.72386 15 6 15C6.24546 15 6.44961 14.8231 6.49194 14.5899L6.5 14.5V5.5C6.5 5.22386 6.27614 5 6 5ZM13.8536 5.14645C13.68 4.97288 13.4106 4.9536 13.2157 5.08859L13.1464 5.14645L8.64645 9.64645C8.47288 9.82001 8.4536 10.0894 8.58859 10.2843L8.64645 10.3536L13.1464 14.8536C13.3417 15.0488 13.6583 15.0488 13.8536 14.8536C14.0271 14.68 14.0464 14.4106 13.9114 14.2157L13.8536 14.1464L9.70711 10L13.8536 5.85355C14.0488 5.65829 14.0488 5.34171 13.8536 5.14645Z",fill:"currentColor"})),nI=v("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v("path",{d:"M13.5 5C13.7455 5 13.9496 5.17688 13.9919 5.41012L14 5.5V14.5C14 14.7761 13.7761 15 13.5 15C13.2545 15 13.0504 14.8231 13.0081 14.5899L13 14.5V5.5C13 5.22386 13.2239 5 13.5 5ZM5.64645 5.14645C5.82001 4.97288 6.08944 4.9536 6.28431 5.08859L6.35355 5.14645L10.8536 9.64645C11.0271 9.82001 11.0464 10.0894 10.9114 10.2843L10.8536 10.3536L6.35355 14.8536C6.15829 15.0488 5.84171 15.0488 5.64645 14.8536C5.47288 14.68 5.4536 14.4106 5.58859 14.2157L5.64645 14.1464L9.79289 10L5.64645 5.85355C5.45118 5.65829 5.45118 5.34171 5.64645 5.14645Z",fill:"currentColor"})),iI=v("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v("path",{d:"M4.089 4.216l.057-.07a.5.5 0 0 1 .638-.057l.07.057L10 9.293l5.146-5.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 .057.638l-.057.07L10.707 10l5.147 5.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.638.057l-.07-.057L10 10.707l-5.146 5.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1-.057-.638l.057-.07L9.293 10L4.146 4.854a.5.5 0 0 1-.057-.638l.057-.07l-.057.07z",fill:"currentColor"}));var aI=O([O("body >",[M("image-container","position: fixed;")]),M("image-preview-container",` - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - display: flex; - `),M("image-preview-overlay",` - z-index: -1; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - background: rgba(0, 0, 0, .3); - `,[Ai()]),M("image-preview-toolbar",` - z-index: 1; - position: absolute; - left: 50%; - transform: translateX(-50%); - border-radius: var(--n-toolbar-border-radius); - height: 48px; - bottom: 40px; - padding: 0 12px; - background: var(--n-toolbar-color); - box-shadow: var(--n-toolbar-box-shadow); - color: var(--n-toolbar-icon-color); - transition: color .3s var(--n-bezier); - display: flex; - align-items: center; - `,[M("base-icon",` - padding: 0 8px; - font-size: 28px; - cursor: pointer; - `),Ai()]),M("image-preview-wrapper",` - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - display: flex; - pointer-events: none; - `,[Mi()]),M("image-preview",` - user-select: none; - -webkit-user-select: none; - pointer-events: all; - margin: auto; - max-height: calc(100vh - 32px); - max-width: calc(100vw - 32px); - transition: transform .3s var(--n-bezier); - `),M("image",` - display: inline-flex; - max-height: 100%; - max-width: 100%; - `,[ut("preview-disabled",` - cursor: pointer; - `),O("img",` - border-radius: inherit; - `)])]);const fa=32;var ub=ae({name:"ImagePreview",props:Object.assign(Object.assign({},vd),{onNext:Function,onPrev:Function,clsPrefix:{type:String,required:!0}}),setup(e){const t=Ee("Image","-image",aI,vE,e,Te(e,"clsPrefix"));let r=null;const o=V(null),n=V(null),i=V(void 0),a=V(!1),l=V(!1),{localeRef:s}=Em("Image");function d(){const{value:C}=n;if(!r||!C)return;const{style:P}=C,I=r.getBoundingClientRect(),W=I.left+I.width/2,z=I.top+I.height/2;P.transformOrigin=`${W}px ${z}px`}function c(C){var P,I;switch(C.key){case" ":C.preventDefault();break;case"ArrowLeft":(P=e.onPrev)===null||P===void 0||P.call(e);break;case"ArrowRight":(I=e.onNext)===null||I===void 0||I.call(e);break;case"Escape":U();break}}De(a,C=>{C?Qe("keydown",document,c):Ue("keydown",document,c)}),ht(()=>{Ue("keydown",document,c)});let u=0,f=0,p=0,h=0,g=0,b=0,m=0,y=0,w=!1;function x(C){const{clientX:P,clientY:I}=C;p=P-u,h=I-f,iv(Le)}function k(C){const{mouseUpClientX:P,mouseUpClientY:I,mouseDownClientX:W,mouseDownClientY:z}=C,L=W-P,Y=z-I,q=`vertical${Y>0?"Top":"Bottom"}`,J=`horizontal${L>0?"Left":"Right"}`;return{moveVerticalDirection:q,moveHorizontalDirection:J,deltaHorizontal:L,deltaVertical:Y}}function T(C){const{value:P}=o;if(!P)return{offsetX:0,offsetY:0};const I=P.getBoundingClientRect(),{moveVerticalDirection:W,moveHorizontalDirection:z,deltaHorizontal:L,deltaVertical:Y}=C||{};let q=0,J=0;return I.width<=window.innerWidth?q=0:I.left>0?q=(I.width-window.innerWidth)/2:I.right0?J=(I.height-window.innerHeight)/2:I.bottom.5){const C=F;E-=1,F=Math.max(.5,Math.pow(N,E));const P=C-F;Le(!1);const I=T();F+=P,Le(!1),F-=P,p=I.offsetX,h=I.offsetY,Le()}}function Le(C=!0){var P;const{value:I}=o;if(!I)return;const{style:W}=I,z=Fa((P=$==null?void 0:$.previewedImgPropsRef.value)===null||P===void 0?void 0:P.style);let L="";if(typeof z=="string")L=z+";";else for(const q in z)L+=`${y3(q)}: ${z[q]};`;const Y=`transform-origin: center; transform: translateX(${p}px) translateY(${h}px) rotate(${j}deg) scale(${F});`;w?W.cssText=L+"cursor: grabbing; transition: none;"+Y:W.cssText=L+"cursor: grab;"+Y+(C?"":"transition: none;"),C||I.offsetHeight}function U(){a.value=!a.value,l.value=!0}function ee(){F=$e(),E=Math.ceil(Math.log(F)/Math.log(N)),p=0,h=0,Le()}const G={setPreviewSrc:C=>{i.value=C},setThumbnailEl:C=>{r=C},toggleShow:U};function se(C,P){if(e.showToolbarTooltip){const{value:I}=t;return v(Tg,{to:!1,theme:I.peers.Tooltip,themeOverrides:I.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>s.value[P],trigger:()=>C})}else return C}const ce=H(()=>{const{common:{cubicBezierEaseInOut:C},self:{toolbarIconColor:P,toolbarBorderRadius:I,toolbarBoxShadow:W,toolbarColor:z}}=t.value;return{"--n-bezier":C,"--n-toolbar-icon-color":P,"--n-toolbar-color":z,"--n-toolbar-border-radius":I,"--n-toolbar-box-shadow":W}}),{inlineThemeDisabled:Re}=st(),ge=Re?Pt("image-preview",void 0,ce,e):void 0;return Object.assign({previewRef:o,previewWrapperRef:n,previewSrc:i,show:a,appear:Hi(),displayed:l,previewedImgProps:$==null?void 0:$.previewedImgPropsRef,handleWheel(C){C.preventDefault()},handlePreviewMousedown:R,handlePreviewDblclick:_,syncTransformOrigin:d,handleAfterLeave:()=>{Q(),j=0,l.value=!1},handleDragStart:C=>{var P,I;(I=(P=$==null?void 0:$.previewedImgPropsRef.value)===null||P===void 0?void 0:P.onDragstart)===null||I===void 0||I.call(P,C),C.preventDefault()},zoomIn:_e,zoomOut:Ge,rotateCounterclockwise:ne,rotateClockwise:pe,handleSwitchPrev:A,handleSwitchNext:X,withTooltip:se,resizeToOrignalImageSize:ee,cssVars:Re?void 0:ce,themeClass:ge==null?void 0:ge.themeClass,onRender:ge==null?void 0:ge.onRender},G)},render(){var e,t;const{clsPrefix:r}=this;return v(Je,null,(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e),v(jc,{show:this.show},{default:()=>{var o;return this.show||this.displayed?((o=this.onRender)===null||o===void 0||o.call(this),Tr(v("div",{class:[`${r}-image-preview-container`,this.themeClass],style:this.cssVars,onWheel:this.handleWheel},v(Bt,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?v("div",{class:`${r}-image-preview-overlay`,onClick:this.toggleShow}):null}),this.showToolbar?v(Bt,{name:"fade-in-transition",appear:this.appear},{default:()=>{if(!this.show)return null;const{withTooltip:n}=this;return v("div",{class:`${r}-image-preview-toolbar`},this.onPrev?v(Je,null,n(v(zt,{clsPrefix:r,onClick:this.handleSwitchPrev},{default:()=>oI}),"tipPrevious"),n(v(zt,{clsPrefix:r,onClick:this.handleSwitchNext},{default:()=>nI}),"tipNext")):null,n(v(zt,{clsPrefix:r,onClick:this.rotateCounterclockwise},{default:()=>v(_6,null)}),"tipCounterclockwise"),n(v(zt,{clsPrefix:r,onClick:this.rotateClockwise},{default:()=>v($6,null)}),"tipClockwise"),n(v(zt,{clsPrefix:r,onClick:this.resizeToOrignalImageSize},{default:()=>v(T6,null)}),"tipOriginalSize"),n(v(zt,{clsPrefix:r,onClick:this.zoomOut},{default:()=>v(k6,null)}),"tipZoomOut"),n(v(zt,{clsPrefix:r,onClick:this.zoomIn},{default:()=>v(P6,null)}),"tipZoomIn"),n(v(zt,{clsPrefix:r,onClick:this.toggleShow},{default:()=>iI}),"tipClose"))}}):null,v(Bt,{name:"fade-in-scale-up-transition",onAfterLeave:this.handleAfterLeave,appear:this.appear,onEnter:this.syncTransformOrigin,onBeforeLeave:this.syncTransformOrigin},{default:()=>{const{previewedImgProps:n={}}=this;return Tr(v("div",{class:`${r}-image-preview-wrapper`,ref:"previewWrapperRef"},v("img",Object.assign({},n,{draggable:!1,onMousedown:this.handlePreviewMousedown,onDblclick:this.handlePreviewDblclick,class:[`${r}-image-preview`,n.class],key:this.previewSrc,src:this.previewSrc,ref:"previewRef",onDragstart:this.handleDragStart}))),[[Si,this.show]])}})),[[cl,{enabled:this.show}]])):null}}))}});const fb="n-image-group",lI=vd;var ZM=ae({name:"ImageGroup",props:lI,setup(e){let t;const{mergedClsPrefixRef:r}=st(e),o=`c${Tn()}`,n=Wr(),i=s=>{var d;t=s,(d=l.value)===null||d===void 0||d.setPreviewSrc(s)};function a(s){if(!(n!=null&&n.proxy))return;const c=n.proxy.$el.parentElement.querySelectorAll(`[data-group-id=${o}]:not([data-error=true])`);if(!c.length)return;const u=Array.from(c).findIndex(f=>f.dataset.previewSrc===t);~u?i(c[(u+s+c.length)%c.length].dataset.previewSrc):i(c[0].dataset.previewSrc)}Be(fb,{mergedClsPrefixRef:r,setPreviewSrc:i,setThumbnailEl:s=>{var d;(d=l.value)===null||d===void 0||d.setThumbnailEl(s)},toggleShow:()=>{var s;(s=l.value)===null||s===void 0||s.toggleShow()},groupId:o});const l=V(null);return{mergedClsPrefix:r,previewInstRef:l,next:()=>a(1),prev:()=>a(-1)}},render(){return v(ub,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:this.mergedClsPrefix,ref:"previewInstRef",onPrev:this.prev,onNext:this.next,showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip},this.$slots)}});const sI=Object.assign({alt:String,height:[String,Number],imgProps:Object,previewedImgProps:Object,lazy:Boolean,intersectionObserverOptions:Object,objectFit:{type:String,default:"fill"},previewSrc:String,fallbackSrc:String,width:[String,Number],src:String,previewDisabled:Boolean,loadDescription:String,onError:Function,onLoad:Function},vd);var cI=ae({name:"Image",props:sI,inheritAttrs:!1,setup(e){const t=V(null),r=V(!1),o=V(null),n=me(fb,null),{mergedClsPrefixRef:i}=n||st(e),a={click:()=>{if(e.previewDisabled||r.value)return;const d=e.previewSrc||e.src;if(n){n.setPreviewSrc(d),n.setThumbnailEl(t.value),n.toggleShow();return}const{value:c}=o;!c||(c.setPreviewSrc(d),c.setThumbnailEl(t.value),c.toggleShow())}},l=V(!e.lazy);gt(()=>{var d;(d=t.value)===null||d===void 0||d.setAttribute("data-group-id",(n==null?void 0:n.groupId)||"")}),gt(()=>{if(yn)return;let d;const c=Wt(()=>{d==null||d(),d=void 0,e.lazy&&(d=cg(t.value,e.intersectionObserverOptions,l))});ht(()=>{c(),d==null||d()})}),Wt(()=>{var d;e.src,(d=e.imgProps)===null||d===void 0||d.src,r.value=!1});const s=V(!1);return Be(Zg,{previewedImgPropsRef:Te(e,"previewedImgProps")}),Object.assign({mergedClsPrefix:i,groupId:n==null?void 0:n.groupId,previewInstRef:o,imageRef:t,showError:r,shouldStartLoading:l,loaded:s,mergedOnClick:d=>{var c,u;a.click(),(u=(c=e.imgProps)===null||c===void 0?void 0:c.onClick)===null||u===void 0||u.call(c,d)},mergedOnError:d=>{if(!l.value)return;r.value=!0;const{onError:c,imgProps:{onError:u}={}}=e;c==null||c(d),u==null||u(d)},mergedOnLoad:d=>{const{onLoad:c,imgProps:{onLoad:u}={}}=e;c==null||c(d),u==null||u(d),s.value=!0}},a)},render(){var e,t;const{mergedClsPrefix:r,imgProps:o={},loaded:n,$attrs:i,lazy:a}=this,l=(t=(e=this.$slots).placeholder)===null||t===void 0?void 0:t.call(e),s=this.src||o.src||"",d=v("img",Object.assign(Object.assign({},o),{ref:"imageRef",width:this.width||o.width,height:this.height||o.height,src:yn?s:this.showError?this.fallbackSrc:this.shouldStartLoading?s:void 0,alt:this.alt||o.alt,"aria-label":this.alt||o.alt,onClick:this.mergedOnClick,onError:this.mergedOnError,onLoad:this.mergedOnLoad,loading:yn&&a&&!this.intersectionObserverOptions?"lazy":"eager",style:[o.style||"",l&&!n?{height:"0",width:"0",visibility:"hidden"}:"",{objectFit:this.objectFit}],"data-error":this.showError,"data-preview-src":this.previewSrc||this.src}));return v("div",Object.assign({},i,{role:"none",class:[i.class,`${r}-image`,(this.previewDisabled||this.showError)&&`${r}-image--preview-disabled`]}),this.groupId?d:v(ub,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:r,ref:"previewInstRef",showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip},{default:()=>d}),!n&&l)}});const dI="n-layout-sider";var uI={extraFontSize:"12px",width:"440px"};const fI={name:"Transfer",common:le,peers:{Checkbox:Nn,Scrollbar:Ut,Input:ur,Empty:Vo,Button:Kt},self(e){const{iconColorDisabled:t,iconColor:r,fontWeight:o,fontSizeLarge:n,fontSizeMedium:i,fontSizeSmall:a,heightLarge:l,heightMedium:s,heightSmall:d,borderRadius:c,inputColor:u,tableHeaderColor:f,textColor1:p,textColorDisabled:h,textColor2:g,hoverColor:b}=e;return Object.assign(Object.assign({},uI),{itemHeightSmall:d,itemHeightMedium:s,itemHeightLarge:l,fontSizeSmall:a,fontSizeMedium:i,fontSizeLarge:n,borderRadius:c,borderColor:"#0000",listColor:u,headerColor:f,titleTextColor:p,titleTextColorDisabled:h,extraTextColor:g,filterDividerColor:"#0000",itemTextColor:g,itemTextColorDisabled:h,itemColorPending:b,titleFontWeight:o,iconColor:r,iconColorDisabled:t})}};var hI=fI;const Ui="n-menu",md="n-submenu",gd="n-menu-item-group",ha=8;function bd(e){const t=me(Ui),{props:r,mergedCollapsedRef:o}=t,n=me(md,null),i=me(gd,null),a=H(()=>r.mode==="horizontal"),l=H(()=>a.value?r.dropdownPlacement:"tmNodes"in e?"right-start":"right"),s=H(()=>{var f;return Math.max((f=r.collapsedIconSize)!==null&&f!==void 0?f:r.iconSize,r.iconSize)}),d=H(()=>{var f;return!a.value&&e.root&&o.value&&(f=r.collapsedIconSize)!==null&&f!==void 0?f:r.iconSize}),c=H(()=>{if(a.value)return;const{collapsedWidth:f,indent:p,rootIndent:h}=r,{root:g,isGroup:b}=e,m=h===void 0?p:h;if(g)return o.value?f/2-s.value/2:m;if(i)return p/2+i.paddingLeftRef.value;if(n)return(b?p/2:p)+n.paddingLeftRef.value}),u=H(()=>{const{collapsedWidth:f,indent:p,rootIndent:h}=r,{value:g}=s,{root:b}=e;return a.value||!b||!o.value?ha:(h===void 0?p:h)+g+ha-(f+g)/2});return{dropdownPlacement:l,activeIconSize:d,maxIconSize:s,paddingLeft:c,iconMarginRight:u,NMenu:t,NSubmenu:n}}const xd={internalKey:{type:[String,Number],required:!0},root:Boolean,isGroup:Boolean,level:{type:Number,required:!0},title:[String,Function],extra:[String,Function]},hb=Object.assign(Object.assign({},xd),{tmNode:{type:Object,required:!0},tmNodes:{type:Array,required:!0}}),pI=ae({name:"MenuOptionGroup",props:hb,setup(e){Be(md,null);const t=bd(e);Be(gd,{paddingLeftRef:t.paddingLeft});const{mergedClsPrefixRef:r,props:o}=me(Ui);return function(){const{value:n}=r,i=t.paddingLeft.value,{nodeProps:a}=o,l=a==null?void 0:a(e.tmNode.rawNode);return v("div",{class:`${n}-menu-item-group`,role:"group"},v("div",Object.assign({},l,{class:[`${n}-menu-item-group-title`,l==null?void 0:l.class],style:[(l==null?void 0:l.style)||"",i!==void 0?`padding-left: ${i}px;`:""]}),St(e.title),e.extra?v(Je,null," ",St(e.extra)):null),v("div",null,e.tmNodes.map(s=>Cd(s,o))))}}});var pb=ae({name:"MenuOptionContent",props:{collapsed:Boolean,disabled:Boolean,title:[String,Function],icon:Function,extra:[String,Function],showArrow:Boolean,childActive:Boolean,hover:Boolean,paddingLeft:Number,selected:Boolean,maxIconSize:{type:Number,required:!0},activeIconSize:{type:Number,required:!0},iconMarginRight:{type:Number,required:!0},clsPrefix:{type:String,required:!0},onClick:Function,tmNode:{type:Object,required:!0}},setup(e){const{props:t}=me(Ui);return{menuProps:t,style:H(()=>{const{paddingLeft:r}=e;return{paddingLeft:r&&`${r}px`}}),iconStyle:H(()=>{const{maxIconSize:r,activeIconSize:o,iconMarginRight:n}=e;return{width:`${r}px`,height:`${r}px`,fontSize:`${o}px`,marginRight:`${n}px`}})}},render(){const{clsPrefix:e,tmNode:t,menuProps:{renderIcon:r,renderLabel:o,renderExtra:n,expandIcon:i}}=this,a=r?r(t.rawNode):St(this.icon);return v("div",{onClick:l=>{var s;(s=this.onClick)===null||s===void 0||s.call(this,l)},role:"none",class:[`${e}-menu-item-content`,{[`${e}-menu-item-content--selected`]:this.selected,[`${e}-menu-item-content--collapsed`]:this.collapsed,[`${e}-menu-item-content--child-active`]:this.childActive,[`${e}-menu-item-content--disabled`]:this.disabled,[`${e}-menu-item-content--hover`]:this.hover}],style:this.style},a&&v("div",{class:`${e}-menu-item-content__icon`,style:this.iconStyle,role:"none"},[a]),v("div",{class:`${e}-menu-item-content-header`,role:"none"},o?o(t.rawNode):St(this.title),this.extra||n?v("span",{class:`${e}-menu-item-content-header__extra`}," ",n?n(t.rawNode):St(this.extra)):null),this.showArrow?v(zt,{ariaHidden:!0,class:`${e}-menu-item-content__arrow`,clsPrefix:e},{default:()=>i?i(t.rawNode):v(S6,null)}):null)}});const vb=Object.assign(Object.assign({},xd),{rawNodes:{type:Array,default:()=>[]},tmNodes:{type:Array,default:()=>[]},tmNode:{type:Object,required:!0},disabled:{type:Boolean,default:!1},icon:Function,onClick:Function}),vI=ae({name:"Submenu",props:vb,setup(e){const t=bd(e),{NMenu:r,NSubmenu:o}=t,{props:n,mergedCollapsedRef:i,mergedThemeRef:a}=r,l=H(()=>{const{disabled:f}=e;return o!=null&&o.mergedDisabledRef.value||n.disabled?!0:f}),s=V(!1);Be(md,{paddingLeftRef:t.paddingLeft,mergedDisabledRef:l}),Be(gd,null);function d(){const{onClick:f}=e;f&&f()}function c(){l.value||(i.value||r.toggleExpand(e.internalKey),d())}function u(f){s.value=f}return{menuProps:n,mergedTheme:a,doSelect:r.doSelect,inverted:r.invertedRef,isHorizontal:r.isHorizontalRef,mergedClsPrefix:r.mergedClsPrefixRef,maxIconSize:t.maxIconSize,activeIconSize:t.activeIconSize,iconMarginRight:t.iconMarginRight,dropdownPlacement:t.dropdownPlacement,dropdownShow:s,paddingLeft:t.paddingLeft,mergedDisabled:l,mergedValue:r.mergedValueRef,childActive:mt(()=>r.activePathRef.value.includes(e.internalKey)),collapsed:H(()=>n.mode==="horizontal"?!1:i.value?!0:!r.mergedExpandedKeysRef.value.includes(e.internalKey)),dropdownEnabled:H(()=>!l.value&&(n.mode==="horizontal"||i.value)),handlePopoverShowChange:u,handleClick:c}},render(){var e;const{mergedClsPrefix:t,menuProps:{renderIcon:r,renderLabel:o}}=this,n=()=>{const{isHorizontal:a,paddingLeft:l,collapsed:s,mergedDisabled:d,maxIconSize:c,activeIconSize:u,title:f,childActive:p,icon:h,handleClick:g,menuProps:{nodeProps:b},dropdownShow:m,iconMarginRight:y,tmNode:w,mergedClsPrefix:x}=this,k=b==null?void 0:b(w.rawNode);return v("div",Object.assign({},k,{class:[`${x}-menu-item`,k==null?void 0:k.class],role:"menuitem"}),v(pb,{tmNode:w,paddingLeft:l,collapsed:s,disabled:d,iconMarginRight:y,maxIconSize:c,activeIconSize:u,title:f,extra:this.extra,showArrow:!a,childActive:p,clsPrefix:x,icon:h,hover:m,onClick:g}))},i=()=>v(ml,null,{default:()=>{const{tmNodes:a,collapsed:l}=this;return l?null:v("div",{class:`${t}-submenu-children`,role:"menu"},a.map(s=>Cd(s,this.menuProps)))}});return this.root?v(sT,Object.assign({size:"large",trigger:"hover"},(e=this.menuProps)===null||e===void 0?void 0:e.dropdownProps,{themeOverrides:this.mergedTheme.peerOverrides.Dropdown,theme:this.mergedTheme.peers.Dropdown,builtinThemeOverrides:{fontSizeLarge:"14px",optionIconSizeLarge:"18px"},value:this.mergedValue,disabled:!this.dropdownEnabled,placement:this.dropdownPlacement,keyField:this.menuProps.keyField,labelField:this.menuProps.labelField,childrenField:this.menuProps.childrenField,onUpdateShow:this.handlePopoverShowChange,options:this.rawNodes,onSelect:this.doSelect,inverted:this.inverted,renderIcon:r,renderLabel:o}),{default:()=>v("div",{class:`${t}-submenu`,role:"menuitem","aria-expanded":!this.collapsed},n(),this.isHorizontal?null:i())}):v("div",{class:`${t}-submenu`,role:"menuitem","aria-expanded":!this.collapsed},n(),i())}}),mb=Object.assign(Object.assign({},xd),{tmNode:{type:Object,required:!0},disabled:Boolean,icon:Function,onClick:Function}),mI=ae({name:"MenuOption",props:mb,setup(e){const t=bd(e),{NSubmenu:r,NMenu:o}=t,{props:n,mergedClsPrefixRef:i,mergedCollapsedRef:a}=o,l=r?r.mergedDisabledRef:{value:!1},s=H(()=>l.value||e.disabled);function d(u){const{onClick:f}=e;f&&f(u)}function c(u){s.value||(o.doSelect(e.internalKey,e.tmNode.rawNode),d(u))}return{mergedClsPrefix:i,dropdownPlacement:t.dropdownPlacement,paddingLeft:t.paddingLeft,iconMarginRight:t.iconMarginRight,maxIconSize:t.maxIconSize,activeIconSize:t.activeIconSize,mergedTheme:o.mergedThemeRef,menuProps:n,dropdownEnabled:mt(()=>e.root&&a.value&&n.mode!=="horizontal"&&!s.value),selected:mt(()=>o.mergedValueRef.value===e.internalKey),mergedDisabled:s,handleClick:c}},render(){const{mergedClsPrefix:e,mergedTheme:t,tmNode:r,menuProps:{renderLabel:o,nodeProps:n}}=this,i=n==null?void 0:n(r.rawNode);return v("div",Object.assign({},i,{role:"menuitem",class:[`${e}-menu-item`,i==null?void 0:i.class]}),v(Tg,{theme:t.peers.Tooltip,themeOverrides:t.peerOverrides.Tooltip,trigger:"hover",placement:this.dropdownPlacement,disabled:!this.dropdownEnabled||this.title===void 0,internalExtraClass:["menu-tooltip"]},{default:()=>o?o(r.rawNode):St(this.title),trigger:()=>v(pb,{tmNode:r,clsPrefix:e,paddingLeft:this.paddingLeft,iconMarginRight:this.iconMarginRight,maxIconSize:this.maxIconSize,activeIconSize:this.activeIconSize,selected:this.selected,title:this.title,extra:this.extra,disabled:this.mergedDisabled,icon:this.icon,onClick:this.handleClick})}))}});var gI=ae({name:"MenuDivider",setup(){const e=me(Ui),{mergedClsPrefixRef:t,isHorizontalRef:r}=e;return()=>r.value?null:v("div",{class:`${t.value}-menu-divider`})}});const bI=sr(hb),xI=sr(mb),CI=sr(vb);function gb(e){return e.type==="divider"||e.type==="render"}function yI(e){return e.type==="divider"}function Cd(e,t){const{rawNode:r}=e,{show:o}=r;if(o===!1)return null;if(gb(r))return yI(r)?v(gI,Object.assign({key:e.key},r.props)):null;const{labelField:n}=t,{key:i,level:a,isGroup:l}=e,s=Object.assign(Object.assign({},r),{title:r.title||r[n],extra:r.titleExtra||r.extra,key:i,internalKey:i,level:a,root:a===0,isGroup:l});return e.children?e.isGroup?v(pI,Jt(s,bI,{tmNode:e,tmNodes:e.children,key:i})):v(vI,Jt(s,CI,{key:i,rawNodes:r[t.childrenField],tmNodes:e.children,tmNode:e})):v(mI,Jt(s,xI,{key:i,tmNode:e}))}const ch=[O("&::before","background-color: var(--n-item-color-hover);"),D("arrow",` - color: var(--n-arrow-color-hover); - `),D("icon",` - color: var(--n-item-icon-color-hover); - `),M("menu-item-content-header",` - color: var(--n-item-text-color-hover); - `,[O("a",` - color: var(--n-item-text-color-hover); - `),D("extra",` - color: var(--n-item-text-color-hover); - `)])],dh=[D("icon",` - color: var(--n-item-icon-color-hover-horizontal); - `),M("menu-item-content-header",` - color: var(--n-item-text-color-hover-horizontal); - `,[O("a",` - color: var(--n-item-text-color-hover-horizontal); - `),D("extra",` - color: var(--n-item-text-color-hover-horizontal); - `)])];var wI=O([M("menu",` - background-color: var(--n-color); - color: var(--n-item-text-color); - overflow: hidden; - transition: background-color .3s var(--n-bezier); - box-sizing: border-box; - font-size: var(--n-font-size); - padding-bottom: 6px; - `,[K("horizontal",` - display: inline-flex; - padding-bottom: 0; - `,[M("submenu","margin: 0;"),M("menu-item","margin: 0;"),M("menu-item-content",` - padding: 0 20px; - border-bottom: 2px solid #0000; - `,[O("&::before","display: none;"),K("selected","border-bottom: 2px solid var(--n-border-color-horizontal)")]),M("menu-item-content",[K("selected",[D("icon","color: var(--n-item-icon-color-active-horizontal);"),M("menu-item-content-header",` - color: var(--n-item-text-color-active-horizontal); - `,[O("a","color: var(--n-item-text-color-active-horizontal);"),D("extra","color: var(--n-item-text-color-active-horizontal);")])]),K("child-active",` - border-bottom: 2px solid var(--n-border-color-horizontal); - `,[M("menu-item-content-header",` - color: var(--n-item-text-color-child-active-horizontal); - `,[O("a",` - color: var(--n-item-text-color-child-active-horizontal); - `),D("extra",` - color: var(--n-item-text-color-child-active-horizontal); - `)]),D("icon",` - color: var(--n-item-icon-color-child-active-horizontal); - `)]),ut("disabled",[ut("selected, child-active",[O("&:focus-within",dh)]),K("selected",[xo(null,[D("icon","color: var(--n-item-icon-color-active-hover-horizontal);"),M("menu-item-content-header",` - color: var(--n-item-text-color-active-hover-horizontal); - `,[O("a","color: var(--n-item-text-color-active-hover-horizontal);"),D("extra","color: var(--n-item-text-color-active-hover-horizontal);")])])]),K("child-active",[xo(null,[D("icon","color: var(--n-item-icon-color-child-active-hover-horizontal);"),M("menu-item-content-header",` - color: var(--n-item-text-color-child-active-hover-horizontal); - `,[O("a","color: var(--n-item-text-color-child-active-hover-horizontal);"),D("extra","color: var(--n-item-text-color-child-active-hover-horizontal);")])])]),xo("border-bottom: 2px solid var(--n-border-color-horizontal);",dh)]),M("menu-item-content-header",[O("a","color: var(--n-item-text-color-horizontal);")])])]),K("collapsed",[M("menu-item-content",[K("selected",[O("&::before",` - background-color: var(--n-item-color-active-collapsed) !important; - `)]),M("menu-item-content-header","opacity: 0;"),D("arrow","opacity: 0;"),D("icon","color: var(--n-item-icon-color-collapsed);")])]),M("menu-item",` - height: var(--n-item-height); - margin-top: 6px; - position: relative; - `),M("menu-item-content",` - box-sizing: border-box; - line-height: 1.75; - height: 100%; - display: grid; - grid-template-areas: "icon content arrow"; - grid-template-columns: auto 1fr auto; - align-items: center; - cursor: pointer; - position: relative; - padding-right: 18px; - transition: - background-color .3s var(--n-bezier), - padding-left .3s var(--n-bezier), - border-color .3s var(--n-bezier); - `,[O("> *","z-index: 1;"),O("&::before",` - z-index: auto; - content: ""; - background-color: #0000; - position: absolute; - left: 8px; - right: 8px; - top: 0; - bottom: 0; - pointer-events: none; - border-radius: var(--n-border-radius); - transition: background-color .3s var(--n-bezier); - `),K("disabled",` - opacity: .45; - cursor: not-allowed; - `),K("collapsed",[D("arrow","transform: rotate(0);")]),K("selected",[O("&::before","background-color: var(--n-item-color-active);"),D("arrow","color: var(--n-arrow-color-active);"),D("icon","color: var(--n-item-icon-color-active);"),M("menu-item-content-header",` - color: var(--n-item-text-color-active); - `,[O("a","color: var(--n-item-text-color-active);"),D("extra","color: var(--n-item-text-color-active);")])]),K("child-active",[M("menu-item-content-header",` - color: var(--n-item-text-color-child-active); - `,[O("a",` - color: var(--n-item-text-color-child-active); - `),D("extra",` - color: var(--n-item-text-color-child-active); - `)]),D("arrow",` - color: var(--n-arrow-color-child-active); - `),D("icon",` - color: var(--n-item-icon-color-child-active); - `)]),ut("disabled",[ut("selected, child-active",[O("&:focus-within",ch)]),K("selected",[xo(null,[D("arrow","color: var(--n-arrow-color-active-hover);"),D("icon","color: var(--n-item-icon-color-active-hover);"),M("menu-item-content-header",` - color: var(--n-item-text-color-active-hover); - `,[O("a","color: var(--n-item-text-color-active-hover);"),D("extra","color: var(--n-item-text-color-active-hover);")])])]),K("child-active",[xo(null,[D("arrow","color: var(--n-arrow-color-child-active-hover);"),D("icon","color: var(--n-item-icon-color-child-active-hover);"),M("menu-item-content-header",` - color: var(--n-item-text-color-child-active-hover); - `,[O("a","color: var(--n-item-text-color-child-active-hover);"),D("extra","color: var(--n-item-text-color-child-active-hover);")])])]),K("selected",[xo(null,[O("&::before","background-color: var(--n-item-color-active-hover);")])]),xo(null,ch)]),D("icon",` - grid-area: icon; - color: var(--n-item-icon-color); - transition: - color .3s var(--n-bezier), - font-size .3s var(--n-bezier), - margin-right .3s var(--n-bezier); - box-sizing: content-box; - display: inline-flex; - align-items: center; - justify-content: center; - `),D("arrow",` - grid-area: arrow; - font-size: 16px; - color: var(--n-arrow-color); - transform: rotate(180deg); - opacity: 1; - transition: - color .3s var(--n-bezier), - transform 0.2s var(--n-bezier), - opacity 0.2s var(--n-bezier); - `),M("menu-item-content-header",` - grid-area: content; - transition: - color .3s var(--n-bezier), - opacity .3s var(--n-bezier); - opacity: 1; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - color: var(--n-item-text-color); - `,[O("a",` - outline: none; - text-decoration: none; - transition: color .3s var(--n-bezier); - color: var(--n-item-text-color); - `,[O("&::before",` - content: ""; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - `)]),D("extra",` - font-size: .93em; - color: var(--n-group-text-color); - transition: color .3s var(--n-bezier); - `)])]),M("submenu",` - cursor: pointer; - position: relative; - margin-top: 6px; - `,[M("menu-item-content",` - height: var(--n-item-height); - `),M("submenu-children",` - overflow: hidden; - padding: 0; - `,[og({duration:".2s"})])]),M("menu-item-group",[M("menu-item-group-title",` - margin-top: 6px; - color: var(--n-group-text-color); - cursor: default; - font-size: .93em; - height: 36px; - display: flex; - align-items: center; - transition: - padding-left .3s var(--n-bezier), - color .3s var(--n-bezier); - `)])]),M("menu-tooltip",[O("a",` - color: inherit; - text-decoration: none; - `)]),M("menu-divider",` - transition: background-color .3s var(--n-bezier); - background-color: var(--n-divider-color); - height: 1px; - margin: 6px 18px; - `)]);function xo(e,t){return[K("hover",e,t),O("&:hover",e,t)]}const SI=Object.assign(Object.assign({},Ee.props),{options:{type:Array,default:()=>[]},collapsed:{type:Boolean,default:void 0},collapsedWidth:{type:Number,default:48},iconSize:{type:Number,default:20},collapsedIconSize:{type:Number,default:24},rootIndent:Number,indent:{type:Number,default:32},labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},disabledField:{type:String,default:"disabled"},defaultExpandAll:Boolean,defaultExpandedKeys:Array,expandedKeys:Array,value:[String,Number],defaultValue:{type:[String,Number],default:null},mode:{type:String,default:"vertical"},watchProps:{type:Array,default:void 0},disabled:Boolean,show:{type:Boolean,defalut:!0},inverted:Boolean,"onUpdate:expandedKeys":[Function,Array],onUpdateExpandedKeys:[Function,Array],onUpdateValue:[Function,Array],"onUpdate:value":[Function,Array],expandIcon:Function,renderIcon:Function,renderLabel:Function,renderExtra:Function,dropdownProps:Object,accordion:Boolean,nodeProps:Function,items:Array,onOpenNamesChange:[Function,Array],onSelect:[Function,Array],onExpandedNamesChange:[Function,Array],expandedNames:Array,defaultExpandedNames:Array,dropdownPlacement:{type:String,default:"bottom"}});var $I=ae({name:"Menu",props:SI,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=st(e),o=Ee("Menu","-menu",wI,NE,e,t),n=me(dI,null),i=H(()=>{var $;const{collapsed:R}=e;if(R!==void 0)return R;if(n){const{collapseModeRef:_,collapsedRef:N}=n;if(_.value==="width")return($=N.value)!==null&&$!==void 0?$:!1}return!1}),a=H(()=>{const{keyField:$,childrenField:R,disabledField:_}=e;return Bm(e.items||e.options,{getIgnored(N){return gb(N)},getChildren(N){return N[R]},getDisabled(N){return N[_]},getKey(N){var E;return(E=N[$])!==null&&E!==void 0?E:N.name}})}),l=H(()=>new Set(a.value.treeNodes.map($=>$.key))),{watchProps:s}=e,d=V(null);s!=null&&s.includes("defaultValue")?Wt(()=>{d.value=e.defaultValue}):d.value=e.defaultValue;const c=Te(e,"value"),u=En(c,d),f=V([]),p=()=>{f.value=e.defaultExpandAll?a.value.getNonLeafKeys():e.defaultExpandedNames||e.defaultExpandedKeys||a.value.getPath(u.value,{includeSelf:!1}).keyPath};s!=null&&s.includes("defaultExpandedKeys")?Wt(p):p();const h=Ti(e,["expandedNames","expandedKeys"]),g=En(h,f),b=H(()=>a.value.treeNodes),m=H(()=>a.value.getPath(u.value).keyPath);Be(Ui,{props:e,mergedCollapsedRef:i,mergedThemeRef:o,mergedValueRef:u,mergedExpandedKeysRef:g,activePathRef:m,mergedClsPrefixRef:t,isHorizontalRef:H(()=>e.mode==="horizontal"),invertedRef:Te(e,"inverted"),doSelect:y,toggleExpand:x});function y($,R){const{"onUpdate:value":_,onUpdateValue:N,onSelect:E}=e;N&&Ae(N,$,R),_&&Ae(_,$,R),E&&Ae(E,$,R),d.value=$}function w($){const{"onUpdate:expandedKeys":R,onUpdateExpandedKeys:_,onExpandedNamesChange:N,onOpenNamesChange:E}=e;R&&Ae(R,$),_&&Ae(_,$),N&&Ae(N,$),E&&Ae(E,$),f.value=$}function x($){const R=Array.from(g.value),_=R.findIndex(N=>N===$);if(~_)R.splice(_,1);else{if(e.accordion&&l.value.has($)){const N=R.findIndex(E=>l.value.has(E));N>-1&&R.splice(N,1)}R.push($)}w(R)}const k=$=>{const R=a.value.getPath($!=null?$:u.value,{includeSelf:!1}).keyPath;if(!R.length)return;const _=Array.from(g.value),N=new Set([..._,...R]);e.accordion&&l.value.forEach(E=>{N.has(E)&&!R.includes(E)&&N.delete(E)}),w(Array.from(N))},T=H(()=>{const{inverted:$}=e,{common:{cubicBezierEaseInOut:R},self:_}=o.value,{borderRadius:N,borderColorHorizontal:E,fontSize:F,itemHeight:j,dividerColor:Q}=_,A={"--n-divider-color":Q,"--n-bezier":R,"--n-font-size":F,"--n-border-color-horizontal":E,"--n-border-radius":N,"--n-item-height":j};return $?(A["--n-group-text-color"]=_.groupTextColorInverted,A["--n-color"]=_.colorInverted,A["--n-item-text-color"]=_.itemTextColorInverted,A["--n-item-text-color-hover"]=_.itemTextColorHoverInverted,A["--n-item-text-color-active"]=_.itemTextColorActiveInverted,A["--n-item-text-color-child-active"]=_.itemTextColorChildActiveInverted,A["--n-item-text-color-child-active-hover"]=_.itemTextColorChildActiveInverted,A["--n-item-text-color-active-hover"]=_.itemTextColorActiveHoverInverted,A["--n-item-icon-color"]=_.itemIconColorInverted,A["--n-item-icon-color-hover"]=_.itemIconColorHoverInverted,A["--n-item-icon-color-active"]=_.itemIconColorActiveInverted,A["--n-item-icon-color-active-hover"]=_.itemIconColorActiveHoverInverted,A["--n-item-icon-color-child-active"]=_.itemIconColorChildActiveInverted,A["--n-item-icon-color-child-active-hover"]=_.itemIconColorChildActiveHoverInverted,A["--n-item-icon-color-collapsed"]=_.itemIconColorCollapsedInverted,A["--n-item-text-color-horizontal"]=_.itemTextColorHorizontalInverted,A["--n-item-text-color-hover-horizontal"]=_.itemTextColorHoverHorizontalInverted,A["--n-item-text-color-active-horizontal"]=_.itemTextColorActiveHorizontalInverted,A["--n-item-text-color-child-active-horizontal"]=_.itemTextColorChildActiveHorizontalInverted,A["--n-item-text-color-child-active-hover-horizontal"]=_.itemTextColorChildActiveHoverHorizontalInverted,A["--n-item-text-color-active-hover-horizontal"]=_.itemTextColorActiveHoverHorizontalInverted,A["--n-item-icon-color-horizontal"]=_.itemIconColorHorizontalInverted,A["--n-item-icon-color-hover-horizontal"]=_.itemIconColorHoverHorizontalInverted,A["--n-item-icon-color-active-horizontal"]=_.itemIconColorActiveHorizontalInverted,A["--n-item-icon-color-active-hover-horizontal"]=_.itemIconColorActiveHoverHorizontalInverted,A["--n-item-icon-color-child-active-horizontal"]=_.itemIconColorChildActiveHorizontalInverted,A["--n-item-icon-color-child-active-hover-horizontal"]=_.itemIconColorChildActiveHoverHorizontalInverted,A["--n-arrow-color"]=_.arrowColorInverted,A["--n-arrow-color-hover"]=_.arrowColorHoverInverted,A["--n-arrow-color-active"]=_.arrowColorActiveInverted,A["--n-arrow-color-active-hover"]=_.arrowColorActiveHoverInverted,A["--n-arrow-color-child-active"]=_.arrowColorChildActiveInverted,A["--n-arrow-color-child-active-hover"]=_.arrowColorChildActiveHoverInverted,A["--n-item-color-hover"]=_.itemColorHoverInverted,A["--n-item-color-active"]=_.itemColorActiveInverted,A["--n-item-color-active-hover"]=_.itemColorActiveHoverInverted,A["--n-item-color-active-collapsed"]=_.itemColorActiveCollapsedInverted):(A["--n-group-text-color"]=_.groupTextColor,A["--n-color"]=_.color,A["--n-item-text-color"]=_.itemTextColor,A["--n-item-text-color-hover"]=_.itemTextColorHover,A["--n-item-text-color-active"]=_.itemTextColorActive,A["--n-item-text-color-child-active"]=_.itemTextColorChildActive,A["--n-item-text-color-child-active-hover"]=_.itemTextColorChildActiveHover,A["--n-item-text-color-active-hover"]=_.itemTextColorActiveHover,A["--n-item-icon-color"]=_.itemIconColor,A["--n-item-icon-color-hover"]=_.itemIconColorHover,A["--n-item-icon-color-active"]=_.itemIconColorActive,A["--n-item-icon-color-active-hover"]=_.itemIconColorActiveHover,A["--n-item-icon-color-child-active"]=_.itemIconColorChildActive,A["--n-item-icon-color-child-active-hover"]=_.itemIconColorChildActiveHover,A["--n-item-icon-color-collapsed"]=_.itemIconColorCollapsed,A["--n-item-text-color-horizontal"]=_.itemTextColorHorizontal,A["--n-item-text-color-hover-horizontal"]=_.itemTextColorHoverHorizontal,A["--n-item-text-color-active-horizontal"]=_.itemTextColorActiveHorizontal,A["--n-item-text-color-child-active-horizontal"]=_.itemTextColorChildActiveHorizontal,A["--n-item-text-color-child-active-hover-horizontal"]=_.itemTextColorChildActiveHoverHorizontal,A["--n-item-text-color-active-hover-horizontal"]=_.itemTextColorActiveHoverHorizontal,A["--n-item-icon-color-horizontal"]=_.itemIconColorHorizontal,A["--n-item-icon-color-hover-horizontal"]=_.itemIconColorHoverHorizontal,A["--n-item-icon-color-active-horizontal"]=_.itemIconColorActiveHorizontal,A["--n-item-icon-color-active-hover-horizontal"]=_.itemIconColorActiveHoverHorizontal,A["--n-item-icon-color-child-active-horizontal"]=_.itemIconColorChildActiveHorizontal,A["--n-item-icon-color-child-active-hover-horizontal"]=_.itemIconColorChildActiveHoverHorizontal,A["--n-arrow-color"]=_.arrowColor,A["--n-arrow-color-hover"]=_.arrowColorHover,A["--n-arrow-color-active"]=_.arrowColorActive,A["--n-arrow-color-active-hover"]=_.arrowColorActiveHover,A["--n-arrow-color-child-active"]=_.arrowColorChildActive,A["--n-arrow-color-child-active-hover"]=_.arrowColorChildActiveHover,A["--n-item-color-hover"]=_.itemColorHover,A["--n-item-color-active"]=_.itemColorActive,A["--n-item-color-active-hover"]=_.itemColorActiveHover,A["--n-item-color-active-collapsed"]=_.itemColorActiveCollapsed),A}),S=r?Pt("menu",H(()=>e.inverted?"a":"b"),T,e):void 0;return{mergedClsPrefix:t,controlledExpandedKeys:h,uncontrolledExpanededKeys:f,mergedExpandedKeys:g,uncontrolledValue:d,mergedValue:u,activePath:m,tmNodes:b,mergedTheme:o,mergedCollapsed:i,cssVars:r?void 0:T,themeClass:S==null?void 0:S.themeClass,onRender:S==null?void 0:S.onRender,showOption:k}},render(){const{mergedClsPrefix:e,mode:t,themeClass:r,onRender:o}=this;return o==null||o(),v("div",{role:t==="horizontal"?"menubar":"menu",class:[`${e}-menu`,r,`${e}-menu--${t}`,this.mergedCollapsed&&`${e}-menu--collapsed`],style:this.cssVars},this.tmNodes.map(n=>Cd(n,this.$props)))}});const bb={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},xb="n-message-api",Cb="n-message-provider";var _I=O([M("message-wrapper",` - margin: var(--n-margin); - z-index: 0; - transform-origin: top center; - display: flex; - `,[og({overflow:"visible",originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.85)"}})]),M("message",` - box-sizing: border-box; - display: flex; - align-items: center; - transition: - color .3s var(--n-bezier), - box-shadow .3s var(--n-bezier), - background-color .3s var(--n-bezier), - opacity .3s var(--n-bezier), - transform .3s var(--n-bezier), - margin-bottom .3s var(--n-bezier); - padding: var(--n-padding); - border-radius: var(--n-border-radius); - flex-wrap: nowrap; - overflow: hidden; - max-width: var(--n-max-width); - color: var(--n-text-color); - background-color: var(--n-color); - box-shadow: var(--n-box-shadow); - `,[D("content",` - display: inline-block; - line-height: var(--n-line-height); - font-size: var(--n-font-size); - `),D("icon",` - position: relative; - margin: var(--n-icon-margin); - height: var(--n-icon-size); - width: var(--n-icon-size); - font-size: var(--n-icon-size); - flex-shrink: 0; - `,[["default","info","success","warning","error","loading"].map(e=>K(`${e}-type`,[O("> *",` - color: var(--n-icon-color-${e}); - transition: color .3s var(--n-bezier); - `)])),O("> *",` - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - `,[Oi()])]),D("close",` - margin: var(--n-close-margin); - transition: - background-color .3s var(--n-bezier), - color .3s var(--n-bezier); - flex-shrink: 0; - `,[O("&:hover",` - color: var(--n-close-icon-color-hover); - `),O("&:active",` - color: var(--n-close-icon-color-pressed); - `)])]),M("message-container",` - z-index: 6000; - position: fixed; - height: 0; - overflow: visible; - display: flex; - flex-direction: column; - align-items: center; - `,[K("top",` - top: 12px; - left: 0; - right: 0; - `),K("top-left",` - top: 12px; - left: 12px; - right: 0; - align-items: flex-start; - `),K("top-right",` - top: 12px; - left: 0; - right: 12px; - align-items: flex-end; - `),K("bottom",` - bottom: 4px; - left: 0; - right: 0; - justify-content: flex-end; - `),K("bottom-left",` - bottom: 4px; - left: 12px; - right: 0; - justify-content: flex-end; - align-items: flex-start; - `),K("bottom-right",` - bottom: 4px; - left: 0; - right: 12px; - justify-content: flex-end; - align-items: flex-end; - `)])]);const PI={info:()=>v(Xs,null),success:()=>v(Im,null),warning:()=>v(Om,null),error:()=>v(Rm,null),default:()=>null};var kI=ae({name:"Message",props:Object.assign(Object.assign({},bb),{render:Function}),setup(e){const{inlineThemeDisabled:t,mergedRtlRef:r}=st(e),{props:o,mergedClsPrefixRef:n}=me(Cb),i=Kr("Message",r,n),a=Ee("Message","-message",_I,wE,o,n),l=H(()=>{const{type:d}=e,{common:{cubicBezierEaseInOut:c},self:{padding:u,margin:f,maxWidth:p,iconMargin:h,closeMargin:g,closeSize:b,iconSize:m,fontSize:y,lineHeight:w,borderRadius:x,iconColorInfo:k,iconColorSuccess:T,iconColorWarning:S,iconColorError:$,iconColorLoading:R,closeIconSize:_,closeBorderRadius:N,[ie("textColor",d)]:E,[ie("boxShadow",d)]:F,[ie("color",d)]:j,[ie("closeColorHover",d)]:Q,[ie("closeColorPressed",d)]:A,[ie("closeIconColor",d)]:X,[ie("closeIconColorPressed",d)]:ne,[ie("closeIconColorHover",d)]:pe}}=a.value;return{"--n-bezier":c,"--n-margin":f,"--n-padding":u,"--n-max-width":p,"--n-font-size":y,"--n-icon-margin":h,"--n-icon-size":m,"--n-close-icon-size":_,"--n-close-border-radius":N,"--n-close-size":b,"--n-close-margin":g,"--n-text-color":E,"--n-color":j,"--n-box-shadow":F,"--n-icon-color-info":k,"--n-icon-color-success":T,"--n-icon-color-warning":S,"--n-icon-color-error":$,"--n-icon-color-loading":R,"--n-close-color-hover":Q,"--n-close-color-pressed":A,"--n-close-icon-color":X,"--n-close-icon-color-pressed":ne,"--n-close-icon-color-hover":pe,"--n-line-height":w,"--n-border-radius":x}}),s=t?Pt("message",H(()=>e.type[0]),l,{}):void 0;return{mergedClsPrefix:n,rtlEnabled:i,messageProviderProps:o,handleClose(){var d;(d=e.onClose)===null||d===void 0||d.call(e)},cssVars:t?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender,placement:o.placement}},render(){const{render:e,type:t,closable:r,content:o,mergedClsPrefix:n,cssVars:i,themeClass:a,onRender:l,icon:s,handleClose:d,showIcon:c}=this;l==null||l();let u;return v("div",{class:[`${n}-message-wrapper`,a],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},i]},e?e(this.$props):v("div",{class:[`${n}-message ${n}-message--${t}-type`,this.rtlEnabled&&`${n}-message--rtl`]},(u=TI(s,t,n))&&c?v("div",{class:`${n}-message__icon ${n}-message__icon--${t}-type`},v(vl,null,{default:()=>u})):null,v("div",{class:`${n}-message__content`},St(o)),r?v(ji,{clsPrefix:n,class:`${n}-message__close`,onClick:d,absolute:!0}):null))}});function TI(e,t,r){if(typeof e=="function")return e();{const o=t==="loading"?v(gl,{clsPrefix:r,strokeWidth:24,scale:.85}):PI[t]();return o?v(zt,{clsPrefix:r,key:t},{default:()=>o}):null}}var zI=ae({name:"MessageEnvironment",props:Object.assign(Object.assign({},bb),{duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function}),setup(e){let t=null;const r=V(!0);gt(()=>{o()});function o(){const{duration:c}=e;c&&(t=window.setTimeout(a,c))}function n(c){c.currentTarget===c.target&&t!==null&&(window.clearTimeout(t),t=null)}function i(c){c.currentTarget===c.target&&o()}function a(){const{onHide:c}=e;r.value=!1,t&&(window.clearTimeout(t),t=null),c&&c()}function l(){const{onClose:c}=e;c&&c(),a()}function s(){const{onAfterLeave:c,onInternalAfterLeave:u,onAfterHide:f,internalKey:p}=e;c&&c(),u&&u(p),f&&f()}function d(){a()}return{show:r,hide:a,handleClose:l,handleAfterLeave:s,handleMouseleave:i,handleMouseenter:n,deactivate:d}},render(){return v(ml,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?v(kI,{content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0}):null]})}});const EI=Object.assign(Object.assign({},Ee.props),{to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:"top"},closable:Boolean,containerStyle:[String,Object]});var RI=ae({name:"MessageProvider",props:EI,setup(e){const{mergedClsPrefixRef:t}=st(e),r=V([]),o=V({}),n={create(s,d){return i(s,Object.assign({type:"default"},d))},info(s,d){return i(s,Object.assign(Object.assign({},d),{type:"info"}))},success(s,d){return i(s,Object.assign(Object.assign({},d),{type:"success"}))},warning(s,d){return i(s,Object.assign(Object.assign({},d),{type:"warning"}))},error(s,d){return i(s,Object.assign(Object.assign({},d),{type:"error"}))},loading(s,d){return i(s,Object.assign(Object.assign({},d),{type:"loading"}))},destroyAll:l};Be(Cb,{props:e,mergedClsPrefixRef:t}),Be(xb,n);function i(s,d){const c=Tn(),u=vr(Object.assign(Object.assign({},d),{content:s,key:c,destroy:()=>{var p;(p=o.value[c])===null||p===void 0||p.hide()}})),{max:f}=e;return f&&r.value.length>=f&&r.value.shift(),r.value.push(u),u}function a(s){r.value.splice(r.value.findIndex(d=>d.key===s),1),delete o.value[s]}function l(){Object.values(o.value).forEach(s=>{s.hide()})}return Object.assign({mergedClsPrefix:t,messageRefs:o,messageList:r,handleAfterLeave:a},n)},render(){var e,t,r;return v(Je,null,(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e),this.messageList.length?v(wp,{to:(r=this.to)!==null&&r!==void 0?r:"body"},v("div",{class:[`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`],key:"message-container",style:this.containerStyle},this.messageList.map(o=>v(zI,Object.assign({ref:n=>{n&&(this.messageRefs[o.key]=n)},internalKey:o.key,onInternalAfterLeave:this.handleAfterLeave},Lc(o,["destroy"],void 0),{duration:o.duration===void 0?this.duration:o.duration,keepAliveOnHover:o.keepAliveOnHover===void 0?this.keepAliveOnHover:o.keepAliveOnHover,closable:o.closable===void 0?this.closable:o.closable}))))):null)}});function II(){const e=me(xb,null);return e===null&&il("use-message","No outer founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A."),e}const OI={name:"Skeleton",common:le,self(e){const{heightSmall:t,heightMedium:r,heightLarge:o,borderRadius:n}=e;return{color:"rgba(255, 255, 255, 0.12)",colorEnd:"rgba(255, 255, 255, 0.18)",borderRadius:n,heightSmall:t,heightMedium:r,heightLarge:o}}};var AI=O([O("@keyframes spin-rotate",` - from { - transform: rotate(0); - } - to { - transform: rotate(360deg); - } - `),M("spin-container",{position:"relative"},[M("spin-body",` - position: absolute; - top: 50%; - left: 50%; - transform: translateX(-50%) translateY(-50%); - `,[Ai()])]),M("spin-body",` - display: inline-flex; - align-items: center; - justify-content: center; - flex-direction: column; - `),M("spin",` - display: inline-flex; - height: var(--n-size); - width: var(--n-size); - font-size: var(--n-size); - color: var(--n-color); - `,[K("rotate",` - animation: spin-rotate 2s linear infinite; - `)]),M("spin-description",` - display: inline-block; - font-size: var(--n-font-size); - color: var(--n-text-color); - transition: color .3s var(--n-bezier); - margin-top: 8px; - `),M("spin-content",` - opacity: 1; - transition: opacity .3s var(--n-bezier); - pointer-events: all; - `,[K("spinning",` - user-select: none; - -webkit-user-select: none; - pointer-events: none; - opacity: var(--n-opacity-spinning); - `)])]);const MI={small:20,medium:18,large:16},BI=Object.assign(Object.assign({},Ee.props),{description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0}});var LI=ae({name:"Spin",props:BI,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=st(e),o=Ee("Spin","-spin",AI,dR,e,t),n=H(()=>{const{size:a}=e,{common:{cubicBezierEaseInOut:l},self:s}=o.value,{opacitySpinning:d,color:c,textColor:u}=s,f=typeof a=="number"?Iy(a):s[ie("size",a)];return{"--n-bezier":l,"--n-opacity-spinning":d,"--n-size":f,"--n-color":c,"--n-text-color":u}}),i=r?Pt("spin",H(()=>{const{size:a}=e;return typeof a=="number"?String(a):a[0]}),n,e):void 0;return{mergedClsPrefix:t,compitableShow:Ti(e,["spinning","show"]),mergedStrokeWidth:H(()=>{const{strokeWidth:a}=e;if(a!==void 0)return a;const{size:l}=e;return MI[typeof l=="number"?"medium":l]}),cssVars:r?void 0:n,themeClass:i==null?void 0:i.themeClass,onRender:i==null?void 0:i.onRender}},render(){var e,t;const{$slots:r,mergedClsPrefix:o,description:n}=this,i=r.icon&&this.rotate,a=(n||r.description)&&v("div",{class:`${o}-spin-description`},n||((e=r.description)===null||e===void 0?void 0:e.call(r))),l=r.icon?v("div",{class:[`${o}-spin-body`,this.themeClass]},v("div",{class:[`${o}-spin`,i&&`${o}-spin--rotate`],style:r.default?"":this.cssVars},r.icon()),a):v("div",{class:[`${o}-spin-body`,this.themeClass]},v(gl,{clsPrefix:o,style:r.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${o}-spin`}),a);return(t=this.onRender)===null||t===void 0||t.call(this),r.default?v("div",{class:[`${o}-spin-container`,this.themeClass],style:this.cssVars},v("div",{class:[`${o}-spin-content`,this.compitableShow&&`${o}-spin-content--spinning`]},r),v(Bt,{name:"fade-in-transition"},{default:()=>this.compitableShow?l:null})):l}});const yd="n-tabs",yb={tab:[String,Number,Object,Function],name:{type:[String,Number],required:!0},disabled:Boolean,displayDirective:{type:String,default:"if"},closable:{type:Boolean,default:void 0},tabProps:Object,label:[String,Number,Object,Function]};var HI=ae({__TAB_PANE__:!0,name:"TabPane",alias:["TabPanel"],props:yb,setup(e){const t=me(yd,null);return t||il("tab-pane","`n-tab-pane` must be placed inside `n-tabs`."),{style:t.paneStyleRef,class:t.paneClassRef,mergedClsPrefix:t.mergedClsPrefixRef}},render(){return v("div",{class:[`${this.mergedClsPrefix}-tab-pane`,this.class],style:this.style},this.$slots)}});const DI=Object.assign({internalLeftPadded:Boolean,internalAddable:Boolean,internalCreatedByPane:Boolean},Lc(yb,["displayDirective"]));var ic=ae({__TAB__:!0,inheritAttrs:!1,name:"Tab",props:DI,setup(e){const{mergedClsPrefixRef:t,valueRef:r,typeRef:o,closableRef:n,tabStyleRef:i,tabChangeIdRef:a,onBeforeLeaveRef:l,triggerRef:s,handleAdd:d,activateTab:c,handleClose:u}=me(yd);return{trigger:s,mergedClosable:H(()=>{if(e.internalAddable)return!1;const{closable:f}=e;return f===void 0?n.value:f}),style:i,clsPrefix:t,value:r,type:o,handleClose(f){f.stopPropagation(),!e.disabled&&u(e.name)},activateTab(){if(e.disabled)return;if(e.internalAddable){d();return}const{name:f}=e,p=++a.id;if(f!==r.value){const{value:h}=l;h?Promise.resolve(h(e.name,r.value)).then(g=>{g&&a.id===p&&c(f)}):c(f)}}}},render(){const{internalAddable:e,clsPrefix:t,name:r,disabled:o,label:n,tab:i,value:a,mergedClosable:l,style:s,trigger:d,$slots:{default:c}}=this,u=n!=null?n:i;return v("div",{class:`${t}-tabs-tab-wrapper`},this.internalLeftPadded?v("div",{class:`${t}-tabs-tab-pad`}):null,v("div",Object.assign({key:r,"data-name":r,"data-disabled":o?!0:void 0},so({class:[`${t}-tabs-tab`,a===r&&`${t}-tabs-tab--active`,o&&`${t}-tabs-tab--disabled`,l&&`${t}-tabs-tab--closable`,e&&`${t}-tabs-tab--addable`],onClick:d==="click"?this.activateTab:void 0,onMouseenter:d==="hover"?this.activateTab:void 0,style:e?void 0:s},this.internalCreatedByPane?this.tabProps||{}:this.$attrs)),v("span",{class:`${t}-tabs-tab__label`},e?v(Je,null,v("div",{class:`${t}-tabs-tab__height-placeholder`},"\xA0"),v(zt,{clsPrefix:t},{default:()=>v(m6,null)})):c?c():typeof u=="object"?u:St(u!=null?u:r)),l&&this.type==="card"?v(ji,{clsPrefix:t,class:`${t}-tabs-tab__close`,onClick:this.handleClose,disabled:o}):null))}}),FI=M("tabs",` - box-sizing: border-box; - width: 100%; - display: flex; - flex-direction: column; - transition: - background-color .3s var(--n-bezier), - border-color .3s var(--n-bezier); -`,[K("segment-type",[M("tabs-rail",[O("&.transition-disabled","color: red;",[M("tabs-tab",` - transition: none; - `)])])]),K("left, right",` - flex-direction: row; - `,[M("tabs-bar",` - width: 2px; - right: 0; - transition: - top .2s var(--n-bezier), - max-height .2s var(--n-bezier), - background-color .3s var(--n-bezier); - `),M("tabs-tab",` - padding: var(--n-tab-padding-vertical); - `)]),K("right",` - flex-direction: row-reverse; - `,[M("tabs-bar",` - left: 0; - `)]),K("bottom",` - flex-direction: column-reverse; - justify-content: flex-end; - `,[M("tabs-bar",` - top: 0; - `)]),M("tabs-rail",` - padding: 3px; - border-radius: var(--n-tab-border-radius); - width: 100%; - background-color: var(--n-color-segment); - transition: background-color .3s var(--n-bezier); - display: flex; - align-items: center; - `,[M("tabs-tab-wrapper",` - flex-basis: 0; - flex-grow: 1; - display: flex; - align-items: center; - justify-content: center; - `,[M("tabs-tab",` - overflow: hidden; - border-radius: var(--n-tab-border-radius); - width: 100%; - display: flex; - align-items: center; - justify-content: center; - `,[K("active",` - font-weight: var(--n-font-weight-strong); - color: var(--n-tab-text-color-active); - background-color: var(--n-tab-color-segment); - box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .08); - `),O("&:hover",` - color: var(--n-tab-text-color-hover); - `)])])]),K("flex",[M("tabs-nav",{width:"100%"},[M("tabs-wrapper",{width:"100%"},[M("tabs-tab",{marginRight:0})])])]),M("tabs-nav",` - box-sizing: border-box; - line-height: 1.5; - display: flex; - transition: border-color .3s var(--n-bezier); - `,[D("prefix, suffix",` - display: flex; - align-items: center; - `),D("prefix","padding-right: 16px;"),D("suffix","padding-left: 16px;")]),M("tabs-nav-scroll-wrapper",` - flex: 1; - position: relative; - overflow: hidden; - `,[K("shadow-before",[O("&::before",` - box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, .12); - `)]),K("shadow-after",[O("&::after",` - box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, .12); - `)]),M("tabs-nav-y-scroll",` - height: 100%; - width: 100%; - overflow-y: auto; - scrollbar-width: none; - `,[O("&::-webkit-scrollbar",` - width: 0; - height: 0; - `)]),O("&::before, &::after",` - transition: box-shadow .3s var(--n-bezier); - pointer-events: none; - content: ""; - position: absolute; - top: 0; - bottom: 0; - width: 20px; - z-index: 1; - `),O("&::before",` - left: 0; - `),O("&::after",` - right: 0; - `)]),M("tabs-nav-scroll-content",` - display: flex; - position: relative; - min-width: 100%; - width: fit-content; - `),M("tabs-wrapper",` - display: inline-flex; - flex-wrap: nowrap; - position: relative; - `),M("tabs-tab-wrapper",` - display: flex; - flex-wrap: nowrap; - flex-shrink: 0; - flex-grow: 0; - `),M("tabs-tab",` - cursor: pointer; - white-space: nowrap; - flex-wrap: nowrap; - display: inline-flex; - align-items: center; - color: var(--n-tab-text-color); - font-size: var(--n-tab-font-size); - background-clip: padding-box; - padding: var(--n-tab-padding); - transition: - box-shadow .3s var(--n-bezier), - color .3s var(--n-bezier), - background-color .3s var(--n-bezier), - border-color .3s var(--n-bezier); - `,[K("disabled",{cursor:"not-allowed"}),D("close",` - margin-left: 6px; - transition: - background-color .3s var(--n-bezier), - color .3s var(--n-bezier); - `),D("label",` - display: flex; - align-items: center; - `)]),M("tabs-bar",` - position: absolute; - bottom: 0; - height: 2px; - border-radius: 1px; - background-color: var(--n-bar-color); - transition: - left .2s var(--n-bezier), - max-width .2s var(--n-bezier), - background-color .3s var(--n-bezier); - `,[O("&.transition-disabled",` - transition: none; - `),K("disabled",` - background-color: var(--n-tab-text-color-disabled) - `)]),M("tabs-pane-wrapper",` - position: relative; - overflow: hidden; - transition: max-height .2s var(--n-bezier); - `),M("tab-pane",` - color: var(--n-pane-text-color); - width: 100%; - padding: var(--n-pane-padding); - transition: - color .3s var(--n-bezier), - background-color .3s var(--n-bezier), - opacity .2s var(--n-bezier); - left: 0; - right: 0; - top: 0; - `,[O("&.next-transition-leave-active, &.prev-transition-leave-active, &.next-transition-enter-active, &.prev-transition-enter-active",` - transition: - color .3s var(--n-bezier), - background-color .3s var(--n-bezier), - transform .2s var(--n-bezier), - opacity .2s var(--n-bezier); - `),O("&.next-transition-leave-active, &.prev-transition-leave-active",` - position: absolute; - `),O("&.next-transition-enter-from, &.prev-transition-leave-to",` - transform: translateX(32px); - opacity: 0; - `),O("&.next-transition-leave-to, &.prev-transition-enter-from",` - transform: translateX(-32px); - opacity: 0; - `),O("&.next-transition-leave-from, &.next-transition-enter-to, &.prev-transition-leave-from, &.prev-transition-enter-to",` - transform: translateX(0); - opacity: 1; - `)]),M("tabs-tab-pad",` - width: var(--n-tab-gap); - flex-grow: 0; - flex-shrink: 0; - `),K("line-type, bar-type",[M("tabs-tab",` - font-weight: var(--n-tab-font-weight); - box-sizing: border-box; - vertical-align: bottom; - `,[O("&:hover",{color:"var(--n-tab-text-color-hover)"}),K("active",` - color: var(--n-tab-text-color-active); - font-weight: var(--n-tab-font-weight-active); - `),K("disabled",{color:"var(--n-tab-text-color-disabled)"})])]),M("tabs-nav",[K("line-type",[D("prefix, suffix",` - transition: border-color .3s var(--n-bezier); - border-bottom: 1px solid var(--n-tab-border-color); - `),M("tabs-nav-scroll-content",` - transition: border-color .3s var(--n-bezier); - border-bottom: 1px solid var(--n-tab-border-color); - `),M("tabs-bar",` - border-radius: 0; - bottom: -1px; - `)]),K("card-type",[D("prefix, suffix",` - transition: border-color .3s var(--n-bezier); - border-bottom: 1px solid var(--n-tab-border-color); - `),M("tabs-pad",` - flex-grow: 1; - transition: border-color .3s var(--n-bezier); - border-bottom: 1px solid var(--n-tab-border-color); - `),M("tabs-tab-pad",` - transition: border-color .3s var(--n-bezier); - border-bottom: 1px solid var(--n-tab-border-color); - `),M("tabs-tab",` - font-weight: var(--n-tab-font-weight); - border: 1px solid var(--n-tab-border-color); - border-top-left-radius: var(--n-tab-border-radius); - border-top-right-radius: var(--n-tab-border-radius); - background-color: var(--n-tab-color); - box-sizing: border-box; - position: relative; - vertical-align: bottom; - display: flex; - justify-content: space-between; - font-size: var(--n-tab-font-size); - color: var(--n-tab-text-color); - `,[K("addable",` - padding-left: 8px; - padding-right: 8px; - font-size: 16px; - `,[D("height-placeholder",` - width: 0; - font-size: var(--n-tab-font-size); - `),ut("disabled",[O("&:hover",` - color: var(--n-tab-text-color-hover); - `)])]),K("closable","padding-right: 6px;"),K("active",` - border-bottom: 1px solid #0000; - background-color: #0000; - font-weight: var(--n-tab-font-weight-active); - color: var(--n-tab-text-color-active); - `),K("disabled","color: var(--n-tab-text-color-disabled);")]),M("tabs-scroll-padding","border-bottom: 1px solid var(--n-tab-border-color);")]),K("left, right",[M("tabs-wrapper",` - flex-direction: column; - `,[M("tabs-tab-wrapper",` - flex-direction: column; - `,[M("tabs-tab-pad",` - height: var(--n-tab-gap); - width: 100%; - `)])]),M("tabs-nav-scroll-content",` - border-bottom: none; - `)]),K("left",[M("tabs-nav-scroll-content",` - box-sizing: border-box; - border-right: 1px solid var(--n-tab-border-color); - `)]),K("right",[M("tabs-nav-scroll-content",` - border-left: 1px solid var(--n-tab-border-color); - `)]),K("bottom",[M("tabs-nav-scroll-content",` - border-top: 1px solid var(--n-tab-border-color); - border-bottom: none; - `)])])]);const jI=Object.assign(Object.assign({},Ee.props),{value:[String,Number],defaultValue:[String,Number],trigger:{type:String,default:"click"},type:{type:String,default:"bar"},closable:Boolean,justifyContent:String,size:{type:String,default:"medium"},placement:{type:String,default:"top"},tabStyle:[String,Object],barWidth:Number,paneClass:String,paneStyle:[String,Object],addable:[Boolean,Object],tabsPadding:{type:Number,default:0},animated:Boolean,onBeforeLeave:Function,onAdd:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClose:[Function,Array],labelSize:String,activeName:[String,Number],onActiveNameChange:[Function,Array]});var NI=ae({name:"Tabs",props:jI,setup(e,{slots:t}){var r,o,n,i;const{mergedClsPrefixRef:a,inlineThemeDisabled:l}=st(e),s=Ee("Tabs","-tabs",FI,zR,e,a),d=V(null),c=V(null),u=V(null),f=V(null),p=V(null),h=V(!0),g=V(!0),b=Ti(e,["labelSize","size"]),m=Ti(e,["activeName","value"]),y=V((o=(r=m.value)!==null&&r!==void 0?r:e.defaultValue)!==null&&o!==void 0?o:t.default?(i=(n=Ao(t.default())[0])===null||n===void 0?void 0:n.props)===null||i===void 0?void 0:i.name:null),w=En(m,y),x={id:0},k=H(()=>{if(!(!e.justifyContent||e.type==="card"))return{display:"flex",justifyContent:e.justifyContent}});De(w,()=>{x.id=0,R(),_()});function T(){var z;const{value:L}=w;return L===null?null:(z=d.value)===null||z===void 0?void 0:z.querySelector(`[data-name="${L}"]`)}function S(z){if(e.type==="card")return;const{value:L}=c;if(!!L&&z){const Y=`${a.value}-tabs-bar--disabled`,{barWidth:q,placement:J}=e;if(z.dataset.disabled==="true"?L.classList.add(Y):L.classList.remove(Y),["top","bottom"].includes(J)){if($(["top","maxHeight","height"]),typeof q=="number"&&z.offsetWidth>=q){const Z=Math.floor((z.offsetWidth-q)/2)+z.offsetLeft;L.style.left=`${Z}px`,L.style.maxWidth=`${q}px`}else L.style.left=`${z.offsetLeft}px`,L.style.maxWidth=`${z.offsetWidth}px`;L.style.width="8192px",L.offsetWidth}else{if($(["left","maxWidth","width"]),typeof q=="number"&&z.offsetHeight>=q){const Z=Math.floor((z.offsetHeight-q)/2)+z.offsetTop;L.style.top=`${Z}px`,L.style.maxHeight=`${q}px`}else L.style.top=`${z.offsetTop}px`,L.style.maxHeight=`${z.offsetHeight}px`;L.style.height="8192px",L.offsetHeight}}}function $(z){const{value:L}=c;if(!!L)for(const Y of z)L.style[Y]=""}function R(){if(e.type==="card")return;const z=T();z&&S(z)}function _(z){var L;const Y=(L=p.value)===null||L===void 0?void 0:L.$el;if(!Y)return;const q=T();if(!q)return;const{scrollLeft:J,offsetWidth:Z}=Y,{offsetLeft:fe,offsetWidth:de}=q;J>fe?Y.scrollTo({top:0,left:fe,behavior:"smooth"}):fe+de>J+Z&&Y.scrollTo({top:0,left:fe+de-Z,behavior:"smooth"})}const N=V(null);let E=0,F=null;function j(z){const L=N.value;if(L){E=z.getBoundingClientRect().height;const Y=`${E}px`,q=()=>{L.style.height=Y,L.style.maxHeight=Y};F?(q(),F(),F=null):F=q}}function Q(z){const L=N.value;if(L){const Y=z.getBoundingClientRect().height,q=()=>{document.body.offsetHeight,L.style.maxHeight=`${Y}px`,L.style.height=`${Math.max(E,Y)}px`};F?(F(),F=null,q()):F=q}}function A(){const z=N.value;z&&(z.style.maxHeight="",z.style.height="")}const X={value:[]},ne=V("next");function pe(z){const L=w.value;let Y="next";for(const q of X.value){if(q===L)break;if(q===z){Y="prev";break}}ne.value=Y,Ce(z)}function Ce(z){const{onActiveNameChange:L,onUpdateValue:Y,"onUpdate:value":q}=e;L&&Ae(L,z),Y&&Ae(Y,z),q&&Ae(q,z),y.value=z}function $e(z){const{onClose:L}=e;L&&Ae(L,z)}function _e(){const{value:z}=c;if(!z)return;const L="transition-disabled";z.classList.add(L),R(),z.classList.remove(L)}let Ge=0;function Le(z){var L;if(z.contentRect.width===0&&z.contentRect.height===0||Ge===z.contentRect.width)return;Ge=z.contentRect.width;const{type:Y}=e;(Y==="line"||Y==="bar")&&_e(),Y!=="segment"&&Re((L=p.value)===null||L===void 0?void 0:L.$el)}const U=Jl(Le,64);De([()=>e.justifyContent,()=>e.size],()=>{Zt(()=>{const{type:z}=e;(z==="line"||z==="bar")&&_e()})});const ee=V(!1);function G(z){var L;const{target:Y,contentRect:{width:q}}=z,J=Y.parentElement.offsetWidth;if(!ee.value)JZ.$el.offsetWidth&&(ee.value=!1)}Re((L=p.value)===null||L===void 0?void 0:L.$el)}const se=Jl(G,64);function ce(){const{onAdd:z}=e;z&&z(),Zt(()=>{const L=T(),{value:Y}=p;!L||!Y||Y.scrollTo({left:L.offsetLeft,top:0,behavior:"smooth"})})}function Re(z){if(!z)return;const{scrollLeft:L,scrollWidth:Y,offsetWidth:q}=z;h.value=L<=0,g.value=L+q>=Y}const ge=Jl(z=>{Re(z.target)},64);Be(yd,{triggerRef:Te(e,"trigger"),tabStyleRef:Te(e,"tabStyle"),paneClassRef:Te(e,"paneClass"),paneStyleRef:Te(e,"paneStyle"),mergedClsPrefixRef:a,typeRef:Te(e,"type"),closableRef:Te(e,"closable"),valueRef:w,tabChangeIdRef:x,onBeforeLeaveRef:Te(e,"onBeforeLeave"),activateTab:pe,handleClose:$e,handleAdd:ce}),gv(()=>{R(),_()}),Wt(()=>{const{value:z}=u;if(!z||["left","right"].includes(e.placement))return;const{value:L}=a,Y=`${L}-tabs-nav-scroll-wrapper--shadow-before`,q=`${L}-tabs-nav-scroll-wrapper--shadow-after`;h.value?z.classList.remove(Y):z.classList.add(Y),g.value?z.classList.remove(q):z.classList.add(q)});const C=V(null);De(w,()=>{if(e.type==="segment"){const z=C.value;z&&Zt(()=>{z.classList.add("transition-disabled"),z.offsetWidth,z.classList.remove("transition-disabled")})}});const P={syncBarPosition:()=>{R()}},I=H(()=>{const{value:z}=b,{type:L}=e,Y={card:"Card",bar:"Bar",line:"Line",segment:"Segment"}[L],q=`${z}${Y}`,{self:{barColor:J,closeIconColor:Z,closeIconColorHover:fe,closeIconColorPressed:de,tabColor:he,tabBorderColor:we,paneTextColor:Ie,tabFontWeight:Ne,tabBorderRadius:Fe,tabFontWeightActive:et,colorSegment:xt,fontWeightStrong:Ft,tabColorSegment:qr,closeSize:er,closeIconSize:Gt,closeColorHover:bt,closeColorPressed:re,closeBorderRadius:ve,[ie("panePadding",z)]:Pe,[ie("tabPadding",q)]:Ye,[ie("tabPaddingVertical",q)]:ct,[ie("tabGap",q)]:wt,[ie("tabTextColor",L)]:Lt,[ie("tabTextColorActive",L)]:tt,[ie("tabTextColorHover",L)]:jt,[ie("tabTextColorDisabled",L)]:Ir,[ie("tabFontSize",z)]:Ko},common:{cubicBezierEaseInOut:qo}}=s.value;return{"--n-bezier":qo,"--n-color-segment":xt,"--n-bar-color":J,"--n-tab-font-size":Ko,"--n-tab-text-color":Lt,"--n-tab-text-color-active":tt,"--n-tab-text-color-disabled":Ir,"--n-tab-text-color-hover":jt,"--n-pane-text-color":Ie,"--n-tab-border-color":we,"--n-tab-border-radius":Fe,"--n-close-size":er,"--n-close-icon-size":Gt,"--n-close-color-hover":bt,"--n-close-color-pressed":re,"--n-close-border-radius":ve,"--n-close-icon-color":Z,"--n-close-icon-color-hover":fe,"--n-close-icon-color-pressed":de,"--n-tab-color":he,"--n-tab-font-weight":Ne,"--n-tab-font-weight-active":et,"--n-tab-padding":Ye,"--n-tab-padding-vertical":ct,"--n-tab-gap":wt,"--n-pane-padding":Pe,"--n-font-weight-strong":Ft,"--n-tab-color-segment":qr}}),W=l?Pt("tabs",H(()=>`${b.value[0]}${e.type[0]}`),I,e):void 0;return Object.assign({mergedClsPrefix:a,mergedValue:w,renderedNames:new Set,tabsRailElRef:C,tabsPaneWrapperRef:N,tabsElRef:d,barElRef:c,addTabInstRef:f,xScrollInstRef:p,scrollWrapperElRef:u,addTabFixed:ee,tabWrapperStyle:k,handleNavResize:U,mergedSize:b,handleScroll:ge,handleTabsResize:se,cssVars:l?void 0:I,themeClass:W==null?void 0:W.themeClass,animationDirection:ne,renderNameListRef:X,onAnimationBeforeLeave:j,onAnimationEnter:Q,onAnimationAfterEnter:A,onRender:W==null?void 0:W.onRender},P)},render(){const{mergedClsPrefix:e,type:t,placement:r,addTabFixed:o,addable:n,mergedSize:i,renderNameListRef:a,onRender:l,$slots:{default:s,prefix:d,suffix:c}}=this;l==null||l();const u=s?Ao(s()).filter(y=>y.type.__TAB_PANE__===!0):[],f=s?Ao(s()).filter(y=>y.type.__TAB__===!0):[],p=!f.length,h=t==="card",g=t==="segment",b=!h&&!g&&this.justifyContent;a.value=[];const m=()=>{const y=v("div",{style:this.tabWrapperStyle,class:[`${e}-tabs-wrapper`]},b?null:v("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}),p?u.map((w,x)=>(a.value.push(w.props.name),cs(v(ic,Object.assign({},w.props,{internalCreatedByPane:!0,internalLeftPadded:x!==0&&(!b||b==="center"||b==="start"||b==="end")}),w.children?{default:w.children.tab}:void 0)))):f.map((w,x)=>(a.value.push(w.props.name),cs(x!==0&&!b?hh(w):w))),!o&&n&&h?fh(n,(p?u.length:f.length)!==0):null,b?null:v("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}));return v("div",{ref:"tabsElRef",class:`${e}-tabs-nav-scroll-content`},h&&n?v(In,{onResize:this.handleTabsResize},{default:()=>y}):y,h?v("div",{class:`${e}-tabs-pad`}):null,h?null:v("div",{ref:"barElRef",class:`${e}-tabs-bar`}))};return v("div",{class:[`${e}-tabs`,this.themeClass,`${e}-tabs--${t}-type`,`${e}-tabs--${i}-size`,b&&`${e}-tabs--flex`,`${e}-tabs--${r}`],style:this.cssVars},v("div",{class:[`${e}-tabs-nav--${t}-type`,`${e}-tabs-nav--${r}`,`${e}-tabs-nav`]},dt(d,y=>y&&v("div",{class:`${e}-tabs-nav__prefix`},y)),g?v("div",{class:`${e}-tabs-rail`,ref:"tabsRailElRef"},p?u.map((y,w)=>(a.value.push(y.props.name),v(ic,Object.assign({},y.props,{internalCreatedByPane:!0,internalLeftPadded:w!==0}),y.children?{default:y.children.tab}:void 0))):f.map((y,w)=>(a.value.push(y.props.name),w===0?y:hh(y)))):v(In,{onResize:this.handleNavResize},{default:()=>v("div",{class:`${e}-tabs-nav-scroll-wrapper`,ref:"scrollWrapperElRef"},["top","bottom"].includes(r)?v(bS,{ref:"xScrollInstRef",onScroll:this.handleScroll},{default:m}):v("div",{class:`${e}-tabs-nav-y-scroll`},m()))}),o&&n&&h?fh(n,!0):null,dt(c,y=>y&&v("div",{class:`${e}-tabs-nav__suffix`},y))),p&&(this.animated?v("div",{ref:"tabsPaneWrapperRef",class:`${e}-tabs-pane-wrapper`},uh(u,this.mergedValue,this.renderedNames,this.onAnimationBeforeLeave,this.onAnimationEnter,this.onAnimationAfterEnter,this.animationDirection)):uh(u,this.mergedValue,this.renderedNames)))}});function uh(e,t,r,o,n,i,a){const l=[];return e.forEach(s=>{const{name:d,displayDirective:c,"display-directive":u}=s.props,f=h=>c===h||u===h,p=t===d;if(s.key!==void 0&&(s.key=d),p||f("show")||f("show:lazy")&&r.has(d)){r.has(d)||r.add(d);const h=!f("if");l.push(h?Tr(s,[[Si,p]]):s)}}),a?v(Rc,{name:`${a}-transition`,onBeforeLeave:o,onEnter:n,onAfterEnter:i},{default:()=>l}):l}function fh(e,t){return v(ic,{ref:"addTabInstRef",key:"__addable",name:"__addable",internalCreatedByPane:!0,internalAddable:!0,internalLeftPadded:t,disabled:typeof e=="object"&&e.disabled})}function hh(e){const t=lr(e);return t.props?t.props.internalLeftPadded=!0:t.props={internalLeftPadded:!0},t}function cs(e){return Array.isArray(e.dynamicProps)?e.dynamicProps.includes("internalLeftPadded")||e.dynamicProps.push("internalLeftPadded"):e.dynamicProps=["internalLeftPadded"],e}const WI=()=>({}),VI={name:"Equation",common:le,self:WI};var UI=VI;const KI={name:"dark",common:le,Alert:Y4,Anchor:tk,AutoComplete:hk,Avatar:ug,AvatarGroup:$k,BackTop:kk,Badge:zk,Breadcrumb:Dk,Button:Kt,ButtonGroup:PE,Calendar:Yk,Card:mg,Carousel:l8,Cascader:h8,Checkbox:Nn,Code:gg,Collapse:g8,CollapseTransition:C8,ColorPicker:Jk,DataTable:U8,DatePicker:vT,Descriptions:xT,Dialog:Lg,Divider:jT,Drawer:VT,Dropdown:sd,DynamicInput:qT,DynamicTags:rz,Element:nz,Empty:Vo,Ellipsis:$g,Equation:UI,Form:sz,GradientText:dE,Icon:X8,IconWrapper:hE,Image:rI,Input:ur,InputNumber:TE,LegacyTransfer:hI,Layout:EE,List:OE,LoadingBar:ME,Log:LE,Menu:VE,Mention:DE,Message:$E,Modal:ET,Notification:xE,PageHeader:qE,Pagination:wg,Popconfirm:XE,Popover:Uo,Popselect:bg,Progress:ob,Radio:_g,Rate:tR,Result:iR,Row:tI,Scrollbar:Ut,Select:Cg,Skeleton:OI,Slider:sR,Space:Ug,Spin:fR,Statistic:vR,Steps:xR,Switch:wR,Table:PR,Tabs:RR,Tag:Qm,Thing:AR,TimePicker:Ag,Timeline:LR,Tooltip:Cl,Transfer:FR,Tree:cb,TreeSelect:VR,Typography:GR,Upload:ZR,Watermark:QR};var wd={exports:{}},wb=function(t,r){return function(){for(var n=new Array(arguments.length),i=0;i=0)return;o==="set-cookie"?r[o]=(r[o]?r[o]:[]).concat([n]):r[o]=r[o]?r[o]+", "+n:n}}),r},vh=qt,SO=vh.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),o;function n(i){var a=i;return t&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return o=n(window.location.href),function(a){var l=vh.isString(a)?n(a):a;return l.protocol===o.protocol&&l.host===o.host}}():function(){return function(){return!0}}();function _d(e){this.message=e}_d.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};_d.prototype.__CANCEL__=!0;var $l=_d,va=qt,$O=pO,_O=vO,PO=Pb,kO=CO,TO=wO,zO=SO,us=zb,EO=Tb,RO=$l,mh=function(t){return new Promise(function(o,n){var i=t.data,a=t.headers,l=t.responseType,s;function d(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}va.isFormData(i)&&delete a["Content-Type"];var c=new XMLHttpRequest;if(t.auth){var u=t.auth.username||"",f=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.Authorization="Basic "+btoa(u+":"+f)}var p=kO(t.baseURL,t.url);c.open(t.method.toUpperCase(),PO(p,t.params,t.paramsSerializer),!0),c.timeout=t.timeout;function h(){if(!!c){var b="getAllResponseHeaders"in c?TO(c.getAllResponseHeaders()):null,m=!l||l==="text"||l==="json"?c.responseText:c.response,y={data:m,status:c.status,statusText:c.statusText,headers:b,config:t,request:c};$O(function(x){o(x),d()},function(x){n(x),d()},y),c=null}}if("onloadend"in c?c.onloadend=h:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(h)},c.onabort=function(){!c||(n(us("Request aborted",t,"ECONNABORTED",c)),c=null)},c.onerror=function(){n(us("Network Error",t,null,c)),c=null},c.ontimeout=function(){var m=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",y=t.transitional||EO;t.timeoutErrorMessage&&(m=t.timeoutErrorMessage),n(us(m,t,y.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",c)),c=null},va.isStandardBrowserEnv()){var g=(t.withCredentials||zO(p))&&t.xsrfCookieName?_O.read(t.xsrfCookieName):void 0;g&&(a[t.xsrfHeaderName]=g)}"setRequestHeader"in c&&va.forEach(a,function(m,y){typeof i=="undefined"&&y.toLowerCase()==="content-type"?delete a[y]:c.setRequestHeader(y,m)}),va.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),l&&l!=="json"&&(c.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&c.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(s=function(b){!c||(n(!b||b&&b.type?new RO("canceled"):b),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s))),i||(i=null),c.send(i)})},Tt=qt,gh=uO,IO=kb,OO=Tb,AO={"Content-Type":"application/x-www-form-urlencoded"};function bh(e,t){!Tt.isUndefined(e)&&Tt.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function MO(){var e;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(e=mh),e}function BO(e,t,r){if(Tt.isString(e))try{return(t||JSON.parse)(e),Tt.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(r||JSON.stringify)(e)}var _l={transitional:OO,adapter:MO(),transformRequest:[function(t,r){return gh(r,"Accept"),gh(r,"Content-Type"),Tt.isFormData(t)||Tt.isArrayBuffer(t)||Tt.isBuffer(t)||Tt.isStream(t)||Tt.isFile(t)||Tt.isBlob(t)?t:Tt.isArrayBufferView(t)?t.buffer:Tt.isURLSearchParams(t)?(bh(r,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):Tt.isObject(t)||r&&r["Content-Type"]==="application/json"?(bh(r,"application/json"),BO(t)):t}],transformResponse:[function(t){var r=this.transitional||_l.transitional,o=r&&r.silentJSONParsing,n=r&&r.forcedJSONParsing,i=!o&&this.responseType==="json";if(i||n&&Tt.isString(t)&&t.length)try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?IO(a,this,"E_JSON_PARSE"):a}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Tt.forEach(["delete","get","head"],function(t){_l.headers[t]={}});Tt.forEach(["post","put","patch"],function(t){_l.headers[t]=Tt.merge(AO)});var Pd=_l,LO=qt,HO=Pd,DO=function(t,r,o){var n=this||HO;return LO.forEach(o,function(a){t=a.call(n,t,r)}),t},Eb=function(t){return!!(t&&t.__CANCEL__)},xh=qt,fs=DO,FO=Eb,jO=Pd,NO=$l;function hs(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new NO("canceled")}var WO=function(t){hs(t),t.headers=t.headers||{},t.data=fs.call(t,t.data,t.headers,t.transformRequest),t.headers=xh.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),xh.forEach(["delete","get","head","post","put","patch","common"],function(n){delete t.headers[n]});var r=t.adapter||jO.adapter;return r(t).then(function(n){return hs(t),n.data=fs.call(t,n.data,n.headers,t.transformResponse),n},function(n){return FO(n)||(hs(t),n&&n.response&&(n.response.data=fs.call(t,n.response.data,n.response.headers,t.transformResponse))),Promise.reject(n)})},Yt=qt,Rb=function(t,r){r=r||{};var o={};function n(c,u){return Yt.isPlainObject(c)&&Yt.isPlainObject(u)?Yt.merge(c,u):Yt.isPlainObject(u)?Yt.merge({},u):Yt.isArray(u)?u.slice():u}function i(c){if(Yt.isUndefined(r[c])){if(!Yt.isUndefined(t[c]))return n(void 0,t[c])}else return n(t[c],r[c])}function a(c){if(!Yt.isUndefined(r[c]))return n(void 0,r[c])}function l(c){if(Yt.isUndefined(r[c])){if(!Yt.isUndefined(t[c]))return n(void 0,t[c])}else return n(void 0,r[c])}function s(c){if(c in r)return n(t[c],r[c]);if(c in t)return n(void 0,t[c])}var d={url:a,method:a,data:a,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:s};return Yt.forEach(Object.keys(t).concat(Object.keys(r)),function(u){var f=d[u]||i,p=f(u);Yt.isUndefined(p)&&f!==s||(o[u]=p)}),o},Ib={version:"0.26.1"},VO=Ib.version,kd={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){kd[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});var Ch={};kd.transitional=function(t,r,o){function n(i,a){return"[Axios v"+VO+"] Transitional option '"+i+"'"+a+(o?". "+o:"")}return function(i,a,l){if(t===!1)throw new Error(n(a," has been removed"+(r?" in "+r:"")));return r&&!Ch[a]&&(Ch[a]=!0,console.warn(n(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,a,l):!0}};function UO(e,t,r){if(typeof e!="object")throw new TypeError("options must be an object");for(var o=Object.keys(e),n=o.length;n-- >0;){var i=o[n],a=t[i];if(a){var l=e[i],s=l===void 0||a(l,i,e);if(s!==!0)throw new TypeError("option "+i+" must be "+s);continue}if(r!==!0)throw Error("Unknown option "+i)}}var KO={assertOptions:UO,validators:kd},Ob=qt,qO=Pb,yh=cO,wh=WO,Pl=Rb,Ab=KO,an=Ab.validators;function Ki(e){this.defaults=e,this.interceptors={request:new yh,response:new yh}}Ki.prototype.request=function(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Pl(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var o=r.transitional;o!==void 0&&Ab.assertOptions(o,{silentJSONParsing:an.transitional(an.boolean),forcedJSONParsing:an.transitional(an.boolean),clarifyTimeoutError:an.transitional(an.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(i=i&&p.synchronous,n.unshift(p.fulfilled,p.rejected))});var a=[];this.interceptors.response.forEach(function(p){a.push(p.fulfilled,p.rejected)});var l;if(!i){var s=[wh,void 0];for(Array.prototype.unshift.apply(s,n),s=s.concat(a),l=Promise.resolve(r);s.length;)l=l.then(s.shift(),s.shift());return l}for(var d=r;n.length;){var c=n.shift(),u=n.shift();try{d=c(d)}catch(f){u(f);break}}try{l=wh(d)}catch(f){return Promise.reject(f)}for(;a.length;)l=l.then(a.shift(),a.shift());return l};Ki.prototype.getUri=function(t){return t=Pl(this.defaults,t),qO(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")};Ob.forEach(["delete","get","head","options"],function(t){Ki.prototype[t]=function(r,o){return this.request(Pl(o||{},{method:t,url:r,data:(o||{}).data}))}});Ob.forEach(["post","put","patch"],function(t){Ki.prototype[t]=function(r,o,n){return this.request(Pl(n||{},{method:t,url:r,data:o}))}});var GO=Ki,YO=$l;function On(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(n){t=n});var r=this;this.promise.then(function(o){if(!!r._listeners){var n,i=r._listeners.length;for(n=0;n(localStorage.getItem("PAOPAO_TOKEN")&&(e.headers.Authorization="Bearer "+localStorage.getItem("PAOPAO_TOKEN")),e),e=>Promise.reject(e));Td.interceptors.response.use(e=>{const{data:t={},code:r=0}=(e==null?void 0:e.data)||{};if(+r==0)return t||{};Promise.reject((e==null?void 0:e.data)||{})},(e={})=>{var r;const{response:t={}}=e||{};return+(t==null?void 0:t.status)==401?(localStorage.removeItem("PAOPAO_TOKEN"),(t==null?void 0:t.data.code)!==10005?window.$message.warning((t==null?void 0:t.data.msg)||"\u9274\u6743\u5931\u8D25"):window.$store.commit("triggerAuth",!0)):window.$message.error(((r=t==null?void 0:t.data)==null?void 0:r.msg)||"\u8BF7\u6C42\u5931\u8D25"),Promise.reject((t==null?void 0:t.data)||{})});function ze(e){return Td(e)}const $h=e=>ze({method:"post",url:"/v1/auth/login",data:e}),nA=e=>ze({method:"post",url:"/v1/auth/register",data:e}),ps=(e="")=>ze({method:"get",url:"/v1/user/info",headers:{Authorization:`Bearer ${e}`}});var Bb=(e,t)=>{const r=e.__vccOpts||e;for(const[o,n]of t)r[o]=n;return r};const iA={class:"auth-wrap"},aA=ae({__name:"auth",setup(e){const t=ol(),r=V(!1),o=V(),n=vr({username:"",password:""}),i=V(),a=vr({username:"",password:"",repassword:""}),l={username:{required:!0,message:"\u8BF7\u8F93\u5165\u8D26\u6237\u540D"},password:{required:!0,message:"\u8BF7\u8F93\u5165\u5BC6\u7801"},repassword:[{required:!0,message:"\u8BF7\u8F93\u5165\u5BC6\u7801"},{validator:(c,u)=>!!a.password&&a.password.startsWith(u)&&a.password.length>=u.length,message:"\u4E24\u6B21\u5BC6\u7801\u8F93\u5165\u4E0D\u4E00\u81F4",trigger:"input"}]},s=c=>{var u;c.preventDefault(),c.stopPropagation(),(u=o.value)==null||u.validate(f=>{f||(r.value=!0,$h({username:n.username,password:n.password}).then(p=>{const h=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",h),ps(h)}).then(p=>{window.$message.success("\u767B\u5F55\u6210\u529F"),r.value=!1,t.commit("updateUserinfo",p),t.commit("triggerAuth",!1),n.username="",n.password=""}).catch(p=>{r.value=!1}))})},d=c=>{var u;c.preventDefault(),c.stopPropagation(),(u=i.value)==null||u.validate(f=>{f||(r.value=!0,nA({username:a.username,password:a.password}).then(p=>$h({username:a.username,password:a.password})).then(p=>{const h=(p==null?void 0:p.token)||"";return localStorage.setItem("PAOPAO_TOKEN",h),ps(h)}).then(p=>{window.$message.success("\u6CE8\u518C\u6210\u529F"),r.value=!1,t.commit("updateUserinfo",p),t.commit("triggerAuth",!1),a.username="",a.password="",a.repassword=""}).catch(p=>{r.value=!1}))})};return gt(()=>{const c=localStorage.getItem("PAOPAO_TOKEN")||"";c?ps(c).then(u=>{t.commit("updateUserinfo",u),t.commit("triggerAuth",!1)}).catch(u=>{t.commit("userLogout")}):t.commit("userLogout")}),(c,u)=>{const f=sg,p=lE,h=fz,g=Da,b=HI,m=NI,y=ad,w=Ng;return lt(),ko(w,{show:Ze(t).state.authModalShow,"onUpdate:show":u[5]||(u[5]=x=>Ze(t).state.authModalShow=x),class:"auth-card",preset:"card",size:"small","mask-closable":!1,bordered:!1,style:{width:"360px"}},{default:qe(()=>[Me("div",iA,[be(y,{bordered:!1},{default:qe(()=>[be(m,{"default-value":Ze(t).state.authModelTab,size:"large","justify-content":"space-evenly"},{default:qe(()=>[be(b,{name:"signin",tab:"\u767B\u5F55"},{default:qe(()=>[be(h,{ref_key:"loginRef",ref:o,model:n,rules:{username:{required:!0,message:"\u8BF7\u8F93\u5165\u8D26\u6237\u540D"},password:{required:!0,message:"\u8BF7\u8F93\u5165\u5BC6\u7801"}}},{default:qe(()=>[be(p,{label:"\u8D26\u6237",path:"username"},{default:qe(()=>[be(f,{value:n.username,"onUpdate:value":u[0]||(u[0]=x=>n.username=x),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",onKeyup:ri(ti(s,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),be(p,{label:"\u5BC6\u7801",path:"password"},{default:qe(()=>[be(f,{type:"password","show-password-on":"mousedown",value:n.password,"onUpdate:value":u[1]||(u[1]=x=>n.password=x),placeholder:"\u8BF7\u8F93\u5165\u8D26\u6237\u5BC6\u7801",onKeyup:ri(ti(s,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),be(g,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:s},{default:qe(()=>[mr(" \u767B\u5F55 ")]),_:1},8,["loading"])]),_:1}),be(b,{name:"signup",tab:"\u6CE8\u518C"},{default:qe(()=>[be(h,{ref_key:"registerRef",ref:i,model:a,rules:l},{default:qe(()=>[be(p,{label:"\u7528\u6237\u540D",path:"username"},{default:qe(()=>[be(f,{value:a.username,"onUpdate:value":u[2]||(u[2]=x=>a.username=x),placeholder:"\u7528\u6237\u540D\u6CE8\u518C\u540E\u65E0\u6CD5\u4FEE\u6539"},null,8,["value"])]),_:1}),be(p,{label:"\u5BC6\u7801",path:"password"},{default:qe(()=>[be(f,{type:"password","show-password-on":"mousedown",placeholder:"\u5BC6\u7801\u4E0D\u5C11\u4E8E6\u4F4D",value:a.password,"onUpdate:value":u[3]||(u[3]=x=>a.password=x),onKeyup:ri(ti(d,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1}),be(p,{label:"\u91CD\u590D\u5BC6\u7801",path:"repassword"},{default:qe(()=>[be(f,{type:"password","show-password-on":"mousedown",placeholder:"\u8BF7\u518D\u6B21\u8F93\u5165\u5BC6\u7801",value:a.repassword,"onUpdate:value":u[4]||(u[4]=x=>a.repassword=x),onKeyup:ri(ti(d,["prevent"]),["enter"])},null,8,["value","onKeyup"])]),_:1})]),_:1},8,["model"]),be(g,{type:"primary",block:"",secondary:"",strong:"",loading:r.value,onClick:d},{default:qe(()=>[mr(" \u6CE8\u518C ")]),_:1},8,["loading"])]),_:1})]),_:1},8,["default-value"])]),_:1})])]),_:1},8,["show"])}}});var lA=Bb(aA,[["__scopeId","data-v-66895776"]]);const JM=e=>ze({method:"get",url:"/v1/posts",params:e}),sA=e=>ze({method:"get",url:"/v1/tags",params:e}),QM=e=>ze({method:"get",url:"/v1/post",params:e}),eB=e=>ze({method:"get",url:"/v1/post/star",params:e}),tB=e=>ze({method:"post",url:"/v1/post/star",data:e}),rB=e=>ze({method:"get",url:"/v1/post/collection",params:e}),oB=e=>ze({method:"post",url:"/v1/post/collection",data:e}),nB=e=>ze({method:"get",url:"/v1/post/comments",params:e}),iB=e=>ze({method:"get",url:"/v1/user/contacts",params:e}),aB=e=>ze({method:"post",url:"/v1/post",data:e}),lB=e=>ze({method:"delete",url:"/v1/post",data:e}),sB=e=>ze({method:"post",url:"/v1/post/lock",data:e}),cB=e=>ze({method:"post",url:"/v1/post/stick",data:e}),dB=e=>ze({method:"post",url:"/v1/post/visibility",data:e}),uB=e=>ze({method:"post",url:"/v1/post/comment",data:e}),fB=e=>ze({method:"delete",url:"/v1/post/comment",data:e}),hB=e=>ze({method:"post",url:"/v1/post/comment/reply",data:e}),pB=e=>ze({method:"delete",url:"/v1/post/comment/reply",data:e}),cA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},dA=Me("path",{d:"M128 80V64a48.14 48.14 0 0 1 48-48h224a48.14 48.14 0 0 1 48 48v368l-80-64",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),uA=Me("path",{d:"M320 96H112a48.14 48.14 0 0 0-48 48v352l152-128l152 128V144a48.14 48.14 0 0 0-48-48z",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),fA=[dA,uA];var hA=ae({name:"BookmarksOutline",render:function(t,r){return lt(),It("svg",cA,fA)}});const pA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},vA=Me("path",{d:"M431 320.6c-1-3.6 1.2-8.6 3.3-12.2a33.68 33.68 0 0 1 2.1-3.1A162 162 0 0 0 464 215c.3-92.2-77.5-167-173.7-167c-83.9 0-153.9 57.1-170.3 132.9a160.7 160.7 0 0 0-3.7 34.2c0 92.3 74.8 169.1 171 169.1c15.3 0 35.9-4.6 47.2-7.7s22.5-7.2 25.4-8.3a26.44 26.44 0 0 1 9.3-1.7a26 26 0 0 1 10.1 2l56.7 20.1a13.52 13.52 0 0 0 3.9 1a8 8 0 0 0 8-8a12.85 12.85 0 0 0-.5-2.7z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),mA=Me("path",{d:"M66.46 232a146.23 146.23 0 0 0 6.39 152.67c2.31 3.49 3.61 6.19 3.21 8s-11.93 61.87-11.93 61.87a8 8 0 0 0 2.71 7.68A8.17 8.17 0 0 0 72 464a7.26 7.26 0 0 0 2.91-.6l56.21-22a15.7 15.7 0 0 1 12 .2c18.94 7.38 39.88 12 60.83 12A159.21 159.21 0 0 0 284 432.11",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),gA=[vA,mA];var bA=ae({name:"ChatbubblesOutline",render:function(t,r){return lt(),It("svg",pA,gA)}});const xA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},CA=Me("path",{d:"M80 212v236a16 16 0 0 0 16 16h96V328a24 24 0 0 1 24-24h80a24 24 0 0 1 24 24v136h96a16 16 0 0 0 16-16V212",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),yA=Me("path",{d:"M480 256L266.89 52c-5-5.28-16.69-5.34-21.78 0L32 256",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),wA=Me("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M400 179V64h-48v69"},null,-1),SA=[CA,yA,wA];var _h=ae({name:"HomeOutline",render:function(t,r){return lt(),It("svg",xA,SA)}});const $A={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},_A=Me("path",{d:"M321.89 171.42C233 114 141 155.22 56 65.22c-19.8-21-8.3 235.5 98.1 332.7c77.79 71 197.9 63.08 238.4-5.92s18.28-163.17-70.61-220.58z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),PA=Me("path",{d:"M173 253c86 81 175 129 292 147",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),kA=[_A,PA];var TA=ae({name:"LeafOutline",render:function(t,r){return lt(),It("svg",$A,kA)}});const zA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},EA=Me("path",{d:"M304 336v40a40 40 0 0 1-40 40H104a40 40 0 0 1-40-40V136a40 40 0 0 1 40-40h152c22.09 0 48 17.91 48 40v40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),RA=Me("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 336l80-80l-80-80"},null,-1),IA=Me("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 256h256"},null,-1),OA=[EA,RA,IA];var Ph=ae({name:"LogOutOutline",render:function(t,r){return lt(),It("svg",zA,OA)}});const AA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},MA=Pp('',6),BA=[MA];var LA=ae({name:"MegaphoneOutline",render:function(t,r){return lt(),It("svg",AA,BA)}});const HA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},DA=Me("path",{d:"M402 168c-2.93 40.67-33.1 72-66 72s-63.12-31.32-66-72c-3-42.31 26.37-72 66-72s69 30.46 66 72z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),FA=Me("path",{d:"M336 304c-65.17 0-127.84 32.37-143.54 95.41c-2.08 8.34 3.15 16.59 11.72 16.59h263.65c8.57 0 13.77-8.25 11.72-16.59C463.85 335.36 401.18 304 336 304z",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1),jA=Me("path",{d:"M200 185.94c-2.34 32.48-26.72 58.06-53 58.06s-50.7-25.57-53-58.06C91.61 152.15 115.34 128 147 128s55.39 24.77 53 57.94z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),NA=Me("path",{d:"M206 306c-18.05-8.27-37.93-11.45-59-11.45c-52 0-102.1 25.85-114.65 76.2c-1.65 6.66 2.53 13.25 9.37 13.25H154",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),WA=[DA,FA,jA,NA];var VA=ae({name:"PeopleOutline",render:function(t,r){return lt(),It("svg",HA,WA)}});const UA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},KA=Me("path",{d:"M456.69 421.39L362.6 327.3a173.81 173.81 0 0 0 34.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 0 0 327.3 362.6l94.09 94.09a25 25 0 0 0 35.3-35.3zM97.92 222.72a124.8 124.8 0 1 1 124.8 124.8a124.95 124.95 0 0 1-124.8-124.8z",fill:"currentColor"},null,-1),qA=[KA];var GA=ae({name:"Search",render:function(t,r){return lt(),It("svg",UA,qA)}});const YA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},XA=Me("path",{d:"M262.29 192.31a64 64 0 1 0 57.4 57.4a64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22a155.3 155.3 0 0 1-21.46-12.57a16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22a155.3 155.3 0 0 1 21.46 12.57a16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),ZA=[XA];var JA=ae({name:"SettingsOutline",render:function(t,r){return lt(),It("svg",YA,ZA)}});const QA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},eM=Me("rect",{x:"48",y:"144",width:"416",height:"288",rx:"48",ry:"48",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),tM=Me("path",{d:"M411.36 144v-30A50 50 0 0 0 352 64.9L88.64 109.85A50 50 0 0 0 48 159v49",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32"},null,-1),rM=Me("path",{d:"M368 320a32 32 0 1 1 32-32a32 32 0 0 1-32 32z",fill:"currentColor"},null,-1),oM=[eM,tM,rM];var nM=ae({name:"WalletOutline",render:function(t,r){return lt(),It("svg",QA,oM)}});const iM={key:0,class:"rightbar-wrap"},aM={class:"search-wrap"},lM={class:"post-num"},sM={class:"copyright"},cM=["href"],dM=["href"],uM=ae({__name:"rightbar",setup(e){const t=V([]),r=V(!1),o=V(""),n=ol(),i=Kp(),a="2022 paopao.info",l="Roc's Me",s="",d="\u6CE1\u6CE1(PaoPao)\u5F00\u6E90\u793E\u533A",c="https://paopao.info",u=()=>{r.value=!0,sA({type:"hot",num:12}).then(h=>{t.value=h.topics,r.value=!1}).catch(h=>{r.value=!1})},f=h=>h>=1e3?(h/1e3).toFixed(1)+"k":h,p=()=>{i.push({name:"home",query:{q:o.value}})};return gt(()=>{u()}),(h,g)=>{const b=fn,m=sg,y=up("router-link"),w=LI,x=ad,k=ez;return Ze(n).state.collapsedRight?Ps("",!0):(lt(),It("div",iM,[Me("div",aM,[be(m,{round:"",clearable:"",placeholder:"\u641C\u4E00\u641C...",value:o.value,"onUpdate:value":g[0]||(g[0]=T=>o.value=T),onKeyup:ri(ti(p,["prevent"]),["enter"])},{prefix:qe(()=>[be(b,{component:Ze(GA)},null,8,["component"])]),_:1},8,["value","onKeyup"])]),be(x,{title:"\u70ED\u95E8\u8BDD\u9898",embedded:"",bordered:!1,size:"small"},{default:qe(()=>[be(w,{show:r.value},{default:qe(()=>[(lt(!0),It(Je,null,H1(t.value,T=>(lt(),It("div",{class:"hot-tag-item",key:T.id},[be(y,{class:"hash-link",to:{name:"home",query:{q:T.tag,t:"tag"}}},{default:qe(()=>[mr(" #"+wo(T.tag),1)]),_:2},1032,["to"]),Me("div",lM,wo(f(T.quote_num)),1)]))),128))]),_:1},8,["show"])]),_:1}),be(x,{class:"copyright-wrap",embedded:"",bordered:!1,size:"small"},{default:qe(()=>[Me("div",sM,"\xA9 "+wo(Ze(a)),1),Me("div",null,[be(k,null,{default:qe(()=>[Me("a",{href:Ze(s),target:"_blank",class:"hash-link"},wo(Ze(l)),9,cM),Me("a",{href:Ze(c),target:"_blank",class:"hash-link"},wo(Ze(d)),9,dM)]),_:1})])]),_:1})]))}}});var fM=Bb(uM,[["__scopeId","data-v-715681a1"]]);const hM={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},pM=Pp('',1),vM=[pM];var kh=ae({name:"Hash",render:function(t,r){return lt(),It("svg",hM,vM)}});const vB=(e={})=>ze({method:"get",url:"/v1/captcha",params:e}),mB=e=>ze({method:"post",url:"/v1/captcha",data:e}),gB=e=>ze({method:"post",url:"/v1/user/whisper",data:e}),bB=e=>ze({method:"post",url:"/v1/friend/requesting",data:e}),xB=e=>ze({method:"post",url:"/v1/friend/add",data:e}),CB=e=>ze({method:"post",url:"/v1/friend/reject",data:e}),yB=e=>ze({method:"post",url:"/v1/friend/delete",data:e}),wB=e=>ze({method:"post",url:"/v1/user/phone",data:e}),SB=e=>ze({method:"post",url:"/v1/user/activate",data:e}),$B=e=>ze({method:"post",url:"/v1/user/password",data:e}),_B=e=>ze({method:"post",url:"/v1/user/nickname",data:e}),PB=e=>ze({method:"post",url:"/v1/user/avatar",data:e}),Th=(e={})=>ze({method:"get",url:"/v1/user/msgcount/unread",params:e}),kB=e=>ze({method:"get",url:"/v1/user/messages",params:e}),TB=e=>ze({method:"post",url:"/v1/user/message/read",data:e}),zB=e=>ze({method:"get",url:"/v1/user/collections",params:e}),EB=e=>ze({method:"get",url:"/v1/user/profile",params:e}),RB=e=>ze({method:"get",url:"/v1/user/posts",params:e}),IB=e=>ze({method:"get",url:"/v1/user/wallet/bills",params:e}),OB=e=>ze({method:"post",url:"/v1/user/recharge",data:e}),AB=e=>ze({method:"get",url:"/v1/user/recharge",params:e}),MB=e=>ze({method:"get",url:"/v1/suggest/users",params:e}),BB=e=>ze({method:"get",url:"/v1/suggest/tags",params:e}),LB=e=>ze({method:"get",url:"/v1/attachment/precheck",params:e}),HB=e=>ze({method:"get",url:"/v1/attachment",params:e}),DB=e=>ze({method:"post",url:"/v1/admin/user/status",data:e});var mM="/assets/logo.52afee68.png";const gM={class:"sidebar-wrap"},bM={class:"logo-wrap"},xM={key:0,class:"user-wrap"},CM={class:"user-info"},yM={class:"nickname"},wM={class:"nickname-txt"},SM={class:"username"},$M={class:"user-mini-wrap"},_M={key:1,class:"user-wrap"},PM={class:"login-wrap"},kM=ae({__name:"sidebar",setup(e){const t=ol(),r=uy(),o=Kp(),n=V(!1),i=V(r.name||""),a=V();De(r,()=>{i.value=r.name}),De(t.state,()=>{t.state.userInfo.id>0?a.value||(Th().then(h=>{n.value=h.count>0}).catch(h=>{console.log(h)}),a.value=setInterval(()=>{Th().then(h=>{n.value=h.count>0}).catch(h=>{console.log(h)})},5e3)):a.value&&clearInterval(a.value)}),gt(()=>{window.onresize=()=>{t.commit("triggerCollapsedLeft",document.body.clientWidth<=821),t.commit("triggerCollapsedRight",document.body.clientWidth<=821)}});const l=H(()=>{const h=[{label:"\u5E7F\u573A",key:"home",icon:()=>v(_h),href:"/"},{label:"\u8BDD\u9898",key:"topic",icon:()=>v(kh),href:"/topic"}];return"false".toLowerCase()==="true"&&h.push({label:"\u516C\u544A",key:"anouncement",icon:()=>v(LA),href:"/anouncement"}),h.push({label:"\u4E3B\u9875",key:"profile",icon:()=>v(TA),href:"/profile"}),h.push({label:"\u6D88\u606F",key:"messages",icon:()=>v(bA),href:"/messages"}),h.push({label:"\u6536\u85CF",key:"collection",icon:()=>v(hA),href:"/collection"}),h.push({label:"\u597D\u53CB",key:"contacts",icon:()=>v(VA),href:"/contacts"}),"false".toLocaleLowerCase()==="true"&&h.push({label:"\u94B1\u5305",key:"wallet",icon:()=>v(nM),href:"/wallet"}),h.push({label:"\u8BBE\u7F6E",key:"setting",icon:()=>v(JA),href:"/setting"}),t.state.userInfo.id>0?h:[{label:"\u5E7F\u573A",key:"home",icon:()=>v(_h),href:"/"},{label:"\u8BDD\u9898",key:"topic",icon:()=>v(kh),href:"/topic"}]}),s=h=>"href"in h?v("div",{},h.label):h.label,d=h=>h.key==="messages"?v(Mk,{dot:!0,show:n.value,processing:!0},{default:()=>v(fn,{color:h.key===i.value?"var(--n-item-icon-color-active)":"var(--n-item-icon-color)"},{default:h.icon})}):v(fn,null,{default:h.icon}),c=(h,g={})=>{i.value=h,o.push({name:h})},u=()=>{r.path==="/"&&t.commit("refresh"),c("home")},f=h=>{t.commit("triggerAuth",!0),t.commit("triggerAuthKey",h)},p=()=>{t.commit("userLogout")};return window.$store=t,window.$message=II(),(h,g)=>{const b=cI,m=$I,y=yk,w=Da;return lt(),It("div",gM,[Me("div",bM,[be(b,{class:"logo-img",width:"36",src:Ze(mM),"preview-disabled":!0,onClick:u},null,8,["src"])]),be(m,{accordion:!0,collapsed:Ze(t).state.collapsedLeft,"collapsed-width":64,"icon-size":24,options:Ze(l),"render-label":s,"render-icon":d,value:i.value,"onUpdate:value":c},null,8,["collapsed","options","value"]),Ze(t).state.userInfo.id>0?(lt(),It("div",xM,[be(y,{class:"user-avatar",round:"",size:34,src:Ze(t).state.userInfo.avatar},null,8,["src"]),Me("div",CM,[Me("div",yM,[Me("span",wM,wo(Ze(t).state.userInfo.nickname),1),be(w,{class:"logout",quaternary:"",circle:"",size:"tiny",onClick:p},{icon:qe(()=>[be(Ze(fn),null,{default:qe(()=>[be(Ze(Ph))]),_:1})]),_:1})]),Me("div",SM,"@"+wo(Ze(t).state.userInfo.username),1)]),Me("div",$M,[be(w,{class:"logout",quaternary:"",circle:"",onClick:p},{icon:qe(()=>[be(Ze(fn),{size:24},{default:qe(()=>[be(Ze(Ph))]),_:1})]),_:1})])])):(lt(),It("div",_M,[Me("div",PM,[be(w,{strong:"",secondary:"",round:"",type:"primary",onClick:g[0]||(g[0]=x=>f("signin"))},{default:qe(()=>[mr(" \u767B\u5F55 ")]),_:1}),be(w,{strong:"",secondary:"",round:"",type:"info",onClick:g[1]||(g[1]=x=>f("signup"))},{default:qe(()=>[mr(" \u6CE8\u518C ")]),_:1})])]))])}}});const TM={"has-sider":"",class:"main-wrap",position:"static"},zM={class:"content-wrap"},EM=ae({__name:"App",setup(e){const t=ol(),r=H(()=>t.state.theme==="dark"?KI:null);return(o,n)=>{const i=kM,a=up("router-view"),l=fM,s=lA,d=HT,c=RI,u=sE,f=w8;return lt(),ko(f,{theme:Ze(r)},{default:qe(()=>[be(c,null,{default:qe(()=>[be(d,null,{default:qe(()=>{var p;return[Me("div",{class:ja(["app-container",{dark:((p=Ze(r))==null?void 0:p.name)==="dark"}])},[Me("div",TM,[be(i),Me("div",zM,[be(a,{class:"app-wrap"},{default:qe(({Component:h})=>[(lt(),ko(R1,null,[o.$route.meta.keepAlive?(lt(),ko(jd(h),{key:0})):Ps("",!0)],1024)),o.$route.meta.keepAlive?Ps("",!0):(lt(),ko(jd(h),{key:0}))]),_:1})]),be(l)]),be(s)],2)]}),_:1})]),_:1}),be(u)]),_:1},8,["theme"])}}});Yx(EM).use(qp).use(Ey).mount("#app");export{ol as $,Pt as A,dt as B,Ao as C,Ny as D,DM as E,ag as F,xl as G,UT as H,js as I,Em as J,Da as K,Lr as L,m6 as M,zt as N,Uy as O,Kh as P,Ke as Q,Tn as R,De as S,Dr as T,Qe as U,Zt as V,lt as W,NM as X,It as Y,Me as Z,sg as _,ut as a,Rn as a$,MB as a0,BB as a1,gt as a2,Ze as a3,be as a4,qe as a5,ko as a6,Ps as a7,ti as a8,mr as a9,ad as aA,Hc as aB,pv as aC,UM as aD,Dn as aE,Tv as aF,D1 as aG,dn as aH,N4 as aI,St as aJ,Wt as aK,D4 as aL,Mu as aM,Zm as aN,Wy as aO,P8 as aP,Bm as aQ,sr as aR,Iu as aS,Jt as aT,Vy as aU,Lc as aV,bl as aW,Mi as aX,T8 as aY,Ti as aZ,Hi as a_,wo as aa,Je as ab,H1 as ac,aB as ad,yk as ae,fn as af,Tg as ag,ez as ah,Bb as ai,uy as aj,JM as ak,Kp as al,up as am,OM as an,jM as ao,kr as ap,Dc as aq,Nr as ar,ht as as,CR as at,Oi as au,Iy as av,Ou as aw,Ia as ax,vl as ay,gl as az,O as b,sB as b$,_v as b0,Pv as b1,zv as b2,Bt as b3,Tr as b4,Si as b5,Ds as b6,_i as b7,LM as b8,WM as b9,Ng as bA,YM as bB,io as bC,Er as bD,ar as bE,Im as bF,Rm as bG,Om as bH,Xs as bI,JE as bJ,ml as bK,x6 as bL,og as bM,XM as bN,wp as bO,VM as bP,KM as bQ,Pp as bR,hB as bS,pB as bT,fB as bU,uB as bV,RM as bW,IM as bX,eB as bY,rB as bZ,lB as b_,Fo as ba,sp as bb,cp as bc,so as bd,In as be,iv as bf,af as bg,Fm as bh,Fr as bi,HM as bj,Km as bk,FM as bl,av as bm,zw as bn,Wm as bo,il as bp,Fc as bq,Wr as br,lr as bs,AM as bt,ri as bu,jd as bv,cI as bw,ZM as bx,LB as by,HB as bz,M as c,cB as c0,dB as c1,tB as c2,oB as c3,sT as c4,QM as c5,nB as c6,LI as c7,sA as c8,HI as c9,ps as cA,IB as cB,OB as cC,AB as cD,vB as cE,PB as cF,$B as cG,wB as cH,SB as cI,_B as cJ,mB as cK,Zz as cL,oE as cM,tE as cN,fz as cO,qM as cP,NI as ca,ja as cb,RB as cc,ld as cd,_T as ce,gB as cf,bB as cg,II as ch,vr as ci,EB as cj,yB as ck,DB as cl,q4 as cm,xe as cn,ji as co,xB as cp,CB as cq,TB as cr,Mk as cs,kB as ct,zB as cu,iB as cv,bf as cw,xr as cx,hl as cy,GM as cz,ae as d,K as e,D as f,co as g,v as h,Fk as i,Kr as j,je as k,L8 as l,oe as m,MM as n,jv as o,Be as p,me as q,V as r,En as s,Te as t,st as u,mt as v,Ae as w,Ee as x,H as y,ie as z}; diff --git a/web/dist/assets/lodash-94eb5868.js b/web/dist/assets/lodash-94eb5868.js new file mode 100644 index 00000000..11d1e580 --- /dev/null +++ b/web/dist/assets/lodash-94eb5868.js @@ -0,0 +1,27 @@ +import{c as jt}from"./copy-to-clipboard-1dd3075d.js";var Je={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */Je.exports;(function(Qe,Ve){(function(){var o,rl="4.17.21",ke=200,il="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",sn="Expected a function",ul="Invalid `variable` option passed into `_.template`",je="__lodash_hash_undefined__",fl=500,ne="__lodash_placeholder__",qn=1,Ii=2,at=4,ct=1,te=2,an=1,jn=2,Si=4,Tn=8,ht=16,Ln=32,gt=64,Wn=128,Ot=256,nr=512,ll=30,ol="...",sl=800,al=16,Ei=1,cl=2,hl=3,nt=1/0,Kn=9007199254740991,gl=17976931348623157e292,ee=0/0,yn=4294967295,_l=yn-1,pl=yn>>>1,vl=[["ary",Wn],["bind",an],["bindKey",jn],["curry",Tn],["curryRight",ht],["flip",nr],["partial",Ln],["partialRight",gt],["rearg",Ot]],_t="[object Arguments]",re="[object Array]",dl="[object AsyncFunction]",Wt="[object Boolean]",Pt="[object Date]",wl="[object DOMException]",ie="[object Error]",ue="[object Function]",Ti="[object GeneratorFunction]",xn="[object Map]",Bt="[object Number]",xl="[object Null]",Pn="[object Object]",Li="[object Promise]",Al="[object Proxy]",bt="[object RegExp]",An="[object Set]",Ft="[object String]",fe="[object Symbol]",Rl="[object Undefined]",Mt="[object WeakMap]",Il="[object WeakSet]",Ut="[object ArrayBuffer]",pt="[object DataView]",tr="[object Float32Array]",er="[object Float64Array]",rr="[object Int8Array]",ir="[object Int16Array]",ur="[object Int32Array]",fr="[object Uint8Array]",lr="[object Uint8ClampedArray]",or="[object Uint16Array]",sr="[object Uint32Array]",Sl=/\b__p \+= '';/g,El=/\b(__p \+=) '' \+/g,Tl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yi=/&(?:amp|lt|gt|quot|#39);/g,Ci=/[&<>"']/g,Ll=RegExp(yi.source),yl=RegExp(Ci.source),Cl=/<%-([\s\S]+?)%>/g,ml=/<%([\s\S]+?)%>/g,mi=/<%=([\s\S]+?)%>/g,Ol=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wl=/^\w*$/,Pl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ar=/[\\^$.*+?()[\]{}|]/g,Bl=RegExp(ar.source),cr=/^\s+/,bl=/\s/,Fl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ml=/\{\n\/\* \[wrapped with (.+)\] \*/,Ul=/,? & /,Dl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Nl=/[()=,{}\[\]\/\s]/,Gl=/\\(\\)?/g,Hl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Oi=/\w*$/,ql=/^[-+]0x[0-9a-f]+$/i,Kl=/^0b[01]+$/i,$l=/^\[object .+?Constructor\]$/,zl=/^0o[0-7]+$/i,Zl=/^(?:0|[1-9]\d*)$/,Yl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,le=/($^)/,Xl=/['\n\r\u2028\u2029\\]/g,oe="\\ud800-\\udfff",Jl="\\u0300-\\u036f",Ql="\\ufe20-\\ufe2f",Vl="\\u20d0-\\u20ff",Wi=Jl+Ql+Vl,Pi="\\u2700-\\u27bf",Bi="a-z\\xdf-\\xf6\\xf8-\\xff",kl="\\xac\\xb1\\xd7\\xf7",jl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",no="\\u2000-\\u206f",to=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bi="A-Z\\xc0-\\xd6\\xd8-\\xde",Fi="\\ufe0e\\ufe0f",Mi=kl+jl+no+to,hr="['’]",eo="["+oe+"]",Ui="["+Mi+"]",se="["+Wi+"]",Di="\\d+",ro="["+Pi+"]",Ni="["+Bi+"]",Gi="[^"+oe+Mi+Di+Pi+Bi+bi+"]",gr="\\ud83c[\\udffb-\\udfff]",io="(?:"+se+"|"+gr+")",Hi="[^"+oe+"]",_r="(?:\\ud83c[\\udde6-\\uddff]){2}",pr="[\\ud800-\\udbff][\\udc00-\\udfff]",vt="["+bi+"]",qi="\\u200d",Ki="(?:"+Ni+"|"+Gi+")",uo="(?:"+vt+"|"+Gi+")",$i="(?:"+hr+"(?:d|ll|m|re|s|t|ve))?",zi="(?:"+hr+"(?:D|LL|M|RE|S|T|VE))?",Zi=io+"?",Yi="["+Fi+"]?",fo="(?:"+qi+"(?:"+[Hi,_r,pr].join("|")+")"+Yi+Zi+")*",lo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xi=Yi+Zi+fo,so="(?:"+[ro,_r,pr].join("|")+")"+Xi,ao="(?:"+[Hi+se+"?",se,_r,pr,eo].join("|")+")",co=RegExp(hr,"g"),ho=RegExp(se,"g"),vr=RegExp(gr+"(?="+gr+")|"+ao+Xi,"g"),go=RegExp([vt+"?"+Ni+"+"+$i+"(?="+[Ui,vt,"$"].join("|")+")",uo+"+"+zi+"(?="+[Ui,vt+Ki,"$"].join("|")+")",vt+"?"+Ki+"+"+$i,vt+"+"+zi,oo,lo,Di,so].join("|"),"g"),_o=RegExp("["+qi+oe+Wi+Fi+"]"),po=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,vo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],wo=-1,M={};M[tr]=M[er]=M[rr]=M[ir]=M[ur]=M[fr]=M[lr]=M[or]=M[sr]=!0,M[_t]=M[re]=M[Ut]=M[Wt]=M[pt]=M[Pt]=M[ie]=M[ue]=M[xn]=M[Bt]=M[Pn]=M[bt]=M[An]=M[Ft]=M[Mt]=!1;var F={};F[_t]=F[re]=F[Ut]=F[pt]=F[Wt]=F[Pt]=F[tr]=F[er]=F[rr]=F[ir]=F[ur]=F[xn]=F[Bt]=F[Pn]=F[bt]=F[An]=F[Ft]=F[fe]=F[fr]=F[lr]=F[or]=F[sr]=!0,F[ie]=F[ue]=F[Mt]=!1;var xo={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ao={"&":"&","<":"<",">":">",'"':""","'":"'"},Ro={"&":"&","<":"<",">":">",""":'"',"'":"'"},Io={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},So=parseFloat,Eo=parseInt,Ji=typeof jt=="object"&&jt&&jt.Object===Object&&jt,To=typeof self=="object"&&self&&self.Object===Object&&self,z=Ji||To||Function("return this")(),dr=Ve&&!Ve.nodeType&&Ve,tt=dr&&!0&&Qe&&!Qe.nodeType&&Qe,Qi=tt&&tt.exports===dr,wr=Qi&&Ji.process,cn=function(){try{var a=tt&&tt.require&&tt.require("util").types;return a||wr&&wr.binding&&wr.binding("util")}catch{}}(),Vi=cn&&cn.isArrayBuffer,ki=cn&&cn.isDate,ji=cn&&cn.isMap,nu=cn&&cn.isRegExp,tu=cn&&cn.isSet,eu=cn&&cn.isTypedArray;function en(a,g,h){switch(h.length){case 0:return a.call(g);case 1:return a.call(g,h[0]);case 2:return a.call(g,h[0],h[1]);case 3:return a.call(g,h[0],h[1],h[2])}return a.apply(g,h)}function Lo(a,g,h,w){for(var S=-1,W=a==null?0:a.length;++S-1}function xr(a,g,h){for(var w=-1,S=a==null?0:a.length;++w-1;);return h}function au(a,g){for(var h=a.length;h--&&dt(g,a[h],0)>-1;);return h}function Fo(a,g){for(var h=a.length,w=0;h--;)a[h]===g&&++w;return w}var Mo=Sr(xo),Uo=Sr(Ao);function Do(a){return"\\"+Io[a]}function No(a,g){return a==null?o:a[g]}function wt(a){return _o.test(a)}function Go(a){return po.test(a)}function Ho(a){for(var g,h=[];!(g=a.next()).done;)h.push(g.value);return h}function yr(a){var g=-1,h=Array(a.size);return a.forEach(function(w,S){h[++g]=[S,w]}),h}function cu(a,g){return function(h){return a(g(h))}}function Zn(a,g){for(var h=-1,w=a.length,S=0,W=[];++h-1}function Cs(n,t){var e=this.__data__,r=ye(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this}Bn.prototype.clear=Es,Bn.prototype.delete=Ts,Bn.prototype.get=Ls,Bn.prototype.has=ys,Bn.prototype.set=Cs;function bn(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t=t?n:t)),n}function pn(n,t,e,r,i,f){var l,s=t&qn,c=t&Ii,_=t&at;if(e&&(l=i?e(n,r,i,f):e(n)),l!==o)return l;if(!D(n))return n;var p=E(n);if(p){if(l=Pa(n),!s)return k(n,l)}else{var v=X(n),d=v==ue||v==Ti;if(kn(n))return Yu(n,s);if(v==Pn||v==_t||d&&!i){if(l=c||d?{}:gf(n),!s)return c?Ra(n,$s(l,n)):Aa(n,Su(l,n))}else{if(!F[v])return i?n:{};l=Ba(n,v,s)}}f||(f=new In);var x=f.get(n);if(x)return x;f.set(n,l),qf(n)?n.forEach(function(I){l.add(pn(I,t,e,I,n,f))}):Gf(n)&&n.forEach(function(I,C){l.set(C,pn(I,t,e,C,n,f))});var R=_?c?jr:kr:c?nn:$,L=p?o:R(n);return hn(L||n,function(I,C){L&&(C=I,I=n[C]),$t(l,C,pn(I,t,e,C,n,f))}),l}function zs(n){var t=$(n);return function(e){return Eu(e,n,t)}}function Eu(n,t,e){var r=e.length;if(n==null)return!r;for(n=b(n);r--;){var i=e[r],f=t[i],l=n[i];if(l===o&&!(i in n)||!f(l))return!1}return!0}function Tu(n,t,e){if(typeof n!="function")throw new gn(sn);return Vt(function(){n.apply(o,e)},t)}function zt(n,t,e,r){var i=-1,f=ae,l=!0,s=n.length,c=[],_=t.length;if(!s)return c;e&&(t=U(t,rn(e))),r?(f=xr,l=!1):t.length>=ke&&(f=Dt,l=!1,t=new it(t));n:for(;++ii?0:i+e),r=r===o||r>i?i:T(r),r<0&&(r+=i),r=e>r?0:$f(r);e0&&e(s)?t>1?Z(s,t-1,e,r,i):zn(i,s):r||(i[i.length]=s)}return i}var br=ju(),Cu=ju(!0);function Cn(n,t){return n&&br(n,t,$)}function Fr(n,t){return n&&Cu(n,t,$)}function me(n,t){return $n(t,function(e){return Nn(n[e])})}function ft(n,t){t=Qn(t,n);for(var e=0,r=t.length;n!=null&&et}function Xs(n,t){return n!=null&&B.call(n,t)}function Js(n,t){return n!=null&&t in b(n)}function Qs(n,t,e){return n>=Y(t,e)&&n=120&&p.length>=120)?new it(l&&p):o}p=n[0];var v=-1,d=s[0];n:for(;++v-1;)s!==n&&Ae.call(s,c,1),Ae.call(n,c,1);return n}function Nu(n,t){for(var e=n?t.length:0,r=e-1;e--;){var i=t[e];if(e==r||i!==f){var f=i;Dn(i)?Ae.call(n,i,1):zr(n,i)}}return n}function qr(n,t){return n+Se(xu()*(t-n+1))}function sa(n,t,e,r){for(var i=-1,f=K(Ie((t-n)/(e||1)),0),l=h(f);f--;)l[r?f:++i]=n,n+=e;return l}function Kr(n,t){var e="";if(!n||t<1||t>Kn)return e;do t%2&&(e+=n),t=Se(t/2),t&&(n+=n);while(t);return e}function y(n,t){return fi(vf(n,t,tn),n+"")}function aa(n){return Iu(mt(n))}function ca(n,t){var e=mt(n);return Ge(e,ut(t,0,e.length))}function Xt(n,t,e,r){if(!D(n))return n;t=Qn(t,n);for(var i=-1,f=t.length,l=f-1,s=n;s!=null&&++ii?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var f=h(i);++r>>1,l=n[f];l!==null&&!fn(l)&&(e?l<=t:l=ke){var _=t?null:Ta(n);if(_)return he(_);l=!1,i=Dt,c=new it}else c=t?[]:s;n:for(;++r=r?n:vn(n,t,e)}var Zu=es||function(n){return z.clearTimeout(n)};function Yu(n,t){if(t)return n.slice();var e=n.length,r=_u?_u(e):new n.constructor(e);return n.copy(r),r}function Jr(n){var t=new n.constructor(n.byteLength);return new we(t).set(new we(n)),t}function va(n,t){var e=t?Jr(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}function da(n){var t=new n.constructor(n.source,Oi.exec(n));return t.lastIndex=n.lastIndex,t}function wa(n){return Kt?b(Kt.call(n)):{}}function Xu(n,t){var e=t?Jr(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function Ju(n,t){if(n!==t){var e=n!==o,r=n===null,i=n===n,f=fn(n),l=t!==o,s=t===null,c=t===t,_=fn(t);if(!s&&!_&&!f&&n>t||f&&l&&c&&!s&&!_||r&&l&&c||!e&&c||!i)return 1;if(!r&&!f&&!_&&n=s)return c;var _=e[r];return c*(_=="desc"?-1:1)}}return n.index-t.index}function Qu(n,t,e,r){for(var i=-1,f=n.length,l=e.length,s=-1,c=t.length,_=K(f-l,0),p=h(c+_),v=!r;++s1?e[i-1]:o,l=i>2?e[2]:o;for(f=n.length>3&&typeof f=="function"?(i--,f):o,l&&Q(e[0],e[1],l)&&(f=i<3?o:f,i=1),t=b(t);++r-1?i[f?t[l]:l]:o}}function ef(n){return Un(function(t){var e=t.length,r=e,i=_n.prototype.thru;for(n&&t.reverse();r--;){var f=t[r];if(typeof f!="function")throw new gn(sn);if(i&&!l&&De(f)=="wrapper")var l=new _n([],!0)}for(r=l?r:e;++r1&&O.reverse(),p&&cs))return!1;var _=f.get(n),p=f.get(t);if(_&&p)return _==t&&p==n;var v=-1,d=!0,x=e&te?new it:o;for(f.set(n,t),f.set(t,n);++v1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(Fl,`{ +/* [wrapped with `+t+`] */ +`)}function Fa(n){return E(n)||st(n)||!!(du&&n&&n[du])}function Dn(n,t){var e=typeof n;return t=t??Kn,!!t&&(e=="number"||e!="symbol"&&Zl.test(n))&&n>-1&&n%1==0&&n0){if(++t>=sl)return arguments[0]}else t=0;return n.apply(o,arguments)}}function Ge(n,t){var e=-1,r=n.length,i=r-1;for(t=t===o?r:t;++e1?n[t-1]:o;return e=typeof e=="function"?(n.pop(),e):o,Cf(n,e)});function mf(n){var t=u(n);return t.__chain__=!0,t}function Zc(n,t){return t(n),n}function He(n,t){return t(n)}var Yc=Un(function(n){var t=n.length,e=t?n[0]:0,r=this.__wrapped__,i=function(f){return Br(f,n)};return t>1||this.__actions__.length||!(r instanceof m)||!Dn(e)?this.thru(i):(r=r.slice(e,+e+(t?1:0)),r.__actions__.push({func:He,args:[i],thisArg:o}),new _n(r,this.__chain__).thru(function(f){return t&&!f.length&&f.push(o),f}))});function Xc(){return mf(this)}function Jc(){return new _n(this.value(),this.__chain__)}function Qc(){this.__values__===o&&(this.__values__=Kf(this.value()));var n=this.__index__>=this.__values__.length,t=n?o:this.__values__[this.__index__++];return{done:n,value:t}}function Vc(){return this}function kc(n){for(var t,e=this;e instanceof Le;){var r=If(e);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;e=e.__wrapped__}return i.__wrapped__=n,t}function jc(){var n=this.__wrapped__;if(n instanceof m){var t=n;return this.__actions__.length&&(t=new m(this)),t=t.reverse(),t.__actions__.push({func:He,args:[li],thisArg:o}),new _n(t,this.__chain__)}return this.thru(li)}function nh(){return $u(this.__wrapped__,this.__actions__)}var th=Be(function(n,t,e){B.call(n,e)?++n[e]:Fn(n,e,1)});function eh(n,t,e){var r=E(n)?ru:Zs;return e&&Q(n,t,e)&&(t=o),r(n,A(t,3))}function rh(n,t){var e=E(n)?$n:yu;return e(n,A(t,3))}var ih=tf(Sf),uh=tf(Ef);function fh(n,t){return Z(qe(n,t),1)}function lh(n,t){return Z(qe(n,t),nt)}function oh(n,t,e){return e=e===o?1:T(e),Z(qe(n,t),e)}function Of(n,t){var e=E(n)?hn:Xn;return e(n,A(t,3))}function Wf(n,t){var e=E(n)?yo:Lu;return e(n,A(t,3))}var sh=Be(function(n,t,e){B.call(n,e)?n[e].push(t):Fn(n,e,[t])});function ah(n,t,e,r){n=j(n)?n:mt(n),e=e&&!r?T(e):0;var i=n.length;return e<0&&(e=K(i+e,0)),Ye(n)?e<=i&&n.indexOf(t,e)>-1:!!i&&dt(n,t,e)>-1}var ch=y(function(n,t,e){var r=-1,i=typeof t=="function",f=j(n)?h(n.length):[];return Xn(n,function(l){f[++r]=i?en(t,l,e):Zt(l,t,e)}),f}),hh=Be(function(n,t,e){Fn(n,e,t)});function qe(n,t){var e=E(n)?U:Bu;return e(n,A(t,3))}function gh(n,t,e,r){return n==null?[]:(E(t)||(t=t==null?[]:[t]),e=r?o:e,E(e)||(e=e==null?[]:[e]),Uu(n,t,e))}var _h=Be(function(n,t,e){n[e?0:1].push(t)},function(){return[[],[]]});function ph(n,t,e){var r=E(n)?Ar:lu,i=arguments.length<3;return r(n,A(t,4),e,i,Xn)}function vh(n,t,e){var r=E(n)?Co:lu,i=arguments.length<3;return r(n,A(t,4),e,i,Lu)}function dh(n,t){var e=E(n)?$n:yu;return e(n,ze(A(t,3)))}function wh(n){var t=E(n)?Iu:aa;return t(n)}function xh(n,t,e){(e?Q(n,t,e):t===o)?t=1:t=T(t);var r=E(n)?Hs:ca;return r(n,t)}function Ah(n){var t=E(n)?qs:ga;return t(n)}function Rh(n){if(n==null)return 0;if(j(n))return Ye(n)?xt(n):n.length;var t=X(n);return t==xn||t==An?n.size:Nr(n).length}function Ih(n,t,e){var r=E(n)?Rr:_a;return e&&Q(n,t,e)&&(t=o),r(n,A(t,3))}var Sh=y(function(n,t){if(n==null)return[];var e=t.length;return e>1&&Q(n,t[0],t[1])?t=[]:e>2&&Q(t[0],t[1],t[2])&&(t=[t[0]]),Uu(n,Z(t,1),[])}),Ke=rs||function(){return z.Date.now()};function Eh(n,t){if(typeof t!="function")throw new gn(sn);return n=T(n),function(){if(--n<1)return t.apply(this,arguments)}}function Pf(n,t,e){return t=e?o:t,t=n&&t==null?n.length:t,Mn(n,Wn,o,o,o,o,t)}function Bf(n,t){var e;if(typeof t!="function")throw new gn(sn);return n=T(n),function(){return--n>0&&(e=t.apply(this,arguments)),n<=1&&(t=o),e}}var si=y(function(n,t,e){var r=an;if(e.length){var i=Zn(e,yt(si));r|=Ln}return Mn(n,r,t,e,i)}),bf=y(function(n,t,e){var r=an|jn;if(e.length){var i=Zn(e,yt(bf));r|=Ln}return Mn(t,r,n,e,i)});function Ff(n,t,e){t=e?o:t;var r=Mn(n,Tn,o,o,o,o,o,t);return r.placeholder=Ff.placeholder,r}function Mf(n,t,e){t=e?o:t;var r=Mn(n,ht,o,o,o,o,o,t);return r.placeholder=Mf.placeholder,r}function Uf(n,t,e){var r,i,f,l,s,c,_=0,p=!1,v=!1,d=!0;if(typeof n!="function")throw new gn(sn);t=wn(t)||0,D(e)&&(p=!!e.leading,v="maxWait"in e,f=v?K(wn(e.maxWait)||0,t):f,d="trailing"in e?!!e.trailing:d);function x(H){var En=r,Hn=i;return r=i=o,_=H,l=n.apply(Hn,En),l}function R(H){return _=H,s=Vt(C,t),p?x(H):l}function L(H){var En=H-c,Hn=H-_,el=t-En;return v?Y(el,f-Hn):el}function I(H){var En=H-c,Hn=H-_;return c===o||En>=t||En<0||v&&Hn>=f}function C(){var H=Ke();if(I(H))return O(H);s=Vt(C,L(H))}function O(H){return s=o,d&&r?x(H):(r=i=o,l)}function ln(){s!==o&&Zu(s),_=0,r=c=i=s=o}function V(){return s===o?l:O(Ke())}function on(){var H=Ke(),En=I(H);if(r=arguments,i=this,c=H,En){if(s===o)return R(c);if(v)return Zu(s),s=Vt(C,t),x(c)}return s===o&&(s=Vt(C,t)),l}return on.cancel=ln,on.flush=V,on}var Th=y(function(n,t){return Tu(n,1,t)}),Lh=y(function(n,t,e){return Tu(n,wn(t)||0,e)});function yh(n){return Mn(n,nr)}function $e(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new gn(sn);var e=function(){var r=arguments,i=t?t.apply(this,r):r[0],f=e.cache;if(f.has(i))return f.get(i);var l=n.apply(this,r);return e.cache=f.set(i,l)||f,l};return e.cache=new($e.Cache||bn),e}$e.Cache=bn;function ze(n){if(typeof n!="function")throw new gn(sn);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Ch(n){return Bf(2,n)}var mh=pa(function(n,t){t=t.length==1&&E(t[0])?U(t[0],rn(A())):U(Z(t,1),rn(A()));var e=t.length;return y(function(r){for(var i=-1,f=Y(r.length,e);++i=t}),st=Ou(function(){return arguments}())?Ou:function(n){return N(n)&&B.call(n,"callee")&&!vu.call(n,"callee")},E=h.isArray,$h=Vi?rn(Vi):ks;function j(n){return n!=null&&Ze(n.length)&&!Nn(n)}function G(n){return N(n)&&j(n)}function zh(n){return n===!0||n===!1||N(n)&&J(n)==Wt}var kn=us||Ri,Zh=ki?rn(ki):js;function Yh(n){return N(n)&&n.nodeType===1&&!kt(n)}function Xh(n){if(n==null)return!0;if(j(n)&&(E(n)||typeof n=="string"||typeof n.splice=="function"||kn(n)||Ct(n)||st(n)))return!n.length;var t=X(n);if(t==xn||t==An)return!n.size;if(Qt(n))return!Nr(n).length;for(var e in n)if(B.call(n,e))return!1;return!0}function Jh(n,t){return Yt(n,t)}function Qh(n,t,e){e=typeof e=="function"?e:o;var r=e?e(n,t):o;return r===o?Yt(n,t,o,e):!!r}function ci(n){if(!N(n))return!1;var t=J(n);return t==ie||t==wl||typeof n.message=="string"&&typeof n.name=="string"&&!kt(n)}function Vh(n){return typeof n=="number"&&wu(n)}function Nn(n){if(!D(n))return!1;var t=J(n);return t==ue||t==Ti||t==dl||t==Al}function Nf(n){return typeof n=="number"&&n==T(n)}function Ze(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Kn}function D(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function N(n){return n!=null&&typeof n=="object"}var Gf=ji?rn(ji):ta;function kh(n,t){return n===t||Dr(n,t,ti(t))}function jh(n,t,e){return e=typeof e=="function"?e:o,Dr(n,t,ti(t),e)}function ng(n){return Hf(n)&&n!=+n}function tg(n){if(Da(n))throw new S(il);return Wu(n)}function eg(n){return n===null}function rg(n){return n==null}function Hf(n){return typeof n=="number"||N(n)&&J(n)==Bt}function kt(n){if(!N(n)||J(n)!=Pn)return!1;var t=xe(n);if(t===null)return!0;var e=B.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&pe.call(e)==jo}var hi=nu?rn(nu):ea;function ig(n){return Nf(n)&&n>=-Kn&&n<=Kn}var qf=tu?rn(tu):ra;function Ye(n){return typeof n=="string"||!E(n)&&N(n)&&J(n)==Ft}function fn(n){return typeof n=="symbol"||N(n)&&J(n)==fe}var Ct=eu?rn(eu):ia;function ug(n){return n===o}function fg(n){return N(n)&&X(n)==Mt}function lg(n){return N(n)&&J(n)==Il}var og=Ue(Gr),sg=Ue(function(n,t){return n<=t});function Kf(n){if(!n)return[];if(j(n))return Ye(n)?Rn(n):k(n);if(Nt&&n[Nt])return Ho(n[Nt]());var t=X(n),e=t==xn?yr:t==An?he:mt;return e(n)}function Gn(n){if(!n)return n===0?n:0;if(n=wn(n),n===nt||n===-nt){var t=n<0?-1:1;return t*gl}return n===n?n:0}function T(n){var t=Gn(n),e=t%1;return t===t?e?t-e:t:0}function $f(n){return n?ut(T(n),0,yn):0}function wn(n){if(typeof n=="number")return n;if(fn(n))return ee;if(D(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=D(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=ou(n);var e=Kl.test(n);return e||zl.test(n)?Eo(n.slice(2),e?2:8):ql.test(n)?ee:+n}function zf(n){return mn(n,nn(n))}function ag(n){return n?ut(T(n),-Kn,Kn):n===0?n:0}function P(n){return n==null?"":un(n)}var cg=Tt(function(n,t){if(Qt(t)||j(t)){mn(t,$(t),n);return}for(var e in t)B.call(t,e)&&$t(n,e,t[e])}),Zf=Tt(function(n,t){mn(t,nn(t),n)}),Xe=Tt(function(n,t,e,r){mn(t,nn(t),n,r)}),hg=Tt(function(n,t,e,r){mn(t,$(t),n,r)}),gg=Un(Br);function _g(n,t){var e=Et(n);return t==null?e:Su(e,t)}var pg=y(function(n,t){n=b(n);var e=-1,r=t.length,i=r>2?t[2]:o;for(i&&Q(t[0],t[1],i)&&(r=1);++e1),f}),mn(n,jr(n),e),r&&(e=pn(e,qn|Ii|at,La));for(var i=t.length;i--;)zr(e,t[i]);return e});function Bg(n,t){return Xf(n,ze(A(t)))}var bg=Un(function(n,t){return n==null?{}:la(n,t)});function Xf(n,t){if(n==null)return{};var e=U(jr(n),function(r){return[r]});return t=A(t),Du(n,e,function(r,i){return t(r,i[0])})}function Fg(n,t,e){t=Qn(t,n);var r=-1,i=t.length;for(i||(i=1,n=o);++rt){var r=n;n=t,t=r}if(e||n%1||t%1){var i=xu();return Y(n+i*(t-n+So("1e-"+((i+"").length-1))),t)}return qr(n,t)}var Zg=Lt(function(n,t,e){return t=t.toLowerCase(),n+(e?Vf(t):t)});function Vf(n){return pi(P(n).toLowerCase())}function kf(n){return n=P(n),n&&n.replace(Yl,Mo).replace(ho,"")}function Yg(n,t,e){n=P(n),t=un(t);var r=n.length;e=e===o?r:ut(T(e),0,r);var i=e;return e-=t.length,e>=0&&n.slice(e,i)==t}function Xg(n){return n=P(n),n&&yl.test(n)?n.replace(Ci,Uo):n}function Jg(n){return n=P(n),n&&Bl.test(n)?n.replace(ar,"\\$&"):n}var Qg=Lt(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()}),Vg=Lt(function(n,t,e){return n+(e?" ":"")+t.toLowerCase()}),kg=nf("toLowerCase");function jg(n,t,e){n=P(n),t=T(t);var r=t?xt(n):0;if(!t||r>=t)return n;var i=(t-r)/2;return Me(Se(i),e)+n+Me(Ie(i),e)}function n_(n,t,e){n=P(n),t=T(t);var r=t?xt(n):0;return t&&r>>0,e?(n=P(n),n&&(typeof t=="string"||t!=null&&!hi(t))&&(t=un(t),!t&&wt(n))?Vn(Rn(n),0,e):n.split(t,e)):[]}var l_=Lt(function(n,t,e){return n+(e?" ":"")+pi(t)});function o_(n,t,e){return n=P(n),e=e==null?0:ut(T(e),0,n.length),t=un(t),n.slice(e,e+t.length)==t}function s_(n,t,e){var r=u.templateSettings;e&&Q(n,t,e)&&(t=o),n=P(n),t=Xe({},t,r,of);var i=Xe({},t.imports,r.imports,of),f=$(i),l=Lr(i,f),s,c,_=0,p=t.interpolate||le,v="__p += '",d=Cr((t.escape||le).source+"|"+p.source+"|"+(p===mi?Hl:le).source+"|"+(t.evaluate||le).source+"|$","g"),x="//# sourceURL="+(B.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++wo+"]")+` +`;n.replace(d,function(I,C,O,ln,V,on){return O||(O=ln),v+=n.slice(_,on).replace(Xl,Do),C&&(s=!0,v+=`' + +__e(`+C+`) + +'`),V&&(c=!0,v+=`'; +`+V+`; +__p += '`),O&&(v+=`' + +((__t = (`+O+`)) == null ? '' : __t) + +'`),_=on+I.length,I}),v+=`'; +`;var R=B.call(t,"variable")&&t.variable;if(!R)v=`with (obj) { +`+v+` +} +`;else if(Nl.test(R))throw new S(ul);v=(c?v.replace(Sl,""):v).replace(El,"$1").replace(Tl,"$1;"),v="function("+(R||"obj")+`) { +`+(R?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+v+`return __p +}`;var L=nl(function(){return W(f,x+"return "+v).apply(o,l)});if(L.source=v,ci(L))throw L;return L}function a_(n){return P(n).toLowerCase()}function c_(n){return P(n).toUpperCase()}function h_(n,t,e){if(n=P(n),n&&(e||t===o))return ou(n);if(!n||!(t=un(t)))return n;var r=Rn(n),i=Rn(t),f=su(r,i),l=au(r,i)+1;return Vn(r,f,l).join("")}function g_(n,t,e){if(n=P(n),n&&(e||t===o))return n.slice(0,hu(n)+1);if(!n||!(t=un(t)))return n;var r=Rn(n),i=au(r,Rn(t))+1;return Vn(r,0,i).join("")}function __(n,t,e){if(n=P(n),n&&(e||t===o))return n.replace(cr,"");if(!n||!(t=un(t)))return n;var r=Rn(n),i=su(r,Rn(t));return Vn(r,i).join("")}function p_(n,t){var e=ll,r=ol;if(D(t)){var i="separator"in t?t.separator:i;e="length"in t?T(t.length):e,r="omission"in t?un(t.omission):r}n=P(n);var f=n.length;if(wt(n)){var l=Rn(n);f=l.length}if(e>=f)return n;var s=e-xt(r);if(s<1)return r;var c=l?Vn(l,0,s).join(""):n.slice(0,s);if(i===o)return c+r;if(l&&(s+=c.length-s),hi(i)){if(n.slice(s).search(i)){var _,p=c;for(i.global||(i=Cr(i.source,P(Oi.exec(i))+"g")),i.lastIndex=0;_=i.exec(p);)var v=_.index;c=c.slice(0,v===o?s:v)}}else if(n.indexOf(un(i),s)!=s){var d=c.lastIndexOf(i);d>-1&&(c=c.slice(0,d))}return c+r}function v_(n){return n=P(n),n&&Ll.test(n)?n.replace(yi,zo):n}var d_=Lt(function(n,t,e){return n+(e?" ":"")+t.toUpperCase()}),pi=nf("toUpperCase");function jf(n,t,e){return n=P(n),t=e?o:t,t===o?Go(n)?Xo(n):Wo(n):n.match(t)||[]}var nl=y(function(n,t){try{return en(n,o,t)}catch(e){return ci(e)?e:new S(e)}}),w_=Un(function(n,t){return hn(t,function(e){e=On(e),Fn(n,e,si(n[e],n))}),n});function x_(n){var t=n==null?0:n.length,e=A();return n=t?U(n,function(r){if(typeof r[1]!="function")throw new gn(sn);return[e(r[0]),r[1]]}):[],y(function(r){for(var i=-1;++iKn)return[];var e=yn,r=Y(n,yn);t=A(t),n-=yn;for(var i=Tr(r,t);++e0||t<0)?new m(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==o&&(t=T(t),e=t<0?e.dropRight(-t):e.take(t-n)),e)},m.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},m.prototype.toArray=function(){return this.take(yn)},Cn(m.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=u[r?"take"+(t=="last"?"Right":""):t],f=r||/^find/.test(t);i&&(u.prototype[t]=function(){var l=this.__wrapped__,s=r?[1]:arguments,c=l instanceof m,_=s[0],p=c||E(l),v=function(C){var O=i.apply(u,zn([C],s));return r&&d?O[0]:O};p&&e&&typeof _=="function"&&_.length!=1&&(c=p=!1);var d=this.__chain__,x=!!this.__actions__.length,R=f&&!d,L=c&&!x;if(!f&&p){l=L?l:new m(this);var I=n.apply(l,s);return I.__actions__.push({func:He,args:[v],thisArg:o}),new _n(I,d)}return R&&L?n.apply(this,s):(I=this.thru(v),R?r?I.value()[0]:I.value():I)})}),hn(["pop","push","shift","sort","splice","unshift"],function(n){var t=ge[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var f=this.value();return t.apply(E(f)?f:[],i)}return this[e](function(l){return t.apply(E(l)?l:[],i)})}}),Cn(m.prototype,function(n,t){var e=u[t];if(e){var r=e.name+"";B.call(St,r)||(St[r]=[]),St[r].push({name:t,func:e})}}),St[be(o,jn).name]=[{name:"wrapper",func:o}],m.prototype.clone=vs,m.prototype.reverse=ds,m.prototype.value=ws,u.prototype.at=Yc,u.prototype.chain=Xc,u.prototype.commit=Jc,u.prototype.next=Qc,u.prototype.plant=kc,u.prototype.reverse=jc,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=nh,u.prototype.first=u.prototype.head,Nt&&(u.prototype[Nt]=Vc),u},At=Jo();tt?((tt.exports=At)._=At,dr._=At):z._=At}).call(jt)})(Je,Je.exports);var ip=Je.exports;export{ip as l}; diff --git a/web/dist/assets/lodash-es-8412e618.js b/web/dist/assets/lodash-es-8412e618.js new file mode 100644 index 00000000..a975ff70 --- /dev/null +++ b/web/dist/assets/lodash-es-8412e618.js @@ -0,0 +1 @@ +var Ke=typeof global=="object"&&global&&global.Object===Object&&global;const ue=Ke;var Je=typeof self=="object"&&self&&self.Object===Object&&self,Xe=ue||Je||Function("return this")();const $=Xe;var Ye=$.Symbol;const C=Ye;var oe=Object.prototype,qe=oe.hasOwnProperty,Qe=oe.toString,H=C?C.toStringTag:void 0;function Ve(r){var e=qe.call(r,H),n=r[H];try{r[H]=void 0;var t=!0}catch{}var a=Qe.call(r);return t&&(e?r[H]=n:delete r[H]),a}var ke=Object.prototype,rn=ke.toString;function en(r){return rn.call(r)}var nn="[object Null]",tn="[object Undefined]",Sr=C?C.toStringTag:void 0;function M(r){return r==null?r===void 0?tn:nn:Sr&&Sr in Object(r)?Ve(r):en(r)}function E(r){return r!=null&&typeof r=="object"}var an="[object Symbol]";function rr(r){return typeof r=="symbol"||E(r)&&M(r)==an}function fe(r,e){for(var n=-1,t=r==null?0:r.length,a=Array(t);++n0){if(++e>=Hn)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}function Zn(r){return function(){return r}}var Kn=function(){try{var r=U(Object,"defineProperty");return r({},"",{}),r}catch{}}();const Y=Kn;var Jn=Y?function(r,e){return Y(r,"toString",{configurable:!0,enumerable:!1,value:Zn(e),writable:!0})}:vr;const Xn=Jn;var Yn=Wn(Xn);const qn=Yn;var Qn=9007199254740991,Vn=/^(?:0|[1-9]\d*)$/;function yr(r,e){var n=typeof r;return e=e??Qn,!!e&&(n=="number"||n!="symbol"&&Vn.test(r))&&r>-1&&r%1==0&&r-1&&r%1==0&&r<=it}function j(r){return r!=null&&_r(r.length)&&!br(r)}function ut(r,e,n){if(!_(n))return!1;var t=typeof e;return(t=="number"?j(n)&&yr(e,n.length):t=="string"&&e in n)?Z(n[e],r):!1}function ot(r){return at(function(e,n){var t=-1,a=n.length,i=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(i=r.length>3&&typeof i=="function"?(a--,i):void 0,o&&ut(n[0],n[1],o)&&(i=a<3?void 0:i,a=1),e=Object(e);++t-1}function ma(r,e){var n=this.__data__,t=er(n,r);return t<0?(++this.size,n.push([r,e])):n[t][1]=e,this}function A(r){var e=-1,n=r==null?0:r.length;for(this.clear();++ea?0:a+e),n=n>a?a:n,n<0&&(n+=a),a=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(a);++t=t?r:Ya(r,e,n)}var Qa="\\ud800-\\udfff",Va="\\u0300-\\u036f",ka="\\ufe20-\\ufe2f",ri="\\u20d0-\\u20ff",ei=Va+ka+ri,ni="\\ufe0e\\ufe0f",ti="\\u200d",ai=RegExp("["+ti+Qa+ei+ni+"]");function _e(r){return ai.test(r)}function ii(r){return r.split("")}var $e="\\ud800-\\udfff",ui="\\u0300-\\u036f",oi="\\ufe20-\\ufe2f",fi="\\u20d0-\\u20ff",si=ui+oi+fi,ci="\\ufe0e\\ufe0f",di="["+$e+"]",sr="["+si+"]",cr="\\ud83c[\\udffb-\\udfff]",li="(?:"+sr+"|"+cr+")",Te="[^"+$e+"]",Oe="(?:\\ud83c[\\udde6-\\uddff]){2}",me="[\\ud800-\\udbff][\\udc00-\\udfff]",pi="\\u200d",Ae=li+"?",we="["+ci+"]?",gi="(?:"+pi+"(?:"+[Te,Oe,me].join("|")+")"+we+Ae+")*",hi=we+Ae+gi,vi="(?:"+[Te+sr+"?",sr,Oe,me,di].join("|")+")",bi=RegExp(cr+"(?="+cr+")|"+vi+hi,"g");function yi(r){return r.match(bi)||[]}function xi(r){return _e(r)?yi(r):ii(r)}function _i(r){return function(e){e=F(e);var n=_e(e)?xi(e):void 0,t=n?n[0]:e.charAt(0),a=n?qa(n,1).join(""):e.slice(1);return t[r]()+a}}var $i=_i("toUpperCase");const rf=$i;function Ti(r,e,n,t){var a=-1,i=r==null?0:r.length;for(t&&i&&(n=r[++a]);++au))return!1;var s=i.get(r),c=i.get(e);if(s&&c)return s==e&&c==r;var l=-1,d=!0,h=n&Yu?new k:void 0;for(i.set(r,e),i.set(e,r);++l=e||S<0||l&&G>=i}function y(){var g=or();if(T(g))return O(g);u=setTimeout(y,b(g))}function O(g){return u=void 0,d&&t?h(g):(t=a=void 0,o)}function K(){u!==void 0&&clearTimeout(u),s=0,t=f=a=u=void 0}function N(){return u===void 0?o:O(or())}function P(){var g=or(),S=T(g);if(t=arguments,a=this,f=g,S){if(u===void 0)return v(f);if(l)return clearTimeout(u),u=setTimeout(y,e),h(f)}return u===void 0&&(u=setTimeout(y,e)),o}return P.cancel=K,P.flush=N,P}function gr(r,e,n){(n!==void 0&&!Z(r[e],n)||n===void 0&&!(e in r))&&xr(r,e,n)}function Ko(r){return E(r)&&j(r)}function hr(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}function Jo(r){return nt(r,he(r))}function Xo(r,e,n,t,a,i,o){var u=hr(r,n),f=hr(e,n),s=o.get(f);if(s){gr(r,n,s);return}var c=i?i(u,f,n+"",r,e,o):void 0,l=c===void 0;if(l){var d=x(f),h=!d&&Q(f),v=!d&&!h&&Tr(f);c=f,d||h||v?x(u)?c=u:Ko(u)?c=Gn(u):h?(l=!1,c=Tu(f,!0)):v?(l=!1,c=Hu(f,!0)):c=[]:Xa(f)||q(f)?(c=u,q(u)?c=Jo(u):(!_(u)||br(u))&&(c=zu(f))):l=!1}l&&(o.set(f,c),a(c,f,t,i,o),o.delete(f)),gr(r,n,c)}function Ze(r,e,n,t,a){r!==e&&We(e,function(i,o){if(a||(a=new m),_(i))Xo(r,e,o,n,Ze,t,a);else{var u=t?t(hr(r,o),i,o+"",r,e,a):void 0;u===void 0&&(u=i),gr(r,o,u)}},he)}function Yo(r,e){var n=-1,t=j(r)?Array(r.length):[];return Go(r,function(a,i,o){t[++n]=e(a,i,o)}),t}function ef(r,e){var n=x(r)?fe:Yo;return n(r,Lo(e))}var qo=du(function(r,e,n){return r+(n?"-":"")+e.toLowerCase()});const nf=qo;var Qo=ot(function(r,e,n){Ze(r,e,n)});const tf=Qo;var Vo=gu("round");const af=Vo;var ko="Expected a function";function uf(r,e,n){var t=!0,a=!0;if(typeof r!="function")throw new TypeError(ko);return _(n)&&(t="leading"in n?!!n.leading:t,a="trailing"in n?!!n.trailing:a),Zo(r,e,{leading:t,maxWait:e,trailing:a})}export{ef as a,Ga as g,nf as k,tf as m,af as r,uf as t,rf as u}; diff --git a/web/dist/assets/logo.52afee68.png b/web/dist/assets/logo-52afee68.png similarity index 100% rename from web/dist/assets/logo.52afee68.png rename to web/dist/assets/logo-52afee68.png diff --git a/web/dist/assets/main-nav-569a7b0c.css b/web/dist/assets/main-nav-569a7b0c.css new file mode 100644 index 00000000..6051995f --- /dev/null +++ b/web/dist/assets/main-nav-569a7b0c.css @@ -0,0 +1 @@ +.nav-title-card{z-index:99;width:100%;top:0;position:sticky;border-radius:0;border-bottom:0;background-color:#ffffffbf;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.nav-title-card .navbar{height:30px;position:relative;display:flex;align-items:center}.nav-title-card .navbar .drawer-btn,.nav-title-card .navbar .back-btn{margin-right:8px}.nav-title-card .navbar .theme-switch-wrap{position:absolute;right:0;top:calc(50% - 9px)}.dark .nav-title-card{background-color:#101014bf} diff --git a/web/dist/assets/main-nav.3167f221.js b/web/dist/assets/main-nav.3167f221.js deleted file mode 100644 index 66be661f..00000000 --- a/web/dist/assets/main-nav.3167f221.js +++ /dev/null @@ -1,102 +0,0 @@ -import{ap as ne,aq as Be,ar as Se,as as $e,r as D,k as ze,at as Me,m as Re,c as ae,f as t,au as oe,b as X,e as h,a as ie,d as L,u as Ve,x as le,o as Le,t as Fe,s as Te,y as E,z as k,av as Z,aw as f,A as Oe,ax as G,h as r,B as y,ay as Ee,az as Ae,w as J,W as z,Y as ee,Z as W,$ as Ne,al as Pe,a2 as De,a6 as Q,a5 as R,a4 as A,a3 as N,a7 as re,a9 as He,aa as Ie,af as We,K as Ke,aA as Ue}from"./index.d4f5aad2.js";let P=0;const je=typeof window!="undefined"&&window.matchMedia!==void 0,B=D(null);let c,C;function H(e){e.matches&&(B.value="dark")}function I(e){e.matches&&(B.value="light")}function qe(){c=window.matchMedia("(prefers-color-scheme: dark)"),C=window.matchMedia("(prefers-color-scheme: light)"),c.matches?B.value="dark":C.matches?B.value="light":B.value=null,c.addEventListener?(c.addEventListener("change",H),C.addEventListener("change",I)):c.addListener&&(c.addListener(H),C.addListener(I))}function Ye(){"removeEventListener"in c?(c.removeEventListener("change",H),C.removeEventListener("change",I)):"removeListener"in c&&(c.removeListener(H),C.removeListener(I)),c=void 0,C=void 0}let se=!0;function Xe(){return je?(P===0&&qe(),se&&(se=Be())&&(Se(()=>{P+=1}),$e(()=>{P-=1,P===0&&Ye()})),ne(B)):ne(B)}const Ze=e=>{const{primaryColor:o,opacityDisabled:i,borderRadius:s,textColor3:l}=e,v="rgba(0, 0, 0, .14)";return Object.assign(Object.assign({},Me),{iconColor:l,textColor:"white",loadingColor:o,opacityDisabled:i,railColor:v,railColorActive:o,buttonBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",buttonColor:"#FFF",railBorderRadiusSmall:s,railBorderRadiusMedium:s,railBorderRadiusLarge:s,buttonBorderRadiusSmall:s,buttonBorderRadiusMedium:s,buttonBorderRadiusLarge:s,boxShadowFocus:`0 0 0 2px ${Re(o,{alpha:.2})}`})},Ge={name:"Switch",common:ze,self:Ze};var Je=Ge,Qe=ae("switch",` - height: var(--n-height); - min-width: var(--n-width); - vertical-align: middle; - user-select: none; - -webkit-user-select: none; - display: inline-flex; - outline: none; - justify-content: center; - align-items: center; -`,[t("children-placeholder",` - height: var(--n-rail-height); - display: flex; - flex-direction: column; - overflow: hidden; - pointer-events: none; - visibility: hidden; - `),t("rail-placeholder",` - display: flex; - flex-wrap: none; - `),t("button-placeholder",` - width: calc(1.75 * var(--n-rail-height)); - height: var(--n-rail-height); - `),ae("base-loading",` - position: absolute; - top: 50%; - left: 50%; - transform: translateX(-50%) translateY(-50%); - font-size: calc(var(--n-button-width) - 4px); - color: var(--n-loading-color); - transition: color .3s var(--n-bezier); - `,[oe({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),t("checked, unchecked",` - transition: color .3s var(--n-bezier); - color: var(--n-text-color); - box-sizing: border-box; - position: absolute; - white-space: nowrap; - top: 0; - bottom: 0; - display: flex; - align-items: center; - line-height: 1; - `),t("checked",` - right: 0; - padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset)); - `),t("unchecked",` - left: 0; - justify-content: flex-end; - padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset)); - `),X("&:focus",[t("rail",` - box-shadow: var(--n-box-shadow-focus); - `)]),h("round",[t("rail","border-radius: calc(var(--n-rail-height) / 2);",[t("button","border-radius: calc(var(--n-button-height) / 2);")])]),ie("disabled",[ie("icon",[h("rubber-band",[h("pressed",[t("rail",[t("button","max-width: var(--n-button-width-pressed);")])]),t("rail",[X("&:active",[t("button","max-width: var(--n-button-width-pressed);")])]),h("active",[h("pressed",[t("rail",[t("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),t("rail",[X("&:active",[t("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),h("active",[t("rail",[t("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),t("rail",` - overflow: hidden; - height: var(--n-rail-height); - min-width: var(--n-rail-width); - border-radius: var(--n-rail-border-radius); - cursor: pointer; - position: relative; - transition: - opacity .3s var(--n-bezier), - background .3s var(--n-bezier), - box-shadow .3s var(--n-bezier); - background-color: var(--n-rail-color); - `,[t("button-icon",` - color: var(--n-icon-color); - transition: color .3s var(--n-bezier); - font-size: calc(var(--n-button-height) - 4px); - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - display: flex; - justify-content: center; - align-items: center; - line-height: 1; - `,[oe()]),t("button",` - align-items: center; - top: var(--n-offset); - left: var(--n-offset); - height: var(--n-button-height); - width: var(--n-button-width-pressed); - max-width: var(--n-button-width); - border-radius: var(--n-button-border-radius); - background-color: var(--n-button-color); - box-shadow: var(--n-button-box-shadow); - box-sizing: border-box; - cursor: inherit; - content: ""; - position: absolute; - transition: - background-color .3s var(--n-bezier), - left .3s var(--n-bezier), - opacity .3s var(--n-bezier), - max-width .3s var(--n-bezier), - box-shadow .3s var(--n-bezier); - `)]),h("active",[t("rail","background-color: var(--n-rail-color-active);")]),h("loading",[t("rail",` - cursor: wait; - `)]),h("disabled",[t("rail",` - cursor: not-allowed; - opacity: .5; - `)])]);const et=Object.assign(Object.assign({},le.props),{size:{type:String,default:"medium"},value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},onChange:[Function,Array]});let V;var tt=L({name:"Switch",props:et,setup(e){V===void 0&&(typeof CSS!="undefined"?typeof CSS.supports!="undefined"?V=CSS.supports("width","max(1px)"):V=!1:V=!0);const{mergedClsPrefixRef:o,inlineThemeDisabled:i}=Ve(e),s=le("Switch","-switch",Qe,Je,e,o),l=Le(e),{mergedSizeRef:v,mergedDisabledRef:d}=l,S=D(e.defaultValue),g=Fe(e,"value"),u=Te(g,S),x=E(()=>u.value===e.checkedValue),b=D(!1),a=D(!1),m=E(()=>{const{railStyle:n}=e;if(!!n)return n({focused:a.value,checked:x.value})});function w(n){const{"onUpdate:value":F,onChange:T,onUpdateValue:O}=e,{nTriggerFormInput:K,nTriggerFormChange:U}=l;F&&J(F,n),O&&J(O,n),T&&J(T,n),S.value=n,K(),U()}function ce(){const{nTriggerFormFocus:n}=l;n()}function de(){const{nTriggerFormBlur:n}=l;n()}function ue(){e.loading||d.value||(u.value!==e.checkedValue?w(e.checkedValue):w(e.uncheckedValue))}function he(){a.value=!0,ce()}function fe(){a.value=!1,de(),b.value=!1}function ve(n){e.loading||d.value||n.key===" "&&(u.value!==e.checkedValue?w(e.checkedValue):w(e.uncheckedValue),b.value=!1)}function ge(n){e.loading||d.value||n.key===" "&&(n.preventDefault(),b.value=!0)}const te=E(()=>{const{value:n}=v,{self:{opacityDisabled:F,railColor:T,railColorActive:O,buttonBoxShadow:K,buttonColor:U,boxShadowFocus:be,loadingColor:me,textColor:we,iconColor:pe,[k("buttonHeight",n)]:p,[k("buttonWidth",n)]:_e,[k("buttonWidthPressed",n)]:xe,[k("railHeight",n)]:_,[k("railWidth",n)]:M,[k("railBorderRadius",n)]:ke,[k("buttonBorderRadius",n)]:ye},common:{cubicBezierEaseInOut:Ce}}=s.value;let j,q,Y;return V?(j=`calc((${_} - ${p}) / 2)`,q=`max(${_}, ${p})`,Y=`max(${M}, calc(${M} + ${p} - ${_}))`):(j=Z((f(_)-f(p))/2),q=Z(Math.max(f(_),f(p))),Y=f(_)>f(p)?M:Z(f(M)+f(p)-f(_))),{"--n-bezier":Ce,"--n-button-border-radius":ye,"--n-button-box-shadow":K,"--n-button-color":U,"--n-button-width":_e,"--n-button-width-pressed":xe,"--n-button-height":p,"--n-height":q,"--n-offset":j,"--n-opacity-disabled":F,"--n-rail-border-radius":ke,"--n-rail-color":T,"--n-rail-color-active":O,"--n-rail-height":_,"--n-rail-width":M,"--n-width":Y,"--n-box-shadow-focus":be,"--n-loading-color":me,"--n-text-color":we,"--n-icon-color":pe}}),$=i?Oe("switch",E(()=>v.value[0]),te,e):void 0;return{handleClick:ue,handleBlur:fe,handleFocus:he,handleKeyup:ve,handleKeydown:ge,mergedRailStyle:m,pressed:b,mergedClsPrefix:o,mergedValue:u,checked:x,mergedDisabled:d,cssVars:i?void 0:te,themeClass:$==null?void 0:$.themeClass,onRender:$==null?void 0:$.onRender}},render(){const{mergedClsPrefix:e,mergedDisabled:o,checked:i,mergedRailStyle:s,onRender:l,$slots:v}=this;l==null||l();const{checked:d,unchecked:S,icon:g,"checked-icon":u,"unchecked-icon":x}=v,b=!(G(g)&&G(u)&&G(x));return r("div",{role:"switch","aria-checked":i,class:[`${e}-switch`,this.themeClass,b&&`${e}-switch--icon`,i&&`${e}-switch--active`,o&&`${e}-switch--disabled`,this.round&&`${e}-switch--round`,this.loading&&`${e}-switch--loading`,this.pressed&&`${e}-switch--pressed`,this.rubberBand&&`${e}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},r("div",{class:`${e}-switch__rail`,"aria-hidden":"true",style:s},y(d,a=>y(S,m=>a||m?r("div",{"aria-hidden":!0,class:`${e}-switch__children-placeholder`},r("div",{class:`${e}-switch__rail-placeholder`},r("div",{class:`${e}-switch__button-placeholder`}),a),r("div",{class:`${e}-switch__rail-placeholder`},r("div",{class:`${e}-switch__button-placeholder`}),m)):null)),r("div",{class:`${e}-switch__button`},y(g,a=>y(u,m=>y(x,w=>r(Ee,null,{default:()=>this.loading?r(Ae,{key:"loading",clsPrefix:e,strokeWidth:20}):this.checked&&(m||a)?r("div",{class:`${e}-switch__button-icon`,key:m?"checked-icon":"icon"},m||a):!this.checked&&(w||a)?r("div",{class:`${e}-switch__button-icon`,key:w?"unchecked-icon":"icon"},w||a):null})))),y(d,a=>a&&r("div",{key:"checked",class:`${e}-switch__checked`},a)),y(S,a=>a&&r("div",{key:"unchecked",class:`${e}-switch__unchecked`},a)))))}});const nt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},at=W("path",{d:"M14.71 6.71a.996.996 0 0 0-1.41 0L8.71 11.3a.996.996 0 0 0 0 1.41l4.59 4.59a.996.996 0 1 0 1.41-1.41L10.83 12l3.88-3.88c.39-.39.38-1.03 0-1.41z",fill:"currentColor"},null,-1),ot=[at];var it=L({name:"ChevronLeftRound",render:function(o,i){return z(),ee("svg",nt,ot)}});const rt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},st=W("path",{d:"M9.37 5.51A7.35 7.35 0 0 0 9.1 7.5c0 4.08 3.32 7.4 7.4 7.4c.68 0 1.35-.09 1.99-.27A7.014 7.014 0 0 1 12 19c-3.86 0-7-3.14-7-7c0-2.93 1.81-5.45 4.37-6.49zM12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26a5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"},null,-1),lt=[st];var ct=L({name:"DarkModeOutlined",render:function(o,i){return z(),ee("svg",rt,lt)}});const dt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ut=W("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3s-3-1.35-3-3s1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5s5-2.24 5-5s-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 0 0-1.41 0a.996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 0 0-1.41 0a.996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 0 0 0-1.41a.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 0 0 0-1.41a.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z",fill:"currentColor"},null,-1),ht=[ut];var ft=L({name:"LightModeOutlined",render:function(o,i){return z(),ee("svg",dt,ht)}});const vt={class:"navbar"},bt=L({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(e){const o=e,i=Ne(),s=Pe(),l=d=>{d?(localStorage.setItem("PAOPAO_THEME","dark"),i.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),i.commit("triggerTheme","light"))},v=()=>{window.history.length<=1?s.push({path:"/"}):s.go(-1)};return De(()=>{localStorage.getItem("PAOPAO_THEME")||l(Xe()==="dark")}),(d,S)=>{const g=We,u=Ke,x=tt,b=Ue;return z(),Q(b,{size:"small",bordered:!0,class:"nav-title-card"},{header:R(()=>[W("div",vt,[e.back?(z(),Q(u,{key:0,class:"back-btn",onClick:v,quaternary:"",circle:"",size:"small"},{icon:R(()=>[A(g,null,{default:R(()=>[A(N(it))]),_:1})]),_:1})):re("",!0),He(" "+Ie(o.title)+" ",1),o.theme?(z(),Q(x,{key:1,value:N(i).state.theme==="dark","onUpdate:value":l,size:"small",class:"theme-switch-wrap"},{"checked-icon":R(()=>[A(g,{component:N(ft)},null,8,["component"])]),"unchecked-icon":R(()=>[A(g,{component:N(ct)},null,8,["component"])]),_:1},8,["value"])):re("",!0)])]),_:1})}}});export{bt as _}; diff --git a/web/dist/assets/main-nav.b4a45e8a.css b/web/dist/assets/main-nav.b4a45e8a.css deleted file mode 100644 index 6ce451a2..00000000 --- a/web/dist/assets/main-nav.b4a45e8a.css +++ /dev/null @@ -1 +0,0 @@ -.nav-title-card{z-index:99;width:100%;top:0;position:sticky;border-radius:0;border-bottom:0;background-color:#ffffffbf;backdrop-filter:blur(12px)}.nav-title-card .navbar{height:30px;position:relative;display:flex;align-items:center}.nav-title-card .navbar .back-btn{margin-right:8px}.nav-title-card .navbar .theme-switch-wrap{position:absolute;right:0;top:calc(50% - 9px)}.dark .nav-title-card{background-color:#101014bf} diff --git a/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js new file mode 100644 index 00000000..73e9f64e --- /dev/null +++ b/web/dist/assets/main-nav.vue_vue_type_style_index_0_lang-be35896a.js @@ -0,0 +1 @@ +import{$ as E}from"./index-347d1d96.js";import{u as S}from"./vuex-473b3783.js";import{u as z}from"./vue-router-b8e3382f.js";import{j as A}from"./vooks-a50491fd.js";import{U as C,X as N,Y as P,Z as D}from"./@vicons-8f91201d.js";import{a3 as R,a4 as V,j as I,e as j,a5 as x,h as H}from"./naive-ui-62663ad7.js";import{d as U,r as h,j as $,o as a,c as f,_ as o,V as e,a1 as t,O as c,a as q,Q as _,e as F,M as L,F as Q}from"./@vue-e0e89260.js";const X={key:0},Y={class:"navbar"},oe=U({__name:"main-nav",props:{title:{default:""},back:{type:Boolean,default:!1},theme:{type:Boolean,default:!0}},setup(g){const i=g,n=S(),m=z(),l=h(!1),k=h("left"),u=s=>{s?(localStorage.setItem("PAOPAO_THEME","dark"),n.commit("triggerTheme","dark")):(localStorage.setItem("PAOPAO_THEME","light"),n.commit("triggerTheme","light"))},w=()=>{window.history.length<=1?m.push({path:"/"}):m.go(-1)},v=()=>{l.value=!0};return $(()=>{localStorage.getItem("PAOPAO_THEME")||u(A()==="dark")}),(s,d)=>{const y=E,b=R,O=V,r=I,p=j,M=x,T=H;return a(),f(Q,null,[o(n).state.drawerModelShow?(a(),f("div",X,[e(O,{show:l.value,"onUpdate:show":d[0]||(d[0]=B=>l.value=B),width:212,placement:k.value,resizable:""},{default:t(()=>[e(b,null,{default:t(()=>[e(y)]),_:1})]),_:1},8,["show","placement"])])):c("",!0),e(T,{size:"small",bordered:!0,class:"nav-title-card"},{header:t(()=>[q("div",Y,[o(n).state.drawerModelShow&&!s.back?(a(),_(p,{key:0,class:"drawer-btn",onClick:v,quaternary:"",circle:"",size:"medium"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(C))]),_:1})]),_:1})):c("",!0),s.back?(a(),_(p,{key:1,class:"back-btn",onClick:w,quaternary:"",circle:"",size:"small"},{icon:t(()=>[e(r,null,{default:t(()=>[e(o(N))]),_:1})]),_:1})):c("",!0),F(" "+L(i.title)+" ",1),i.theme?(a(),_(M,{key:2,value:o(n).state.theme==="dark","onUpdate:value":u,size:"small",class:"theme-switch-wrap"},{"checked-icon":t(()=>[e(r,{component:o(P)},null,8,["component"])]),"unchecked-icon":t(()=>[e(r,{component:o(D)},null,8,["component"])]),_:1},8,["value"])):c("",!0)])]),_:1})],64)}}});export{oe as _}; diff --git a/web/dist/assets/moment-2ab8298d.js b/web/dist/assets/moment-2ab8298d.js new file mode 100644 index 00000000..96ae27c3 --- /dev/null +++ b/web/dist/assets/moment-2ab8298d.js @@ -0,0 +1,15 @@ +//! moment.js +//! version : 2.29.4 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com +var Wt;function l(){return Wt.apply(null,arguments)}function Ds(e){Wt=e}function I(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function ae(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function nt(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(y(e,t))return!1;return!0}function b(e){return e===void 0}function q(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function De(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Pt(e,t){var s=[],r,a=e.length;for(r=0;r>>0,r;for(r=0;r0)for(s=0;s=0;return(n?s?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}var ut=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,pe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,qe={},ue={};function h(e,t,s,r){var a=r;typeof r=="string"&&(a=function(){return this[r]()}),e&&(ue[e]=a),t&&(ue[t[0]]=function(){return E(a.apply(this,arguments),t[1],t[2])}),s&&(ue[s]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function Os(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Ts(e){var t=e.match(ut),s,r;for(s=0,r=t.length;s=0&&pe.test(e);)e=e.replace(pe,r),pe.lastIndex=0,s-=1;return e}var xs={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function bs(e){var t=this._longDateFormat[e],s=this._longDateFormat[e.toUpperCase()];return t||!s?t:(this._longDateFormat[e]=s.match(ut).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var Ws="Invalid date";function Ps(){return this._invalidDate}var Ns="%d",Rs=/\d{1,2}/;function Fs(e){return this._ordinal.replace("%d",e)}var Ls={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Is(e,t,s,r){var a=this._relativeTime[s];return V(a)?a(e,t,s,r):a.replace(/%d/i,e)}function Cs(e,t){var s=this._relativeTime[e>0?"future":"past"];return V(s)?s(t):s.replace(/%s/i,t)}var ye={};function O(e,t){var s=e.toLowerCase();ye[s]=ye[s+"s"]=ye[t]=e}function F(e){return typeof e=="string"?ye[e]||ye[e.toLowerCase()]:void 0}function dt(e){var t={},s,r;for(r in e)y(e,r)&&(s=F(r),s&&(t[s]=e[r]));return t}var Lt={};function T(e,t){Lt[e]=t}function Us(e){var t=[],s;for(s in e)y(e,s)&&t.push({unit:s,priority:Lt[s]});return t.sort(function(r,a){return r.priority-a.priority}),t}function Ce(e){return e%4===0&&e%100!==0||e%400===0}function N(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function _(e){var t=+e,s=0;return t!==0&&isFinite(t)&&(s=N(t)),s}function fe(e,t){return function(s){return s!=null?(It(this,e,s),l.updateOffset(this,t),this):We(this,e)}}function We(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function It(e,t,s){e.isValid()&&!isNaN(s)&&(t==="FullYear"&&Ce(e.year())&&e.month()===1&&e.date()===29?(s=_(s),e._d["set"+(e._isUTC?"UTC":"")+t](s,e.month(),Ge(s,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](s))}function Hs(e){return e=F(e),V(this[e])?this[e]():this}function Es(e,t){if(typeof e=="object"){e=dt(e);var s=Us(e),r,a=s.length;for(r=0;r68?1900:2e3)};var Zt=fe("FullYear",!0);function nr(){return Ce(this.year())}function ir(e,t,s,r,a,n,i){var d;return e<100&&e>=0?(d=new Date(e+400,t,s,r,a,n,i),isFinite(d.getFullYear())&&d.setFullYear(e)):d=new Date(e,t,s,r,a,n,i),d}function ke(e){var t,s;return e<100&&e>=0?(s=Array.prototype.slice.call(arguments),s[0]=e+400,t=new Date(Date.UTC.apply(null,s)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ne(e,t,s){var r=7+t-s,a=(7+ke(e,0,r).getUTCDay()-t)%7;return-a+r-1}function $t(e,t,s,r,a){var n=(7+s-r)%7,i=Ne(e,r,a),d=1+7*(t-1)+n+i,c,k;return d<=0?(c=e-1,k=we(c)+d):d>we(e)?(c=e+1,k=d-we(e)):(c=e,k=d),{year:c,dayOfYear:k}}function Me(e,t,s){var r=Ne(e.year(),t,s),a=Math.floor((e.dayOfYear()-r-1)/7)+1,n,i;return a<1?(i=e.year()-1,n=a+B(i,t,s)):a>B(e.year(),t,s)?(n=a-B(e.year(),t,s),i=e.year()+1):(i=e.year(),n=a),{week:n,year:i}}function B(e,t,s){var r=Ne(e,t,s),a=Ne(e+1,t,s);return(we(e)-r+a)/7}h("w",["ww",2],"wo","week");h("W",["WW",2],"Wo","isoWeek");O("week","w");O("isoWeek","W");T("week",5);T("isoWeek",5);u("w",D);u("ww",D,P);u("W",D);u("WW",D,P);ve(["w","ww","W","WW"],function(e,t,s,r){t[r.substr(0,1)]=_(e)});function or(e){return Me(e,this._week.dow,this._week.doy).week}var lr={dow:0,doy:6};function ur(){return this._week.dow}function dr(){return this._week.doy}function hr(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function fr(e){var t=Me(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}h("d",0,"do","day");h("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});h("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});h("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});h("e",0,0,"weekday");h("E",0,0,"isoWeekday");O("day","d");O("weekday","e");O("isoWeekday","E");T("day",11);T("weekday",11);T("isoWeekday",11);u("d",D);u("e",D);u("E",D);u("dd",function(e,t){return t.weekdaysMinRegex(e)});u("ddd",function(e,t){return t.weekdaysShortRegex(e)});u("dddd",function(e,t){return t.weekdaysRegex(e)});ve(["dd","ddd","dddd"],function(e,t,s,r){var a=s._locale.weekdaysParse(e,r,s._strict);a!=null?t.d=a:f(s).invalidWeekday=e});ve(["d","e","E"],function(e,t,s,r){t[r]=_(e)});function cr(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function _r(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function ct(e,t){return e.slice(t,7).concat(e.slice(0,t))}var mr="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Bt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),yr="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),wr=ge,kr=ge,Mr=ge;function Sr(e,t){var s=I(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?ct(s,this._week.dow):e?s[e.day()]:s}function Dr(e){return e===!0?ct(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Yr(e){return e===!0?ct(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function gr(e,t,s){var r,a,n,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)n=A([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(n,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(n,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(n,"").toLocaleLowerCase();return s?t==="dddd"?(a=g.call(this._weekdaysParse,i),a!==-1?a:null):t==="ddd"?(a=g.call(this._shortWeekdaysParse,i),a!==-1?a:null):(a=g.call(this._minWeekdaysParse,i),a!==-1?a:null):t==="dddd"?(a=g.call(this._weekdaysParse,i),a!==-1||(a=g.call(this._shortWeekdaysParse,i),a!==-1)?a:(a=g.call(this._minWeekdaysParse,i),a!==-1?a:null)):t==="ddd"?(a=g.call(this._shortWeekdaysParse,i),a!==-1||(a=g.call(this._weekdaysParse,i),a!==-1)?a:(a=g.call(this._minWeekdaysParse,i),a!==-1?a:null)):(a=g.call(this._minWeekdaysParse,i),a!==-1||(a=g.call(this._weekdaysParse,i),a!==-1)?a:(a=g.call(this._shortWeekdaysParse,i),a!==-1?a:null))}function vr(e,t,s){var r,a,n;if(this._weekdaysParseExact)return gr.call(this,e,t,s);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(a=A([2e3,1]).day(r),s&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(n="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(n.replace(".",""),"i")),s&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(s&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(s&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!s&&this._weekdaysParse[r].test(e))return r}}function pr(e){if(!this.isValid())return e!=null?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return e!=null?(e=cr(e,this.localeData()),this.add(e-t,"d")):t}function Or(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function Tr(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=_r(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function xr(e){return this._weekdaysParseExact?(y(this,"_weekdaysRegex")||_t.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(y(this,"_weekdaysRegex")||(this._weekdaysRegex=wr),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function br(e){return this._weekdaysParseExact?(y(this,"_weekdaysRegex")||_t.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(y(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=kr),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Wr(e){return this._weekdaysParseExact?(y(this,"_weekdaysRegex")||_t.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(y(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Mr),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function _t(){function e(x,G){return G.length-x.length}var t=[],s=[],r=[],a=[],n,i,d,c,k;for(n=0;n<7;n++)i=A([2e3,1]).day(n),d=W(this.weekdaysMin(i,"")),c=W(this.weekdaysShort(i,"")),k=W(this.weekdays(i,"")),t.push(d),s.push(c),r.push(k),a.push(d),a.push(c),a.push(k);t.sort(e),s.sort(e),r.sort(e),a.sort(e),this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function mt(){return this.hours()%12||12}function Pr(){return this.hours()||24}h("H",["HH",2],0,"hour");h("h",["hh",2],0,mt);h("k",["kk",2],0,Pr);h("hmm",0,0,function(){return""+mt.apply(this)+E(this.minutes(),2)});h("hmmss",0,0,function(){return""+mt.apply(this)+E(this.minutes(),2)+E(this.seconds(),2)});h("Hmm",0,0,function(){return""+this.hours()+E(this.minutes(),2)});h("Hmmss",0,0,function(){return""+this.hours()+E(this.minutes(),2)+E(this.seconds(),2)});function qt(e,t){h(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}qt("a",!0);qt("A",!1);O("hour","h");T("hour",13);function Jt(e,t){return t._meridiemParse}u("a",Jt);u("A",Jt);u("H",D);u("h",D);u("k",D);u("HH",D,P);u("hh",D,P);u("kk",D,P);u("hmm",Ht);u("hmmss",Et);u("Hmm",Ht);u("Hmmss",Et);M(["H","HH"],v);M(["k","kk"],function(e,t,s){var r=_(e);t[v]=r===24?0:r});M(["a","A"],function(e,t,s){s._isPm=s._locale.isPM(e),s._meridiem=e});M(["h","hh"],function(e,t,s){t[v]=_(e),f(s).bigHour=!0});M("hmm",function(e,t,s){var r=e.length-2;t[v]=_(e.substr(0,r)),t[L]=_(e.substr(r)),f(s).bigHour=!0});M("hmmss",function(e,t,s){var r=e.length-4,a=e.length-2;t[v]=_(e.substr(0,r)),t[L]=_(e.substr(r,2)),t[$]=_(e.substr(a)),f(s).bigHour=!0});M("Hmm",function(e,t,s){var r=e.length-2;t[v]=_(e.substr(0,r)),t[L]=_(e.substr(r))});M("Hmmss",function(e,t,s){var r=e.length-4,a=e.length-2;t[v]=_(e.substr(0,r)),t[L]=_(e.substr(r,2)),t[$]=_(e.substr(a))});function Nr(e){return(e+"").toLowerCase().charAt(0)==="p"}var Rr=/[ap]\.?m?\.?/i,Fr=fe("Hours",!0);function Lr(e,t,s){return e>11?s?"pm":"PM":s?"am":"AM"}var Qt={calendar:vs,longDateFormat:xs,invalidDate:Ws,ordinal:Ns,dayOfMonthOrdinalParse:Rs,relativeTime:Ls,months:qs,monthsShort:At,week:lr,weekdays:mr,weekdaysMin:yr,weekdaysShort:Bt,meridiemParse:Rr},Y={},_e={},Se;function Ir(e,t){var s,r=Math.min(e.length,t.length);for(s=0;s0;){if(a=je(n.slice(0,s).join("-")),a)return a;if(r&&r.length>=s&&Ir(n,r)>=s-1)break;s--}t++}return Se}function Ur(e){return e.match("^[^/\\\\]*$")!=null}function je(e){var t=null,s;if(Y[e]===void 0&&typeof module<"u"&&module&&module.exports&&Ur(e))try{t=Se._abbr,s=require,s("./locale/"+e),te(t)}catch{Y[e]=null}return Y[e]}function te(e,t){var s;return e&&(b(t)?s=J(e):s=yt(e,t),s?Se=s:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Se._abbr}function yt(e,t){if(t!==null){var s,r=Qt;if(t.abbr=e,Y[e]!=null)Rt("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Y[e]._config;else if(t.parentLocale!=null)if(Y[t.parentLocale]!=null)r=Y[t.parentLocale]._config;else if(s=je(t.parentLocale),s!=null)r=s._config;else return _e[t.parentLocale]||(_e[t.parentLocale]=[]),_e[t.parentLocale].push({name:e,config:t}),null;return Y[e]=new lt(Ke(r,t)),_e[e]&&_e[e].forEach(function(a){yt(a.name,a.config)}),te(e),Y[e]}else return delete Y[e],null}function Hr(e,t){if(t!=null){var s,r,a=Qt;Y[e]!=null&&Y[e].parentLocale!=null?Y[e].set(Ke(Y[e]._config,t)):(r=je(e),r!=null&&(a=r._config),t=Ke(a,t),r==null&&(t.abbr=e),s=new lt(t),s.parentLocale=Y[e],Y[e]=s),te(e)}else Y[e]!=null&&(Y[e].parentLocale!=null?(Y[e]=Y[e].parentLocale,e===te()&&te(e)):Y[e]!=null&&delete Y[e]);return Y[e]}function J(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Se;if(!I(e)){if(t=je(e),t)return t;e=[e]}return Cr(e)}function Er(){return et(Y)}function wt(e){var t,s=e._a;return s&&f(e).overflow===-2&&(t=s[Z]<0||s[Z]>11?Z:s[H]<1||s[H]>Ge(s[p],s[Z])?H:s[v]<0||s[v]>24||s[v]===24&&(s[L]!==0||s[$]!==0||s[re]!==0)?v:s[L]<0||s[L]>59?L:s[$]<0||s[$]>59?$:s[re]<0||s[re]>999?re:-1,f(e)._overflowDayOfYear&&(tH)&&(t=H),f(e)._overflowWeeks&&t===-1&&(t=Zs),f(e)._overflowWeekday&&t===-1&&(t=$s),f(e).overflow=t),e}var Ar=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Vr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Gr=/Z|[+-]\d\d(?::?\d\d)?/,Oe=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Je=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],jr=/^\/?Date\((-?\d+)/i,zr=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Zr={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Xt(e){var t,s,r=e._i,a=Ar.exec(r)||Vr.exec(r),n,i,d,c,k=Oe.length,x=Je.length;if(a){for(f(e).iso=!0,t=0,s=k;twe(i)||e._dayOfYear===0)&&(f(e)._overflowDayOfYear=!0),s=ke(i,0,e._dayOfYear),e._a[Z]=s.getUTCMonth(),e._a[H]=s.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=a[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[v]===24&&e._a[L]===0&&e._a[$]===0&&e._a[re]===0&&(e._nextDay=!0,e._a[v]=0),e._d=(e._useUTC?ke:ir).apply(null,r),n=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[v]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==n&&(f(e).weekdayMismatch=!0)}}function ea(e){var t,s,r,a,n,i,d,c,k;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(n=1,i=4,s=oe(t.GG,e._a[p],Me(S(),1,4).year),r=oe(t.W,1),a=oe(t.E,1),(a<1||a>7)&&(c=!0)):(n=e._locale._week.dow,i=e._locale._week.doy,k=Me(S(),n,i),s=oe(t.gg,e._a[p],k.year),r=oe(t.w,k.week),t.d!=null?(a=t.d,(a<0||a>6)&&(c=!0)):t.e!=null?(a=t.e+n,(t.e<0||t.e>6)&&(c=!0)):a=n),r<1||r>B(s,n,i)?f(e)._overflowWeeks=!0:c!=null?f(e)._overflowWeekday=!0:(d=$t(s,r,a,n,i),e._a[p]=d.year,e._dayOfYear=d.dayOfYear)}l.ISO_8601=function(){};l.RFC_2822=function(){};function Mt(e){if(e._f===l.ISO_8601){Xt(e);return}if(e._f===l.RFC_2822){Kt(e);return}e._a=[],f(e).empty=!0;var t=""+e._i,s,r,a,n,i,d=t.length,c=0,k,x;for(a=Ft(e._f,e._locale).match(ut)||[],x=a.length,s=0;s0&&f(e).unusedInput.push(i),t=t.slice(t.indexOf(r)+r.length),c+=r.length),ue[n]?(r?f(e).empty=!1:f(e).unusedTokens.push(n),zs(n,r,e)):e._strict&&!r&&f(e).unusedTokens.push(n);f(e).charsLeftOver=d-c,t.length>0&&f(e).unusedInput.push(t),e._a[v]<=12&&f(e).bigHour===!0&&e._a[v]>0&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[v]=ta(e._locale,e._a[v],e._meridiem),k=f(e).era,k!==null&&(e._a[p]=e._locale.erasConvertYear(k,e._a[p])),kt(e),wt(e)}function ta(e,t,s){var r;return s==null?t:e.meridiemHour!=null?e.meridiemHour(t,s):(e.isPM!=null&&(r=e.isPM(s),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function sa(e){var t,s,r,a,n,i,d=!1,c=e._f.length;if(c===0){f(e).invalidFormat=!0,e._d=new Date(NaN);return}for(a=0;athis?this:e:Ie()});function ss(e,t){var s,r;if(t.length===1&&I(t[0])&&(t=t[0]),!t.length)return S();for(s=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ga(){if(!b(this._isDSTShifted))return this._isDSTShifted;var e={},t;return ot(e,this),e=es(e),e._a?(t=e._isUTC?A(e._a):S(e._a),this._isDSTShifted=this.isValid()&&_a(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function va(){return this.isValid()?!this._isUTC:!1}function pa(){return this.isValid()?this._isUTC:!1}function as(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Oa=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ta=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function U(e,t){var s=e,r=null,a,n,i;return xe(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:q(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(r=Oa.exec(e))?(a=r[1]==="-"?-1:1,s={y:0,d:_(r[H])*a,h:_(r[v])*a,m:_(r[L])*a,s:_(r[$])*a,ms:_(st(r[re]*1e3))*a}):(r=Ta.exec(e))?(a=r[1]==="-"?-1:1,s={y:se(r[2],a),M:se(r[3],a),w:se(r[4],a),d:se(r[5],a),h:se(r[6],a),m:se(r[7],a),s:se(r[8],a)}):s==null?s={}:typeof s=="object"&&("from"in s||"to"in s)&&(i=xa(S(s.from),S(s.to)),s={},s.ms=i.milliseconds,s.M=i.months),n=new ze(s),xe(e)&&y(e,"_locale")&&(n._locale=e._locale),xe(e)&&y(e,"_isValid")&&(n._isValid=e._isValid),n}U.fn=ze.prototype;U.invalid=ca;function se(e,t){var s=e&&parseFloat(e.replace(",","."));return(isNaN(s)?0:s)*t}function xt(e,t){var s={};return s.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(s.months,"M").isAfter(t)&&--s.months,s.milliseconds=+t-+e.clone().add(s.months,"M"),s}function xa(e,t){var s;return e.isValid()&&t.isValid()?(t=Dt(t,e),e.isBefore(t)?s=xt(e,t):(s=xt(t,e),s.milliseconds=-s.milliseconds,s.months=-s.months),s):{milliseconds:0,months:0}}function ns(e,t){return function(s,r){var a,n;return r!==null&&!isNaN(+r)&&(Rt(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=s,s=r,r=n),a=U(s,r),is(this,a,e),this}}function is(e,t,s,r){var a=t._milliseconds,n=st(t._days),i=st(t._months);e.isValid()&&(r=r??!0,i&&Gt(e,We(e,"Month")+i*s),n&&It(e,"Date",We(e,"Date")+n*s),a&&e._d.setTime(e._d.valueOf()+a*s),r&&l.updateOffset(e,n||i))}var ba=ns(1,"add"),Wa=ns(-1,"subtract");function os(e){return typeof e=="string"||e instanceof String}function Pa(e){return C(e)||De(e)||os(e)||q(e)||Ra(e)||Na(e)||e===null||e===void 0}function Na(e){var t=ae(e)&&!nt(e),s=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a,n,i=r.length;for(a=0;as.valueOf():s.valueOf()9999?Te(s,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):V(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Te(s,"Z")):Te(s,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function $a(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",s,r,a,n;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),s="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",n=t+'[")]',this.format(s+r+a+n)}function Ba(e){e||(e=this.isUtc()?l.defaultFormatUtc:l.defaultFormat);var t=Te(this,e);return this.localeData().postformat(t)}function qa(e,t){return this.isValid()&&(C(e)&&e.isValid()||S(e).isValid())?U({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Ja(e){return this.from(S(),e)}function Qa(e,t){return this.isValid()&&(C(e)&&e.isValid()||S(e).isValid())?U({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Xa(e){return this.to(S(),e)}function ls(e){var t;return e===void 0?this._locale._abbr:(t=J(e),t!=null&&(this._locale=t),this)}var us=R("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function ds(){return this._locale}var Re=1e3,de=60*Re,Fe=60*de,hs=(365*400+97)*24*Fe;function he(e,t){return(e%t+t)%t}function fs(e,t,s){return e<100&&e>=0?new Date(e+400,t,s)-hs:new Date(e,t,s).valueOf()}function cs(e,t,s){return e<100&&e>=0?Date.UTC(e+400,t,s)-hs:Date.UTC(e,t,s)}function Ka(e){var t,s;if(e=F(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(s=this._isUTC?cs:fs,e){case"year":t=s(this.year(),0,1);break;case"quarter":t=s(this.year(),this.month()-this.month()%3,1);break;case"month":t=s(this.year(),this.month(),1);break;case"week":t=s(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=s(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=he(t+(this._isUTC?0:this.utcOffset()*de),Fe);break;case"minute":t=this._d.valueOf(),t-=he(t,de);break;case"second":t=this._d.valueOf(),t-=he(t,Re);break}return this._d.setTime(t),l.updateOffset(this,!0),this}function en(e){var t,s;if(e=F(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(s=this._isUTC?cs:fs,e){case"year":t=s(this.year()+1,0,1)-1;break;case"quarter":t=s(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=s(this.year(),this.month()+1,1)-1;break;case"week":t=s(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=s(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Fe-he(t+(this._isUTC?0:this.utcOffset()*de),Fe)-1;break;case"minute":t=this._d.valueOf(),t+=de-he(t,de)-1;break;case"second":t=this._d.valueOf(),t+=Re-he(t,Re)-1;break}return this._d.setTime(t),l.updateOffset(this,!0),this}function tn(){return this._d.valueOf()-(this._offset||0)*6e4}function sn(){return Math.floor(this.valueOf()/1e3)}function rn(){return new Date(this.valueOf())}function an(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function nn(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function on(){return this.isValid()?this.toISOString():null}function ln(){return it(this)}function un(){return K({},f(this))}function dn(){return f(this).overflow}function hn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}h("N",0,0,"eraAbbr");h("NN",0,0,"eraAbbr");h("NNN",0,0,"eraAbbr");h("NNNN",0,0,"eraName");h("NNNNN",0,0,"eraNarrow");h("y",["y",1],"yo","eraYear");h("y",["yy",2],0,"eraYear");h("y",["yyy",3],0,"eraYear");h("y",["yyyy",4],0,"eraYear");u("N",Yt);u("NN",Yt);u("NNN",Yt);u("NNNN",Yn);u("NNNNN",gn);M(["N","NN","NNN","NNNN","NNNNN"],function(e,t,s,r){var a=s._locale.erasParse(e,r,s._strict);a?f(s).era=a:f(s).invalidEra=e});u("y",ce);u("yy",ce);u("yyy",ce);u("yyyy",ce);u("yo",vn);M(["y","yy","yyy","yyyy"],p);M(["yo"],function(e,t,s,r){var a;s._locale._eraYearOrdinalRegex&&(a=e.match(s._locale._eraYearOrdinalRegex)),s._locale.eraYearOrdinalParse?t[p]=s._locale.eraYearOrdinalParse(e,a):t[p]=parseInt(e,10)});function fn(e,t){var s,r,a,n=this._eras||J("en")._eras;for(s=0,r=n.length;s=0)return n[r]}function _n(e,t){var s=e.since<=e.until?1:-1;return t===void 0?l(e.since).year():l(e.since).year()+(t-e.offset)*s}function mn(){var e,t,s,r=this.localeData().eras();for(e=0,t=r.length;en&&(t=n),Pn.call(this,e,t,s,r,a))}function Pn(e,t,s,r,a){var n=$t(e,t,s,r,a),i=ke(n.year,0,n.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}h("Q",0,"Qo","quarter");O("quarter","Q");T("quarter",7);u("Q",Ct);M("Q",function(e,t){t[Z]=(_(e)-1)*3});function Nn(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}h("D",["DD",2],"Do","date");O("date","D");T("date",9);u("D",D);u("DD",D,P);u("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});M(["D","DD"],H);M("Do",function(e,t){t[H]=_(e.match(D)[0])});var ms=fe("Date",!0);h("DDD",["DDDD",3],"DDDo","dayOfYear");O("dayOfYear","DDD");T("dayOfYear",4);u("DDD",He);u("DDDD",Ut);M(["DDD","DDDD"],function(e,t,s){s._dayOfYear=_(e)});function Rn(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}h("m",["mm",2],0,"minute");O("minute","m");T("minute",14);u("m",D);u("mm",D,P);M(["m","mm"],L);var Fn=fe("Minutes",!1);h("s",["ss",2],0,"second");O("second","s");T("second",15);u("s",D);u("ss",D,P);M(["s","ss"],$);var Ln=fe("Seconds",!1);h("S",0,0,function(){return~~(this.millisecond()/100)});h(0,["SS",2],0,function(){return~~(this.millisecond()/10)});h(0,["SSS",3],0,"millisecond");h(0,["SSSS",4],0,function(){return this.millisecond()*10});h(0,["SSSSS",5],0,function(){return this.millisecond()*100});h(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});h(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});h(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});h(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});O("millisecond","ms");T("millisecond",16);u("S",He,Ct);u("SS",He,P);u("SSS",He,Ut);var ee,ys;for(ee="SSSS";ee.length<=9;ee+="S")u(ee,ce);function In(e,t){t[re]=_(("0."+e)*1e3)}for(ee="S";ee.length<=9;ee+="S")M(ee,In);ys=fe("Milliseconds",!1);h("z",0,0,"zoneAbbr");h("zz",0,0,"zoneName");function Cn(){return this._isUTC?"UTC":""}function Un(){return this._isUTC?"Coordinated Universal Time":""}var o=Ye.prototype;o.add=ba;o.calendar=Ia;o.clone=Ca;o.diff=ja;o.endOf=en;o.format=Ba;o.from=qa;o.fromNow=Ja;o.to=Qa;o.toNow=Xa;o.get=Hs;o.invalidAt=dn;o.isAfter=Ua;o.isBefore=Ha;o.isBetween=Ea;o.isSame=Aa;o.isSameOrAfter=Va;o.isSameOrBefore=Ga;o.isValid=ln;o.lang=us;o.locale=ls;o.localeData=ds;o.max=oa;o.min=ia;o.parsingFlags=un;o.set=Es;o.startOf=Ka;o.subtract=Wa;o.toArray=an;o.toObject=nn;o.toDate=rn;o.toISOString=Za;o.inspect=$a;typeof Symbol<"u"&&Symbol.for!=null&&(o[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});o.toJSON=on;o.toString=za;o.unix=sn;o.valueOf=tn;o.creationData=hn;o.eraName=mn;o.eraNarrow=yn;o.eraAbbr=wn;o.eraYear=kn;o.year=Zt;o.isLeapYear=nr;o.weekYear=pn;o.isoWeekYear=On;o.quarter=o.quarters=Nn;o.month=jt;o.daysInMonth=sr;o.week=o.weeks=hr;o.isoWeek=o.isoWeeks=fr;o.weeksInYear=bn;o.weeksInWeekYear=Wn;o.isoWeeksInYear=Tn;o.isoWeeksInISOWeekYear=xn;o.date=ms;o.day=o.days=pr;o.weekday=Or;o.isoWeekday=Tr;o.dayOfYear=Rn;o.hour=o.hours=Fr;o.minute=o.minutes=Fn;o.second=o.seconds=Ln;o.millisecond=o.milliseconds=ys;o.utcOffset=ya;o.utc=ka;o.local=Ma;o.parseZone=Sa;o.hasAlignedHourOffset=Da;o.isDST=Ya;o.isLocal=va;o.isUtcOffset=pa;o.isUtc=as;o.isUTC=as;o.zoneAbbr=Cn;o.zoneName=Un;o.dates=R("dates accessor is deprecated. Use date instead.",ms);o.months=R("months accessor is deprecated. Use month instead",jt);o.years=R("years accessor is deprecated. Use year instead",Zt);o.zone=R("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",wa);o.isDSTShifted=R("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ga);function Hn(e){return S(e*1e3)}function En(){return S.apply(null,arguments).parseZone()}function ws(e){return e}var w=lt.prototype;w.calendar=ps;w.longDateFormat=bs;w.invalidDate=Ps;w.ordinal=Fs;w.preparse=ws;w.postformat=ws;w.relativeTime=Is;w.pastFuture=Cs;w.set=gs;w.eras=fn;w.erasParse=cn;w.erasConvertYear=_n;w.erasAbbrRegex=Sn;w.erasNameRegex=Mn;w.erasNarrowRegex=Dn;w.months=Xs;w.monthsShort=Ks;w.monthsParse=tr;w.monthsRegex=ar;w.monthsShortRegex=rr;w.week=or;w.firstDayOfYear=dr;w.firstDayOfWeek=ur;w.weekdays=Sr;w.weekdaysMin=Yr;w.weekdaysShort=Dr;w.weekdaysParse=vr;w.weekdaysRegex=xr;w.weekdaysShortRegex=br;w.weekdaysMinRegex=Wr;w.isPM=Nr;w.meridiem=Lr;function Le(e,t,s,r){var a=J(),n=A().set(r,t);return a[s](n,e)}function ks(e,t,s){if(q(e)&&(t=e,e=void 0),e=e||"",t!=null)return Le(e,t,s,"month");var r,a=[];for(r=0;r<12;r++)a[r]=Le(e,r,s,"month");return a}function vt(e,t,s,r){typeof e=="boolean"?(q(t)&&(s=t,t=void 0),t=t||""):(t=e,s=t,e=!1,q(t)&&(s=t,t=void 0),t=t||"");var a=J(),n=e?a._week.dow:0,i,d=[];if(s!=null)return Le(t,(s+n)%7,r,"day");for(i=0;i<7;i++)d[i]=Le(t,(i+n)%7,r,"day");return d}function An(e,t){return ks(e,t,"months")}function Vn(e,t){return ks(e,t,"monthsShort")}function Gn(e,t,s){return vt(e,t,s,"weekdays")}function jn(e,t,s){return vt(e,t,s,"weekdaysShort")}function zn(e,t,s){return vt(e,t,s,"weekdaysMin")}te("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,s=_(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+s}});l.lang=R("moment.lang is deprecated. Use moment.locale instead.",te);l.langData=R("moment.langData is deprecated. Use moment.localeData instead.",J);var j=Math.abs;function Zn(){var e=this._data;return this._milliseconds=j(this._milliseconds),this._days=j(this._days),this._months=j(this._months),e.milliseconds=j(e.milliseconds),e.seconds=j(e.seconds),e.minutes=j(e.minutes),e.hours=j(e.hours),e.months=j(e.months),e.years=j(e.years),this}function Ms(e,t,s,r){var a=U(t,s);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function $n(e,t){return Ms(this,e,t,1)}function Bn(e,t){return Ms(this,e,t,-1)}function bt(e){return e<0?Math.floor(e):Math.ceil(e)}function qn(){var e=this._milliseconds,t=this._days,s=this._months,r=this._data,a,n,i,d,c;return e>=0&&t>=0&&s>=0||e<=0&&t<=0&&s<=0||(e+=bt(at(s)+t)*864e5,t=0,s=0),r.milliseconds=e%1e3,a=N(e/1e3),r.seconds=a%60,n=N(a/60),r.minutes=n%60,i=N(n/60),r.hours=i%24,t+=N(i/24),c=N(Ss(t)),s+=c,t-=bt(at(c)),d=N(s/12),s%=12,r.days=t,r.months=s,r.years=d,this}function Ss(e){return e*4800/146097}function at(e){return e*146097/4800}function Jn(e){if(!this.isValid())return NaN;var t,s,r=this._milliseconds;if(e=F(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,s=this._months+Ss(t),e){case"month":return s;case"quarter":return s/3;case"year":return s/12}else switch(t=this._days+Math.round(at(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function Qn(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+_(this._months/12)*31536e6:NaN}function Q(e){return function(){return this.as(e)}}var Xn=Q("ms"),Kn=Q("s"),ei=Q("m"),ti=Q("h"),si=Q("d"),ri=Q("w"),ai=Q("M"),ni=Q("Q"),ii=Q("y");function oi(){return U(this)}function li(e){return e=F(e),this.isValid()?this[e+"s"]():NaN}function ne(e){return function(){return this.isValid()?this._data[e]:NaN}}var ui=ne("milliseconds"),di=ne("seconds"),hi=ne("minutes"),fi=ne("hours"),ci=ne("days"),_i=ne("months"),mi=ne("years");function yi(){return N(this.days()/7)}var z=Math.round,le={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function wi(e,t,s,r,a){return a.relativeTime(t||1,!!s,e,r)}function ki(e,t,s,r){var a=U(e).abs(),n=z(a.as("s")),i=z(a.as("m")),d=z(a.as("h")),c=z(a.as("d")),k=z(a.as("M")),x=z(a.as("w")),G=z(a.as("y")),X=n<=s.ss&&["s",n]||n0,X[4]=r,wi.apply(null,X)}function Mi(e){return e===void 0?z:typeof e=="function"?(z=e,!0):!1}function Si(e,t){return le[e]===void 0?!1:t===void 0?le[e]:(le[e]=t,e==="s"&&(le.ss=t-1),!0)}function Di(e,t){if(!this.isValid())return this.localeData().invalidDate();var s=!1,r=le,a,n;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(s=e),typeof t=="object"&&(r=Object.assign({},le,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),a=this.localeData(),n=ki(this,!s,r,a),s&&(n=a.pastFuture(+this,n)),a.postformat(n)}var Qe=Math.abs;function ie(e){return(e>0)-(e<0)||+e}function $e(){if(!this.isValid())return this.localeData().invalidDate();var e=Qe(this._milliseconds)/1e3,t=Qe(this._days),s=Qe(this._months),r,a,n,i,d=this.asSeconds(),c,k,x,G;return d?(r=N(e/60),a=N(r/60),e%=60,r%=60,n=N(s/12),s%=12,i=e?e.toFixed(3).replace(/\.?0+$/,""):"",c=d<0?"-":"",k=ie(this._months)!==ie(d)?"-":"",x=ie(this._days)!==ie(d)?"-":"",G=ie(this._milliseconds)!==ie(d)?"-":"",c+"P"+(n?k+n+"Y":"")+(s?k+s+"M":"")+(t?x+t+"D":"")+(a||r||e?"T":"")+(a?G+a+"H":"")+(r?G+r+"M":"")+(e?G+i+"S":"")):"P0D"}var m=ze.prototype;m.isValid=fa;m.abs=Zn;m.add=$n;m.subtract=Bn;m.as=Jn;m.asMilliseconds=Xn;m.asSeconds=Kn;m.asMinutes=ei;m.asHours=ti;m.asDays=si;m.asWeeks=ri;m.asMonths=ai;m.asQuarters=ni;m.asYears=ii;m.valueOf=Qn;m._bubble=qn;m.clone=oi;m.get=li;m.milliseconds=ui;m.seconds=di;m.minutes=hi;m.hours=fi;m.days=ci;m.weeks=yi;m.months=_i;m.years=mi;m.humanize=Di;m.toISOString=$e;m.toString=$e;m.toJSON=$e;m.locale=ls;m.localeData=ds;m.toIsoString=R("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$e);m.lang=us;h("X",0,0,"unix");h("x",0,0,"valueOf");u("x",Ae);u("X",Vs);M("X",function(e,t,s){s._d=new Date(parseFloat(e)*1e3)});M("x",function(e,t,s){s._d=new Date(_(e))});//! moment.js +l.version="2.29.4";Ds(S);l.fn=o;l.min=la;l.max=ua;l.now=da;l.utc=A;l.unix=Hn;l.months=An;l.isDate=De;l.locale=te;l.invalid=Ie;l.duration=U;l.isMoment=C;l.weekdays=Gn;l.parseZone=En;l.localeData=J;l.isDuration=xe;l.monthsShort=Vn;l.weekdaysMin=zn;l.defineLocale=yt;l.updateLocale=Hr;l.locales=Er;l.weekdaysShort=jn;l.normalizeUnits=F;l.relativeTimeRounding=Mi;l.relativeTimeThreshold=Si;l.calendarFormat=La;l.prototype=o;l.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};//! moment.js locale configuration +//! locale : Chinese (China) [zh-cn] +//! author : suupic : https://github.com/suupic +//! author : Zeno Zeng : https://github.com/zenozeng +//! author : uu109 : https://github.com/uu109 +l.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return e===12&&(e=0),t==="凌晨"||t==="早上"||t==="上午"?e:t==="下午"||t==="晚上"?e+12:e>=11?e:e+12},meridiem:function(e,t,s){var r=e*100+t;return r<600?"凌晨":r<900?"早上":r<1130?"上午":r<1230?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}});export{l as h}; diff --git a/web/dist/assets/naive-ui-62663ad7.js b/web/dist/assets/naive-ui-62663ad7.js new file mode 100644 index 00000000..837b14c1 --- /dev/null +++ b/web/dist/assets/naive-ui-62663ad7.js @@ -0,0 +1,3674 @@ +import{r as ir,s as Je,c as $e,g as Qt,d as Mo,a as Ko,h as pt,b as J,e as it,f as Qs,p as _o,i as qt,j as Ai}from"./seemly-76b7b838.js";import{e as nn,F as ao,C as Ei,f as Js,v as Go,d as q,i as Se,g as Pr,w as Ke,h as wo,r as D,j as mo,k as lr,l as ed,m as ji,p as Oe,n as R,q as oo,s as i,T as no,t as fn,u as le,x as ko,y as io,z as Lo,A as Jt,B as od,D as Wn,E as Wi,G as Nr,H as Vr,I as td,J as rd,K as Ni}from"./@vue-e0e89260.js";import{r as Nn,V as vt,a as nd,b as kr,F as hn,c as Ir,d as Br,e as Vn,L as pn,f as id}from"./vueuc-59ca65c3.js";import{u as We,i as Ct,a as ld,b as so,c as gt,d as ad,e as Vi,f as Ui,g as sd,o as dd}from"./vooks-a50491fd.js";import{m as Tt,u as cd,a as ud,r as fd,g as Ki,k as hd,t as Ur}from"./lodash-es-8412e618.js";import{m as zr}from"./@emotion-8a8e73f6.js";import{c as Ft,m as pd,z as Tr}from"./vdirs-b0483831.js";import{c as vd,a as ar}from"./treemate-25c27bff.js";import{S as gd}from"./async-validator-dee29e8b.js";import{o as Do,a as Ro}from"./evtd-b614532e.js";import{p as md,u as Fr}from"./@css-render-580d83ec.js";import{d as bd}from"./date-fns-975a2d8f.js";import{C as xd,e as Cd}from"./css-render-6a5c5852.js";function vn(e,o="default",t=[]){const n=e.$slots[o];return n===void 0?t:n()}function go(e,o=[],t){const r={};return o.forEach(n=>{r[n]=e[n]}),Object.assign(r,t)}function _t(e,o=[],t){const r={};return Object.getOwnPropertyNames(e).forEach(l=>{o.includes(l)||(r[l]=e[l])}),Object.assign(r,t)}function tt(e,o=!0,t=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&t.push(nn(String(r)));return}if(Array.isArray(r)){tt(r,o,t);return}if(r.type===ao){if(r.children===null)return;Array.isArray(r.children)&&tt(r.children,o,t)}else r.type!==Ei&&t.push(r)}}),t}function ae(e,...o){if(Array.isArray(e))e.forEach(t=>ae(t,...o));else return e(...o)}function yo(e){return Object.keys(e)}const qe=(e,...o)=>typeof e=="function"?e(...o):typeof e=="string"?nn(e):typeof e=="number"?nn(String(e)):null;function qo(e,o){console.error(`[naive/${e}]: ${o}`)}function Eo(e,o){throw new Error(`[naive/${e}]: ${o}`)}function Un(e){switch(e){case"tiny":return"mini";case"small":return"tiny";case"medium":return"small";case"large":return"medium";case"huge":return"large"}throw Error(`${e} has no smaller size.`)}function Gi(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function ln(e,o="default",t=void 0){const r=e[o];if(!r)return qo("getFirstSlotVNode",`slot[${o}] is empty`),null;const n=tt(r(t));return n.length===1?n[0]:(qo("getFirstSlotVNode",`slot[${o}] should have exactly one child`),null)}function qi(e){return o=>{o?e.value=o.$el:e.value=null}}function sr(e){return e.some(o=>Js(o)?!(o.type===Ei||o.type===ao&&!sr(o.children)):!0)?e:null}function lo(e,o){return e&&sr(e())||o()}function an(e,o,t){return e&&sr(e(o))||t(o)}function Ee(e,o){const t=e&&sr(e());return o(t||null)}function ht(e){return!(e&&sr(e()))}function Zt(e){const o=e.filter(t=>t!==void 0);if(o.length!==0)return o.length===1?o[0]:t=>{e.forEach(r=>{r&&r(t)})}}function yd(e){var o;const t=(o=e.dirs)===null||o===void 0?void 0:o.find(({dir:r})=>r===Go);return!!(t&&t.value===!1)}const sn=q({render(){var e,o;return(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e)}}),wd=/^(\d|\.)+$/,Kn=/(\d|\.)+/;function eo(e,{c:o=1,offset:t=0,attachPx:r=!0}={}){if(typeof e=="number"){const n=(e+t)*o;return n===0?"0":`${n}px`}else if(typeof e=="string")if(wd.test(e)){const n=(Number(e)+t)*o;return r?n===0?"0":`${n}px`:`${n}`}else{const n=Kn.exec(e);return n?e.replace(Kn,String((Number(n[0])+t)*o)):e}return e}function Ot(e){return e.replace(/#|\(|\)|,|\s/g,"_")}function W(e,o){return e+(o==="default"?"":o.replace(/^[a-z]/,t=>t.toUpperCase()))}W("abc","def");const Sd="n",er=`.${Sd}-`,zd="__",$d="--",Yi=xd(),Xi=md({blockPrefix:er,elementPrefix:zd,modifierPrefix:$d});Yi.use(Xi);const{c:C,find:u1}=Yi,{cB:g,cE:y,cM:P,cNotM:je}=Xi;function Or(e){return C(({props:{bPrefix:o}})=>`${o||er}modal, ${o||er}drawer`,[e])}function gn(e){return C(({props:{bPrefix:o}})=>`${o||er}popover`,[e])}function Zi(e){return C(({props:{bPrefix:o}})=>`&${o||er}modal`,e)}const Rd=(...e)=>C(">",[g(...e)]);let Kr;function Pd(){return Kr===void 0&&(Kr=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Kr}const jo=typeof document<"u"&&typeof window<"u",Qi=new WeakSet;function kd(e){Qi.add(e)}function Ji(e){return!Qi.has(e)}function Id(e,o,t){var r;const n=Se(e,null);if(n===null)return;const l=(r=Pr())===null||r===void 0?void 0:r.proxy;Ke(t,a),a(t.value),wo(()=>{a(void 0,t.value)});function a(c,u){const f=n[o];u!==void 0&&s(f,u),c!==void 0&&d(f,c)}function s(c,u){c[u]||(c[u]=[]),c[u].splice(c[u].findIndex(f=>f===l),1)}function d(c,u){c[u]||(c[u]=[]),~c[u].findIndex(f=>f===l)||c[u].push(l)}}function Bd(e,o,t){if(!o)return e;const r=D(e.value);let n=null;return Ke(e,l=>{n!==null&&window.clearTimeout(n),l===!0?t&&!t.value?r.value=!0:n=window.setTimeout(()=>{r.value=!0},o):r.value=!1}),r}const mn="n-internal-select-menu",el="n-internal-select-menu-body",dr="n-modal-body",ol="n-modal",cr="n-drawer-body",bn="n-drawer",Dt="n-popover-body",tl="__disabled__";function Io(e){const o=Se(dr,null),t=Se(cr,null),r=Se(Dt,null),n=Se(el,null),l=D();if(typeof document<"u"){l.value=document.fullscreenElement;const a=()=>{l.value=document.fullscreenElement};mo(()=>{Do("fullscreenchange",document,a)}),wo(()=>{Ro("fullscreenchange",document,a)})}return We(()=>{var a;const{to:s}=e;return s!==void 0?s===!1?tl:s===!0?l.value||"body":s:o!=null&&o.value?(a=o.value.$el)!==null&&a!==void 0?a:o.value:t!=null&&t.value?t.value:r!=null&&r.value?r.value:n!=null&&n.value?n.value:s??(l.value||"body")})}Io.tdkey=tl;Io.propTo={type:[String,Object,Boolean],default:void 0};let Gn=!1;function rl(){if(jo&&window.CSS&&!Gn&&(Gn=!0,"registerProperty"in(window==null?void 0:window.CSS)))try{CSS.registerProperty({name:"--n-color-start",syntax:"",inherits:!1,initialValue:"#0000"}),CSS.registerProperty({name:"--n-color-end",syntax:"",inherits:!1,initialValue:"#0000"})}catch{}}function nl(e,o){o&&(mo(()=>{const{value:t}=e;t&&Nn.registerHandler(t,o)}),wo(()=>{const{value:t}=e;t&&Nn.unregisterHandler(t)}))}let Pt=0,qn="",Yn="",Xn="",Zn="";const Qn=D("0px");function il(e){if(typeof document>"u")return;const o=document.documentElement;let t,r=!1;const n=()=>{o.style.marginRight=qn,o.style.overflow=Yn,o.style.overflowX=Xn,o.style.overflowY=Zn,Qn.value="0px"};mo(()=>{t=Ke(e,l=>{if(l){if(!Pt){const a=window.innerWidth-o.offsetWidth;a>0&&(qn=o.style.marginRight,o.style.marginRight=`${a}px`,Qn.value=`${a}px`),Yn=o.style.overflow,Xn=o.style.overflowX,Zn=o.style.overflowY,o.style.overflow="hidden",o.style.overflowX="hidden",o.style.overflowY="hidden"}r=!0,Pt++}else Pt--,Pt||n(),r=!1},{immediate:!0})}),wo(()=>{t==null||t(),r&&(Pt--,Pt||n(),r=!1)})}const xn=D(!1),Jn=()=>{xn.value=!0},ei=()=>{xn.value=!1};let Yt=0;const ll=()=>(jo&&(lr(()=>{Yt||(window.addEventListener("compositionstart",Jn),window.addEventListener("compositionend",ei)),Yt++}),wo(()=>{Yt<=1?(window.removeEventListener("compositionstart",Jn),window.removeEventListener("compositionend",ei),Yt=0):Yt--})),xn);function Td(e){const o={isDeactivated:!1};let t=!1;return ed(()=>{if(o.isDeactivated=!1,!t){t=!0;return}e()}),ji(()=>{o.isDeactivated=!0,t||(t=!0)}),o}const $r="n-form-item";function rt(e,{defaultSize:o="medium",mergedSize:t,mergedDisabled:r}={}){const n=Se($r,null);Oe($r,null);const l=R(t?()=>t(n):()=>{const{size:d}=e;if(d)return d;if(n){const{mergedSize:c}=n;if(c.value!==void 0)return c.value}return o}),a=R(r?()=>r(n):()=>{const{disabled:d}=e;return d!==void 0?d:n?n.disabled.value:!1}),s=R(()=>{const{status:d}=e;return d||(n==null?void 0:n.mergedValidationStatus.value)});return wo(()=>{n&&n.restoreValidation()}),{mergedSizeRef:l,mergedDisabledRef:a,mergedStatusRef:s,nTriggerFormBlur(){n&&n.handleContentBlur()},nTriggerFormChange(){n&&n.handleContentChange()},nTriggerFormFocus(){n&&n.handleContentFocus()},nTriggerFormInput(){n&&n.handleContentInput()}}}const So={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:Fd,fontFamily:Od,lineHeight:Md}=So,al=C("body",` + margin: 0; + font-size: ${Fd}; + font-family: ${Od}; + line-height: ${Md}; + -webkit-text-size-adjust: 100%; + -webkit-tap-highlight-color: transparent; +`,[C("input",` + font-family: inherit; + font-size: inherit; + `)]),Yo="n-config-provider",or="naive-ui-style";function ne(e,o,t,r,n,l){const a=Fr(),s=Se(Yo,null);if(t){const c=()=>{const u=l==null?void 0:l.value;t.mount({id:u===void 0?o:u+o,head:!0,props:{bPrefix:u?`.${u}-`:void 0},anchorMetaName:or,ssr:a}),s!=null&&s.preflightStyleDisabled||al.mount({id:"n-global",head:!0,anchorMetaName:or,ssr:a})};a?c():lr(c)}return R(()=>{var c;const{theme:{common:u,self:f,peers:p={}}={},themeOverrides:v={},builtinThemeOverrides:h={}}=n,{common:m,peers:b}=v,{common:x=void 0,[e]:{common:S=void 0,self:B=void 0,peers:T={}}={}}=(s==null?void 0:s.mergedThemeRef.value)||{},{common:z=void 0,[e]:I={}}=(s==null?void 0:s.mergedThemeOverridesRef.value)||{},{common:w,peers:O={}}=I,k=Tt({},u||S||x||r.common,z,w,m),$=Tt((c=f||B||r.self)===null||c===void 0?void 0:c(k),h,I,v);return{common:k,self:$,peers:Tt({},r.peers,T,p),peerOverrides:Tt({},h.peers,O,b)}})}ne.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const sl="n";function ke(e={},o={defaultBordered:!0}){const t=Se(Yo,null);return{inlineThemeDisabled:t==null?void 0:t.inlineThemeDisabled,mergedRtlRef:t==null?void 0:t.mergedRtlRef,mergedComponentPropsRef:t==null?void 0:t.mergedComponentPropsRef,mergedBreakpointsRef:t==null?void 0:t.mergedBreakpointsRef,mergedBorderedRef:R(()=>{var r,n;const{bordered:l}=e;return l!==void 0?l:(n=(r=t==null?void 0:t.mergedBorderedRef.value)!==null&&r!==void 0?r:o.defaultBordered)!==null&&n!==void 0?n:!0}),mergedClsPrefixRef:R(()=>(t==null?void 0:t.mergedClsPrefixRef.value)||sl),namespaceRef:R(()=>t==null?void 0:t.mergedNamespaceRef.value)}}const _d={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}},Dd=_d,Ld={name:"en-US",locale:bd},Hd=Ld;function Xo(e){const{mergedLocaleRef:o,mergedDateLocaleRef:t}=Se(Yo,null)||{},r=R(()=>{var l,a;return(a=(l=o==null?void 0:o.value)===null||l===void 0?void 0:l[e])!==null&&a!==void 0?a:Dd[e]});return{dateLocaleRef:R(()=>{var l;return(l=t==null?void 0:t.value)!==null&&l!==void 0?l:Hd}),localeRef:r}}function Zo(e,o,t){if(!o)return;const r=Fr(),n=Se(Yo,null),l=()=>{const a=t==null?void 0:t.value;o.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:or,props:{bPrefix:a?`.${a}-`:void 0},ssr:r}),n!=null&&n.preflightStyleDisabled||al.mount({id:"n-global",head:!0,anchorMetaName:or,ssr:r})};r?l():lr(l)}function Ae(e,o,t,r){var n;t||Eo("useThemeClass","cssVarsRef is not passed");const l=(n=Se(Yo,null))===null||n===void 0?void 0:n.mergedThemeHashRef,a=D(""),s=Fr();let d;const c=`__${e}`,u=()=>{let f=c;const p=o?o.value:void 0,v=l==null?void 0:l.value;v&&(f+="-"+v),p&&(f+="-"+p);const{themeOverrides:h,builtinThemeOverrides:m}=r;h&&(f+="-"+zr(JSON.stringify(h))),m&&(f+="-"+zr(JSON.stringify(m))),a.value=f,d=()=>{const b=t.value;let x="";for(const S in b)x+=`${S}: ${b[S]};`;C(`.${f}`,x).mount({id:f,ssr:s}),d=void 0}};return oo(()=>{u()}),{themeClass:a,onRender:()=>{d==null||d()}}}function to(e,o,t){if(!o)return;const r=Fr(),n=R(()=>{const{value:a}=o;if(!a)return;const s=a[e];if(s)return s}),l=()=>{oo(()=>{const{value:a}=t,s=`${a}${e}Rtl`;if(Cd(s,r))return;const{value:d}=n;d&&d.style.mount({id:s,head:!0,anchorMetaName:or,props:{bPrefix:a?`.${a}-`:void 0},ssr:r})})};return r?l():lr(l),n}const tr=q({name:"Add",render(){return i("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}}),Ad=q({name:"ArrowDown",render(){return i("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M23.7916,15.2664 C24.0788,14.9679 24.0696,14.4931 23.7711,14.206 C23.4726,13.9188 22.9978,13.928 22.7106,14.2265 L14.7511,22.5007 L14.7511,3.74792 C14.7511,3.33371 14.4153,2.99792 14.0011,2.99792 C13.5869,2.99792 13.2511,3.33371 13.2511,3.74793 L13.2511,22.4998 L5.29259,14.2265 C5.00543,13.928 4.53064,13.9188 4.23213,14.206 C3.93361,14.4931 3.9244,14.9679 4.21157,15.2664 L13.2809,24.6944 C13.6743,25.1034 14.3289,25.1034 14.7223,24.6944 L23.7916,15.2664 Z"}))))}}),Ed=q({name:"ArrowUp",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},i("g",{fill:"none"},i("path",{d:"M3.13 9.163a.5.5 0 1 0 .74.674L9.5 3.67V17.5a.5.5 0 0 0 1 0V3.672l5.63 6.165a.5.5 0 0 0 .738-.674l-6.315-6.916a.746.746 0 0 0-.632-.24a.746.746 0 0 0-.476.24L3.131 9.163z",fill:"currentColor"})))}});function bo(e,o){return q({name:cd(e),setup(){var t;const r=(t=Se(Yo,null))===null||t===void 0?void 0:t.mergedIconsRef;return()=>{var n;const l=(n=r==null?void 0:r.value)===null||n===void 0?void 0:n[e];return l?l():o}}})}const jd=bo("attach",i("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M3.25735931,8.70710678 L7.85355339,4.1109127 C8.82986412,3.13460197 10.4127766,3.13460197 11.3890873,4.1109127 C12.365398,5.08722343 12.365398,6.67013588 11.3890873,7.64644661 L6.08578644,12.9497475 C5.69526215,13.3402718 5.06209717,13.3402718 4.67157288,12.9497475 C4.28104858,12.5592232 4.28104858,11.9260582 4.67157288,11.5355339 L9.97487373,6.23223305 C10.1701359,6.0369709 10.1701359,5.72038841 9.97487373,5.52512627 C9.77961159,5.32986412 9.4630291,5.32986412 9.26776695,5.52512627 L3.96446609,10.8284271 C3.18341751,11.6094757 3.18341751,12.8758057 3.96446609,13.6568542 C4.74551468,14.4379028 6.01184464,14.4379028 6.79289322,13.6568542 L12.0961941,8.35355339 C13.4630291,6.98671837 13.4630291,4.77064094 12.0961941,3.40380592 C10.7293591,2.0369709 8.51328163,2.0369709 7.14644661,3.40380592 L2.55025253,8 C2.35499039,8.19526215 2.35499039,8.51184464 2.55025253,8.70710678 C2.74551468,8.90236893 3.06209717,8.90236893 3.25735931,8.70710678 Z"}))))),oi=q({name:"Backward",render(){return i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M12.2674 15.793C11.9675 16.0787 11.4927 16.0672 11.2071 15.7673L6.20572 10.5168C5.9298 10.2271 5.9298 9.7719 6.20572 9.48223L11.2071 4.23177C11.4927 3.93184 11.9675 3.92031 12.2674 4.206C12.5673 4.49169 12.5789 4.96642 12.2932 5.26634L7.78458 9.99952L12.2932 14.7327C12.5789 15.0326 12.5673 15.5074 12.2674 15.793Z",fill:"currentColor"}))}}),Wd=q({name:"Checkmark",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},i("g",{fill:"none"},i("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),Nd=q({name:"ChevronRight",render(){return i("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z",fill:"currentColor"}))}}),Vd=bo("close",i("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),dl=q({name:"Eye",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},i("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),i("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),Ud=q({name:"EyeOff",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},i("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),i("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),i("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),i("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),i("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}}),Kd=bo("trash",i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},i("path",{d:"M432,144,403.33,419.74A32,32,0,0,1,371.55,448H140.46a32,32,0,0,1-31.78-28.26L80,144",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),i("rect",{x:"32",y:"64",width:"448",height:"80",rx:"16",ry:"16",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),i("line",{x1:"312",y1:"240",x2:"200",y2:"352",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),i("line",{x1:"312",y1:"352",x2:"200",y2:"240",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),Gd=bo("download",i("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M3.5,13 L12.5,13 C12.7761424,13 13,13.2238576 13,13.5 C13,13.7454599 12.8231248,13.9496084 12.5898756,13.9919443 L12.5,14 L3.5,14 C3.22385763,14 3,13.7761424 3,13.5 C3,13.2545401 3.17687516,13.0503916 3.41012437,13.0080557 L3.5,13 L12.5,13 L3.5,13 Z M7.91012437,1.00805567 L8,1 C8.24545989,1 8.44960837,1.17687516 8.49194433,1.41012437 L8.5,1.5 L8.5,10.292 L11.1819805,7.6109127 C11.3555469,7.43734635 11.6249713,7.4180612 11.8198394,7.55305725 L11.8890873,7.6109127 C12.0626536,7.78447906 12.0819388,8.05390346 11.9469427,8.2487716 L11.8890873,8.31801948 L8.35355339,11.8535534 C8.17998704,12.0271197 7.91056264,12.0464049 7.7156945,11.9114088 L7.64644661,11.8535534 L4.1109127,8.31801948 C3.91565056,8.12275734 3.91565056,7.80617485 4.1109127,7.6109127 C4.28447906,7.43734635 4.55390346,7.4180612 4.7487716,7.55305725 L4.81801948,7.6109127 L7.5,10.292 L7.5,1.5 C7.5,1.25454011 7.67687516,1.05039163 7.91012437,1.00805567 L8,1 L7.91012437,1.00805567 Z"}))))),qd=q({name:"Empty",render(){return i("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),i("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),Lt=bo("error",i("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M17.8838835,16.1161165 L17.7823881,16.0249942 C17.3266086,15.6583353 16.6733914,15.6583353 16.2176119,16.0249942 L16.1161165,16.1161165 L16.0249942,16.2176119 C15.6583353,16.6733914 15.6583353,17.3266086 16.0249942,17.7823881 L16.1161165,17.8838835 L22.233,24 L16.1161165,30.1161165 L16.0249942,30.2176119 C15.6583353,30.6733914 15.6583353,31.3266086 16.0249942,31.7823881 L16.1161165,31.8838835 L16.2176119,31.9750058 C16.6733914,32.3416647 17.3266086,32.3416647 17.7823881,31.9750058 L17.8838835,31.8838835 L24,25.767 L30.1161165,31.8838835 L30.2176119,31.9750058 C30.6733914,32.3416647 31.3266086,32.3416647 31.7823881,31.9750058 L31.8838835,31.8838835 L31.9750058,31.7823881 C32.3416647,31.3266086 32.3416647,30.6733914 31.9750058,30.2176119 L31.8838835,30.1161165 L25.767,24 L31.8838835,17.8838835 L31.9750058,17.7823881 C32.3416647,17.3266086 32.3416647,16.6733914 31.9750058,16.2176119 L31.8838835,16.1161165 L31.7823881,16.0249942 C31.3266086,15.6583353 30.6733914,15.6583353 30.2176119,16.0249942 L30.1161165,16.1161165 L24,22.233 L17.8838835,16.1161165 L17.7823881,16.0249942 L17.8838835,16.1161165 Z"}))))),ti=q({name:"FastBackward",render(){return i("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M8.73171,16.7949 C9.03264,17.0795 9.50733,17.0663 9.79196,16.7654 C10.0766,16.4644 10.0634,15.9897 9.76243,15.7051 L4.52339,10.75 L17.2471,10.75 C17.6613,10.75 17.9971,10.4142 17.9971,10 C17.9971,9.58579 17.6613,9.25 17.2471,9.25 L4.52112,9.25 L9.76243,4.29275 C10.0634,4.00812 10.0766,3.53343 9.79196,3.2325 C9.50733,2.93156 9.03264,2.91834 8.73171,3.20297 L2.31449,9.27241 C2.14819,9.4297 2.04819,9.62981 2.01448,9.8386 C2.00308,9.89058 1.99707,9.94459 1.99707,10 C1.99707,10.0576 2.00356,10.1137 2.01585,10.1675 C2.05084,10.3733 2.15039,10.5702 2.31449,10.7254 L8.73171,16.7949 Z"}))))}}),ri=q({name:"FastForward",render(){return i("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z"}))))}}),ni=q({name:"Forward",render(){return i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M7.73271 4.20694C8.03263 3.92125 8.50737 3.93279 8.79306 4.23271L13.7944 9.48318C14.0703 9.77285 14.0703 10.2281 13.7944 10.5178L8.79306 15.7682C8.50737 16.0681 8.03263 16.0797 7.73271 15.794C7.43279 15.5083 7.42125 15.0336 7.70694 14.7336L12.2155 10.0005L7.70694 5.26729C7.42125 4.96737 7.43279 4.49264 7.73271 4.20694Z",fill:"currentColor"}))}}),mt=bo("info",i("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M14,2 C20.6274,2 26,7.37258 26,14 C26,20.6274 20.6274,26 14,26 C7.37258,26 2,20.6274 2,14 C2,7.37258 7.37258,2 14,2 Z M14,11 C13.4477,11 13,11.4477 13,12 L13,12 L13,20 C13,20.5523 13.4477,21 14,21 C14.5523,21 15,20.5523 15,20 L15,20 L15,12 C15,11.4477 14.5523,11 14,11 Z M14,6.75 C13.3096,6.75 12.75,7.30964 12.75,8 C12.75,8.69036 13.3096,9.25 14,9.25 C14.6904,9.25 15.25,8.69036 15.25,8 C15.25,7.30964 14.6904,6.75 14,6.75 Z"}))))),ii=q({name:"More",render(){return i("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M4,7 C4.55228,7 5,7.44772 5,8 C5,8.55229 4.55228,9 4,9 C3.44772,9 3,8.55229 3,8 C3,7.44772 3.44772,7 4,7 Z M8,7 C8.55229,7 9,7.44772 9,8 C9,8.55229 8.55229,9 8,9 C7.44772,9 7,8.55229 7,8 C7,7.44772 7.44772,7 8,7 Z M12,7 C12.5523,7 13,7.44772 13,8 C13,8.55229 12.5523,9 12,9 C11.4477,9 11,8.55229 11,8 C11,7.44772 11.4477,7 12,7 Z"}))))}}),cl=q({name:"Remove",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},i("line",{x1:"400",y1:"256",x2:"112",y2:"256",style:` + fill: none; + stroke: currentColor; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 32px; + `}))}}),Ht=bo("success",i("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.6338835,17.6161165 C32.1782718,17.1605048 31.4584514,17.1301307 30.9676119,17.5249942 L30.8661165,17.6161165 L20.75,27.732233 L17.1338835,24.1161165 C16.6457281,23.6279612 15.8542719,23.6279612 15.3661165,24.1161165 C14.9105048,24.5717282 14.8801307,25.2915486 15.2749942,25.7823881 L15.3661165,25.8838835 L19.8661165,30.3838835 C20.3217282,30.8394952 21.0415486,30.8698693 21.5323881,30.4750058 L21.6338835,30.3838835 L32.6338835,19.3838835 C33.1220388,18.8957281 33.1220388,18.1042719 32.6338835,17.6161165 Z"}))))),yt=bo("warning",i("svg",{viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M12,2 C17.523,2 22,6.478 22,12 C22,17.522 17.523,22 12,22 C6.477,22 2,17.522 2,12 C2,6.478 6.477,2 12,2 Z M12.0018002,15.0037242 C11.450254,15.0037242 11.0031376,15.4508407 11.0031376,16.0023869 C11.0031376,16.553933 11.450254,17.0010495 12.0018002,17.0010495 C12.5533463,17.0010495 13.0004628,16.553933 13.0004628,16.0023869 C13.0004628,15.4508407 12.5533463,15.0037242 12.0018002,15.0037242 Z M11.99964,7 C11.4868042,7.00018474 11.0642719,7.38637706 11.0066858,7.8837365 L11,8.00036004 L11.0018003,13.0012393 L11.00857,13.117858 C11.0665141,13.6151758 11.4893244,14.0010638 12.0021602,14.0008793 C12.514996,14.0006946 12.9375283,13.6145023 12.9951144,13.1171428 L13.0018002,13.0005193 L13,7.99964009 L12.9932303,7.8830214 C12.9352861,7.38570354 12.5124758,6.99981552 11.99964,7 Z"}))))),Yd=bo("cancel",i("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M2.58859116,2.7156945 L2.64644661,2.64644661 C2.82001296,2.47288026 3.08943736,2.45359511 3.2843055,2.58859116 L3.35355339,2.64644661 L8,7.293 L12.6464466,2.64644661 C12.8417088,2.45118446 13.1582912,2.45118446 13.3535534,2.64644661 C13.5488155,2.84170876 13.5488155,3.15829124 13.3535534,3.35355339 L8.707,8 L13.3535534,12.6464466 C13.5271197,12.820013 13.5464049,13.0894374 13.4114088,13.2843055 L13.3535534,13.3535534 C13.179987,13.5271197 12.9105626,13.5464049 12.7156945,13.4114088 L12.6464466,13.3535534 L8,8.707 L3.35355339,13.3535534 C3.15829124,13.5488155 2.84170876,13.5488155 2.64644661,13.3535534 C2.45118446,13.1582912 2.45118446,12.8417088 2.64644661,12.6464466 L7.293,8 L2.64644661,3.35355339 C2.47288026,3.17998704 2.45359511,2.91056264 2.58859116,2.7156945 L2.64644661,2.64644661 L2.58859116,2.7156945 Z"}))))),Xd=q({name:"ChevronDown",render(){return i("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),Zd=bo("clear",i("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),Qd=q({name:"ChevronDownFilled",render(){return i("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M3.20041 5.73966C3.48226 5.43613 3.95681 5.41856 4.26034 5.70041L8 9.22652L11.7397 5.70041C12.0432 5.41856 12.5177 5.43613 12.7996 5.73966C13.0815 6.0432 13.0639 6.51775 12.7603 6.7996L8.51034 10.7996C8.22258 11.0668 7.77743 11.0668 7.48967 10.7996L3.23966 6.7996C2.93613 6.51775 2.91856 6.0432 3.20041 5.73966Z",fill:"currentColor"}))}}),Jd=bo("retry",i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},i("path",{d:"M320,146s24.36-12-64-12A160,160,0,1,0,416,294",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-miterlimit: 10; stroke-width: 32px;"}),i("polyline",{points:"256 58 336 138 256 218",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),ec=bo("rotateClockwise",i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 12.7916 15.3658 15.2026 13 16.3265V14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5V17.5C12 17.7761 12.2239 18 12.5 18H15.5C15.7761 18 16 17.7761 16 17.5C16 17.2239 15.7761 17 15.5 17H13.8758C16.3346 15.6357 18 13.0128 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 10.2761 2.22386 10.5 2.5 10.5C2.77614 10.5 3 10.2761 3 10Z",fill:"currentColor"}),i("path",{d:"M10 12C11.1046 12 12 11.1046 12 10C12 8.89543 11.1046 8 10 8C8.89543 8 8 8.89543 8 10C8 11.1046 8.89543 12 10 12ZM10 11C9.44772 11 9 10.5523 9 10C9 9.44772 9.44772 9 10 9C10.5523 9 11 9.44772 11 10C11 10.5523 10.5523 11 10 11Z",fill:"currentColor"}))),oc=bo("rotateClockwise",i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M17 10C17 6.13401 13.866 3 10 3C6.13401 3 3 6.13401 3 10C3 12.7916 4.63419 15.2026 7 16.3265V14.5C7 14.2239 7.22386 14 7.5 14C7.77614 14 8 14.2239 8 14.5V17.5C8 17.7761 7.77614 18 7.5 18H4.5C4.22386 18 4 17.7761 4 17.5C4 17.2239 4.22386 17 4.5 17H6.12422C3.66539 15.6357 2 13.0128 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10C18 10.2761 17.7761 10.5 17.5 10.5C17.2239 10.5 17 10.2761 17 10Z",fill:"currentColor"}),i("path",{d:"M10 12C8.89543 12 8 11.1046 8 10C8 8.89543 8.89543 8 10 8C11.1046 8 12 8.89543 12 10C12 11.1046 11.1046 12 10 12ZM10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10C9 10.5523 9.44772 11 10 11Z",fill:"currentColor"}))),tc=bo("zoomIn",i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5Z",fill:"currentColor"}),i("path",{d:"M8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z",fill:"currentColor"}))),rc=bo("zoomOut",i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11Z",fill:"currentColor"}),i("path",{d:"M14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z",fill:"currentColor"}))),nc=q({name:"ResizeSmall",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},i("g",{fill:"none"},i("path",{d:"M5.5 4A1.5 1.5 0 0 0 4 5.5v1a.5.5 0 0 1-1 0v-1A2.5 2.5 0 0 1 5.5 3h1a.5.5 0 0 1 0 1h-1zM16 5.5A1.5 1.5 0 0 0 14.5 4h-1a.5.5 0 0 1 0-1h1A2.5 2.5 0 0 1 17 5.5v1a.5.5 0 0 1-1 0v-1zm0 9a1.5 1.5 0 0 1-1.5 1.5h-1a.5.5 0 0 0 0 1h1a2.5 2.5 0 0 0 2.5-2.5v-1a.5.5 0 0 0-1 0v1zm-12 0A1.5 1.5 0 0 0 5.5 16h1.25a.5.5 0 0 1 0 1H5.5A2.5 2.5 0 0 1 3 14.5v-1.25a.5.5 0 0 1 1 0v1.25zM8.5 7A1.5 1.5 0 0 0 7 8.5v3A1.5 1.5 0 0 0 8.5 13h3a1.5 1.5 0 0 0 1.5-1.5v-3A1.5 1.5 0 0 0 11.5 7h-3zM8 8.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-3z",fill:"currentColor"})))}}),At=q({name:"BaseIconSwitchTransition",setup(e,{slots:o}){const t=Ct();return()=>i(no,{name:"icon-switch-transition",appear:t.value},o)}}),wt=q({name:"FadeInExpandTransition",props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:o}){function t(s){e.width?s.style.maxWidth=`${s.offsetWidth}px`:s.style.maxHeight=`${s.offsetHeight}px`,s.offsetWidth}function r(s){e.width?s.style.maxWidth="0":s.style.maxHeight="0",s.offsetWidth;const{onLeave:d}=e;d&&d()}function n(s){e.width?s.style.maxWidth="":s.style.maxHeight="";const{onAfterLeave:d}=e;d&&d()}function l(s){if(s.style.transition="none",e.width){const d=s.offsetWidth;s.style.maxWidth="0",s.offsetWidth,s.style.transition="",s.style.maxWidth=`${d}px`}else if(e.reverse)s.style.maxHeight=`${s.offsetHeight}px`,s.offsetHeight,s.style.transition="",s.style.maxHeight="0";else{const d=s.offsetHeight;s.style.maxHeight="0",s.offsetWidth,s.style.transition="",s.style.maxHeight=`${d}px`}s.offsetWidth}function a(s){var d;e.width?s.style.maxWidth="":e.reverse||(s.style.maxHeight=""),(d=e.onAfterEnter)===null||d===void 0||d.call(e)}return()=>{const{group:s,width:d,appear:c,mode:u}=e,f=s?fn:no,p={name:d?"fade-in-width-expand-transition":"fade-in-height-expand-transition",appear:c,onEnter:l,onAfterEnter:a,onBeforeLeave:t,onLeave:r,onAfterLeave:n};return s||(p.mode=u),i(f,p,o)}}}),ic=g("base-icon",` + height: 1em; + width: 1em; + line-height: 1em; + text-align: center; + display: inline-block; + position: relative; + fill: currentColor; + transform: translateZ(0); +`,[C("svg",` + height: 1em; + width: 1em; + `)]),De=q({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){Zo("-base-icon",ic,le(e,"clsPrefix"))},render(){return i("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),lc=g("base-close",` + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + background-color: transparent; + color: var(--n-close-icon-color); + border-radius: var(--n-close-border-radius); + height: var(--n-close-size); + width: var(--n-close-size); + font-size: var(--n-close-icon-size); + outline: none; + border: none; + position: relative; + padding: 0; +`,[P("absolute",` + height: var(--n-close-icon-size); + width: var(--n-close-icon-size); + `),C("&::before",` + content: ""; + position: absolute; + width: var(--n-close-size); + height: var(--n-close-size); + left: 50%; + top: 50%; + transform: translateY(-50%) translateX(-50%); + transition: inherit; + border-radius: inherit; + `),je("disabled",[C("&:hover",` + color: var(--n-close-icon-color-hover); + `),C("&:hover::before",` + background-color: var(--n-close-color-hover); + `),C("&:focus::before",` + background-color: var(--n-close-color-hover); + `),C("&:active",` + color: var(--n-close-icon-color-pressed); + `),C("&:active::before",` + background-color: var(--n-close-color-pressed); + `)]),P("disabled",` + cursor: not-allowed; + color: var(--n-close-icon-color-disabled); + background-color: transparent; + `),P("round",[C("&::before",` + border-radius: 50%; + `)])]),St=q({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return Zo("-base-close",lc,le(e,"clsPrefix")),()=>{const{clsPrefix:o,disabled:t,absolute:r,round:n,isButtonTag:l}=e;return i(l?"button":"div",{type:l?"button":void 0,tabindex:t||!e.focusable?-1:0,"aria-disabled":t,"aria-label":"close",role:l?void 0:"button",disabled:t,class:[`${o}-base-close`,r&&`${o}-base-close--absolute`,t&&`${o}-base-close--disabled`,n&&`${o}-base-close--round`],onMousedown:s=>{e.focusable||s.preventDefault()},onClick:e.onClick},i(De,{clsPrefix:o},{default:()=>i(Vd,null)}))}}}),ac=q({props:{onFocus:Function,onBlur:Function},setup(e){return()=>i("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}}),{cubicBezierEaseInOut:sc}=So;function lt({originalTransform:e="",left:o=0,top:t=0,transition:r=`all .3s ${sc} !important`}={}){return[C("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:e+" scale(0.75)",left:o,top:t,opacity:0}),C("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:o,top:t,opacity:1}),C("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:o,top:t,transition:r})]}const dc=C([C("@keyframes loading-container-rotate",` + to { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } + `),C("@keyframes loading-layer-rotate",` + 12.5% { + -webkit-transform: rotate(135deg); + transform: rotate(135deg); + } + 25% { + -webkit-transform: rotate(270deg); + transform: rotate(270deg); + } + 37.5% { + -webkit-transform: rotate(405deg); + transform: rotate(405deg); + } + 50% { + -webkit-transform: rotate(540deg); + transform: rotate(540deg); + } + 62.5% { + -webkit-transform: rotate(675deg); + transform: rotate(675deg); + } + 75% { + -webkit-transform: rotate(810deg); + transform: rotate(810deg); + } + 87.5% { + -webkit-transform: rotate(945deg); + transform: rotate(945deg); + } + 100% { + -webkit-transform: rotate(1080deg); + transform: rotate(1080deg); + } + `),C("@keyframes loading-left-spin",` + from { + -webkit-transform: rotate(265deg); + transform: rotate(265deg); + } + 50% { + -webkit-transform: rotate(130deg); + transform: rotate(130deg); + } + to { + -webkit-transform: rotate(265deg); + transform: rotate(265deg); + } + `),C("@keyframes loading-right-spin",` + from { + -webkit-transform: rotate(-265deg); + transform: rotate(-265deg); + } + 50% { + -webkit-transform: rotate(-130deg); + transform: rotate(-130deg); + } + to { + -webkit-transform: rotate(-265deg); + transform: rotate(-265deg); + } + `),g("base-loading",` + position: relative; + line-height: 0; + width: 1em; + height: 1em; + `,[y("transition-wrapper",` + position: absolute; + width: 100%; + height: 100%; + `,[lt()]),y("container",` + display: inline-flex; + position: relative; + direction: ltr; + line-height: 0; + animation: loading-container-rotate 1568.2352941176ms linear infinite; + font-size: 0; + letter-spacing: 0; + white-space: nowrap; + opacity: 1; + width: 100%; + height: 100%; + `,[y("svg",` + stroke: var(--n-text-color); + fill: transparent; + position: absolute; + height: 100%; + overflow: hidden; + `),y("container-layer",` + position: absolute; + width: 100%; + height: 100%; + animation: loading-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; + `,[y("container-layer-left",` + display: inline-flex; + position: relative; + width: 50%; + height: 100%; + overflow: hidden; + `,[y("svg",` + animation: loading-left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; + width: 200%; + `)]),y("container-layer-patch",` + position: absolute; + top: 0; + left: 47.5%; + box-sizing: border-box; + width: 5%; + height: 100%; + overflow: hidden; + `,[y("svg",` + left: -900%; + width: 2000%; + transform: rotate(180deg); + `)]),y("container-layer-right",` + display: inline-flex; + position: relative; + width: 50%; + height: 100%; + overflow: hidden; + `,[y("svg",` + animation: loading-right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; + left: -100%; + width: 200%; + `)])])]),y("placeholder",` + position: absolute; + left: 50%; + top: 50%; + transform: translateX(-50%) translateY(-50%); + `,[lt({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})])])]),cc={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},Et=q({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},cc),setup(e){Zo("-base-loading",dc,le(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:o,strokeWidth:t,stroke:r,scale:n}=this,l=o/n;return i("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},i(At,null,{default:()=>this.show?i("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},i("div",{class:`${e}-base-loading__container`},i("div",{class:`${e}-base-loading__container-layer`},i("div",{class:`${e}-base-loading__container-layer-left`},i("svg",{class:`${e}-base-loading__svg`,viewBox:`0 0 ${2*l} ${2*l}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i("circle",{fill:"none",stroke:"currentColor","stroke-width":t,"stroke-linecap":"round",cx:l,cy:l,r:o-t/2,"stroke-dasharray":4.91*o,"stroke-dashoffset":2.46*o}))),i("div",{class:`${e}-base-loading__container-layer-patch`},i("svg",{class:`${e}-base-loading__svg`,viewBox:`0 0 ${2*l} ${2*l}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i("circle",{fill:"none",stroke:"currentColor","stroke-width":t,"stroke-linecap":"round",cx:l,cy:l,r:o-t/2,"stroke-dasharray":4.91*o,"stroke-dashoffset":2.46*o}))),i("div",{class:`${e}-base-loading__container-layer-right`},i("svg",{class:`${e}-base-loading__svg`,viewBox:`0 0 ${2*l} ${2*l}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i("circle",{fill:"none",stroke:"currentColor","stroke-width":t,"stroke-linecap":"round",cx:l,cy:l,r:o-t/2,"stroke-dasharray":4.91*o,"stroke-dashoffset":2.46*o})))))):i("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),we={neutralBase:"#000",neutralInvertBase:"#fff",neutralTextBase:"#fff",neutralPopover:"rgb(72, 72, 78)",neutralCard:"rgb(24, 24, 28)",neutralModal:"rgb(44, 44, 50)",neutralBody:"rgb(16, 16, 20)",alpha1:"0.9",alpha2:"0.82",alpha3:"0.52",alpha4:"0.38",alpha5:"0.28",alphaClose:"0.52",alphaDisabled:"0.38",alphaDisabledInput:"0.06",alphaPending:"0.09",alphaTablePending:"0.06",alphaTableStriped:"0.05",alphaPressed:"0.05",alphaAvatar:"0.18",alphaRail:"0.2",alphaProgressRail:"0.12",alphaBorder:"0.24",alphaDivider:"0.09",alphaInput:"0.1",alphaAction:"0.06",alphaTab:"0.04",alphaScrollbar:"0.2",alphaScrollbarHover:"0.3",alphaCode:"0.12",alphaTag:"0.2",primaryHover:"#7fe7c4",primaryDefault:"#63e2b7",primaryActive:"#5acea7",primarySuppl:"rgb(42, 148, 125)",infoHover:"#8acbec",infoDefault:"#70c0e8",infoActive:"#66afd3",infoSuppl:"rgb(56, 137, 197)",errorHover:"#e98b8b",errorDefault:"#e88080",errorActive:"#e57272",errorSuppl:"rgb(208, 58, 82)",warningHover:"#f5d599",warningDefault:"#f2c97d",warningActive:"#e6c260",warningSuppl:"rgb(240, 138, 0)",successHover:"#7fe7c4",successDefault:"#63e2b7",successActive:"#5acea7",successSuppl:"rgb(42, 148, 125)"},uc=ir(we.neutralBase),ul=ir(we.neutralInvertBase),fc="rgba("+ul.slice(0,3).join(", ")+", ";function Ne(e){return fc+String(e)+")"}function hc(e){const o=Array.from(ul);return o[3]=Number(e),$e(uc,o)}const pc=Object.assign(Object.assign({name:"common"},So),{baseColor:we.neutralBase,primaryColor:we.primaryDefault,primaryColorHover:we.primaryHover,primaryColorPressed:we.primaryActive,primaryColorSuppl:we.primarySuppl,infoColor:we.infoDefault,infoColorHover:we.infoHover,infoColorPressed:we.infoActive,infoColorSuppl:we.infoSuppl,successColor:we.successDefault,successColorHover:we.successHover,successColorPressed:we.successActive,successColorSuppl:we.successSuppl,warningColor:we.warningDefault,warningColorHover:we.warningHover,warningColorPressed:we.warningActive,warningColorSuppl:we.warningSuppl,errorColor:we.errorDefault,errorColorHover:we.errorHover,errorColorPressed:we.errorActive,errorColorSuppl:we.errorSuppl,textColorBase:we.neutralTextBase,textColor1:Ne(we.alpha1),textColor2:Ne(we.alpha2),textColor3:Ne(we.alpha3),textColorDisabled:Ne(we.alpha4),placeholderColor:Ne(we.alpha4),placeholderColorDisabled:Ne(we.alpha5),iconColor:Ne(we.alpha4),iconColorDisabled:Ne(we.alpha5),iconColorHover:Ne(Number(we.alpha4)*1.25),iconColorPressed:Ne(Number(we.alpha4)*.8),opacity1:we.alpha1,opacity2:we.alpha2,opacity3:we.alpha3,opacity4:we.alpha4,opacity5:we.alpha5,dividerColor:Ne(we.alphaDivider),borderColor:Ne(we.alphaBorder),closeIconColorHover:Ne(Number(we.alphaClose)),closeIconColor:Ne(Number(we.alphaClose)),closeIconColorPressed:Ne(Number(we.alphaClose)),closeColorHover:"rgba(255, 255, 255, .12)",closeColorPressed:"rgba(255, 255, 255, .08)",clearColor:Ne(we.alpha4),clearColorHover:Je(Ne(we.alpha4),{alpha:1.25}),clearColorPressed:Je(Ne(we.alpha4),{alpha:.8}),scrollbarColor:Ne(we.alphaScrollbar),scrollbarColorHover:Ne(we.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:Ne(we.alphaProgressRail),railColor:Ne(we.alphaRail),popoverColor:we.neutralPopover,tableColor:we.neutralCard,cardColor:we.neutralCard,modalColor:we.neutralModal,bodyColor:we.neutralBody,tagColor:hc(we.alphaTag),avatarColor:Ne(we.alphaAvatar),invertedColor:we.neutralBase,inputColor:Ne(we.alphaInput),codeColor:Ne(we.alphaCode),tabColor:Ne(we.alphaTab),actionColor:Ne(we.alphaAction),tableHeaderColor:Ne(we.alphaAction),hoverColor:Ne(we.alphaPending),tableColorHover:Ne(we.alphaTablePending),tableColorStriped:Ne(we.alphaTableStriped),pressedColor:Ne(we.alphaPressed),opacityDisabled:we.alphaDisabled,inputColorDisabled:Ne(we.alphaDisabledInput),buttonColor2:"rgba(255, 255, 255, .08)",buttonColor2Hover:"rgba(255, 255, 255, .12)",buttonColor2Pressed:"rgba(255, 255, 255, .08)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),fe=pc,Be={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaDisabledInput:"0.02",alphaPending:"0.05",alphaTablePending:"0.02",alphaPressed:"0.07",alphaAvatar:"0.2",alphaRail:"0.14",alphaProgressRail:".08",alphaBorder:"0.12",alphaDivider:"0.06",alphaInput:"0",alphaAction:"0.02",alphaTab:"0.04",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",alphaCode:"0.05",alphaTag:"0.02",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},vc=ir(Be.neutralBase),fl=ir(Be.neutralInvertBase),gc="rgba("+fl.slice(0,3).join(", ")+", ";function li(e){return gc+String(e)+")"}function ho(e){const o=Array.from(fl);return o[3]=Number(e),$e(vc,o)}const mc=Object.assign(Object.assign({name:"common"},So),{baseColor:Be.neutralBase,primaryColor:Be.primaryDefault,primaryColorHover:Be.primaryHover,primaryColorPressed:Be.primaryActive,primaryColorSuppl:Be.primarySuppl,infoColor:Be.infoDefault,infoColorHover:Be.infoHover,infoColorPressed:Be.infoActive,infoColorSuppl:Be.infoSuppl,successColor:Be.successDefault,successColorHover:Be.successHover,successColorPressed:Be.successActive,successColorSuppl:Be.successSuppl,warningColor:Be.warningDefault,warningColorHover:Be.warningHover,warningColorPressed:Be.warningActive,warningColorSuppl:Be.warningSuppl,errorColor:Be.errorDefault,errorColorHover:Be.errorHover,errorColorPressed:Be.errorActive,errorColorSuppl:Be.errorSuppl,textColorBase:Be.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:ho(Be.alpha4),placeholderColor:ho(Be.alpha4),placeholderColorDisabled:ho(Be.alpha5),iconColor:ho(Be.alpha4),iconColorHover:Je(ho(Be.alpha4),{lightness:.75}),iconColorPressed:Je(ho(Be.alpha4),{lightness:.9}),iconColorDisabled:ho(Be.alpha5),opacity1:Be.alpha1,opacity2:Be.alpha2,opacity3:Be.alpha3,opacity4:Be.alpha4,opacity5:Be.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:ho(Number(Be.alphaClose)),closeIconColorHover:ho(Number(Be.alphaClose)),closeIconColorPressed:ho(Number(Be.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:ho(Be.alpha4),clearColorHover:Je(ho(Be.alpha4),{lightness:.75}),clearColorPressed:Je(ho(Be.alpha4),{lightness:.9}),scrollbarColor:li(Be.alphaScrollbar),scrollbarColorHover:li(Be.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:ho(Be.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:Be.neutralPopover,tableColor:Be.neutralCard,cardColor:Be.neutralCard,modalColor:Be.neutralModal,bodyColor:Be.neutralBody,tagColor:"#eee",avatarColor:ho(Be.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:ho(Be.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:Be.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),Le=mc,bc={iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"},hl=e=>{const{textColorDisabled:o,iconColor:t,textColor2:r,fontSizeSmall:n,fontSizeMedium:l,fontSizeLarge:a,fontSizeHuge:s}=e;return Object.assign(Object.assign({},bc),{fontSizeSmall:n,fontSizeMedium:l,fontSizeLarge:a,fontSizeHuge:s,textColor:o,iconColor:t,extraTextColor:r})},xc={name:"Empty",common:Le,self:hl},Cn=xc,Cc={name:"Empty",common:fe,self:hl},zt=Cc,yc=g("empty",` + display: flex; + flex-direction: column; + align-items: center; + font-size: var(--n-font-size); +`,[y("icon",` + width: var(--n-icon-size); + height: var(--n-icon-size); + font-size: var(--n-icon-size); + line-height: var(--n-icon-size); + color: var(--n-icon-color); + transition: + color .3s var(--n-bezier); + `,[C("+",[y("description",` + margin-top: 8px; + `)])]),y("description",` + transition: color .3s var(--n-bezier); + color: var(--n-text-color); + `),y("extra",` + text-align: center; + transition: color .3s var(--n-bezier); + margin-top: 12px; + color: var(--n-extra-text-color); + `)]),wc=Object.assign(Object.assign({},ne.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),Sc=q({name:"Empty",props:wc,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Empty","-empty",yc,Cn,e,o),{localeRef:n}=Xo("Empty"),l=Se(Yo,null),a=R(()=>{var u,f,p;return(u=e.description)!==null&&u!==void 0?u:(p=(f=l==null?void 0:l.mergedComponentPropsRef.value)===null||f===void 0?void 0:f.Empty)===null||p===void 0?void 0:p.description}),s=R(()=>{var u,f;return((f=(u=l==null?void 0:l.mergedComponentPropsRef.value)===null||u===void 0?void 0:u.Empty)===null||f===void 0?void 0:f.renderIcon)||(()=>i(qd,null))}),d=R(()=>{const{size:u}=e,{common:{cubicBezierEaseInOut:f},self:{[W("iconSize",u)]:p,[W("fontSize",u)]:v,textColor:h,iconColor:m,extraTextColor:b}}=r.value;return{"--n-icon-size":p,"--n-font-size":v,"--n-bezier":f,"--n-text-color":h,"--n-icon-color":m,"--n-extra-text-color":b}}),c=t?Ae("empty",R(()=>{let u="";const{size:f}=e;return u+=f[0],u}),d,e):void 0;return{mergedClsPrefix:o,mergedRenderIcon:s,localizedDescription:R(()=>a.value||n.value.description),cssVars:t?void 0:d,themeClass:c==null?void 0:c.themeClass,onRender:c==null?void 0:c.onRender}},render(){const{$slots:e,mergedClsPrefix:o,onRender:t}=this;return t==null||t(),i("div",{class:[`${o}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i("div",{class:`${o}-empty__icon`},e.icon?e.icon():i(De,{clsPrefix:o},{default:this.mergedRenderIcon})):null,this.showDescription?i("div",{class:`${o}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?i("div",{class:`${o}-empty__extra`},e.extra()):null)}}),pl=e=>{const{scrollbarColor:o,scrollbarColorHover:t}=e;return{color:o,colorHover:t}},zc={name:"Scrollbar",common:Le,self:pl},Mr=zc,$c={name:"Scrollbar",common:fe,self:pl},zo=$c,{cubicBezierEaseInOut:ai}=So;function Mt({name:e="fade-in",enterDuration:o="0.2s",leaveDuration:t="0.2s",enterCubicBezier:r=ai,leaveCubicBezier:n=ai}={}){return[C(`&.${e}-transition-enter-active`,{transition:`all ${o} ${r}!important`}),C(`&.${e}-transition-leave-active`,{transition:`all ${t} ${n}!important`}),C(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),C(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}const Rc=g("scrollbar",` + overflow: hidden; + position: relative; + z-index: auto; + height: 100%; + width: 100%; +`,[C(">",[g("scrollbar-container",` + width: 100%; + overflow: scroll; + height: 100%; + max-height: inherit; + scrollbar-width: none; + `,[C("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",` + width: 0; + height: 0; + display: none; + `),C(">",[g("scrollbar-content",` + box-sizing: border-box; + min-width: 100%; + `)])])]),C(">, +",[g("scrollbar-rail",` + position: absolute; + pointer-events: none; + user-select: none; + -webkit-user-select: none; + `,[P("horizontal",` + left: 2px; + right: 2px; + bottom: 4px; + height: var(--n-scrollbar-height); + `,[C(">",[y("scrollbar",` + height: var(--n-scrollbar-height); + border-radius: var(--n-scrollbar-border-radius); + right: 0; + `)])]),P("vertical",` + right: 4px; + top: 2px; + bottom: 2px; + width: var(--n-scrollbar-width); + `,[C(">",[y("scrollbar",` + width: var(--n-scrollbar-width); + border-radius: var(--n-scrollbar-border-radius); + bottom: 0; + `)])]),P("disabled",[C(">",[y("scrollbar",{pointerEvents:"none"})])]),C(">",[y("scrollbar",` + position: absolute; + cursor: pointer; + pointer-events: all; + background-color: var(--n-scrollbar-color); + transition: background-color .2s var(--n-scrollbar-bezier); + `,[Mt(),C("&:hover",{backgroundColor:"var(--n-scrollbar-color-hover)"})])])])])]),Pc=Object.assign(Object.assign({},ne.props),{size:{type:Number,default:5},duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:String,contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean}),vl=q({name:"Scrollbar",props:Pc,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t,mergedRtlRef:r}=ke(e),n=to("Scrollbar",r,o),l=D(null),a=D(null),s=D(null),d=D(null),c=D(null),u=D(null),f=D(null),p=D(null),v=D(null),h=D(null),m=D(null),b=D(0),x=D(0),S=D(!1),B=D(!1);let T=!1,z=!1,I,w,O=0,k=0,$=0,L=0;const M=ld(),j=R(()=>{const{value:F}=p,{value:K}=u,{value:ie}=h;return F===null||K===null||ie===null?0:Math.min(F,ie*F/K+e.size*1.5)}),E=R(()=>`${j.value}px`),U=R(()=>{const{value:F}=v,{value:K}=f,{value:ie}=m;return F===null||K===null||ie===null?0:ie*F/K+e.size*1.5}),_=R(()=>`${U.value}px`),V=R(()=>{const{value:F}=p,{value:K}=b,{value:ie}=u,{value:ze}=h;if(F===null||ie===null||ze===null)return 0;{const Pe=ie-F;return Pe?K/Pe*(ze-j.value):0}}),te=R(()=>`${V.value}px`),N=R(()=>{const{value:F}=v,{value:K}=x,{value:ie}=f,{value:ze}=m;if(F===null||ie===null||ze===null)return 0;{const Pe=ie-F;return Pe?K/Pe*(ze-U.value):0}}),G=R(()=>`${N.value}px`),Ce=R(()=>{const{value:F}=p,{value:K}=u;return F!==null&&K!==null&&K>F}),X=R(()=>{const{value:F}=v,{value:K}=f;return F!==null&&K!==null&&K>F}),ve=R(()=>{const{trigger:F}=e;return F==="none"||S.value}),he=R(()=>{const{trigger:F}=e;return F==="none"||B.value}),be=R(()=>{const{container:F}=e;return F?F():a.value}),me=R(()=>{const{content:F}=e;return F?F():s.value}),se=Td(()=>{e.container||ee({top:b.value,left:x.value})}),Re=()=>{se.isDeactivated||Ve()},ge=F=>{if(se.isDeactivated)return;const{onResize:K}=e;K&&K(F),Ve()},ee=(F,K)=>{if(!e.scrollable)return;if(typeof F=="number"){de(K??0,F,0,!1,"auto");return}const{left:ie,top:ze,index:Pe,elSize:Ie,position:Te,behavior:_e,el:Qe,debounce:vo=!0}=F;(ie!==void 0||ze!==void 0)&&de(ie??0,ze??0,0,!1,_e),Qe!==void 0?de(0,Qe.offsetTop,Qe.offsetHeight,vo,_e):Pe!==void 0&&Ie!==void 0?de(0,Pe*Ie,Ie,vo,_e):Te==="bottom"?de(0,Number.MAX_SAFE_INTEGER,0,!1,_e):Te==="top"&&de(0,0,0,!1,_e)},xe=(F,K)=>{if(!e.scrollable)return;const{value:ie}=be;ie&&(typeof F=="object"?ie.scrollBy(F):ie.scrollBy(F,K||0))};function de(F,K,ie,ze,Pe){const{value:Ie}=be;if(Ie){if(ze){const{scrollTop:Te,offsetHeight:_e}=Ie;if(K>Te){K+ie<=Te+_e||Ie.scrollTo({left:F,top:K+ie-_e,behavior:Pe});return}}Ie.scrollTo({left:F,top:K,behavior:Pe})}}function ye(){Z(),re(),Ve()}function pe(){Me()}function Me(){Q(),A()}function Q(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{B.value=!1},e.duration)}function A(){I!==void 0&&window.clearTimeout(I),I=window.setTimeout(()=>{S.value=!1},e.duration)}function Z(){I!==void 0&&window.clearTimeout(I),S.value=!0}function re(){w!==void 0&&window.clearTimeout(w),B.value=!0}function ue(F){const{onScroll:K}=e;K&&K(F),Y()}function Y(){const{value:F}=be;F&&(b.value=F.scrollTop,x.value=F.scrollLeft*(n!=null&&n.value?-1:1))}function ce(){const{value:F}=me;F&&(u.value=F.offsetHeight,f.value=F.offsetWidth);const{value:K}=be;K&&(p.value=K.offsetHeight,v.value=K.offsetWidth);const{value:ie}=c,{value:ze}=d;ie&&(m.value=ie.offsetWidth),ze&&(h.value=ze.offsetHeight)}function He(){const{value:F}=be;F&&(b.value=F.scrollTop,x.value=F.scrollLeft*(n!=null&&n.value?-1:1),p.value=F.offsetHeight,v.value=F.offsetWidth,u.value=F.scrollHeight,f.value=F.scrollWidth);const{value:K}=c,{value:ie}=d;K&&(m.value=K.offsetWidth),ie&&(h.value=ie.offsetHeight)}function Ve(){e.scrollable&&(e.useUnifiedContainer?He():(ce(),Y()))}function Ze(F){var K;return!(!((K=l.value)===null||K===void 0)&&K.contains(Qt(F)))}function po(F){F.preventDefault(),F.stopPropagation(),z=!0,Do("mousemove",window,fo,!0),Do("mouseup",window,Bo,!0),k=x.value,$=n!=null&&n.value?window.innerWidth-F.clientX:F.clientX}function fo(F){if(!z)return;I!==void 0&&window.clearTimeout(I),w!==void 0&&window.clearTimeout(w);const{value:K}=v,{value:ie}=f,{value:ze}=U;if(K===null||ie===null)return;const Ie=(n!=null&&n.value?window.innerWidth-F.clientX-$:F.clientX-$)*(ie-K)/(K-ze),Te=ie-K;let _e=k+Ie;_e=Math.min(Te,_e),_e=Math.max(_e,0);const{value:Qe}=be;if(Qe){Qe.scrollLeft=_e*(n!=null&&n.value?-1:1);const{internalOnUpdateScrollLeft:vo}=e;vo&&vo(_e)}}function Bo(F){F.preventDefault(),F.stopPropagation(),Ro("mousemove",window,fo,!0),Ro("mouseup",window,Bo,!0),z=!1,Ve(),Ze(F)&&Me()}function To(F){F.preventDefault(),F.stopPropagation(),T=!0,Do("mousemove",window,xo,!0),Do("mouseup",window,Co,!0),O=b.value,L=F.clientY}function xo(F){if(!T)return;I!==void 0&&window.clearTimeout(I),w!==void 0&&window.clearTimeout(w);const{value:K}=p,{value:ie}=u,{value:ze}=j;if(K===null||ie===null)return;const Ie=(F.clientY-L)*(ie-K)/(K-ze),Te=ie-K;let _e=O+Ie;_e=Math.min(Te,_e),_e=Math.max(_e,0);const{value:Qe}=be;Qe&&(Qe.scrollTop=_e)}function Co(F){F.preventDefault(),F.stopPropagation(),Ro("mousemove",window,xo,!0),Ro("mouseup",window,Co,!0),T=!1,Ve(),Ze(F)&&Me()}oo(()=>{const{value:F}=X,{value:K}=Ce,{value:ie}=o,{value:ze}=c,{value:Pe}=d;ze&&(F?ze.classList.remove(`${ie}-scrollbar-rail--disabled`):ze.classList.add(`${ie}-scrollbar-rail--disabled`)),Pe&&(K?Pe.classList.remove(`${ie}-scrollbar-rail--disabled`):Pe.classList.add(`${ie}-scrollbar-rail--disabled`))}),mo(()=>{e.container||Ve()}),wo(()=>{I!==void 0&&window.clearTimeout(I),w!==void 0&&window.clearTimeout(w),Ro("mousemove",window,xo,!0),Ro("mouseup",window,Co,!0)});const Ao=ne("Scrollbar","-scrollbar",Rc,Mr,e,o),Fo=R(()=>{const{common:{cubicBezierEaseInOut:F,scrollbarBorderRadius:K,scrollbarHeight:ie,scrollbarWidth:ze},self:{color:Pe,colorHover:Ie}}=Ao.value;return{"--n-scrollbar-bezier":F,"--n-scrollbar-color":Pe,"--n-scrollbar-color-hover":Ie,"--n-scrollbar-border-radius":K,"--n-scrollbar-width":ze,"--n-scrollbar-height":ie}}),co=t?Ae("scrollbar",void 0,Fo,e):void 0;return Object.assign(Object.assign({},{scrollTo:ee,scrollBy:xe,sync:Ve,syncUnifiedContainer:He,handleMouseEnterWrapper:ye,handleMouseLeaveWrapper:pe}),{mergedClsPrefix:o,rtlEnabled:n,containerScrollTop:b,wrapperRef:l,containerRef:a,contentRef:s,yRailRef:d,xRailRef:c,needYBar:Ce,needXBar:X,yBarSizePx:E,xBarSizePx:_,yBarTopPx:te,xBarLeftPx:G,isShowXBar:ve,isShowYBar:he,isIos:M,handleScroll:ue,handleContentResize:Re,handleContainerResize:ge,handleYScrollMouseDown:To,handleXScrollMouseDown:po,cssVars:t?void 0:Fo,themeClass:co==null?void 0:co.themeClass,onRender:co==null?void 0:co.onRender})},render(){var e;const{$slots:o,mergedClsPrefix:t,triggerDisplayManually:r,rtlEnabled:n,internalHoistYRail:l}=this;if(!this.scrollable)return(e=o.default)===null||e===void 0?void 0:e.call(o);const a=this.trigger==="none",s=()=>i("div",{ref:"yRailRef",class:[`${t}-scrollbar-rail`,`${t}-scrollbar-rail--vertical`],"data-scrollbar-rail":!0,style:this.verticalRailStyle,"aria-hidden":!0},i(a?sn:no,a?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i("div",{class:`${t}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),d=()=>{var u,f;return(u=this.onRender)===null||u===void 0||u.call(this),i("div",ko(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${t}-scrollbar`,this.themeClass,n&&`${t}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(f=o.default)===null||f===void 0?void 0:f.call(o):i("div",{role:"none",ref:"containerRef",class:[`${t}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i(vt,{onResize:this.handleContentResize},{default:()=>i("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${t}-scrollbar-content`,this.contentClass]},o)})),l?null:s(),this.xScrollable&&i("div",{ref:"xRailRef",class:[`${t}-scrollbar-rail`,`${t}-scrollbar-rail--horizontal`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i(a?sn:no,a?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?i("div",{class:`${t}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:n?this.xBarLeftPx:void 0,left:n?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},c=this.container?d():i(vt,{onResize:this.handleContainerResize},{default:d});return l?i(ao,null,c,s()):c}}),ur=vl,gl=vl,kc={height:"calc(var(--n-option-height) * 7.6)",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"},ml=e=>{const{borderRadius:o,popoverColor:t,textColor3:r,dividerColor:n,textColor2:l,primaryColorPressed:a,textColorDisabled:s,primaryColor:d,opacityDisabled:c,hoverColor:u,fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:v,fontSizeHuge:h,heightSmall:m,heightMedium:b,heightLarge:x,heightHuge:S}=e;return Object.assign(Object.assign({},kc),{optionFontSizeSmall:f,optionFontSizeMedium:p,optionFontSizeLarge:v,optionFontSizeHuge:h,optionHeightSmall:m,optionHeightMedium:b,optionHeightLarge:x,optionHeightHuge:S,borderRadius:o,color:t,groupHeaderTextColor:r,actionDividerColor:n,optionTextColor:l,optionTextColorPressed:a,optionTextColorDisabled:s,optionTextColorActive:d,optionOpacityDisabled:c,optionCheckColor:d,optionColorPending:u,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:u,actionTextColor:l,loadingColor:d})},Ic={name:"InternalSelectMenu",common:Le,peers:{Scrollbar:Mr,Empty:Cn},self:ml},_r=Ic,Bc={name:"InternalSelectMenu",common:fe,peers:{Scrollbar:zo,Empty:zt},self:ml},fr=Bc;function Tc(e,o){return i(no,{name:"fade-in-scale-up-transition"},{default:()=>e?i(De,{clsPrefix:o,class:`${o}-base-select-option__check`},{default:()=>i(Wd)}):null})}const si=q({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:o,pendingTmNodeRef:t,multipleRef:r,valueSetRef:n,renderLabelRef:l,renderOptionRef:a,labelFieldRef:s,valueFieldRef:d,showCheckmarkRef:c,nodePropsRef:u,handleOptionClick:f,handleOptionMouseEnter:p}=Se(mn),v=We(()=>{const{value:x}=t;return x?e.tmNode.key===x.key:!1});function h(x){const{tmNode:S}=e;S.disabled||f(x,S)}function m(x){const{tmNode:S}=e;S.disabled||p(x,S)}function b(x){const{tmNode:S}=e,{value:B}=v;S.disabled||B||p(x,S)}return{multiple:r,isGrouped:We(()=>{const{tmNode:x}=e,{parent:S}=x;return S&&S.rawNode.type==="group"}),showCheckmark:c,nodeProps:u,isPending:v,isSelected:We(()=>{const{value:x}=o,{value:S}=r;if(x===null)return!1;const B=e.tmNode.rawNode[d.value];if(S){const{value:T}=n;return T.has(B)}else return x===B}),labelField:s,renderLabel:l,renderOption:a,handleMouseMove:b,handleMouseEnter:m,handleClick:h}},render(){const{clsPrefix:e,tmNode:{rawNode:o},isSelected:t,isPending:r,isGrouped:n,showCheckmark:l,nodeProps:a,renderOption:s,renderLabel:d,handleClick:c,handleMouseEnter:u,handleMouseMove:f}=this,p=Tc(t,e),v=d?[d(o,t),l&&p]:[qe(o[this.labelField],o,t),l&&p],h=a==null?void 0:a(o),m=i("div",Object.assign({},h,{class:[`${e}-base-select-option`,o.class,h==null?void 0:h.class,{[`${e}-base-select-option--disabled`]:o.disabled,[`${e}-base-select-option--selected`]:t,[`${e}-base-select-option--grouped`]:n,[`${e}-base-select-option--pending`]:r,[`${e}-base-select-option--show-checkmark`]:l}],style:[(h==null?void 0:h.style)||"",o.style||""],onClick:Zt([c,h==null?void 0:h.onClick]),onMouseenter:Zt([u,h==null?void 0:h.onMouseenter]),onMousemove:Zt([f,h==null?void 0:h.onMousemove])}),i("div",{class:`${e}-base-select-option__content`},v));return o.render?o.render({node:m,option:o,selected:t}):s?s({node:m,option:o,selected:t}):m}}),di=q({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:o,labelFieldRef:t,nodePropsRef:r}=Se(mn);return{labelField:t,nodeProps:r,renderLabel:e,renderOption:o}},render(){const{clsPrefix:e,renderLabel:o,renderOption:t,nodeProps:r,tmNode:{rawNode:n}}=this,l=r==null?void 0:r(n),a=o?o(n,!1):qe(n[this.labelField],n,!1),s=i("div",Object.assign({},l,{class:[`${e}-base-select-group-header`,l==null?void 0:l.class]}),a);return n.render?n.render({node:s,option:n}):t?t({node:s,option:n,selected:!1}):s}}),{cubicBezierEaseIn:ci,cubicBezierEaseOut:ui}=So;function at({transformOrigin:e="inherit",duration:o=".2s",enterScale:t=".9",originalTransform:r="",originalTransition:n=""}={}){return[C("&.fade-in-scale-up-transition-leave-active",{transformOrigin:e,transition:`opacity ${o} ${ci}, transform ${o} ${ci} ${n&&","+n}`}),C("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${o} ${ui}, transform ${o} ${ui} ${n&&","+n}`}),C("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${t})`}),C("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const Fc=g("base-select-menu",` + line-height: 1.5; + outline: none; + z-index: 0; + position: relative; + border-radius: var(--n-border-radius); + transition: + background-color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); + background-color: var(--n-color); +`,[g("scrollbar",` + max-height: var(--n-height); + `),g("virtual-list",` + max-height: var(--n-height); + `),g("base-select-option",` + min-height: var(--n-option-height); + font-size: var(--n-option-font-size); + display: flex; + align-items: center; + `,[y("content",` + z-index: 1; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + `)]),g("base-select-group-header",` + min-height: var(--n-option-height); + font-size: .93em; + display: flex; + align-items: center; + `),g("base-select-menu-option-wrapper",` + position: relative; + width: 100%; + `),y("loading, empty",` + display: flex; + padding: 12px 32px; + flex: 1; + justify-content: center; + `),y("loading",` + color: var(--n-loading-color); + font-size: var(--n-loading-size); + `),y("action",` + padding: 8px var(--n-option-padding-left); + font-size: var(--n-option-font-size); + transition: + color .3s var(--n-bezier), + border-color .3s var(--n-bezier); + border-top: 1px solid var(--n-action-divider-color); + color: var(--n-action-text-color); + `),g("base-select-group-header",` + position: relative; + cursor: default; + padding: var(--n-option-padding); + color: var(--n-group-header-text-color); + `),g("base-select-option",` + cursor: pointer; + position: relative; + padding: var(--n-option-padding); + transition: + color .3s var(--n-bezier), + opacity .3s var(--n-bezier); + box-sizing: border-box; + color: var(--n-option-text-color); + opacity: 1; + `,[P("show-checkmark",` + padding-right: calc(var(--n-option-padding-right) + 20px); + `),C("&::before",` + content: ""; + position: absolute; + left: 4px; + right: 4px; + top: 0; + bottom: 0; + border-radius: var(--n-border-radius); + transition: background-color .3s var(--n-bezier); + `),C("&:active",` + color: var(--n-option-text-color-pressed); + `),P("grouped",` + padding-left: calc(var(--n-option-padding-left) * 1.5); + `),P("pending",[C("&::before",` + background-color: var(--n-option-color-pending); + `)]),P("selected",` + color: var(--n-option-text-color-active); + `,[C("&::before",` + background-color: var(--n-option-color-active); + `),P("pending",[C("&::before",` + background-color: var(--n-option-color-active-pending); + `)])]),P("disabled",` + cursor: not-allowed; + `,[je("selected",` + color: var(--n-option-text-color-disabled); + `),P("selected",` + opacity: var(--n-option-opacity-disabled); + `)]),y("check",` + font-size: 16px; + position: absolute; + right: calc(var(--n-option-padding-right) - 4px); + top: calc(50% - 7px); + color: var(--n-option-check-color); + transition: color .3s var(--n-bezier); + `,[at({enterScale:"0.5"})])])]),yn=q({name:"InternalSelectMenu",props:Object.assign(Object.assign({},ne.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const o=ne("InternalSelectMenu","-internal-select-menu",Fc,_r,e,le(e,"clsPrefix")),t=D(null),r=D(null),n=D(null),l=R(()=>e.treeMate.getFlattenedNodes()),a=R(()=>vd(l.value)),s=D(null);function d(){const{treeMate:N}=e;let G=null;const{value:Ce}=e;Ce===null?G=N.getFirstAvailableNode():(e.multiple?G=N.getNode((Ce||[])[(Ce||[]).length-1]):G=N.getNode(Ce),(!G||G.disabled)&&(G=N.getFirstAvailableNode())),L(G||null)}function c(){const{value:N}=s;N&&!e.treeMate.getNode(N.key)&&(s.value=null)}let u;Ke(()=>e.show,N=>{N?u=Ke(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?d():c(),io(M)):c()},{immediate:!0}):u==null||u()},{immediate:!0}),wo(()=>{u==null||u()});const f=R(()=>Mo(o.value.self[W("optionHeight",e.size)])),p=R(()=>Ko(o.value.self[W("padding",e.size)])),v=R(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),h=R(()=>{const N=l.value;return N&&N.length===0});function m(N){const{onToggle:G}=e;G&&G(N)}function b(N){const{onScroll:G}=e;G&&G(N)}function x(N){var G;(G=n.value)===null||G===void 0||G.sync(),b(N)}function S(){var N;(N=n.value)===null||N===void 0||N.sync()}function B(){const{value:N}=s;return N||null}function T(N,G){G.disabled||L(G,!1)}function z(N,G){G.disabled||m(G)}function I(N){var G;pt(N,"action")||(G=e.onKeyup)===null||G===void 0||G.call(e,N)}function w(N){var G;pt(N,"action")||(G=e.onKeydown)===null||G===void 0||G.call(e,N)}function O(N){var G;(G=e.onMousedown)===null||G===void 0||G.call(e,N),!e.focusable&&N.preventDefault()}function k(){const{value:N}=s;N&&L(N.getNext({loop:!0}),!0)}function $(){const{value:N}=s;N&&L(N.getPrev({loop:!0}),!0)}function L(N,G=!1){s.value=N,G&&M()}function M(){var N,G;const Ce=s.value;if(!Ce)return;const X=a.value(Ce.key);X!==null&&(e.virtualScroll?(N=r.value)===null||N===void 0||N.scrollTo({index:X}):(G=n.value)===null||G===void 0||G.scrollTo({index:X,elSize:f.value}))}function j(N){var G,Ce;!((G=t.value)===null||G===void 0)&&G.contains(N.target)&&((Ce=e.onFocus)===null||Ce===void 0||Ce.call(e,N))}function E(N){var G,Ce;!((G=t.value)===null||G===void 0)&&G.contains(N.relatedTarget)||(Ce=e.onBlur)===null||Ce===void 0||Ce.call(e,N)}Oe(mn,{handleOptionMouseEnter:T,handleOptionClick:z,valueSetRef:v,pendingTmNodeRef:s,nodePropsRef:le(e,"nodeProps"),showCheckmarkRef:le(e,"showCheckmark"),multipleRef:le(e,"multiple"),valueRef:le(e,"value"),renderLabelRef:le(e,"renderLabel"),renderOptionRef:le(e,"renderOption"),labelFieldRef:le(e,"labelField"),valueFieldRef:le(e,"valueField")}),Oe(el,t),mo(()=>{const{value:N}=n;N&&N.sync()});const U=R(()=>{const{size:N}=e,{common:{cubicBezierEaseInOut:G},self:{height:Ce,borderRadius:X,color:ve,groupHeaderTextColor:he,actionDividerColor:be,optionTextColorPressed:me,optionTextColor:se,optionTextColorDisabled:Re,optionTextColorActive:ge,optionOpacityDisabled:ee,optionCheckColor:xe,actionTextColor:de,optionColorPending:ye,optionColorActive:pe,loadingColor:Me,loadingSize:Q,optionColorActivePending:A,[W("optionFontSize",N)]:Z,[W("optionHeight",N)]:re,[W("optionPadding",N)]:ue}}=o.value;return{"--n-height":Ce,"--n-action-divider-color":be,"--n-action-text-color":de,"--n-bezier":G,"--n-border-radius":X,"--n-color":ve,"--n-option-font-size":Z,"--n-group-header-text-color":he,"--n-option-check-color":xe,"--n-option-color-pending":ye,"--n-option-color-active":pe,"--n-option-color-active-pending":A,"--n-option-height":re,"--n-option-opacity-disabled":ee,"--n-option-text-color":se,"--n-option-text-color-active":ge,"--n-option-text-color-disabled":Re,"--n-option-text-color-pressed":me,"--n-option-padding":ue,"--n-option-padding-left":Ko(ue,"left"),"--n-option-padding-right":Ko(ue,"right"),"--n-loading-color":Me,"--n-loading-size":Q}}),{inlineThemeDisabled:_}=e,V=_?Ae("internal-select-menu",R(()=>e.size[0]),U,e):void 0,te={selfRef:t,next:k,prev:$,getPendingTmNode:B};return nl(t,e.onResize),Object.assign({mergedTheme:o,virtualListRef:r,scrollbarRef:n,itemSize:f,padding:p,flattenedNodes:l,empty:h,virtualListContainer(){const{value:N}=r;return N==null?void 0:N.listElRef},virtualListContent(){const{value:N}=r;return N==null?void 0:N.itemsElRef},doScroll:b,handleFocusin:j,handleFocusout:E,handleKeyUp:I,handleKeyDown:w,handleMouseDown:O,handleVirtualListResize:S,handleVirtualListScroll:x,cssVars:_?void 0:U,themeClass:V==null?void 0:V.themeClass,onRender:V==null?void 0:V.onRender},te)},render(){const{$slots:e,virtualScroll:o,clsPrefix:t,mergedTheme:r,themeClass:n,onRender:l}=this;return l==null||l(),i("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${t}-base-select-menu`,n,this.multiple&&`${t}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},this.loading?i("div",{class:`${t}-base-select-menu__loading`},i(Et,{clsPrefix:t,strokeWidth:20})):this.empty?i("div",{class:`${t}-base-select-menu__empty`,"data-empty":!0},lo(e.empty,()=>[i(Sc,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty})])):i(ur,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:o?this.virtualListContainer:void 0,content:o?this.virtualListContent:void 0,onScroll:o?void 0:this.doScroll},{default:()=>o?i(nd,{ref:"virtualListRef",class:`${t}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?i(di,{key:a.key,clsPrefix:t,tmNode:a}):a.ignored?null:i(si,{clsPrefix:t,key:a.key,tmNode:a})}):i("div",{class:`${t}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?i(di,{key:a.key,clsPrefix:t,tmNode:a}):i(si,{clsPrefix:t,key:a.key,tmNode:a})))}),Ee(e.action,a=>a&&[i("div",{class:`${t}-base-select-menu__action`,"data-action":!0,key:"action"},a),i(ac,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),Oc=g("base-wave",` + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + border-radius: inherit; +`),bl=q({name:"BaseWave",props:{clsPrefix:{type:String,required:!0}},setup(e){Zo("-base-wave",Oc,le(e,"clsPrefix"));const o=D(null),t=D(!1);let r=null;return wo(()=>{r!==null&&window.clearTimeout(r)}),{active:t,selfRef:o,play(){r!==null&&(window.clearTimeout(r),t.value=!1,r=null),io(()=>{var n;(n=o.value)===null||n===void 0||n.offsetHeight,t.value=!0,r=window.setTimeout(()=>{t.value=!1,r=null},1e3)})}}},render(){const{clsPrefix:e}=this;return i("div",{ref:"selfRef","aria-hidden":!0,class:[`${e}-base-wave`,this.active&&`${e}-base-wave--active`]})}}),Mc={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"},xl=e=>{const{boxShadow2:o,popoverColor:t,textColor2:r,borderRadius:n,fontSize:l,dividerColor:a}=e;return Object.assign(Object.assign({},Mc),{fontSize:l,borderRadius:n,color:t,dividerColor:a,textColor:r,boxShadow:o})},_c={name:"Popover",common:Le,self:xl},jt=_c,Dc={name:"Popover",common:fe,self:xl},$t=Dc,Gr={top:"bottom",bottom:"top",left:"right",right:"left"},ro="var(--n-arrow-height) * 1.414",Lc=C([g("popover",` + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + position: relative; + font-size: var(--n-font-size); + color: var(--n-text-color); + box-shadow: var(--n-box-shadow); + word-break: break-word; + `,[C(">",[g("scrollbar",` + height: inherit; + max-height: inherit; + `)]),je("raw",` + background-color: var(--n-color); + border-radius: var(--n-border-radius); + `,[je("scrollable",[je("show-header-or-footer","padding: var(--n-padding);")])]),y("header",` + padding: var(--n-padding); + border-bottom: 1px solid var(--n-divider-color); + transition: border-color .3s var(--n-bezier); + `),y("footer",` + padding: var(--n-padding); + border-top: 1px solid var(--n-divider-color); + transition: border-color .3s var(--n-bezier); + `),P("scrollable, show-header-or-footer",[y("content",` + padding: var(--n-padding); + `)])]),g("popover-shared",` + transform-origin: inherit; + `,[g("popover-arrow-wrapper",` + position: absolute; + overflow: hidden; + pointer-events: none; + `,[g("popover-arrow",` + transition: background-color .3s var(--n-bezier); + position: absolute; + display: block; + width: calc(${ro}); + height: calc(${ro}); + box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12); + transform: rotate(45deg); + background-color: var(--n-color); + pointer-events: all; + `)]),C("&.popover-transition-enter-from, &.popover-transition-leave-to",` + opacity: 0; + transform: scale(.85); + `),C("&.popover-transition-enter-to, &.popover-transition-leave-from",` + transform: scale(1); + opacity: 1; + `),C("&.popover-transition-enter-active",` + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier), + opacity .15s var(--n-bezier-ease-out), + transform .15s var(--n-bezier-ease-out); + `),C("&.popover-transition-leave-active",` + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier), + opacity .15s var(--n-bezier-ease-in), + transform .15s var(--n-bezier-ease-in); + `)]),Oo("top-start",` + top: calc(${ro} / -2); + left: calc(${ot("top-start")} - var(--v-offset-left)); + `),Oo("top",` + top: calc(${ro} / -2); + transform: translateX(calc(${ro} / -2)) rotate(45deg); + left: 50%; + `),Oo("top-end",` + top: calc(${ro} / -2); + right: calc(${ot("top-end")} + var(--v-offset-left)); + `),Oo("bottom-start",` + bottom: calc(${ro} / -2); + left: calc(${ot("bottom-start")} - var(--v-offset-left)); + `),Oo("bottom",` + bottom: calc(${ro} / -2); + transform: translateX(calc(${ro} / -2)) rotate(45deg); + left: 50%; + `),Oo("bottom-end",` + bottom: calc(${ro} / -2); + right: calc(${ot("bottom-end")} + var(--v-offset-left)); + `),Oo("left-start",` + left: calc(${ro} / -2); + top: calc(${ot("left-start")} - var(--v-offset-top)); + `),Oo("left",` + left: calc(${ro} / -2); + transform: translateY(calc(${ro} / -2)) rotate(45deg); + top: 50%; + `),Oo("left-end",` + left: calc(${ro} / -2); + bottom: calc(${ot("left-end")} + var(--v-offset-top)); + `),Oo("right-start",` + right: calc(${ro} / -2); + top: calc(${ot("right-start")} - var(--v-offset-top)); + `),Oo("right",` + right: calc(${ro} / -2); + transform: translateY(calc(${ro} / -2)) rotate(45deg); + top: 50%; + `),Oo("right-end",` + right: calc(${ro} / -2); + bottom: calc(${ot("right-end")} + var(--v-offset-top)); + `),...ud({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,o)=>{const t=["right","left"].includes(o),r=t?"width":"height";return e.map(n=>{const l=n.split("-")[1]==="end",s=`calc((${`var(--v-target-${r}, 0px)`} - ${ro}) / 2)`,d=ot(n);return C(`[v-placement="${n}"] >`,[g("popover-shared",[P("center-arrow",[g("popover-arrow",`${o}: calc(max(${s}, ${d}) ${l?"+":"-"} var(--v-offset-${t?"left":"top"}));`)])])])})})]);function ot(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function Oo(e,o){const t=e.split("-")[0],r=["top","bottom"].includes(t)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return C(`[v-placement="${e}"] >`,[g("popover-shared",` + margin-${Gr[t]}: var(--n-space); + `,[P("show-arrow",` + margin-${Gr[t]}: var(--n-space-arrow); + `),P("overlap",` + margin: 0; + `),Rd("popover-arrow-wrapper",` + right: 0; + left: 0; + top: 0; + bottom: 0; + ${t}: 100%; + ${Gr[t]}: auto; + ${r} + `,[g("popover-arrow",o)])])])}const Cl=Object.assign(Object.assign({},ne.props),{to:Io.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number}),yl=({arrowStyle:e,clsPrefix:o})=>i("div",{key:"__popover-arrow__",class:`${o}-popover-arrow-wrapper`},i("div",{class:`${o}-popover-arrow`,style:e})),Hc=q({name:"PopoverBody",inheritAttrs:!1,props:Cl,setup(e,{slots:o,attrs:t}){const{namespaceRef:r,mergedClsPrefixRef:n,inlineThemeDisabled:l}=ke(e),a=ne("Popover","-popover",Lc,jt,e,n),s=D(null),d=Se("NPopover"),c=D(null),u=D(e.show),f=D(!1);oo(()=>{const{show:w}=e;w&&!Pd()&&!e.internalDeactivateImmediately&&(f.value=!0)});const p=R(()=>{const{trigger:w,onClickoutside:O}=e,k=[],{positionManuallyRef:{value:$}}=d;return $||(w==="click"&&!O&&k.push([Ft,T,void 0,{capture:!0}]),w==="hover"&&k.push([pd,B])),O&&k.push([Ft,T,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&f.value)&&k.push([Go,e.show]),k}),v=R(()=>{const w=e.width==="trigger"?void 0:eo(e.width),O=[];w&&O.push({width:w});const{maxWidth:k,minWidth:$}=e;return k&&O.push({maxWidth:eo(k)}),$&&O.push({maxWidth:eo($)}),l||O.push(h.value),O}),h=R(()=>{const{common:{cubicBezierEaseInOut:w,cubicBezierEaseIn:O,cubicBezierEaseOut:k},self:{space:$,spaceArrow:L,padding:M,fontSize:j,textColor:E,dividerColor:U,color:_,boxShadow:V,borderRadius:te,arrowHeight:N,arrowOffset:G,arrowOffsetVertical:Ce}}=a.value;return{"--n-box-shadow":V,"--n-bezier":w,"--n-bezier-ease-in":O,"--n-bezier-ease-out":k,"--n-font-size":j,"--n-text-color":E,"--n-color":_,"--n-divider-color":U,"--n-border-radius":te,"--n-arrow-height":N,"--n-arrow-offset":G,"--n-arrow-offset-vertical":Ce,"--n-padding":M,"--n-space":$,"--n-space-arrow":L}}),m=l?Ae("popover",void 0,h,e):void 0;d.setBodyInstance({syncPosition:b}),wo(()=>{d.setBodyInstance(null)}),Ke(le(e,"show"),w=>{e.animated||(w?u.value=!0:u.value=!1)});function b(){var w;(w=s.value)===null||w===void 0||w.syncPosition()}function x(w){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&d.handleMouseEnter(w)}function S(w){e.trigger==="hover"&&e.keepAliveOnHover&&d.handleMouseLeave(w)}function B(w){e.trigger==="hover"&&!z().contains(Qt(w))&&d.handleMouseMoveOutside(w)}function T(w){(e.trigger==="click"&&!z().contains(Qt(w))||e.onClickoutside)&&d.handleClickOutside(w)}function z(){return d.getTriggerElement()}Oe(Dt,c),Oe(cr,null),Oe(dr,null);function I(){if(m==null||m.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&f.value))return null;let O;const k=d.internalRenderBodyRef.value,{value:$}=n;if(k)O=k([`${$}-popover-shared`,m==null?void 0:m.themeClass.value,e.overlap&&`${$}-popover-shared--overlap`,e.showArrow&&`${$}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${$}-popover-shared--center-arrow`],c,v.value,x,S);else{const{value:L}=d.extraClassRef,{internalTrapFocus:M}=e,j=!ht(o.header)||!ht(o.footer),E=()=>{var U;const _=j?i(ao,null,Ee(o.header,N=>N?i("div",{class:`${$}-popover__header`,style:e.headerStyle},N):null),Ee(o.default,N=>N?i("div",{class:`${$}-popover__content`,style:e.contentStyle},o):null),Ee(o.footer,N=>N?i("div",{class:`${$}-popover__footer`,style:e.footerStyle},N):null)):e.scrollable?(U=o.default)===null||U===void 0?void 0:U.call(o):i("div",{class:`${$}-popover__content`,style:e.contentStyle},o),V=e.scrollable?i(gl,{contentClass:j?void 0:`${$}-popover__content`,contentStyle:j?void 0:e.contentStyle},{default:()=>_}):_,te=e.showArrow?yl({arrowStyle:e.arrowStyle,clsPrefix:$}):null;return[V,te]};O=i("div",ko({class:[`${$}-popover`,`${$}-popover-shared`,m==null?void 0:m.themeClass.value,L.map(U=>`${$}-${U}`),{[`${$}-popover--scrollable`]:e.scrollable,[`${$}-popover--show-header-or-footer`]:j,[`${$}-popover--raw`]:e.raw,[`${$}-popover-shared--overlap`]:e.overlap,[`${$}-popover-shared--show-arrow`]:e.showArrow,[`${$}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:c,style:v.value,onKeydown:d.handleKeydown,onMouseenter:x,onMouseleave:S},t),M?i(hn,{active:e.show,autoFocus:!0},{default:E}):E())}return Lo(O,p.value)}return{displayed:f,namespace:r,isMounted:d.isMountedRef,zIndex:d.zIndexRef,followerRef:s,adjustedTo:Io(e),followerEnabled:u,renderContentNode:I}},render(){return i(kr,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===Io.tdkey},{default:()=>this.animated?i(no,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}}),Ac=Object.keys(Cl),Ec={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function jc(e,o,t){Ec[o].forEach(r=>{e.props?e.props=Object.assign({},e.props):e.props={};const n=e.props[r],l=t[r];n?e.props[r]=(...a)=>{n(...a),l(...a)}:e.props[r]=l})}const bt={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:Io.propTo,scrollable:Boolean,contentStyle:[Object,String],headerStyle:[Object,String],footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Wc=Object.assign(Object.assign(Object.assign({},ne.props),bt),{internalOnAfterLeave:Function,internalRenderBody:Function}),hr=q({name:"Popover",inheritAttrs:!1,props:Wc,__popover__:!0,setup(e){const o=Ct(),t=D(null),r=R(()=>e.show),n=D(e.defaultShow),l=so(r,n),a=We(()=>e.disabled?!1:l.value),s=()=>{if(e.disabled)return!0;const{getDisabled:E}=e;return!!(E!=null&&E())},d=()=>s()?!1:l.value,c=gt(e,["arrow","showArrow"]),u=R(()=>e.overlap?!1:c.value);let f=null;const p=D(null),v=D(null),h=We(()=>e.x!==void 0&&e.y!==void 0);function m(E){const{"onUpdate:show":U,onUpdateShow:_,onShow:V,onHide:te}=e;n.value=E,U&&ae(U,E),_&&ae(_,E),E&&V&&ae(V,!0),E&&te&&ae(te,!1)}function b(){f&&f.syncPosition()}function x(){const{value:E}=p;E&&(window.clearTimeout(E),p.value=null)}function S(){const{value:E}=v;E&&(window.clearTimeout(E),v.value=null)}function B(){const E=s();if(e.trigger==="focus"&&!E){if(d())return;m(!0)}}function T(){const E=s();if(e.trigger==="focus"&&!E){if(!d())return;m(!1)}}function z(){const E=s();if(e.trigger==="hover"&&!E){if(S(),p.value!==null||d())return;const U=()=>{m(!0),p.value=null},{delay:_}=e;_===0?U():p.value=window.setTimeout(U,_)}}function I(){const E=s();if(e.trigger==="hover"&&!E){if(x(),v.value!==null||!d())return;const U=()=>{m(!1),v.value=null},{duration:_}=e;_===0?U():v.value=window.setTimeout(U,_)}}function w(){I()}function O(E){var U;d()&&(e.trigger==="click"&&(x(),S(),m(!1)),(U=e.onClickoutside)===null||U===void 0||U.call(e,E))}function k(){if(e.trigger==="click"&&!s()){x(),S();const E=!d();m(E)}}function $(E){e.internalTrapFocus&&E.key==="Escape"&&(x(),S(),m(!1))}function L(E){n.value=E}function M(){var E;return(E=t.value)===null||E===void 0?void 0:E.targetRef}function j(E){f=E}return Oe("NPopover",{getTriggerElement:M,handleKeydown:$,handleMouseEnter:z,handleMouseLeave:I,handleClickOutside:O,handleMouseMoveOutside:w,setBodyInstance:j,positionManuallyRef:h,isMountedRef:o,zIndexRef:le(e,"zIndex"),extraClassRef:le(e,"internalExtraClass"),internalRenderBodyRef:le(e,"internalRenderBody")}),oo(()=>{l.value&&s()&&m(!1)}),{binderInstRef:t,positionManually:h,mergedShowConsideringDisabledProp:a,uncontrolledShow:n,mergedShowArrow:u,getMergedShow:d,setShow:L,handleClick:k,handleMouseEnter:z,handleMouseLeave:I,handleFocus:B,handleBlur:T,syncPosition:b}},render(){var e;const{positionManually:o,$slots:t}=this;let r,n=!1;if(!o&&(t.activator?r=ln(t,"activator"):r=ln(t,"trigger"),r)){r=Jt(r),r=r.type===od?i("span",[r]):r;const l={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=r.type)===null||e===void 0)&&e.__popover__)n=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[l,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[l];else{const{internalInheritedEventHandlers:a}=this,s=[l,...a],d={onBlur:c=>{s.forEach(u=>{u.onBlur(c)})},onFocus:c=>{s.forEach(u=>{u.onFocus(c)})},onClick:c=>{s.forEach(u=>{u.onClick(c)})},onMouseenter:c=>{s.forEach(u=>{u.onMouseenter(c)})},onMouseleave:c=>{s.forEach(u=>{u.onMouseleave(c)})}};jc(r,a?"nested":o?"manual":this.trigger,d)}}return i(Ir,{ref:"binderInstRef",syncTarget:!n,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const l=this.getMergedShow();return[this.internalTrapFocus&&l?Lo(i("div",{style:{position:"fixed",inset:0}}),[[Tr,{enabled:l,zIndex:this.zIndex}]]):null,o?null:i(Br,null,{default:()=>r}),i(Hc,go(this.$props,Ac,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:l})),{default:()=>{var a,s;return(s=(a=this.$slots).default)===null||s===void 0?void 0:s.call(a)},header:()=>{var a,s;return(s=(a=this.$slots).header)===null||s===void 0?void 0:s.call(a)},footer:()=>{var a,s;return(s=(a=this.$slots).footer)===null||s===void 0?void 0:s.call(a)}})]}})}}),wl={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px",closeMarginRtl:"0 4px 0 0"},Nc={name:"Tag",common:fe,self(e){const{textColor2:o,primaryColorHover:t,primaryColorPressed:r,primaryColor:n,infoColor:l,successColor:a,warningColor:s,errorColor:d,baseColor:c,borderColor:u,tagColor:f,opacityDisabled:p,closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,closeColorHover:b,closeColorPressed:x,borderRadiusSmall:S,fontSizeMini:B,fontSizeTiny:T,fontSizeSmall:z,fontSizeMedium:I,heightMini:w,heightTiny:O,heightSmall:k,heightMedium:$,buttonColor2Hover:L,buttonColor2Pressed:M,fontWeightStrong:j}=e;return Object.assign(Object.assign({},wl),{closeBorderRadius:S,heightTiny:w,heightSmall:O,heightMedium:k,heightLarge:$,borderRadius:S,opacityDisabled:p,fontSizeTiny:B,fontSizeSmall:T,fontSizeMedium:z,fontSizeLarge:I,fontWeightStrong:j,textColorCheckable:o,textColorHoverCheckable:o,textColorPressedCheckable:o,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:L,colorPressedCheckable:M,colorChecked:n,colorCheckedHover:t,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:o,color:f,colorBordered:"#0000",closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,closeColorHover:b,closeColorPressed:x,borderPrimary:`1px solid ${J(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:J(n,{alpha:.16}),colorBorderedPrimary:"#0000",closeIconColorPrimary:Je(n,{lightness:.7}),closeIconColorHoverPrimary:Je(n,{lightness:.7}),closeIconColorPressedPrimary:Je(n,{lightness:.7}),closeColorHoverPrimary:J(n,{alpha:.16}),closeColorPressedPrimary:J(n,{alpha:.12}),borderInfo:`1px solid ${J(l,{alpha:.3})}`,textColorInfo:l,colorInfo:J(l,{alpha:.16}),colorBorderedInfo:"#0000",closeIconColorInfo:Je(l,{alpha:.7}),closeIconColorHoverInfo:Je(l,{alpha:.7}),closeIconColorPressedInfo:Je(l,{alpha:.7}),closeColorHoverInfo:J(l,{alpha:.16}),closeColorPressedInfo:J(l,{alpha:.12}),borderSuccess:`1px solid ${J(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:J(a,{alpha:.16}),colorBorderedSuccess:"#0000",closeIconColorSuccess:Je(a,{alpha:.7}),closeIconColorHoverSuccess:Je(a,{alpha:.7}),closeIconColorPressedSuccess:Je(a,{alpha:.7}),closeColorHoverSuccess:J(a,{alpha:.16}),closeColorPressedSuccess:J(a,{alpha:.12}),borderWarning:`1px solid ${J(s,{alpha:.3})}`,textColorWarning:s,colorWarning:J(s,{alpha:.16}),colorBorderedWarning:"#0000",closeIconColorWarning:Je(s,{alpha:.7}),closeIconColorHoverWarning:Je(s,{alpha:.7}),closeIconColorPressedWarning:Je(s,{alpha:.7}),closeColorHoverWarning:J(s,{alpha:.16}),closeColorPressedWarning:J(s,{alpha:.11}),borderError:`1px solid ${J(d,{alpha:.3})}`,textColorError:d,colorError:J(d,{alpha:.16}),colorBorderedError:"#0000",closeIconColorError:Je(d,{alpha:.7}),closeIconColorHoverError:Je(d,{alpha:.7}),closeIconColorPressedError:Je(d,{alpha:.7}),closeColorHoverError:J(d,{alpha:.16}),closeColorPressedError:J(d,{alpha:.12})})}},Sl=Nc,Vc=e=>{const{textColor2:o,primaryColorHover:t,primaryColorPressed:r,primaryColor:n,infoColor:l,successColor:a,warningColor:s,errorColor:d,baseColor:c,borderColor:u,opacityDisabled:f,tagColor:p,closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,borderRadiusSmall:b,fontSizeMini:x,fontSizeTiny:S,fontSizeSmall:B,fontSizeMedium:T,heightMini:z,heightTiny:I,heightSmall:w,heightMedium:O,closeColorHover:k,closeColorPressed:$,buttonColor2Hover:L,buttonColor2Pressed:M,fontWeightStrong:j}=e;return Object.assign(Object.assign({},wl),{closeBorderRadius:b,heightTiny:z,heightSmall:I,heightMedium:w,heightLarge:O,borderRadius:b,opacityDisabled:f,fontSizeTiny:x,fontSizeSmall:S,fontSizeMedium:B,fontSizeLarge:T,fontWeightStrong:j,textColorCheckable:o,textColorHoverCheckable:o,textColorPressedCheckable:o,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:L,colorPressedCheckable:M,colorChecked:n,colorCheckedHover:t,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:o,color:p,colorBordered:"rgb(250, 250, 252)",closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,closeColorHover:k,closeColorPressed:$,borderPrimary:`1px solid ${J(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:J(n,{alpha:.12}),colorBorderedPrimary:J(n,{alpha:.1}),closeIconColorPrimary:n,closeIconColorHoverPrimary:n,closeIconColorPressedPrimary:n,closeColorHoverPrimary:J(n,{alpha:.12}),closeColorPressedPrimary:J(n,{alpha:.18}),borderInfo:`1px solid ${J(l,{alpha:.3})}`,textColorInfo:l,colorInfo:J(l,{alpha:.12}),colorBorderedInfo:J(l,{alpha:.1}),closeIconColorInfo:l,closeIconColorHoverInfo:l,closeIconColorPressedInfo:l,closeColorHoverInfo:J(l,{alpha:.12}),closeColorPressedInfo:J(l,{alpha:.18}),borderSuccess:`1px solid ${J(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:J(a,{alpha:.12}),colorBorderedSuccess:J(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:J(a,{alpha:.12}),closeColorPressedSuccess:J(a,{alpha:.18}),borderWarning:`1px solid ${J(s,{alpha:.35})}`,textColorWarning:s,colorWarning:J(s,{alpha:.15}),colorBorderedWarning:J(s,{alpha:.12}),closeIconColorWarning:s,closeIconColorHoverWarning:s,closeIconColorPressedWarning:s,closeColorHoverWarning:J(s,{alpha:.12}),closeColorPressedWarning:J(s,{alpha:.18}),borderError:`1px solid ${J(d,{alpha:.23})}`,textColorError:d,colorError:J(d,{alpha:.1}),colorBorderedError:J(d,{alpha:.08}),closeIconColorError:d,closeIconColorHoverError:d,closeIconColorPressedError:d,closeColorHoverError:J(d,{alpha:.12}),closeColorPressedError:J(d,{alpha:.18})})},Uc={name:"Tag",common:Le,self:Vc},Kc=Uc,Gc={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},qc=g("tag",` + white-space: nowrap; + position: relative; + box-sizing: border-box; + cursor: default; + display: inline-flex; + align-items: center; + flex-wrap: nowrap; + padding: var(--n-padding); + border-radius: var(--n-border-radius); + color: var(--n-text-color); + background-color: var(--n-color); + transition: + border-color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier), + opacity .3s var(--n-bezier); + line-height: 1; + height: var(--n-height); + font-size: var(--n-font-size); +`,[P("strong",` + font-weight: var(--n-font-weight-strong); + `),y("border",` + pointer-events: none; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + border-radius: inherit; + border: var(--n-border); + transition: border-color .3s var(--n-bezier); + `),y("icon",` + display: flex; + margin: 0 4px 0 0; + color: var(--n-text-color); + transition: color .3s var(--n-bezier); + font-size: var(--n-avatar-size-override); + `),y("avatar",` + display: flex; + margin: 0 6px 0 0; + `),y("close",` + margin: var(--n-close-margin); + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + `),P("round",` + padding: 0 calc(var(--n-height) / 3); + border-radius: calc(var(--n-height) / 2); + `,[y("icon",` + margin: 0 4px 0 calc((var(--n-height) - 8px) / -2); + `),y("avatar",` + margin: 0 6px 0 calc((var(--n-height) - 8px) / -2); + `),P("closable",` + padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3); + `)]),P("icon, avatar",[P("round",` + padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2); + `)]),P("disabled",` + cursor: not-allowed !important; + opacity: var(--n-opacity-disabled); + `),P("checkable",` + cursor: pointer; + box-shadow: none; + color: var(--n-text-color-checkable); + background-color: var(--n-color-checkable); + `,[je("disabled",[C("&:hover","background-color: var(--n-color-hover-checkable);",[je("checked","color: var(--n-text-color-hover-checkable);")]),C("&:active","background-color: var(--n-color-pressed-checkable);",[je("checked","color: var(--n-text-color-pressed-checkable);")])]),P("checked",` + color: var(--n-text-color-checked); + background-color: var(--n-color-checked); + `,[je("disabled",[C("&:hover","background-color: var(--n-color-checked-hover);"),C("&:active","background-color: var(--n-color-checked-pressed);")])])])]),Yc=Object.assign(Object.assign(Object.assign({},ne.props),Gc),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),zl="n-tag",qr=q({name:"Tag",props:Yc,setup(e){const o=D(null),{mergedBorderedRef:t,mergedClsPrefixRef:r,inlineThemeDisabled:n,mergedRtlRef:l}=ke(e),a=ne("Tag","-tag",qc,Kc,e,r);Oe(zl,{roundRef:le(e,"round")});function s(v){if(!e.disabled&&e.checkable){const{checked:h,onCheckedChange:m,onUpdateChecked:b,"onUpdate:checked":x}=e;b&&b(!h),x&&x(!h),m&&m(!h)}}function d(v){if(e.triggerClickOnClose||v.stopPropagation(),!e.disabled){const{onClose:h}=e;h&&ae(h,v)}}const c={setTextContent(v){const{value:h}=o;h&&(h.textContent=v)}},u=to("Tag",l,r),f=R(()=>{const{type:v,size:h,color:{color:m,textColor:b}={}}=e,{common:{cubicBezierEaseInOut:x},self:{padding:S,closeMargin:B,closeMarginRtl:T,borderRadius:z,opacityDisabled:I,textColorCheckable:w,textColorHoverCheckable:O,textColorPressedCheckable:k,textColorChecked:$,colorCheckable:L,colorHoverCheckable:M,colorPressedCheckable:j,colorChecked:E,colorCheckedHover:U,colorCheckedPressed:_,closeBorderRadius:V,fontWeightStrong:te,[W("colorBordered",v)]:N,[W("closeSize",h)]:G,[W("closeIconSize",h)]:Ce,[W("fontSize",h)]:X,[W("height",h)]:ve,[W("color",v)]:he,[W("textColor",v)]:be,[W("border",v)]:me,[W("closeIconColor",v)]:se,[W("closeIconColorHover",v)]:Re,[W("closeIconColorPressed",v)]:ge,[W("closeColorHover",v)]:ee,[W("closeColorPressed",v)]:xe}}=a.value;return{"--n-font-weight-strong":te,"--n-avatar-size-override":`calc(${ve} - 8px)`,"--n-bezier":x,"--n-border-radius":z,"--n-border":me,"--n-close-icon-size":Ce,"--n-close-color-pressed":xe,"--n-close-color-hover":ee,"--n-close-border-radius":V,"--n-close-icon-color":se,"--n-close-icon-color-hover":Re,"--n-close-icon-color-pressed":ge,"--n-close-icon-color-disabled":se,"--n-close-margin":B,"--n-close-margin-rtl":T,"--n-close-size":G,"--n-color":m||(t.value?N:he),"--n-color-checkable":L,"--n-color-checked":E,"--n-color-checked-hover":U,"--n-color-checked-pressed":_,"--n-color-hover-checkable":M,"--n-color-pressed-checkable":j,"--n-font-size":X,"--n-height":ve,"--n-opacity-disabled":I,"--n-padding":S,"--n-text-color":b||be,"--n-text-color-checkable":w,"--n-text-color-checked":$,"--n-text-color-hover-checkable":O,"--n-text-color-pressed-checkable":k}}),p=n?Ae("tag",R(()=>{let v="";const{type:h,size:m,color:{color:b,textColor:x}={}}=e;return v+=h[0],v+=m[0],b&&(v+=`a${Ot(b)}`),x&&(v+=`b${Ot(x)}`),t.value&&(v+="c"),v}),f,e):void 0;return Object.assign(Object.assign({},c),{rtlEnabled:u,mergedClsPrefix:r,contentRef:o,mergedBordered:t,handleClick:s,handleCloseClick:d,cssVars:n?void 0:f,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender})},render(){var e,o;const{mergedClsPrefix:t,rtlEnabled:r,closable:n,color:{borderColor:l}={},round:a,onRender:s,$slots:d}=this;s==null||s();const c=Ee(d.avatar,f=>f&&i("div",{class:`${t}-tag__avatar`},f)),u=Ee(d.icon,f=>f&&i("div",{class:`${t}-tag__icon`},f));return i("div",{class:[`${t}-tag`,this.themeClass,{[`${t}-tag--rtl`]:r,[`${t}-tag--strong`]:this.strong,[`${t}-tag--disabled`]:this.disabled,[`${t}-tag--checkable`]:this.checkable,[`${t}-tag--checked`]:this.checkable&&this.checked,[`${t}-tag--round`]:a,[`${t}-tag--avatar`]:c,[`${t}-tag--icon`]:u,[`${t}-tag--closable`]:n}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},u||c,i("span",{class:`${t}-tag__content`,ref:"contentRef"},(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e)),!this.checkable&&n?i(St,{clsPrefix:t,class:`${t}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?i("div",{class:`${t}-tag__border`,style:{borderColor:l}}):null)}}),Xc=g("base-clear",` + flex-shrink: 0; + height: 1em; + width: 1em; + position: relative; +`,[C(">",[y("clear",` + font-size: var(--n-clear-size); + height: 1em; + width: 1em; + cursor: pointer; + color: var(--n-clear-color); + transition: color .3s var(--n-bezier); + display: flex; + `,[C("&:hover",` + color: var(--n-clear-color-hover)!important; + `),C("&:active",` + color: var(--n-clear-color-pressed)!important; + `)]),y("placeholder",` + display: flex; + `),y("clear, placeholder",` + position: absolute; + left: 50%; + top: 50%; + transform: translateX(-50%) translateY(-50%); + `,[lt({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),dn=q({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return Zo("-base-clear",Xc,le(e,"clsPrefix")),{handleMouseDown(o){o.preventDefault()}}},render(){const{clsPrefix:e}=this;return i("div",{class:`${e}-base-clear`},i(At,null,{default:()=>{var o,t;return this.show?i("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},lo(this.$slots.icon,()=>[i(De,{clsPrefix:e},{default:()=>i(Zd,null)})])):i("div",{key:"icon",class:`${e}-base-clear__placeholder`},(t=(o=this.$slots).placeholder)===null||t===void 0?void 0:t.call(o))}}))}}),$l=q({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:o}){return()=>{const{clsPrefix:t}=e;return i(Et,{clsPrefix:t,class:`${t}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?i(dn,{clsPrefix:t,show:e.showClear,onClear:e.onClear},{placeholder:()=>i(De,{clsPrefix:t,class:`${t}-base-suffix__arrow`},{default:()=>lo(o.default,()=>[i(Xd,null)])})}):null})}}}),Rl={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"},Zc=e=>{const{borderRadius:o,textColor2:t,textColorDisabled:r,inputColor:n,inputColorDisabled:l,primaryColor:a,primaryColorHover:s,warningColor:d,warningColorHover:c,errorColor:u,errorColorHover:f,borderColor:p,iconColor:v,iconColorDisabled:h,clearColor:m,clearColorHover:b,clearColorPressed:x,placeholderColor:S,placeholderColorDisabled:B,fontSizeTiny:T,fontSizeSmall:z,fontSizeMedium:I,fontSizeLarge:w,heightTiny:O,heightSmall:k,heightMedium:$,heightLarge:L}=e;return Object.assign(Object.assign({},Rl),{fontSizeTiny:T,fontSizeSmall:z,fontSizeMedium:I,fontSizeLarge:w,heightTiny:O,heightSmall:k,heightMedium:$,heightLarge:L,borderRadius:o,textColor:t,textColorDisabled:r,placeholderColor:S,placeholderColorDisabled:B,color:n,colorDisabled:l,colorActive:n,border:`1px solid ${p}`,borderHover:`1px solid ${s}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${s}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${J(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${J(a,{alpha:.2})}`,caretColor:a,arrowColor:v,arrowColorDisabled:h,loadingColor:a,borderWarning:`1px solid ${d}`,borderHoverWarning:`1px solid ${c}`,borderActiveWarning:`1px solid ${d}`,borderFocusWarning:`1px solid ${c}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${J(d,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${J(d,{alpha:.2})}`,colorActiveWarning:n,caretColorWarning:d,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${f}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${f}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${J(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${J(u,{alpha:.2})}`,colorActiveError:n,caretColorError:u,clearColor:m,clearColorHover:b,clearColorPressed:x})},Qc={name:"InternalSelection",common:Le,peers:{Popover:jt},self:Zc},Pl=Qc,Jc={name:"InternalSelection",common:fe,peers:{Popover:$t},self(e){const{borderRadius:o,textColor2:t,textColorDisabled:r,inputColor:n,inputColorDisabled:l,primaryColor:a,primaryColorHover:s,warningColor:d,warningColorHover:c,errorColor:u,errorColorHover:f,iconColor:p,iconColorDisabled:v,clearColor:h,clearColorHover:m,clearColorPressed:b,placeholderColor:x,placeholderColorDisabled:S,fontSizeTiny:B,fontSizeSmall:T,fontSizeMedium:z,fontSizeLarge:I,heightTiny:w,heightSmall:O,heightMedium:k,heightLarge:$}=e;return Object.assign(Object.assign({},Rl),{fontSizeTiny:B,fontSizeSmall:T,fontSizeMedium:z,fontSizeLarge:I,heightTiny:w,heightSmall:O,heightMedium:k,heightLarge:$,borderRadius:o,textColor:t,textColorDisabled:r,placeholderColor:x,placeholderColorDisabled:S,color:n,colorDisabled:l,colorActive:J(a,{alpha:.1}),border:"1px solid #0000",borderHover:`1px solid ${s}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${s}`,boxShadowHover:"none",boxShadowActive:`0 0 8px 0 ${J(a,{alpha:.4})}`,boxShadowFocus:`0 0 8px 0 ${J(a,{alpha:.4})}`,caretColor:a,arrowColor:p,arrowColorDisabled:v,loadingColor:a,borderWarning:`1px solid ${d}`,borderHoverWarning:`1px solid ${c}`,borderActiveWarning:`1px solid ${d}`,borderFocusWarning:`1px solid ${c}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 8px 0 ${J(d,{alpha:.4})}`,boxShadowFocusWarning:`0 0 8px 0 ${J(d,{alpha:.4})}`,colorActiveWarning:J(d,{alpha:.1}),caretColorWarning:d,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${f}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${f}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 8px 0 ${J(u,{alpha:.4})}`,boxShadowFocusError:`0 0 8px 0 ${J(u,{alpha:.4})}`,colorActiveError:J(u,{alpha:.1}),caretColorError:u,clearColor:h,clearColorHover:m,clearColorPressed:b})}},wn=Jc,eu=C([g("base-selection",` + position: relative; + z-index: auto; + box-shadow: none; + width: 100%; + max-width: 100%; + display: inline-block; + vertical-align: bottom; + border-radius: var(--n-border-radius); + min-height: var(--n-height); + line-height: 1.5; + font-size: var(--n-font-size); + `,[g("base-loading",` + color: var(--n-loading-color); + `),g("base-selection-tags","min-height: var(--n-height);"),y("border, state-border",` + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + pointer-events: none; + border: var(--n-border); + border-radius: inherit; + transition: + box-shadow .3s var(--n-bezier), + border-color .3s var(--n-bezier); + `),y("state-border",` + z-index: 1; + border-color: #0000; + `),g("base-suffix",` + cursor: pointer; + position: absolute; + top: 50%; + transform: translateY(-50%); + right: 10px; + `,[y("arrow",` + font-size: var(--n-arrow-size); + color: var(--n-arrow-color); + transition: color .3s var(--n-bezier); + `)]),g("base-selection-overlay",` + display: flex; + align-items: center; + white-space: nowrap; + pointer-events: none; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + padding: var(--n-padding-single); + transition: color .3s var(--n-bezier); + `,[y("wrapper",` + flex-basis: 0; + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; + `)]),g("base-selection-placeholder",` + color: var(--n-placeholder-color); + `,[y("inner",` + max-width: 100%; + overflow: hidden; + `)]),g("base-selection-tags",` + cursor: pointer; + outline: none; + box-sizing: border-box; + position: relative; + z-index: auto; + display: flex; + padding: var(--n-padding-multiple); + flex-wrap: wrap; + align-items: center; + width: 100%; + vertical-align: bottom; + background-color: var(--n-color); + border-radius: inherit; + transition: + color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier); + `),g("base-selection-label",` + height: var(--n-height); + display: inline-flex; + width: 100%; + vertical-align: bottom; + cursor: pointer; + outline: none; + z-index: auto; + box-sizing: border-box; + position: relative; + transition: + color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier); + border-radius: inherit; + background-color: var(--n-color); + align-items: center; + `,[g("base-selection-input",` + font-size: inherit; + line-height: inherit; + outline: none; + cursor: pointer; + box-sizing: border-box; + border:none; + width: 100%; + padding: var(--n-padding-single); + background-color: #0000; + color: var(--n-text-color); + transition: color .3s var(--n-bezier); + caret-color: var(--n-caret-color); + `,[y("content",` + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + `)]),y("render-label",` + color: var(--n-text-color); + `)]),je("disabled",[C("&:hover",[y("state-border",` + box-shadow: var(--n-box-shadow-hover); + border: var(--n-border-hover); + `)]),P("focus",[y("state-border",` + box-shadow: var(--n-box-shadow-focus); + border: var(--n-border-focus); + `)]),P("active",[y("state-border",` + box-shadow: var(--n-box-shadow-active); + border: var(--n-border-active); + `),g("base-selection-label","background-color: var(--n-color-active);"),g("base-selection-tags","background-color: var(--n-color-active);")])]),P("disabled","cursor: not-allowed;",[y("arrow",` + color: var(--n-arrow-color-disabled); + `),g("base-selection-label",` + cursor: not-allowed; + background-color: var(--n-color-disabled); + `,[g("base-selection-input",` + cursor: not-allowed; + color: var(--n-text-color-disabled); + `),y("render-label",` + color: var(--n-text-color-disabled); + `)]),g("base-selection-tags",` + cursor: not-allowed; + background-color: var(--n-color-disabled); + `),g("base-selection-placeholder",` + cursor: not-allowed; + color: var(--n-placeholder-color-disabled); + `)]),g("base-selection-input-tag",` + height: calc(var(--n-height) - 6px); + line-height: calc(var(--n-height) - 6px); + outline: none; + display: none; + position: relative; + margin-bottom: 3px; + max-width: 100%; + vertical-align: bottom; + `,[y("input",` + font-size: inherit; + font-family: inherit; + min-width: 1px; + padding: 0; + background-color: #0000; + outline: none; + border: none; + max-width: 100%; + overflow: hidden; + width: 1em; + line-height: inherit; + cursor: pointer; + color: var(--n-text-color); + caret-color: var(--n-caret-color); + `),y("mirror",` + position: absolute; + left: 0; + top: 0; + white-space: pre; + visibility: hidden; + user-select: none; + -webkit-user-select: none; + opacity: 0; + `)]),["warning","error"].map(e=>P(`${e}-status`,[y("state-border",`border: var(--n-border-${e});`),je("disabled",[C("&:hover",[y("state-border",` + box-shadow: var(--n-box-shadow-hover-${e}); + border: var(--n-border-hover-${e}); + `)]),P("active",[y("state-border",` + box-shadow: var(--n-box-shadow-active-${e}); + border: var(--n-border-active-${e}); + `),g("base-selection-label",`background-color: var(--n-color-active-${e});`),g("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),P("focus",[y("state-border",` + box-shadow: var(--n-box-shadow-focus-${e}); + border: var(--n-border-focus-${e}); + `)])])]))]),g("base-selection-popover",` + margin-bottom: -3px; + display: flex; + flex-wrap: wrap; + margin-right: -8px; + `),g("base-selection-tag-wrapper",` + max-width: 100%; + display: inline-flex; + padding: 0 7px 3px 0; + `,[C("&:last-child","padding-right: 0;"),g("tag",` + font-size: 14px; + max-width: 100%; + `,[y("content",` + line-height: 1.25; + text-overflow: ellipsis; + overflow: hidden; + `)])])]),ou=q({name:"InternalSelection",props:Object.assign(Object.assign({},ne.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const o=D(null),t=D(null),r=D(null),n=D(null),l=D(null),a=D(null),s=D(null),d=D(null),c=D(null),u=D(null),f=D(!1),p=D(!1),v=D(!1),h=ne("InternalSelection","-internal-selection",eu,Pl,e,le(e,"clsPrefix")),m=R(()=>e.clearable&&!e.disabled&&(v.value||e.active)),b=R(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):qe(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),x=R(()=>{const Y=e.selectedOption;if(Y)return Y[e.labelField]}),S=R(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function B(){var Y;const{value:ce}=o;if(ce){const{value:He}=t;He&&(He.style.width=`${ce.offsetWidth}px`,e.maxTagCount!=="responsive"&&((Y=c.value)===null||Y===void 0||Y.sync()))}}function T(){const{value:Y}=u;Y&&(Y.style.display="none")}function z(){const{value:Y}=u;Y&&(Y.style.display="inline-block")}Ke(le(e,"active"),Y=>{Y||T()}),Ke(le(e,"pattern"),()=>{e.multiple&&io(B)});function I(Y){const{onFocus:ce}=e;ce&&ce(Y)}function w(Y){const{onBlur:ce}=e;ce&&ce(Y)}function O(Y){const{onDeleteOption:ce}=e;ce&&ce(Y)}function k(Y){const{onClear:ce}=e;ce&&ce(Y)}function $(Y){const{onPatternInput:ce}=e;ce&&ce(Y)}function L(Y){var ce;(!Y.relatedTarget||!(!((ce=r.value)===null||ce===void 0)&&ce.contains(Y.relatedTarget)))&&I(Y)}function M(Y){var ce;!((ce=r.value)===null||ce===void 0)&&ce.contains(Y.relatedTarget)||w(Y)}function j(Y){k(Y)}function E(){v.value=!0}function U(){v.value=!1}function _(Y){!e.active||!e.filterable||Y.target!==t.value&&Y.preventDefault()}function V(Y){O(Y)}function te(Y){if(Y.key==="Backspace"&&!N.value&&!e.pattern.length){const{selectedOptions:ce}=e;ce!=null&&ce.length&&V(ce[ce.length-1])}}const N=D(!1);let G=null;function Ce(Y){const{value:ce}=o;if(ce){const He=Y.target.value;ce.textContent=He,B()}e.ignoreComposition&&N.value?G=Y:$(Y)}function X(){N.value=!0}function ve(){N.value=!1,e.ignoreComposition&&$(G),G=null}function he(Y){var ce;p.value=!0,(ce=e.onPatternFocus)===null||ce===void 0||ce.call(e,Y)}function be(Y){var ce;p.value=!1,(ce=e.onPatternBlur)===null||ce===void 0||ce.call(e,Y)}function me(){var Y,ce;if(e.filterable)p.value=!1,(Y=a.value)===null||Y===void 0||Y.blur(),(ce=t.value)===null||ce===void 0||ce.blur();else if(e.multiple){const{value:He}=n;He==null||He.blur()}else{const{value:He}=l;He==null||He.blur()}}function se(){var Y,ce,He;e.filterable?(p.value=!1,(Y=a.value)===null||Y===void 0||Y.focus()):e.multiple?(ce=n.value)===null||ce===void 0||ce.focus():(He=l.value)===null||He===void 0||He.focus()}function Re(){const{value:Y}=t;Y&&(z(),Y.focus())}function ge(){const{value:Y}=t;Y&&Y.blur()}function ee(Y){const{value:ce}=s;ce&&ce.setTextContent(`+${Y}`)}function xe(){const{value:Y}=d;return Y}function de(){return t.value}let ye=null;function pe(){ye!==null&&window.clearTimeout(ye)}function Me(){e.disabled||e.active||(pe(),ye=window.setTimeout(()=>{S.value&&(f.value=!0)},100))}function Q(){pe()}function A(Y){Y||(pe(),f.value=!1)}Ke(S,Y=>{Y||(f.value=!1)}),mo(()=>{oo(()=>{const Y=a.value;Y&&(Y.tabIndex=e.disabled||p.value?-1:0)})}),nl(r,e.onResize);const{inlineThemeDisabled:Z}=e,re=R(()=>{const{size:Y}=e,{common:{cubicBezierEaseInOut:ce},self:{borderRadius:He,color:Ve,placeholderColor:Ze,textColor:po,paddingSingle:fo,paddingMultiple:Bo,caretColor:To,colorDisabled:xo,textColorDisabled:Co,placeholderColorDisabled:Ao,colorActive:Fo,boxShadowFocus:co,boxShadowActive:uo,boxShadowHover:F,border:K,borderFocus:ie,borderHover:ze,borderActive:Pe,arrowColor:Ie,arrowColorDisabled:Te,loadingColor:_e,colorActiveWarning:Qe,boxShadowFocusWarning:vo,boxShadowActiveWarning:Wo,boxShadowHoverWarning:No,borderWarning:st,borderFocusWarning:Kt,borderHoverWarning:Rt,borderActiveWarning:Vo,colorActiveError:H,boxShadowFocusError:oe,boxShadowActiveError:Fe,boxShadowHoverError:Ge,borderError:Ye,borderFocusError:Ue,borderHoverError:Qo,borderActiveError:Jo,clearColor:et,clearColorHover:dt,clearColorPressed:ct,clearSize:Gt,arrowSize:Er,[W("height",Y)]:jr,[W("fontSize",Y)]:Wr}}=h.value;return{"--n-bezier":ce,"--n-border":K,"--n-border-active":Pe,"--n-border-focus":ie,"--n-border-hover":ze,"--n-border-radius":He,"--n-box-shadow-active":uo,"--n-box-shadow-focus":co,"--n-box-shadow-hover":F,"--n-caret-color":To,"--n-color":Ve,"--n-color-active":Fo,"--n-color-disabled":xo,"--n-font-size":Wr,"--n-height":jr,"--n-padding-single":fo,"--n-padding-multiple":Bo,"--n-placeholder-color":Ze,"--n-placeholder-color-disabled":Ao,"--n-text-color":po,"--n-text-color-disabled":Co,"--n-arrow-color":Ie,"--n-arrow-color-disabled":Te,"--n-loading-color":_e,"--n-color-active-warning":Qe,"--n-box-shadow-focus-warning":vo,"--n-box-shadow-active-warning":Wo,"--n-box-shadow-hover-warning":No,"--n-border-warning":st,"--n-border-focus-warning":Kt,"--n-border-hover-warning":Rt,"--n-border-active-warning":Vo,"--n-color-active-error":H,"--n-box-shadow-focus-error":oe,"--n-box-shadow-active-error":Fe,"--n-box-shadow-hover-error":Ge,"--n-border-error":Ye,"--n-border-focus-error":Ue,"--n-border-hover-error":Qo,"--n-border-active-error":Jo,"--n-clear-size":Gt,"--n-clear-color":et,"--n-clear-color-hover":dt,"--n-clear-color-pressed":ct,"--n-arrow-size":Er}}),ue=Z?Ae("internal-selection",R(()=>e.size[0]),re,e):void 0;return{mergedTheme:h,mergedClearable:m,patternInputFocused:p,filterablePlaceholder:b,label:x,selected:S,showTagsPanel:f,isComposing:N,counterRef:s,counterWrapperRef:d,patternInputMirrorRef:o,patternInputRef:t,selfRef:r,multipleElRef:n,singleElRef:l,patternInputWrapperRef:a,overflowRef:c,inputTagElRef:u,handleMouseDown:_,handleFocusin:L,handleClear:j,handleMouseEnter:E,handleMouseLeave:U,handleDeleteOption:V,handlePatternKeyDown:te,handlePatternInputInput:Ce,handlePatternInputBlur:be,handlePatternInputFocus:he,handleMouseEnterCounter:Me,handleMouseLeaveCounter:Q,handleFocusout:M,handleCompositionEnd:ve,handleCompositionStart:X,onPopoverUpdateShow:A,focus:se,focusInput:Re,blur:me,blurInput:ge,updateCounter:ee,getCounter:xe,getTail:de,renderLabel:e.renderLabel,cssVars:Z?void 0:re,themeClass:ue==null?void 0:ue.themeClass,onRender:ue==null?void 0:ue.onRender}},render(){const{status:e,multiple:o,size:t,disabled:r,filterable:n,maxTagCount:l,bordered:a,clsPrefix:s,onRender:d,renderTag:c,renderLabel:u}=this;d==null||d();const f=l==="responsive",p=typeof l=="number",v=f||p,h=i(sn,null,{default:()=>i($l,{clsPrefix:s,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var b,x;return(x=(b=this.$slots).arrow)===null||x===void 0?void 0:x.call(b)}})});let m;if(o){const{labelField:b}=this,x=M=>i("div",{class:`${s}-base-selection-tag-wrapper`,key:M.value},c?c({option:M,handleClose:()=>{this.handleDeleteOption(M)}}):i(qr,{size:t,closable:!M.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(M)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(M,!0):qe(M[b],M,!0)})),S=()=>(p?this.selectedOptions.slice(0,l):this.selectedOptions).map(x),B=n?i("div",{class:`${s}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${s}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i("span",{ref:"patternInputMirrorRef",class:`${s}-base-selection-input-tag__mirror`},this.pattern)):null,T=f?()=>i("div",{class:`${s}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i(qr,{size:t,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let z;if(p){const M=this.selectedOptions.length-l;M>0&&(z=i("div",{class:`${s}-base-selection-tag-wrapper`,key:"__counter__"},i(qr,{size:t,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${M}`})))}const I=f?n?i(Vn,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:T,tail:()=>B}):i(Vn,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:T}):p?S().concat(z):S(),w=v?()=>i("div",{class:`${s}-base-selection-popover`},f?S():this.selectedOptions.map(x)):void 0,O=v?{show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover}:null,$=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i("div",{class:`${s}-base-selection-placeholder ${s}-base-selection-overlay`},i("div",{class:`${s}-base-selection-placeholder__inner`},this.placeholder)):null,L=n?i("div",{ref:"patternInputWrapperRef",class:`${s}-base-selection-tags`},I,f?null:B,h):i("div",{ref:"multipleElRef",class:`${s}-base-selection-tags`,tabindex:r?void 0:0},I,h);m=i(ao,null,v?i(hr,Object.assign({},O,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>L,default:w}):L,$)}else if(n){const b=this.pattern||this.isComposing,x=this.active?!b:!this.selected,S=this.active?!1:this.selected;m=i("div",{ref:"patternInputWrapperRef",class:`${s}-base-selection-label`},i("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${s}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?i("div",{class:`${s}-base-selection-label__render-label ${s}-base-selection-overlay`,key:"input"},i("div",{class:`${s}-base-selection-overlay__wrapper`},c?c({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):qe(this.label,this.selectedOption,!0))):null,x?i("div",{class:`${s}-base-selection-placeholder ${s}-base-selection-overlay`,key:"placeholder"},i("div",{class:`${s}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,h)}else m=i("div",{ref:"singleElRef",class:`${s}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i("div",{class:`${s}-base-selection-input`,title:Gi(this.label),key:"input"},i("div",{class:`${s}-base-selection-input__content`},c?c({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):qe(this.label,this.selectedOption,!0))):i("div",{class:`${s}-base-selection-placeholder ${s}-base-selection-overlay`,key:"placeholder"},i("div",{class:`${s}-base-selection-placeholder__inner`},this.placeholder)),h);return i("div",{ref:"selfRef",class:[`${s}-base-selection`,this.themeClass,e&&`${s}-base-selection--${e}-status`,{[`${s}-base-selection--active`]:this.active,[`${s}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${s}-base-selection--disabled`]:this.disabled,[`${s}-base-selection--multiple`]:this.multiple,[`${s}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},m,a?i("div",{class:`${s}-base-selection__border`}):null,a?i("div",{class:`${s}-base-selection__state-border`}):null)}}),fi=q({name:"SlotMachineNumber",props:{clsPrefix:{type:String,required:!0},value:{type:[Number,String],required:!0},oldOriginalNumber:{type:Number,default:void 0},newOriginalNumber:{type:Number,default:void 0}},setup(e){const o=D(null),t=D(e.value),r=D(e.value),n=D("up"),l=D(!1),a=R(()=>l.value?`${e.clsPrefix}-base-slot-machine-current-number--${n.value}-scroll`:null),s=R(()=>l.value?`${e.clsPrefix}-base-slot-machine-old-number--${n.value}-scroll`:null);Ke(le(e,"value"),(u,f)=>{t.value=f,r.value=u,io(d)});function d(){const u=e.newOriginalNumber,f=e.oldOriginalNumber;f===void 0||u===void 0||(u>f?c("up"):f>u&&c("down"))}function c(u){n.value=u,l.value=!1,io(()=>{var f;(f=o.value)===null||f===void 0||f.offsetWidth,l.value=!0})}return()=>{const{clsPrefix:u}=e;return i("span",{ref:o,class:`${u}-base-slot-machine-number`},t.value!==null?i("span",{class:[`${u}-base-slot-machine-old-number ${u}-base-slot-machine-old-number--top`,s.value]},t.value):null,i("span",{class:[`${u}-base-slot-machine-current-number`,a.value]},i("span",{ref:"numberWrapper",class:[`${u}-base-slot-machine-current-number__inner`,typeof e.value!="number"&&`${u}-base-slot-machine-current-number__inner--not-number`]},r.value)),t.value!==null?i("span",{class:[`${u}-base-slot-machine-old-number ${u}-base-slot-machine-old-number--bottom`,s.value]},t.value):null)}}}),{cubicBezierEaseInOut:nt}=So;function kl({duration:e=".2s",delay:o=".1s"}={}){return[C("&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to",{opacity:1}),C("&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from",` + opacity: 0!important; + margin-left: 0!important; + margin-right: 0!important; + `),C("&.fade-in-width-expand-transition-leave-active",` + overflow: hidden; + transition: + opacity ${e} ${nt}, + max-width ${e} ${nt} ${o}, + margin-left ${e} ${nt} ${o}, + margin-right ${e} ${nt} ${o}; + `),C("&.fade-in-width-expand-transition-enter-active",` + overflow: hidden; + transition: + opacity ${e} ${nt} ${o}, + max-width ${e} ${nt}, + margin-left ${e} ${nt}, + margin-right ${e} ${nt}; + `)]}const{cubicBezierEaseOut:kt}=So;function tu({duration:e=".2s"}={}){return[C("&.fade-up-width-expand-transition-leave-active",{transition:` + opacity ${e} ${kt}, + max-width ${e} ${kt}, + transform ${e} ${kt} + `}),C("&.fade-up-width-expand-transition-enter-active",{transition:` + opacity ${e} ${kt}, + max-width ${e} ${kt}, + transform ${e} ${kt} + `}),C("&.fade-up-width-expand-transition-enter-to",{opacity:1,transform:"translateX(0) translateY(0)"}),C("&.fade-up-width-expand-transition-enter-from",{maxWidth:"0 !important",opacity:0,transform:"translateY(60%)"}),C("&.fade-up-width-expand-transition-leave-from",{opacity:1,transform:"translateY(0)"}),C("&.fade-up-width-expand-transition-leave-to",{maxWidth:"0 !important",opacity:0,transform:"translateY(60%)"})]}const ru=C([C("@keyframes n-base-slot-machine-fade-up-in",` + from { + transform: translateY(60%); + opacity: 0; + } + to { + transform: translateY(0); + opacity: 1; + } + `),C("@keyframes n-base-slot-machine-fade-down-in",` + from { + transform: translateY(-60%); + opacity: 0; + } + to { + transform: translateY(0); + opacity: 1; + } + `),C("@keyframes n-base-slot-machine-fade-up-out",` + from { + transform: translateY(0%); + opacity: 1; + } + to { + transform: translateY(-60%); + opacity: 0; + } + `),C("@keyframes n-base-slot-machine-fade-down-out",` + from { + transform: translateY(0%); + opacity: 1; + } + to { + transform: translateY(60%); + opacity: 0; + } + `),g("base-slot-machine",` + overflow: hidden; + white-space: nowrap; + display: inline-block; + height: 18px; + line-height: 18px; + `,[g("base-slot-machine-number",` + display: inline-block; + position: relative; + height: 18px; + width: .6em; + max-width: .6em; + `,[tu({duration:".2s"}),kl({duration:".2s",delay:"0s"}),g("base-slot-machine-old-number",` + display: inline-block; + opacity: 0; + position: absolute; + left: 0; + right: 0; + `,[P("top",{transform:"translateY(-100%)"}),P("bottom",{transform:"translateY(100%)"}),P("down-scroll",{animation:"n-base-slot-machine-fade-down-out .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),P("up-scroll",{animation:"n-base-slot-machine-fade-up-out .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1})]),g("base-slot-machine-current-number",` + display: inline-block; + position: absolute; + left: 0; + top: 0; + bottom: 0; + right: 0; + opacity: 1; + transform: translateY(0); + width: .6em; + `,[P("down-scroll",{animation:"n-base-slot-machine-fade-down-in .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),P("up-scroll",{animation:"n-base-slot-machine-fade-up-in .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),y("inner",` + display: inline-block; + position: absolute; + right: 0; + top: 0; + width: .6em; + `,[P("not-number",` + right: unset; + left: 0; + `)])])])])]),nu=q({name:"BaseSlotMachine",props:{clsPrefix:{type:String,required:!0},value:{type:[Number,String],default:0},max:{type:Number,default:void 0},appeared:{type:Boolean,required:!0}},setup(e){Zo("-base-slot-machine",ru,le(e,"clsPrefix"));const o=D(),t=D(),r=R(()=>{if(typeof e.value=="string")return[];if(e.value<1)return[0];const n=[];let l=e.value;for(e.max!==void 0&&(l=Math.min(e.max,l));l>=1;)n.push(l%10),l/=10,l=Math.floor(l);return n.reverse(),n});return Ke(le(e,"value"),(n,l)=>{typeof n=="string"?(t.value=void 0,o.value=void 0):typeof l=="string"?(t.value=n,o.value=void 0):(t.value=n,o.value=l)}),()=>{const{value:n,clsPrefix:l}=e;return typeof n=="number"?i("span",{class:`${l}-base-slot-machine`},i(fn,{name:"fade-up-width-expand-transition",tag:"span"},{default:()=>r.value.map((a,s)=>i(fi,{clsPrefix:l,key:r.value.length-s-1,oldOriginalNumber:o.value,newOriginalNumber:t.value,value:a}))}),i(wt,{key:"+",width:!0},{default:()=>e.max!==void 0&&e.max{const{lineHeight:o,borderRadius:t,fontWeightStrong:r,baseColor:n,dividerColor:l,actionColor:a,textColor1:s,textColor2:d,closeColorHover:c,closeColorPressed:u,closeIconColor:f,closeIconColorHover:p,closeIconColorPressed:v,infoColor:h,successColor:m,warningColor:b,errorColor:x,fontSize:S}=e;return Object.assign(Object.assign({},Il),{fontSize:S,lineHeight:o,titleFontWeight:r,borderRadius:t,border:`1px solid ${l}`,color:a,titleTextColor:s,iconColor:d,contentTextColor:d,closeBorderRadius:t,closeColorHover:c,closeColorPressed:u,closeIconColor:f,closeIconColorHover:p,closeIconColorPressed:v,borderInfo:`1px solid ${$e(n,J(h,{alpha:.25}))}`,colorInfo:$e(n,J(h,{alpha:.08})),titleTextColorInfo:s,iconColorInfo:h,contentTextColorInfo:d,closeColorHoverInfo:c,closeColorPressedInfo:u,closeIconColorInfo:f,closeIconColorHoverInfo:p,closeIconColorPressedInfo:v,borderSuccess:`1px solid ${$e(n,J(m,{alpha:.25}))}`,colorSuccess:$e(n,J(m,{alpha:.08})),titleTextColorSuccess:s,iconColorSuccess:m,contentTextColorSuccess:d,closeColorHoverSuccess:c,closeColorPressedSuccess:u,closeIconColorSuccess:f,closeIconColorHoverSuccess:p,closeIconColorPressedSuccess:v,borderWarning:`1px solid ${$e(n,J(b,{alpha:.33}))}`,colorWarning:$e(n,J(b,{alpha:.08})),titleTextColorWarning:s,iconColorWarning:b,contentTextColorWarning:d,closeColorHoverWarning:c,closeColorPressedWarning:u,closeIconColorWarning:f,closeIconColorHoverWarning:p,closeIconColorPressedWarning:v,borderError:`1px solid ${$e(n,J(x,{alpha:.25}))}`,colorError:$e(n,J(x,{alpha:.08})),titleTextColorError:s,iconColorError:x,contentTextColorError:d,closeColorHoverError:c,closeColorPressedError:u,closeIconColorError:f,closeIconColorHoverError:p,closeIconColorPressedError:v})},su={name:"Alert",common:Le,self:au},du=su,{cubicBezierEaseInOut:Uo,cubicBezierEaseOut:cu,cubicBezierEaseIn:uu}=So;function rr({overflow:e="hidden",duration:o=".3s",originalTransition:t="",leavingDelay:r="0s",foldPadding:n=!1,enterToProps:l=void 0,leaveToProps:a=void 0,reverse:s=!1}={}){const d=s?"leave":"enter",c=s?"enter":"leave";return[C(`&.fade-in-height-expand-transition-${c}-from, + &.fade-in-height-expand-transition-${d}-to`,Object.assign(Object.assign({},l),{opacity:1})),C(`&.fade-in-height-expand-transition-${c}-to, + &.fade-in-height-expand-transition-${d}-from`,Object.assign(Object.assign({},a),{opacity:0,marginTop:"0 !important",marginBottom:"0 !important",paddingTop:n?"0 !important":void 0,paddingBottom:n?"0 !important":void 0})),C(`&.fade-in-height-expand-transition-${c}-active`,` + overflow: ${e}; + transition: + max-height ${o} ${Uo} ${r}, + opacity ${o} ${cu} ${r}, + margin-top ${o} ${Uo} ${r}, + margin-bottom ${o} ${Uo} ${r}, + padding-top ${o} ${Uo} ${r}, + padding-bottom ${o} ${Uo} ${r} + ${t?","+t:""} + `),C(`&.fade-in-height-expand-transition-${d}-active`,` + overflow: ${e}; + transition: + max-height ${o} ${Uo}, + opacity ${o} ${uu}, + margin-top ${o} ${Uo}, + margin-bottom ${o} ${Uo}, + padding-top ${o} ${Uo}, + padding-bottom ${o} ${Uo} + ${t?","+t:""} + `)]}const fu=g("alert",` + line-height: var(--n-line-height); + border-radius: var(--n-border-radius); + position: relative; + transition: background-color .3s var(--n-bezier); + background-color: var(--n-color); + text-align: start; + word-break: break-word; +`,[y("border",` + border-radius: inherit; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + transition: border-color .3s var(--n-bezier); + border: var(--n-border); + pointer-events: none; + `),P("closable",[g("alert-body",[y("title",` + padding-right: 24px; + `)])]),y("icon",{color:"var(--n-icon-color)"}),g("alert-body",{padding:"var(--n-padding)"},[y("title",{color:"var(--n-title-text-color)"}),y("content",{color:"var(--n-content-text-color)"})]),rr({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),y("icon",` + position: absolute; + left: 0; + top: 0; + align-items: center; + justify-content: center; + display: flex; + width: var(--n-icon-size); + height: var(--n-icon-size); + font-size: var(--n-icon-size); + margin: var(--n-icon-margin); + `),y("close",` + transition: + color .3s var(--n-bezier), + background-color .3s var(--n-bezier); + position: absolute; + right: 0; + top: 0; + margin: var(--n-close-margin); + `),P("show-icon",[g("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),g("alert-body",` + border-radius: var(--n-border-radius); + transition: border-color .3s var(--n-bezier); + `,[y("title",` + transition: color .3s var(--n-bezier); + font-size: 16px; + line-height: 19px; + font-weight: var(--n-title-font-weight); + `,[C("& +",[y("content",{marginTop:"9px"})])]),y("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),y("icon",{transition:"color .3s var(--n-bezier)"})]),hu=Object.assign(Object.assign({},ne.props),{title:String,showIcon:{type:Boolean,default:!0},type:{type:String,default:"default"},bordered:{type:Boolean,default:!0},closable:Boolean,onClose:Function,onAfterLeave:Function,onAfterHide:Function}),f1=q({name:"Alert",inheritAttrs:!1,props:hu,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=ke(e),l=ne("Alert","-alert",fu,du,e,o),a=to("Alert",n,o),s=R(()=>{const{common:{cubicBezierEaseInOut:v},self:h}=l.value,{fontSize:m,borderRadius:b,titleFontWeight:x,lineHeight:S,iconSize:B,iconMargin:T,iconMarginRtl:z,closeIconSize:I,closeBorderRadius:w,closeSize:O,closeMargin:k,closeMarginRtl:$,padding:L}=h,{type:M}=e,{left:j,right:E}=Ko(T);return{"--n-bezier":v,"--n-color":h[W("color",M)],"--n-close-icon-size":I,"--n-close-border-radius":w,"--n-close-color-hover":h[W("closeColorHover",M)],"--n-close-color-pressed":h[W("closeColorPressed",M)],"--n-close-icon-color":h[W("closeIconColor",M)],"--n-close-icon-color-hover":h[W("closeIconColorHover",M)],"--n-close-icon-color-pressed":h[W("closeIconColorPressed",M)],"--n-icon-color":h[W("iconColor",M)],"--n-border":h[W("border",M)],"--n-title-text-color":h[W("titleTextColor",M)],"--n-content-text-color":h[W("contentTextColor",M)],"--n-line-height":S,"--n-border-radius":b,"--n-font-size":m,"--n-title-font-weight":x,"--n-icon-size":B,"--n-icon-margin":T,"--n-icon-margin-rtl":z,"--n-close-size":O,"--n-close-margin":k,"--n-close-margin-rtl":$,"--n-padding":L,"--n-icon-margin-left":j,"--n-icon-margin-right":E}}),d=r?Ae("alert",R(()=>e.type[0]),s,e):void 0,c=D(!0),u=()=>{const{onAfterLeave:v,onAfterHide:h}=e;v&&v(),h&&h()};return{rtlEnabled:a,mergedClsPrefix:o,mergedBordered:t,visible:c,handleCloseClick:()=>{var v;Promise.resolve((v=e.onClose)===null||v===void 0?void 0:v.call(e)).then(h=>{h!==!1&&(c.value=!1)})},handleAfterLeave:()=>{u()},mergedTheme:l,cssVars:r?void 0:s,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),i(wt,{onAfterLeave:this.handleAfterLeave},{default:()=>{const{mergedClsPrefix:o,$slots:t}=this,r={class:[`${o}-alert`,this.themeClass,this.closable&&`${o}-alert--closable`,this.showIcon&&`${o}-alert--show-icon`,this.rtlEnabled&&`${o}-alert--rtl`],style:this.cssVars,role:"alert"};return this.visible?i("div",Object.assign({},ko(this.$attrs,r)),this.closable&&i(St,{clsPrefix:o,class:`${o}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&i("div",{class:`${o}-alert__border`}),this.showIcon&&i("div",{class:`${o}-alert__icon`,"aria-hidden":"true"},lo(t.icon,()=>[i(De,{clsPrefix:o},{default:()=>{switch(this.type){case"success":return i(Ht,null);case"info":return i(mt,null);case"warning":return i(yt,null);case"error":return i(Lt,null);default:return null}}})])),i("div",{class:[`${o}-alert-body`,this.mergedBordered&&`${o}-alert-body--bordered`]},Ee(t.header,n=>{const l=n||this.title;return l?i("div",{class:`${o}-alert-body__title`},l):null}),t.default&&i("div",{class:`${o}-alert-body__content`},t))):null}})}}),pu={linkFontSize:"13px",linkPadding:"0 0 0 16px",railWidth:"4px"},vu=e=>{const{borderRadius:o,railColor:t,primaryColor:r,primaryColorHover:n,primaryColorPressed:l,textColor2:a}=e;return Object.assign(Object.assign({},pu),{borderRadius:o,railColor:t,railColorActive:r,linkColor:J(r,{alpha:.15}),linkTextColor:a,linkTextColorHover:n,linkTextColorPressed:l,linkTextColorActive:r})},gu={name:"Anchor",common:fe,self:vu},mu=gu;function Rr(e){return e.type==="group"}function Bl(e){return e.type==="ignored"}function Yr(e,o){try{return!!(1+o.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function Tl(e,o){return{getIsGroup:Rr,getIgnored:Bl,getKey(r){return Rr(r)?r.name||r.key||"key-required":r[e]},getChildren(r){return r[o]}}}function bu(e,o,t,r){if(!o)return e;function n(l){if(!Array.isArray(l))return[];const a=[];for(const s of l)if(Rr(s)){const d=n(s[r]);d.length&&a.push(Object.assign({},s,{[r]:d}))}else{if(Bl(s))continue;o(t,s)&&a.push(s)}return a}return n(e)}function xu(e,o,t){const r=new Map;return e.forEach(n=>{Rr(n)?n[t].forEach(l=>{r.set(l[o],l)}):r.set(n[o],n)}),r}const Cu=jo&&"chrome"in window;jo&&navigator.userAgent.includes("Firefox");const Fl=jo&&navigator.userAgent.includes("Safari")&&!Cu,Ol={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"},yu={name:"Input",common:fe,self(e){const{textColor2:o,textColor3:t,textColorDisabled:r,primaryColor:n,primaryColorHover:l,inputColor:a,inputColorDisabled:s,warningColor:d,warningColorHover:c,errorColor:u,errorColorHover:f,borderRadius:p,lineHeight:v,fontSizeTiny:h,fontSizeSmall:m,fontSizeMedium:b,fontSizeLarge:x,heightTiny:S,heightSmall:B,heightMedium:T,heightLarge:z,clearColor:I,clearColorHover:w,clearColorPressed:O,placeholderColor:k,placeholderColorDisabled:$,iconColor:L,iconColorDisabled:M,iconColorHover:j,iconColorPressed:E}=e;return Object.assign(Object.assign({},Ol),{countTextColorDisabled:r,countTextColor:t,heightTiny:S,heightSmall:B,heightMedium:T,heightLarge:z,fontSizeTiny:h,fontSizeSmall:m,fontSizeMedium:b,fontSizeLarge:x,lineHeight:v,lineHeightTextarea:v,borderRadius:p,iconSize:"16px",groupLabelColor:a,textColor:o,textColorDisabled:r,textDecorationColor:o,groupLabelTextColor:o,caretColor:n,placeholderColor:k,placeholderColorDisabled:$,color:a,colorDisabled:s,colorFocus:J(n,{alpha:.1}),groupLabelBorder:"1px solid #0000",border:"1px solid #0000",borderHover:`1px solid ${l}`,borderDisabled:"1px solid #0000",borderFocus:`1px solid ${l}`,boxShadowFocus:`0 0 8px 0 ${J(n,{alpha:.3})}`,loadingColor:n,loadingColorWarning:d,borderWarning:`1px solid ${d}`,borderHoverWarning:`1px solid ${c}`,colorFocusWarning:J(d,{alpha:.1}),borderFocusWarning:`1px solid ${c}`,boxShadowFocusWarning:`0 0 8px 0 ${J(d,{alpha:.3})}`,caretColorWarning:d,loadingColorError:u,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${f}`,colorFocusError:J(u,{alpha:.1}),borderFocusError:`1px solid ${f}`,boxShadowFocusError:`0 0 8px 0 ${J(u,{alpha:.3})}`,caretColorError:u,clearColor:I,clearColorHover:w,clearColorPressed:O,iconColor:L,iconColorDisabled:M,iconColorHover:j,iconColorPressed:E,suffixTextColor:o})}},Ho=yu,wu=e=>{const{textColor2:o,textColor3:t,textColorDisabled:r,primaryColor:n,primaryColorHover:l,inputColor:a,inputColorDisabled:s,borderColor:d,warningColor:c,warningColorHover:u,errorColor:f,errorColorHover:p,borderRadius:v,lineHeight:h,fontSizeTiny:m,fontSizeSmall:b,fontSizeMedium:x,fontSizeLarge:S,heightTiny:B,heightSmall:T,heightMedium:z,heightLarge:I,actionColor:w,clearColor:O,clearColorHover:k,clearColorPressed:$,placeholderColor:L,placeholderColorDisabled:M,iconColor:j,iconColorDisabled:E,iconColorHover:U,iconColorPressed:_}=e;return Object.assign(Object.assign({},Ol),{countTextColorDisabled:r,countTextColor:t,heightTiny:B,heightSmall:T,heightMedium:z,heightLarge:I,fontSizeTiny:m,fontSizeSmall:b,fontSizeMedium:x,fontSizeLarge:S,lineHeight:h,lineHeightTextarea:h,borderRadius:v,iconSize:"16px",groupLabelColor:w,groupLabelTextColor:o,textColor:o,textColorDisabled:r,textDecorationColor:o,caretColor:n,placeholderColor:L,placeholderColorDisabled:M,color:a,colorDisabled:s,colorFocus:a,groupLabelBorder:`1px solid ${d}`,border:`1px solid ${d}`,borderHover:`1px solid ${l}`,borderDisabled:`1px solid ${d}`,borderFocus:`1px solid ${l}`,boxShadowFocus:`0 0 0 2px ${J(n,{alpha:.2})}`,loadingColor:n,loadingColorWarning:c,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${u}`,colorFocusWarning:a,borderFocusWarning:`1px solid ${u}`,boxShadowFocusWarning:`0 0 0 2px ${J(c,{alpha:.2})}`,caretColorWarning:c,loadingColorError:f,borderError:`1px solid ${f}`,borderHoverError:`1px solid ${p}`,colorFocusError:a,borderFocusError:`1px solid ${p}`,boxShadowFocusError:`0 0 0 2px ${J(f,{alpha:.2})}`,caretColorError:f,clearColor:O,clearColorHover:k,clearColorPressed:$,iconColor:j,iconColorDisabled:E,iconColorHover:U,iconColorPressed:_,suffixTextColor:o})},Su={name:"Input",common:Le,self:wu},pr=Su,Ml="n-input";function zu(e){let o=0;for(const t of e)o++;return o}function mr(e){return e===""||e==null}function $u(e){const o=D(null);function t(){const{value:l}=e;if(!(l!=null&&l.focus)){n();return}const{selectionStart:a,selectionEnd:s,value:d}=l;if(a==null||s==null){n();return}o.value={start:a,end:s,beforeText:d.slice(0,a),afterText:d.slice(s)}}function r(){var l;const{value:a}=o,{value:s}=e;if(!a||!s)return;const{value:d}=s,{start:c,beforeText:u,afterText:f}=a;let p=d.length;if(d.endsWith(f))p=d.length-f.length;else if(d.startsWith(u))p=u.length;else{const v=u[c-1],h=d.indexOf(v,c-1);h!==-1&&(p=h+1)}(l=s.setSelectionRange)===null||l===void 0||l.call(s,p,p)}function n(){o.value=null}return Ke(e,n),{recordCursor:t,restoreCursor:r}}const hi=q({name:"InputWordCount",setup(e,{slots:o}){const{mergedValueRef:t,maxlengthRef:r,mergedClsPrefixRef:n,countGraphemesRef:l}=Se(Ml),a=R(()=>{const{value:s}=t;return s===null||Array.isArray(s)?0:(l.value||zu)(s)});return()=>{const{value:s}=r,{value:d}=t;return i("span",{class:`${n.value}-input-word-count`},an(o.default,{value:d===null||Array.isArray(d)?"":d},()=>[s===void 0?a.value:`${a.value} / ${s}`]))}}}),Ru=g("input",` + max-width: 100%; + cursor: text; + line-height: 1.5; + z-index: auto; + outline: none; + box-sizing: border-box; + position: relative; + display: inline-flex; + border-radius: var(--n-border-radius); + background-color: var(--n-color); + transition: background-color .3s var(--n-bezier); + font-size: var(--n-font-size); + --n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2); +`,[y("input, textarea",` + overflow: hidden; + flex-grow: 1; + position: relative; + `),y("input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder",` + box-sizing: border-box; + font-size: inherit; + line-height: 1.5; + font-family: inherit; + border: none; + outline: none; + background-color: #0000; + text-align: inherit; + transition: + -webkit-text-fill-color .3s var(--n-bezier), + caret-color .3s var(--n-bezier), + color .3s var(--n-bezier), + text-decoration-color .3s var(--n-bezier); + `),y("input-el, textarea-el",` + -webkit-appearance: none; + scrollbar-width: none; + width: 100%; + min-width: 0; + text-decoration-color: var(--n-text-decoration-color); + color: var(--n-text-color); + caret-color: var(--n-caret-color); + background-color: transparent; + `,[C("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",` + width: 0; + height: 0; + display: none; + `),C("&::placeholder",` + color: #0000; + -webkit-text-fill-color: transparent !important; + `),C("&:-webkit-autofill ~",[y("placeholder","display: none;")])]),P("round",[je("textarea","border-radius: calc(var(--n-height) / 2);")]),y("placeholder",` + pointer-events: none; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + overflow: hidden; + color: var(--n-placeholder-color); + `,[C("span",` + width: 100%; + display: inline-block; + `)]),P("textarea",[y("placeholder","overflow: visible;")]),je("autosize","width: 100%;"),P("autosize",[y("textarea-el, input-el",` + position: absolute; + top: 0; + left: 0; + height: 100%; + `)]),g("input-wrapper",` + overflow: hidden; + display: inline-flex; + flex-grow: 1; + position: relative; + padding-left: var(--n-padding-left); + padding-right: var(--n-padding-right); + `),y("input-mirror",` + padding: 0; + height: var(--n-height); + line-height: var(--n-height); + overflow: hidden; + visibility: hidden; + position: static; + white-space: pre; + pointer-events: none; + `),y("input-el",` + padding: 0; + height: var(--n-height); + line-height: var(--n-height); + `,[C("+",[y("placeholder",` + display: flex; + align-items: center; + `)])]),je("textarea",[y("placeholder","white-space: nowrap;")]),y("eye",` + display: flex; + align-items: center; + justify-content: center; + transition: color .3s var(--n-bezier); + `),P("textarea","width: 100%;",[g("input-word-count",` + position: absolute; + right: var(--n-padding-right); + bottom: var(--n-padding-vertical); + `),P("resizable",[g("input-wrapper",` + resize: vertical; + min-height: var(--n-height); + `)]),y("textarea-el, textarea-mirror, placeholder",` + height: 100%; + padding-left: 0; + padding-right: 0; + padding-top: var(--n-padding-vertical); + padding-bottom: var(--n-padding-vertical); + word-break: break-word; + display: inline-block; + vertical-align: bottom; + box-sizing: border-box; + line-height: var(--n-line-height-textarea); + margin: 0; + resize: none; + white-space: pre-wrap; + `),y("textarea-mirror",` + width: 100%; + pointer-events: none; + overflow: hidden; + visibility: hidden; + position: static; + white-space: pre-wrap; + overflow-wrap: break-word; + `)]),P("pair",[y("input-el, placeholder","text-align: center;"),y("separator",` + display: flex; + align-items: center; + transition: color .3s var(--n-bezier); + color: var(--n-text-color); + white-space: nowrap; + `,[g("icon",` + color: var(--n-icon-color); + `),g("base-icon",` + color: var(--n-icon-color); + `)])]),P("disabled",` + cursor: not-allowed; + background-color: var(--n-color-disabled); + `,[y("border","border: var(--n-border-disabled);"),y("input-el, textarea-el",` + cursor: not-allowed; + color: var(--n-text-color-disabled); + text-decoration-color: var(--n-text-color-disabled); + `),y("placeholder","color: var(--n-placeholder-color-disabled);"),y("separator","color: var(--n-text-color-disabled);",[g("icon",` + color: var(--n-icon-color-disabled); + `),g("base-icon",` + color: var(--n-icon-color-disabled); + `)]),g("input-word-count",` + color: var(--n-count-text-color-disabled); + `),y("suffix, prefix","color: var(--n-text-color-disabled);",[g("icon",` + color: var(--n-icon-color-disabled); + `),g("internal-icon",` + color: var(--n-icon-color-disabled); + `)])]),je("disabled",[y("eye",` + color: var(--n-icon-color); + cursor: pointer; + `,[C("&:hover",` + color: var(--n-icon-color-hover); + `),C("&:active",` + color: var(--n-icon-color-pressed); + `)]),C("&:hover",[y("state-border","border: var(--n-border-hover);")]),P("focus","background-color: var(--n-color-focus);",[y("state-border",` + border: var(--n-border-focus); + box-shadow: var(--n-box-shadow-focus); + `)])]),y("border, state-border",` + box-sizing: border-box; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + pointer-events: none; + border-radius: inherit; + border: var(--n-border); + transition: + box-shadow .3s var(--n-bezier), + border-color .3s var(--n-bezier); + `),y("state-border",` + border-color: #0000; + z-index: 1; + `),y("prefix","margin-right: 4px;"),y("suffix",` + margin-left: 4px; + `),y("suffix, prefix",` + transition: color .3s var(--n-bezier); + flex-wrap: nowrap; + flex-shrink: 0; + line-height: var(--n-height); + white-space: nowrap; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--n-suffix-text-color); + `,[g("base-loading",` + font-size: var(--n-icon-size); + margin: 0 2px; + color: var(--n-loading-color); + `),g("base-clear",` + font-size: var(--n-icon-size); + `,[y("placeholder",[g("base-icon",` + transition: color .3s var(--n-bezier); + color: var(--n-icon-color); + font-size: var(--n-icon-size); + `)])]),C(">",[g("icon",` + transition: color .3s var(--n-bezier); + color: var(--n-icon-color); + font-size: var(--n-icon-size); + `)]),g("base-icon",` + font-size: var(--n-icon-size); + `)]),g("input-word-count",` + pointer-events: none; + line-height: 1.5; + font-size: .85em; + color: var(--n-count-text-color); + transition: color .3s var(--n-bezier); + margin-left: 4px; + font-variant: tabular-nums; + `),["warning","error"].map(e=>P(`${e}-status`,[je("disabled",[g("base-loading",` + color: var(--n-loading-color-${e}) + `),y("input-el, textarea-el",` + caret-color: var(--n-caret-color-${e}); + `),y("state-border",` + border: var(--n-border-${e}); + `),C("&:hover",[y("state-border",` + border: var(--n-border-hover-${e}); + `)]),C("&:focus",` + background-color: var(--n-color-focus-${e}); + `,[y("state-border",` + box-shadow: var(--n-box-shadow-focus-${e}); + border: var(--n-border-focus-${e}); + `)]),P("focus",` + background-color: var(--n-color-focus-${e}); + `,[y("state-border",` + box-shadow: var(--n-box-shadow-focus-${e}); + border: var(--n-border-focus-${e}); + `)])])]))]),Pu=g("input",[P("disabled",[y("input-el, textarea-el",` + -webkit-text-fill-color: var(--n-text-color-disabled); + `)])]),ku=Object.assign(Object.assign({},ne.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:Function,onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:Boolean,showPasswordToggle:Boolean}),xt=q({name:"Input",props:ku,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=ke(e),l=ne("Input","-input",Ru,pr,e,o);Fl&&Zo("-input-safari",Pu,o);const a=D(null),s=D(null),d=D(null),c=D(null),u=D(null),f=D(null),p=D(null),v=$u(p),h=D(null),{localeRef:m}=Xo("Input"),b=D(e.defaultValue),x=le(e,"value"),S=so(x,b),B=rt(e),{mergedSizeRef:T,mergedDisabledRef:z,mergedStatusRef:I}=B,w=D(!1),O=D(!1),k=D(!1),$=D(!1);let L=null;const M=R(()=>{const{placeholder:H,pair:oe}=e;return oe?Array.isArray(H)?H:H===void 0?["",""]:[H,H]:H===void 0?[m.value.placeholder]:[H]}),j=R(()=>{const{value:H}=k,{value:oe}=S,{value:Fe}=M;return!H&&(mr(oe)||Array.isArray(oe)&&mr(oe[0]))&&Fe[0]}),E=R(()=>{const{value:H}=k,{value:oe}=S,{value:Fe}=M;return!H&&Fe[1]&&(mr(oe)||Array.isArray(oe)&&mr(oe[1]))}),U=We(()=>e.internalForceFocus||w.value),_=We(()=>{if(z.value||e.readonly||!e.clearable||!U.value&&!O.value)return!1;const{value:H}=S,{value:oe}=U;return e.pair?!!(Array.isArray(H)&&(H[0]||H[1]))&&(O.value||oe):!!H&&(O.value||oe)}),V=R(()=>{const{showPasswordOn:H}=e;if(H)return H;if(e.showPasswordToggle)return"click"}),te=D(!1),N=R(()=>{const{textDecoration:H}=e;return H?Array.isArray(H)?H.map(oe=>({textDecoration:oe})):[{textDecoration:H}]:["",""]}),G=D(void 0),Ce=()=>{var H,oe;if(e.type==="textarea"){const{autosize:Fe}=e;if(Fe&&(G.value=(oe=(H=h.value)===null||H===void 0?void 0:H.$el)===null||oe===void 0?void 0:oe.offsetWidth),!s.value||typeof Fe=="boolean")return;const{paddingTop:Ge,paddingBottom:Ye,lineHeight:Ue}=window.getComputedStyle(s.value),Qo=Number(Ge.slice(0,-2)),Jo=Number(Ye.slice(0,-2)),et=Number(Ue.slice(0,-2)),{value:dt}=d;if(!dt)return;if(Fe.minRows){const ct=Math.max(Fe.minRows,1),Gt=`${Qo+Jo+et*ct}px`;dt.style.minHeight=Gt}if(Fe.maxRows){const ct=`${Qo+Jo+et*Fe.maxRows}px`;dt.style.maxHeight=ct}}},X=R(()=>{const{maxlength:H}=e;return H===void 0?void 0:Number(H)});mo(()=>{const{value:H}=S;Array.isArray(H)||Te(H)});const ve=Pr().proxy;function he(H){const{onUpdateValue:oe,"onUpdate:value":Fe,onInput:Ge}=e,{nTriggerFormInput:Ye}=B;oe&&ae(oe,H),Fe&&ae(Fe,H),Ge&&ae(Ge,H),b.value=H,Ye()}function be(H){const{onChange:oe}=e,{nTriggerFormChange:Fe}=B;oe&&ae(oe,H),b.value=H,Fe()}function me(H){const{onBlur:oe}=e,{nTriggerFormBlur:Fe}=B;oe&&ae(oe,H),Fe()}function se(H){const{onFocus:oe}=e,{nTriggerFormFocus:Fe}=B;oe&&ae(oe,H),Fe()}function Re(H){const{onClear:oe}=e;oe&&ae(oe,H)}function ge(H){const{onInputBlur:oe}=e;oe&&ae(oe,H)}function ee(H){const{onInputFocus:oe}=e;oe&&ae(oe,H)}function xe(){const{onDeactivate:H}=e;H&&ae(H)}function de(){const{onActivate:H}=e;H&&ae(H)}function ye(H){const{onClick:oe}=e;oe&&ae(oe,H)}function pe(H){const{onWrapperFocus:oe}=e;oe&&ae(oe,H)}function Me(H){const{onWrapperBlur:oe}=e;oe&&ae(oe,H)}function Q(){k.value=!0}function A(H){k.value=!1,H.target===f.value?Z(H,1):Z(H,0)}function Z(H,oe=0,Fe="input"){const Ge=H.target.value;if(Te(Ge),H instanceof InputEvent&&!H.isComposing&&(k.value=!1),e.type==="textarea"){const{value:Ue}=h;Ue&&Ue.syncUnifiedContainer()}if(L=Ge,k.value)return;v.recordCursor();const Ye=re(Ge);if(Ye)if(!e.pair)Fe==="input"?he(Ge):be(Ge);else{let{value:Ue}=S;Array.isArray(Ue)?Ue=[Ue[0],Ue[1]]:Ue=["",""],Ue[oe]=Ge,Fe==="input"?he(Ue):be(Ue)}ve.$forceUpdate(),Ye||io(v.restoreCursor)}function re(H){const{countGraphemes:oe,maxlength:Fe,minlength:Ge}=e;if(oe){let Ue;if(Fe!==void 0&&(Ue===void 0&&(Ue=oe(H)),Ue>Number(Fe))||Ge!==void 0&&(Ue===void 0&&(Ue=oe(H)),Ue{Ge.preventDefault(),Ro("mouseup",document,oe)};if(Do("mouseup",document,oe),V.value!=="mousedown")return;te.value=!0;const Fe=()=>{te.value=!1,Ro("mouseup",document,Fe)};Do("mouseup",document,Fe)}function Fo(H){var oe;switch((oe=e.onKeydown)===null||oe===void 0||oe.call(e,H),H.key){case"Escape":uo();break;case"Enter":co(H);break}}function co(H){var oe,Fe;if(e.passivelyActivated){const{value:Ge}=$;if(Ge){e.internalDeactivateOnEnter&&uo();return}H.preventDefault(),e.type==="textarea"?(oe=s.value)===null||oe===void 0||oe.focus():(Fe=u.value)===null||Fe===void 0||Fe.focus()}}function uo(){e.passivelyActivated&&($.value=!1,io(()=>{var H;(H=a.value)===null||H===void 0||H.focus()}))}function F(){var H,oe,Fe;z.value||(e.passivelyActivated?(H=a.value)===null||H===void 0||H.focus():((oe=s.value)===null||oe===void 0||oe.focus(),(Fe=u.value)===null||Fe===void 0||Fe.focus()))}function K(){var H;!((H=a.value)===null||H===void 0)&&H.contains(document.activeElement)&&document.activeElement.blur()}function ie(){var H,oe;(H=s.value)===null||H===void 0||H.select(),(oe=u.value)===null||oe===void 0||oe.select()}function ze(){z.value||(s.value?s.value.focus():u.value&&u.value.focus())}function Pe(){const{value:H}=a;H!=null&&H.contains(document.activeElement)&&H!==document.activeElement&&uo()}function Ie(H){if(e.type==="textarea"){const{value:oe}=s;oe==null||oe.scrollTo(H)}else{const{value:oe}=u;oe==null||oe.scrollTo(H)}}function Te(H){const{type:oe,pair:Fe,autosize:Ge}=e;if(!Fe&&Ge)if(oe==="textarea"){const{value:Ye}=d;Ye&&(Ye.textContent=(H??"")+`\r +`)}else{const{value:Ye}=c;Ye&&(H?Ye.textContent=H:Ye.innerHTML=" ")}}function _e(){Ce()}const Qe=D({top:"0"});function vo(H){var oe;const{scrollTop:Fe}=H.target;Qe.value.top=`${-Fe}px`,(oe=h.value)===null||oe===void 0||oe.syncUnifiedContainer()}let Wo=null;oo(()=>{const{autosize:H,type:oe}=e;H&&oe==="textarea"?Wo=Ke(S,Fe=>{!Array.isArray(Fe)&&Fe!==L&&Te(Fe)}):Wo==null||Wo()});let No=null;oo(()=>{e.type==="textarea"?No=Ke(S,H=>{var oe;!Array.isArray(H)&&H!==L&&((oe=h.value)===null||oe===void 0||oe.syncUnifiedContainer())}):No==null||No()}),Oe(Ml,{mergedValueRef:S,maxlengthRef:X,mergedClsPrefixRef:o,countGraphemesRef:le(e,"countGraphemes")});const st={wrapperElRef:a,inputElRef:u,textareaElRef:s,isCompositing:k,focus:F,blur:K,select:ie,deactivate:Pe,activate:ze,scrollTo:Ie},Kt=to("Input",n,o),Rt=R(()=>{const{value:H}=T,{common:{cubicBezierEaseInOut:oe},self:{color:Fe,borderRadius:Ge,textColor:Ye,caretColor:Ue,caretColorError:Qo,caretColorWarning:Jo,textDecorationColor:et,border:dt,borderDisabled:ct,borderHover:Gt,borderFocus:Er,placeholderColor:jr,placeholderColorDisabled:Wr,lineHeightTextarea:ms,colorDisabled:bs,colorFocus:xs,textColorDisabled:Cs,boxShadowFocus:ys,iconSize:ws,colorFocusWarning:Ss,boxShadowFocusWarning:zs,borderWarning:$s,borderFocusWarning:Rs,borderHoverWarning:Ps,colorFocusError:ks,boxShadowFocusError:Is,borderError:Bs,borderFocusError:Ts,borderHoverError:Fs,clearSize:Os,clearColor:Ms,clearColorHover:_s,clearColorPressed:Ds,iconColor:Ls,iconColorDisabled:Hs,suffixTextColor:As,countTextColor:Es,countTextColorDisabled:js,iconColorHover:Ws,iconColorPressed:Ns,loadingColor:Vs,loadingColorError:Us,loadingColorWarning:Ks,[W("padding",H)]:Gs,[W("fontSize",H)]:qs,[W("height",H)]:Ys}}=l.value,{left:Xs,right:Zs}=Ko(Gs);return{"--n-bezier":oe,"--n-count-text-color":Es,"--n-count-text-color-disabled":js,"--n-color":Fe,"--n-font-size":qs,"--n-border-radius":Ge,"--n-height":Ys,"--n-padding-left":Xs,"--n-padding-right":Zs,"--n-text-color":Ye,"--n-caret-color":Ue,"--n-text-decoration-color":et,"--n-border":dt,"--n-border-disabled":ct,"--n-border-hover":Gt,"--n-border-focus":Er,"--n-placeholder-color":jr,"--n-placeholder-color-disabled":Wr,"--n-icon-size":ws,"--n-line-height-textarea":ms,"--n-color-disabled":bs,"--n-color-focus":xs,"--n-text-color-disabled":Cs,"--n-box-shadow-focus":ys,"--n-loading-color":Vs,"--n-caret-color-warning":Jo,"--n-color-focus-warning":Ss,"--n-box-shadow-focus-warning":zs,"--n-border-warning":$s,"--n-border-focus-warning":Rs,"--n-border-hover-warning":Ps,"--n-loading-color-warning":Ks,"--n-caret-color-error":Qo,"--n-color-focus-error":ks,"--n-box-shadow-focus-error":Is,"--n-border-error":Bs,"--n-border-focus-error":Ts,"--n-border-hover-error":Fs,"--n-loading-color-error":Us,"--n-clear-color":Ms,"--n-clear-size":Os,"--n-clear-color-hover":_s,"--n-clear-color-pressed":Ds,"--n-icon-color":Ls,"--n-icon-color-hover":Ws,"--n-icon-color-pressed":Ns,"--n-icon-color-disabled":Hs,"--n-suffix-text-color":As}}),Vo=r?Ae("input",R(()=>{const{value:H}=T;return H[0]}),Rt,e):void 0;return Object.assign(Object.assign({},st),{wrapperElRef:a,inputElRef:u,inputMirrorElRef:c,inputEl2Ref:f,textareaElRef:s,textareaMirrorElRef:d,textareaScrollbarInstRef:h,rtlEnabled:Kt,uncontrolledValue:b,mergedValue:S,passwordVisible:te,mergedPlaceholder:M,showPlaceholder1:j,showPlaceholder2:E,mergedFocus:U,isComposing:k,activated:$,showClearButton:_,mergedSize:T,mergedDisabled:z,textDecorationStyle:N,mergedClsPrefix:o,mergedBordered:t,mergedShowPasswordOn:V,placeholderStyle:Qe,mergedStatus:I,textAreaScrollContainerWidth:G,handleTextAreaScroll:vo,handleCompositionStart:Q,handleCompositionEnd:A,handleInput:Z,handleInputBlur:ue,handleInputFocus:Y,handleWrapperBlur:ce,handleWrapperFocus:He,handleMouseEnter:To,handleMouseLeave:xo,handleMouseDown:Bo,handleChange:Ze,handleClick:po,handleClear:fo,handlePasswordToggleClick:Co,handlePasswordToggleMousedown:Ao,handleWrapperKeydown:Fo,handleTextAreaMirrorResize:_e,getTextareaScrollContainer:()=>s.value,mergedTheme:l,cssVars:r?void 0:Rt,themeClass:Vo==null?void 0:Vo.themeClass,onRender:Vo==null?void 0:Vo.onRender})},render(){var e,o;const{mergedClsPrefix:t,mergedStatus:r,themeClass:n,type:l,countGraphemes:a,onRender:s}=this,d=this.$slots;return s==null||s(),i("div",{ref:"wrapperElRef",class:[`${t}-input`,n,r&&`${t}-input--${r}-status`,{[`${t}-input--rtl`]:this.rtlEnabled,[`${t}-input--disabled`]:this.mergedDisabled,[`${t}-input--textarea`]:l==="textarea",[`${t}-input--resizable`]:this.resizable&&!this.autosize,[`${t}-input--autosize`]:this.autosize,[`${t}-input--round`]:this.round&&l!=="textarea",[`${t}-input--pair`]:this.pair,[`${t}-input--focus`]:this.mergedFocus,[`${t}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.onKeyup,onKeydown:this.handleWrapperKeydown},i("div",{class:`${t}-input-wrapper`},Ee(d.prefix,c=>c&&i("div",{class:`${t}-input__prefix`},c)),l==="textarea"?i(ur,{ref:"textareaScrollbarInstRef",class:`${t}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var c,u;const{textAreaScrollContainerWidth:f}=this,p={width:this.autosize&&f&&`${f}px`};return i(ao,null,i("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${t}-input__textarea-el`,(c=this.inputProps)===null||c===void 0?void 0:c.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(u=this.inputProps)===null||u===void 0?void 0:u.style,p],onBlur:this.handleInputBlur,onFocus:v=>{this.handleInputFocus(v,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?i("div",{class:`${t}-input__placeholder`,style:[this.placeholderStyle,p],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?i(vt,{onResize:this.handleTextAreaMirrorResize},{default:()=>i("div",{ref:"textareaMirrorElRef",class:`${t}-input__textarea-mirror`,key:"mirror"})}):null)}}):i("div",{class:`${t}-input__input`},i("input",Object.assign({type:l==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":l},this.inputProps,{ref:"inputElRef",class:[`${t}-input__input-el`,(e=this.inputProps)===null||e===void 0?void 0:e.class],style:[this.textDecorationStyle[0],(o=this.inputProps)===null||o===void 0?void 0:o.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:c=>{this.handleInputFocus(c,0)},onInput:c=>{this.handleInput(c,0)},onChange:c=>{this.handleChange(c,0)}})),this.showPlaceholder1?i("div",{class:`${t}-input__placeholder`},i("span",null,this.mergedPlaceholder[0])):null,this.autosize?i("div",{class:`${t}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&Ee(d.suffix,c=>c||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?i("div",{class:`${t}-input__suffix`},[Ee(d["clear-icon-placeholder"],u=>(this.clearable||u)&&i(dn,{clsPrefix:t,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>u,icon:()=>{var f,p;return(p=(f=this.$slots)["clear-icon"])===null||p===void 0?void 0:p.call(f)}})),this.internalLoadingBeforeSuffix?null:c,this.loading!==void 0?i($l,{clsPrefix:t,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?c:null,this.showCount&&this.type!=="textarea"?i(hi,null,{default:u=>{var f;return(f=d.count)===null||f===void 0?void 0:f.call(d,u)}}):null,this.mergedShowPasswordOn&&this.type==="password"?i("div",{class:`${t}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?lo(d["password-visible-icon"],()=>[i(De,{clsPrefix:t},{default:()=>i(dl,null)})]):lo(d["password-invisible-icon"],()=>[i(De,{clsPrefix:t},{default:()=>i(Ud,null)})])):null]):null)),this.pair?i("span",{class:`${t}-input__separator`},lo(d.separator,()=>[this.separator])):null,this.pair?i("div",{class:`${t}-input-wrapper`},i("div",{class:`${t}-input__input`},i("input",{ref:"inputEl2Ref",type:this.type,class:`${t}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:c=>{this.handleInputFocus(c,1)},onInput:c=>{this.handleInput(c,1)},onChange:c=>{this.handleChange(c,1)}}),this.showPlaceholder2?i("div",{class:`${t}-input__placeholder`},i("span",null,this.mergedPlaceholder[1])):null),Ee(d.suffix,c=>(this.clearable||c)&&i("div",{class:`${t}-input__suffix`},[this.clearable&&i(dn,{clsPrefix:t,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var u;return(u=d["clear-icon"])===null||u===void 0?void 0:u.call(d)},placeholder:()=>{var u;return(u=d["clear-icon-placeholder"])===null||u===void 0?void 0:u.call(d)}}),c]))):null,this.mergedBordered?i("div",{class:`${t}-input__border`}):null,this.mergedBordered?i("div",{class:`${t}-input__state-border`}):null,this.showCount&&l==="textarea"?i(hi,null,{default:c=>{var u;const{renderCount:f}=this;return f?f(c):(u=d.count)===null||u===void 0?void 0:u.call(d,c)}}):null)}}),Iu=g("input-group",` + display: inline-flex; + width: 100%; + flex-wrap: nowrap; + vertical-align: bottom; +`,[C(">",[g("input",[C("&:not(:last-child)",` + border-top-right-radius: 0!important; + border-bottom-right-radius: 0!important; + `),C("&:not(:first-child)",` + border-top-left-radius: 0!important; + border-bottom-left-radius: 0!important; + margin-left: -1px!important; + `)]),g("button",[C("&:not(:last-child)",` + border-top-right-radius: 0!important; + border-bottom-right-radius: 0!important; + `,[y("state-border, border",` + border-top-right-radius: 0!important; + border-bottom-right-radius: 0!important; + `)]),C("&:not(:first-child)",` + border-top-left-radius: 0!important; + border-bottom-left-radius: 0!important; + `,[y("state-border, border",` + border-top-left-radius: 0!important; + border-bottom-left-radius: 0!important; + `)])]),C("*",[C("&:not(:last-child)",` + border-top-right-radius: 0!important; + border-bottom-right-radius: 0!important; + `,[C(">",[g("input",` + border-top-right-radius: 0!important; + border-bottom-right-radius: 0!important; + `),g("base-selection",[g("base-selection-label",` + border-top-right-radius: 0!important; + border-bottom-right-radius: 0!important; + `),g("base-selection-tags",` + border-top-right-radius: 0!important; + border-bottom-right-radius: 0!important; + `),y("box-shadow, border, state-border",` + border-top-right-radius: 0!important; + border-bottom-right-radius: 0!important; + `)])])]),C("&:not(:first-child)",` + margin-left: -1px!important; + border-top-left-radius: 0!important; + border-bottom-left-radius: 0!important; + `,[C(">",[g("input",` + border-top-left-radius: 0!important; + border-bottom-left-radius: 0!important; + `),g("base-selection",[g("base-selection-label",` + border-top-left-radius: 0!important; + border-bottom-left-radius: 0!important; + `),g("base-selection-tags",` + border-top-left-radius: 0!important; + border-bottom-left-radius: 0!important; + `),y("box-shadow, border, state-border",` + border-top-left-radius: 0!important; + border-bottom-left-radius: 0!important; + `)])])])])])]),Bu={},h1=q({name:"InputGroup",props:Bu,setup(e){const{mergedClsPrefixRef:o}=ke(e);return Zo("-input-group",Iu,o),{mergedClsPrefix:o}},render(){const{mergedClsPrefix:e}=this;return i("div",{class:`${e}-input-group`},this.$slots)}});function Tu(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}const Fu={name:"AutoComplete",common:fe,peers:{InternalSelectMenu:fr,Input:Ho},self:Tu},Ou=Fu,Sr=jo&&"loading"in document.createElement("img"),Mu=(e={})=>{var o;const{root:t=null}=e;return{hash:`${e.rootMargin||"0px 0px 0px 0px"}-${Array.isArray(e.threshold)?e.threshold.join(","):(o=e.threshold)!==null&&o!==void 0?o:"0"}`,options:Object.assign(Object.assign({},e),{root:(typeof t=="string"?document.querySelector(t):t)||document.documentElement})}},Xr=new WeakMap,Zr=new WeakMap,Qr=new WeakMap,_l=(e,o,t)=>{if(!e)return()=>{};const r=Mu(o),{root:n}=r.options;let l;const a=Xr.get(n);a?l=a:(l=new Map,Xr.set(n,l));let s,d;l.has(r.hash)?(d=l.get(r.hash),d[1].has(e)||(s=d[0],d[1].add(e),s.observe(e))):(s=new IntersectionObserver(f=>{f.forEach(p=>{if(p.isIntersecting){const v=Zr.get(p.target),h=Qr.get(p.target);v&&v(),h&&(h.value=!0)}})},r.options),s.observe(e),d=[s,new Set([e])],l.set(r.hash,d));let c=!1;const u=()=>{c||(Zr.delete(e),Qr.delete(e),c=!0,d[1].has(e)&&(d[0].unobserve(e),d[1].delete(e)),d[1].size<=0&&l.delete(r.hash),l.size||Xr.delete(n))};return Zr.set(e,u),Qr.set(e,t),u},Dl=e=>{const{borderRadius:o,avatarColor:t,cardColor:r,fontSize:n,heightTiny:l,heightSmall:a,heightMedium:s,heightLarge:d,heightHuge:c,modalColor:u,popoverColor:f}=e;return{borderRadius:o,fontSize:n,border:`2px solid ${r}`,heightTiny:l,heightSmall:a,heightMedium:s,heightLarge:d,heightHuge:c,color:$e(r,t),colorModal:$e(u,t),colorPopover:$e(f,t)}},_u={name:"Avatar",common:Le,self:Dl},Du=_u,Lu={name:"Avatar",common:fe,self:Dl},Ll=Lu,Hu="n-avatar-group",Au=g("avatar",` + width: var(--n-merged-size); + height: var(--n-merged-size); + color: #FFF; + font-size: var(--n-font-size); + display: inline-flex; + position: relative; + overflow: hidden; + text-align: center; + border: var(--n-border); + border-radius: var(--n-border-radius); + --n-merged-color: var(--n-color); + background-color: var(--n-merged-color); + transition: + border-color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); +`,[Or(C("&","--n-merged-color: var(--n-color-modal);")),gn(C("&","--n-merged-color: var(--n-color-popover);")),C("img",` + width: 100%; + height: 100%; + `),y("text",` + white-space: nowrap; + display: inline-block; + position: absolute; + left: 50%; + top: 50%; + `),g("icon",` + vertical-align: bottom; + font-size: calc(var(--n-merged-size) - 6px); + `),y("text","line-height: 1.25")]),Eu=Object.assign(Object.assign({},ne.props),{size:[String,Number],src:String,circle:{type:Boolean,default:void 0},objectFit:String,round:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},onError:Function,fallbackSrc:String,intersectionObserverOptions:Object,lazy:Boolean,onLoad:Function,renderPlaceholder:Function,renderFallback:Function,imgProps:Object,color:String}),p1=q({name:"Avatar",props:Eu,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=D(!1);let n=null;const l=D(null),a=D(null),s=()=>{const{value:B}=l;if(B&&(n===null||n!==B.innerHTML)){n=B.innerHTML;const{value:T}=a;if(T){const{offsetWidth:z,offsetHeight:I}=T,{offsetWidth:w,offsetHeight:O}=B,k=.9,$=Math.min(z/w*k,I/O*k,1);B.style.transform=`translateX(-50%) translateY(-50%) scale(${$})`}}},d=Se(Hu,null),c=R(()=>{const{size:B}=e;if(B)return B;const{size:T}=d||{};return T||"medium"}),u=ne("Avatar","-avatar",Au,Du,e,o),f=Se(zl,null),p=R(()=>{if(d)return!0;const{round:B,circle:T}=e;return B!==void 0||T!==void 0?B||T:f?f.roundRef.value:!1}),v=R(()=>d?!0:e.bordered||!1),h=B=>{var T;if(!x.value)return;r.value=!0;const{onError:z,imgProps:I}=e;(T=I==null?void 0:I.onError)===null||T===void 0||T.call(I,B),z&&z(B)};Ke(()=>e.src,()=>r.value=!1);const m=R(()=>{const B=c.value,T=p.value,z=v.value,{color:I}=e,{self:{borderRadius:w,fontSize:O,color:k,border:$,colorModal:L,colorPopover:M},common:{cubicBezierEaseInOut:j}}=u.value;let E;return typeof B=="number"?E=`${B}px`:E=u.value.self[W("height",B)],{"--n-font-size":O,"--n-border":z?$:"none","--n-border-radius":T?"50%":w,"--n-color":I||k,"--n-color-modal":I||L,"--n-color-popover":I||M,"--n-bezier":j,"--n-merged-size":`var(--n-avatar-size-override, ${E})`}}),b=t?Ae("avatar",R(()=>{const B=c.value,T=p.value,z=v.value,{color:I}=e;let w="";return B&&(typeof B=="number"?w+=`a${B}`:w+=B[0]),T&&(w+="b"),z&&(w+="c"),I&&(w+=Ot(I)),w}),m,e):void 0,x=D(!e.lazy);mo(()=>{if(Sr)return;let B;const T=oo(()=>{B==null||B(),B=void 0,e.lazy&&(B=_l(a.value,e.intersectionObserverOptions,x))});wo(()=>{T(),B==null||B()})});const S=D(!e.lazy);return{textRef:l,selfRef:a,mergedRoundRef:p,mergedClsPrefix:o,fitTextTransform:s,cssVars:t?void 0:m,themeClass:b==null?void 0:b.themeClass,onRender:b==null?void 0:b.onRender,hasLoadError:r,handleError:h,shouldStartLoading:x,loaded:S,mergedOnLoad:B=>{var T;const{onLoad:z,imgProps:I}=e;z==null||z(B),(T=I==null?void 0:I.onLoad)===null||T===void 0||T.call(I,B),S.value=!0}}},render(){var e,o;const{$slots:t,src:r,mergedClsPrefix:n,lazy:l,onRender:a,mergedOnLoad:s,shouldStartLoading:d,loaded:c,hasLoadError:u}=this;a==null||a();let f;const p=!c&&!u&&(this.renderPlaceholder?this.renderPlaceholder():(o=(e=this.$slots).placeholder)===null||o===void 0?void 0:o.call(e));return this.hasLoadError?f=this.renderFallback?this.renderFallback():lo(t.fallback,()=>[i("img",{src:this.fallbackSrc,style:{objectFit:this.objectFit}})]):f=Ee(t.default,v=>{if(v)return i(vt,{onResize:this.fitTextTransform},{default:()=>i("span",{ref:"textRef",class:`${n}-avatar__text`},v)});if(r){const{imgProps:h}=this;return i("img",Object.assign(Object.assign({},h),{loading:Sr&&!this.intersectionObserverOptions&&l?"lazy":"eager",src:Sr||d||c?r:void 0,onLoad:s,"data-image-src":r,onError:this.handleError,style:[h==null?void 0:h.style,{objectFit:this.objectFit},p?{height:"0",width:"0",visibility:"hidden",position:"absolute"}:""]}))}}),i("span",{ref:"selfRef",class:[`${n}-avatar`,this.themeClass],style:this.cssVars},f,l&&p)}}),ju=()=>({gap:"-12px"}),Wu={name:"AvatarGroup",common:fe,peers:{Avatar:Ll},self:ju},Nu=Wu,Vu={width:"44px",height:"44px",borderRadius:"22px",iconSize:"26px"},Uu={name:"BackTop",common:fe,self(e){const{popoverColor:o,textColor2:t,primaryColorHover:r,primaryColorPressed:n}=e;return Object.assign(Object.assign({},Vu),{color:o,textColor:t,iconColor:t,iconColorHover:r,iconColorPressed:n,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})}},Ku=Uu,Gu={name:"Badge",common:fe,self(e){const{errorColorSuppl:o,infoColorSuppl:t,successColorSuppl:r,warningColorSuppl:n,fontFamily:l}=e;return{color:o,colorInfo:t,colorSuccess:r,colorError:o,colorWarning:n,fontSize:"12px",fontFamily:l}}},qu=Gu,Yu=e=>{const{errorColor:o,infoColor:t,successColor:r,warningColor:n,fontFamily:l}=e;return{color:o,colorInfo:t,colorSuccess:r,colorError:o,colorWarning:n,fontSize:"12px",fontFamily:l}},Xu={name:"Badge",common:Le,self:Yu},Zu=Xu,Qu=C([C("@keyframes badge-wave-spread",{from:{boxShadow:"0 0 0.5px 0px var(--n-ripple-color)",opacity:.6},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)",opacity:0}}),g("badge",` + display: inline-flex; + position: relative; + vertical-align: middle; + color: var(--n-color); + font-family: var(--n-font-family); + `,[P("as-is",[g("badge-sup",{position:"static",transform:"translateX(0)"},[at({transformOrigin:"left bottom",originalTransform:"translateX(0)"})])]),P("dot",[g("badge-sup",` + height: 8px; + width: 8px; + padding: 0; + min-width: 8px; + left: 100%; + bottom: calc(100% - 4px); + `,[C("::before","border-radius: 4px;")])]),g("badge-sup",` + background: var(--n-color); + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + color: #FFF; + position: absolute; + height: 18px; + line-height: 18px; + border-radius: 9px; + padding: 0 6px; + text-align: center; + font-size: var(--n-font-size); + transform: translateX(-50%); + left: 100%; + bottom: calc(100% - 9px); + font-variant-numeric: tabular-nums; + z-index: 1; + display: flex; + align-items: center; + `,[at({transformOrigin:"left bottom",originalTransform:"translateX(-50%)"}),g("base-wave",{zIndex:1,animationDuration:"2s",animationIterationCount:"infinite",animationDelay:"1s",animationTimingFunction:"var(--n-ripple-bezier)",animationName:"badge-wave-spread"}),C("&::before",` + opacity: 0; + transform: scale(1); + border-radius: 9px; + content: ""; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + `)])])]),Ju=Object.assign(Object.assign({},ne.props),{value:[String,Number],max:Number,dot:Boolean,type:{type:String,default:"default"},show:{type:Boolean,default:!0},showZero:Boolean,processing:Boolean,color:String,offset:Array}),v1=q({name:"Badge",props:Ju,setup(e,{slots:o}){const{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=ke(e),l=ne("Badge","-badge",Qu,Zu,e,t),a=D(!1),s=()=>{a.value=!0},d=()=>{a.value=!1},c=R(()=>e.show&&(e.dot||e.value!==void 0&&!(!e.showZero&&Number(e.value)<=0)||!ht(o.value)));mo(()=>{c.value&&(a.value=!0)});const u=to("Badge",n,t),f=R(()=>{const{type:h,color:m}=e,{common:{cubicBezierEaseInOut:b,cubicBezierEaseOut:x},self:{[W("color",h)]:S,fontFamily:B,fontSize:T}}=l.value;return{"--n-font-size":T,"--n-font-family":B,"--n-color":m||S,"--n-ripple-color":m||S,"--n-bezier":b,"--n-ripple-bezier":x}}),p=r?Ae("badge",R(()=>{let h="";const{type:m,color:b}=e;return m&&(h+=m[0]),b&&(h+=Ot(b)),h}),f,e):void 0,v=R(()=>{const{offset:h}=e;if(!h)return;const[m,b]=h,x=typeof m=="number"?`${m}px`:m,S=typeof b=="number"?`${b}px`:b;return{transform:`translate(calc(${u!=null&&u.value?"50%":"-50%"} + ${x}), ${S})`}});return{rtlEnabled:u,mergedClsPrefix:t,appeared:a,showBadge:c,handleAfterEnter:s,handleAfterLeave:d,cssVars:r?void 0:f,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender,offsetStyle:v}},render(){var e;const{mergedClsPrefix:o,onRender:t,themeClass:r,$slots:n}=this;t==null||t();const l=(e=n.default)===null||e===void 0?void 0:e.call(n);return i("div",{class:[`${o}-badge`,this.rtlEnabled&&`${o}-badge--rtl`,r,{[`${o}-badge--dot`]:this.dot,[`${o}-badge--as-is`]:!l}],style:this.cssVars},l,i(no,{name:"fade-in-scale-up-transition",onAfterEnter:this.handleAfterEnter,onAfterLeave:this.handleAfterLeave},{default:()=>this.showBadge?i("sup",{class:`${o}-badge-sup`,title:Gi(this.value),style:this.offsetStyle},lo(n.value,()=>[this.dot?null:i(nu,{clsPrefix:o,appeared:this.appeared,max:this.max,value:this.value})]),this.processing?i(bl,{clsPrefix:o}):null):null}))}}),ef={fontWeightActive:"400"},of=e=>{const{fontSize:o,textColor3:t,textColor2:r,borderRadius:n,buttonColor2Hover:l,buttonColor2Pressed:a}=e;return Object.assign(Object.assign({},ef),{fontSize:o,itemLineHeight:"1.25",itemTextColor:t,itemTextColorHover:r,itemTextColorPressed:r,itemTextColorActive:r,itemBorderRadius:n,itemColorHover:l,itemColorPressed:a,separatorColor:t})},tf={name:"Breadcrumb",common:fe,self:of},rf=tf;function ut(e){return $e(e,[255,255,255,.16])}function br(e){return $e(e,[0,0,0,.12])}const Hl="n-button-group",nf={paddingTiny:"0 6px",paddingSmall:"0 10px",paddingMedium:"0 14px",paddingLarge:"0 18px",paddingRoundTiny:"0 10px",paddingRoundSmall:"0 14px",paddingRoundMedium:"0 18px",paddingRoundLarge:"0 22px",iconMarginTiny:"6px",iconMarginSmall:"6px",iconMarginMedium:"6px",iconMarginLarge:"6px",iconSizeTiny:"14px",iconSizeSmall:"18px",iconSizeMedium:"18px",iconSizeLarge:"20px",rippleDuration:".6s"},Al=e=>{const{heightTiny:o,heightSmall:t,heightMedium:r,heightLarge:n,borderRadius:l,fontSizeTiny:a,fontSizeSmall:s,fontSizeMedium:d,fontSizeLarge:c,opacityDisabled:u,textColor2:f,textColor3:p,primaryColorHover:v,primaryColorPressed:h,borderColor:m,primaryColor:b,baseColor:x,infoColor:S,infoColorHover:B,infoColorPressed:T,successColor:z,successColorHover:I,successColorPressed:w,warningColor:O,warningColorHover:k,warningColorPressed:$,errorColor:L,errorColorHover:M,errorColorPressed:j,fontWeight:E,buttonColor2:U,buttonColor2Hover:_,buttonColor2Pressed:V,fontWeightStrong:te}=e;return Object.assign(Object.assign({},nf),{heightTiny:o,heightSmall:t,heightMedium:r,heightLarge:n,borderRadiusTiny:l,borderRadiusSmall:l,borderRadiusMedium:l,borderRadiusLarge:l,fontSizeTiny:a,fontSizeSmall:s,fontSizeMedium:d,fontSizeLarge:c,opacityDisabled:u,colorOpacitySecondary:"0.16",colorOpacitySecondaryHover:"0.22",colorOpacitySecondaryPressed:"0.28",colorSecondary:U,colorSecondaryHover:_,colorSecondaryPressed:V,colorTertiary:U,colorTertiaryHover:_,colorTertiaryPressed:V,colorQuaternary:"#0000",colorQuaternaryHover:_,colorQuaternaryPressed:V,color:"#0000",colorHover:"#0000",colorPressed:"#0000",colorFocus:"#0000",colorDisabled:"#0000",textColor:f,textColorTertiary:p,textColorHover:v,textColorPressed:h,textColorFocus:v,textColorDisabled:f,textColorText:f,textColorTextHover:v,textColorTextPressed:h,textColorTextFocus:v,textColorTextDisabled:f,textColorGhost:f,textColorGhostHover:v,textColorGhostPressed:h,textColorGhostFocus:v,textColorGhostDisabled:f,border:`1px solid ${m}`,borderHover:`1px solid ${v}`,borderPressed:`1px solid ${h}`,borderFocus:`1px solid ${v}`,borderDisabled:`1px solid ${m}`,rippleColor:b,colorPrimary:b,colorHoverPrimary:v,colorPressedPrimary:h,colorFocusPrimary:v,colorDisabledPrimary:b,textColorPrimary:x,textColorHoverPrimary:x,textColorPressedPrimary:x,textColorFocusPrimary:x,textColorDisabledPrimary:x,textColorTextPrimary:b,textColorTextHoverPrimary:v,textColorTextPressedPrimary:h,textColorTextFocusPrimary:v,textColorTextDisabledPrimary:f,textColorGhostPrimary:b,textColorGhostHoverPrimary:v,textColorGhostPressedPrimary:h,textColorGhostFocusPrimary:v,textColorGhostDisabledPrimary:b,borderPrimary:`1px solid ${b}`,borderHoverPrimary:`1px solid ${v}`,borderPressedPrimary:`1px solid ${h}`,borderFocusPrimary:`1px solid ${v}`,borderDisabledPrimary:`1px solid ${b}`,rippleColorPrimary:b,colorInfo:S,colorHoverInfo:B,colorPressedInfo:T,colorFocusInfo:B,colorDisabledInfo:S,textColorInfo:x,textColorHoverInfo:x,textColorPressedInfo:x,textColorFocusInfo:x,textColorDisabledInfo:x,textColorTextInfo:S,textColorTextHoverInfo:B,textColorTextPressedInfo:T,textColorTextFocusInfo:B,textColorTextDisabledInfo:f,textColorGhostInfo:S,textColorGhostHoverInfo:B,textColorGhostPressedInfo:T,textColorGhostFocusInfo:B,textColorGhostDisabledInfo:S,borderInfo:`1px solid ${S}`,borderHoverInfo:`1px solid ${B}`,borderPressedInfo:`1px solid ${T}`,borderFocusInfo:`1px solid ${B}`,borderDisabledInfo:`1px solid ${S}`,rippleColorInfo:S,colorSuccess:z,colorHoverSuccess:I,colorPressedSuccess:w,colorFocusSuccess:I,colorDisabledSuccess:z,textColorSuccess:x,textColorHoverSuccess:x,textColorPressedSuccess:x,textColorFocusSuccess:x,textColorDisabledSuccess:x,textColorTextSuccess:z,textColorTextHoverSuccess:I,textColorTextPressedSuccess:w,textColorTextFocusSuccess:I,textColorTextDisabledSuccess:f,textColorGhostSuccess:z,textColorGhostHoverSuccess:I,textColorGhostPressedSuccess:w,textColorGhostFocusSuccess:I,textColorGhostDisabledSuccess:z,borderSuccess:`1px solid ${z}`,borderHoverSuccess:`1px solid ${I}`,borderPressedSuccess:`1px solid ${w}`,borderFocusSuccess:`1px solid ${I}`,borderDisabledSuccess:`1px solid ${z}`,rippleColorSuccess:z,colorWarning:O,colorHoverWarning:k,colorPressedWarning:$,colorFocusWarning:k,colorDisabledWarning:O,textColorWarning:x,textColorHoverWarning:x,textColorPressedWarning:x,textColorFocusWarning:x,textColorDisabledWarning:x,textColorTextWarning:O,textColorTextHoverWarning:k,textColorTextPressedWarning:$,textColorTextFocusWarning:k,textColorTextDisabledWarning:f,textColorGhostWarning:O,textColorGhostHoverWarning:k,textColorGhostPressedWarning:$,textColorGhostFocusWarning:k,textColorGhostDisabledWarning:O,borderWarning:`1px solid ${O}`,borderHoverWarning:`1px solid ${k}`,borderPressedWarning:`1px solid ${$}`,borderFocusWarning:`1px solid ${k}`,borderDisabledWarning:`1px solid ${O}`,rippleColorWarning:O,colorError:L,colorHoverError:M,colorPressedError:j,colorFocusError:M,colorDisabledError:L,textColorError:x,textColorHoverError:x,textColorPressedError:x,textColorFocusError:x,textColorDisabledError:x,textColorTextError:L,textColorTextHoverError:M,textColorTextPressedError:j,textColorTextFocusError:M,textColorTextDisabledError:f,textColorGhostError:L,textColorGhostHoverError:M,textColorGhostPressedError:j,textColorGhostFocusError:M,textColorGhostDisabledError:L,borderError:`1px solid ${L}`,borderHoverError:`1px solid ${M}`,borderPressedError:`1px solid ${j}`,borderFocusError:`1px solid ${M}`,borderDisabledError:`1px solid ${L}`,rippleColorError:L,waveOpacity:"0.6",fontWeight:E,fontWeightStrong:te})},lf={name:"Button",common:Le,self:Al},Wt=lf,af={name:"Button",common:fe,self(e){const o=Al(e);return o.waveOpacity="0.8",o.colorOpacitySecondary="0.16",o.colorOpacitySecondaryHover="0.2",o.colorOpacitySecondaryPressed="0.12",o}},$o=af,sf=C([g("button",` + margin: 0; + font-weight: var(--n-font-weight); + line-height: 1; + font-family: inherit; + padding: var(--n-padding); + height: var(--n-height); + font-size: var(--n-font-size); + border-radius: var(--n-border-radius); + color: var(--n-text-color); + background-color: var(--n-color); + width: var(--n-width); + white-space: nowrap; + outline: none; + position: relative; + z-index: auto; + border: none; + display: inline-flex; + flex-wrap: nowrap; + flex-shrink: 0; + align-items: center; + justify-content: center; + user-select: none; + -webkit-user-select: none; + text-align: center; + cursor: pointer; + text-decoration: none; + transition: + color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + opacity .3s var(--n-bezier), + border-color .3s var(--n-bezier); + `,[P("color",[y("border",{borderColor:"var(--n-border-color)"}),P("disabled",[y("border",{borderColor:"var(--n-border-color-disabled)"})]),je("disabled",[C("&:focus",[y("state-border",{borderColor:"var(--n-border-color-focus)"})]),C("&:hover",[y("state-border",{borderColor:"var(--n-border-color-hover)"})]),C("&:active",[y("state-border",{borderColor:"var(--n-border-color-pressed)"})]),P("pressed",[y("state-border",{borderColor:"var(--n-border-color-pressed)"})])])]),P("disabled",{backgroundColor:"var(--n-color-disabled)",color:"var(--n-text-color-disabled)"},[y("border",{border:"var(--n-border-disabled)"})]),je("disabled",[C("&:focus",{backgroundColor:"var(--n-color-focus)",color:"var(--n-text-color-focus)"},[y("state-border",{border:"var(--n-border-focus)"})]),C("&:hover",{backgroundColor:"var(--n-color-hover)",color:"var(--n-text-color-hover)"},[y("state-border",{border:"var(--n-border-hover)"})]),C("&:active",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[y("state-border",{border:"var(--n-border-pressed)"})]),P("pressed",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[y("state-border",{border:"var(--n-border-pressed)"})])]),P("loading","cursor: wait;"),g("base-wave",` + pointer-events: none; + top: 0; + right: 0; + bottom: 0; + left: 0; + animation-iteration-count: 1; + animation-duration: var(--n-ripple-duration); + animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out); + `,[P("active",{zIndex:1,animationName:"button-wave-spread, button-wave-opacity"})]),jo&&"MozBoxSizing"in document.createElement("div").style?C("&::moz-focus-inner",{border:0}):null,y("border, state-border",` + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + border-radius: inherit; + transition: border-color .3s var(--n-bezier); + pointer-events: none; + `),y("border",{border:"var(--n-border)"}),y("state-border",{border:"var(--n-border)",borderColor:"#0000",zIndex:1}),y("icon",` + margin: var(--n-icon-margin); + margin-left: 0; + height: var(--n-icon-size); + width: var(--n-icon-size); + max-width: var(--n-icon-size); + font-size: var(--n-icon-size); + position: relative; + flex-shrink: 0; + `,[g("icon-slot",` + height: var(--n-icon-size); + width: var(--n-icon-size); + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + display: flex; + align-items: center; + justify-content: center; + `,[lt({top:"50%",originalTransform:"translateY(-50%)"})]),kl()]),y("content",` + display: flex; + align-items: center; + flex-wrap: nowrap; + min-width: 0; + `,[C("~",[y("icon",{margin:"var(--n-icon-margin)",marginRight:0})])]),P("block",` + display: flex; + width: 100%; + `),P("dashed",[y("border, state-border",{borderStyle:"dashed !important"})]),P("disabled",{cursor:"not-allowed",opacity:"var(--n-opacity-disabled)"})]),C("@keyframes button-wave-spread",{from:{boxShadow:"0 0 0.5px 0 var(--n-ripple-color)"},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)"}}),C("@keyframes button-wave-opacity",{from:{opacity:"var(--n-wave-opacity)"},to:{opacity:0}})]),df=Object.assign(Object.assign({},ne.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:"button"},type:{type:String,default:"default"},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:"left"},attrType:{type:String,default:"button"},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!Fl}}),El=q({name:"Button",props:df,setup(e){const o=D(null),t=D(null),r=D(!1),n=We(()=>!e.quaternary&&!e.tertiary&&!e.secondary&&!e.text&&(!e.color||e.ghost||e.dashed)&&e.bordered),l=Se(Hl,{}),{mergedSizeRef:a}=rt({},{defaultSize:"medium",mergedSize:T=>{const{size:z}=e;if(z)return z;const{size:I}=l;if(I)return I;const{mergedSize:w}=T||{};return w?w.value:"medium"}}),s=R(()=>e.focusable&&!e.disabled),d=T=>{var z;s.value||T.preventDefault(),!e.nativeFocusBehavior&&(T.preventDefault(),!e.disabled&&s.value&&((z=o.value)===null||z===void 0||z.focus({preventScroll:!0})))},c=T=>{var z;if(!e.disabled&&!e.loading){const{onClick:I}=e;I&&ae(I,T),e.text||(z=t.value)===null||z===void 0||z.play()}},u=T=>{switch(T.key){case"Enter":if(!e.keyboard)return;r.value=!1}},f=T=>{switch(T.key){case"Enter":if(!e.keyboard||e.loading){T.preventDefault();return}r.value=!0}},p=()=>{r.value=!1},{inlineThemeDisabled:v,mergedClsPrefixRef:h,mergedRtlRef:m}=ke(e),b=ne("Button","-button",sf,Wt,e,h),x=to("Button",m,h),S=R(()=>{const T=b.value,{common:{cubicBezierEaseInOut:z,cubicBezierEaseOut:I},self:w}=T,{rippleDuration:O,opacityDisabled:k,fontWeight:$,fontWeightStrong:L}=w,M=a.value,{dashed:j,type:E,ghost:U,text:_,color:V,round:te,circle:N,textColor:G,secondary:Ce,tertiary:X,quaternary:ve,strong:he}=e,be={"font-weight":he?L:$};let me={"--n-color":"initial","--n-color-hover":"initial","--n-color-pressed":"initial","--n-color-focus":"initial","--n-color-disabled":"initial","--n-ripple-color":"initial","--n-text-color":"initial","--n-text-color-hover":"initial","--n-text-color-pressed":"initial","--n-text-color-focus":"initial","--n-text-color-disabled":"initial"};const se=E==="tertiary",Re=E==="default",ge=se?"default":E;if(_){const ue=G||V;me={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":"#0000","--n-text-color":ue||w[W("textColorText",ge)],"--n-text-color-hover":ue?ut(ue):w[W("textColorTextHover",ge)],"--n-text-color-pressed":ue?br(ue):w[W("textColorTextPressed",ge)],"--n-text-color-focus":ue?ut(ue):w[W("textColorTextHover",ge)],"--n-text-color-disabled":ue||w[W("textColorTextDisabled",ge)]}}else if(U||j){const ue=G||V;me={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":V||w[W("rippleColor",ge)],"--n-text-color":ue||w[W("textColorGhost",ge)],"--n-text-color-hover":ue?ut(ue):w[W("textColorGhostHover",ge)],"--n-text-color-pressed":ue?br(ue):w[W("textColorGhostPressed",ge)],"--n-text-color-focus":ue?ut(ue):w[W("textColorGhostHover",ge)],"--n-text-color-disabled":ue||w[W("textColorGhostDisabled",ge)]}}else if(Ce){const ue=Re?w.textColor:se?w.textColorTertiary:w[W("color",ge)],Y=V||ue,ce=E!=="default"&&E!=="tertiary";me={"--n-color":ce?J(Y,{alpha:Number(w.colorOpacitySecondary)}):w.colorSecondary,"--n-color-hover":ce?J(Y,{alpha:Number(w.colorOpacitySecondaryHover)}):w.colorSecondaryHover,"--n-color-pressed":ce?J(Y,{alpha:Number(w.colorOpacitySecondaryPressed)}):w.colorSecondaryPressed,"--n-color-focus":ce?J(Y,{alpha:Number(w.colorOpacitySecondaryHover)}):w.colorSecondaryHover,"--n-color-disabled":w.colorSecondary,"--n-ripple-color":"#0000","--n-text-color":Y,"--n-text-color-hover":Y,"--n-text-color-pressed":Y,"--n-text-color-focus":Y,"--n-text-color-disabled":Y}}else if(X||ve){const ue=Re?w.textColor:se?w.textColorTertiary:w[W("color",ge)],Y=V||ue;X?(me["--n-color"]=w.colorTertiary,me["--n-color-hover"]=w.colorTertiaryHover,me["--n-color-pressed"]=w.colorTertiaryPressed,me["--n-color-focus"]=w.colorSecondaryHover,me["--n-color-disabled"]=w.colorTertiary):(me["--n-color"]=w.colorQuaternary,me["--n-color-hover"]=w.colorQuaternaryHover,me["--n-color-pressed"]=w.colorQuaternaryPressed,me["--n-color-focus"]=w.colorQuaternaryHover,me["--n-color-disabled"]=w.colorQuaternary),me["--n-ripple-color"]="#0000",me["--n-text-color"]=Y,me["--n-text-color-hover"]=Y,me["--n-text-color-pressed"]=Y,me["--n-text-color-focus"]=Y,me["--n-text-color-disabled"]=Y}else me={"--n-color":V||w[W("color",ge)],"--n-color-hover":V?ut(V):w[W("colorHover",ge)],"--n-color-pressed":V?br(V):w[W("colorPressed",ge)],"--n-color-focus":V?ut(V):w[W("colorFocus",ge)],"--n-color-disabled":V||w[W("colorDisabled",ge)],"--n-ripple-color":V||w[W("rippleColor",ge)],"--n-text-color":G||(V?w.textColorPrimary:se?w.textColorTertiary:w[W("textColor",ge)]),"--n-text-color-hover":G||(V?w.textColorHoverPrimary:w[W("textColorHover",ge)]),"--n-text-color-pressed":G||(V?w.textColorPressedPrimary:w[W("textColorPressed",ge)]),"--n-text-color-focus":G||(V?w.textColorFocusPrimary:w[W("textColorFocus",ge)]),"--n-text-color-disabled":G||(V?w.textColorDisabledPrimary:w[W("textColorDisabled",ge)])};let ee={"--n-border":"initial","--n-border-hover":"initial","--n-border-pressed":"initial","--n-border-focus":"initial","--n-border-disabled":"initial"};_?ee={"--n-border":"none","--n-border-hover":"none","--n-border-pressed":"none","--n-border-focus":"none","--n-border-disabled":"none"}:ee={"--n-border":w[W("border",ge)],"--n-border-hover":w[W("borderHover",ge)],"--n-border-pressed":w[W("borderPressed",ge)],"--n-border-focus":w[W("borderFocus",ge)],"--n-border-disabled":w[W("borderDisabled",ge)]};const{[W("height",M)]:xe,[W("fontSize",M)]:de,[W("padding",M)]:ye,[W("paddingRound",M)]:pe,[W("iconSize",M)]:Me,[W("borderRadius",M)]:Q,[W("iconMargin",M)]:A,waveOpacity:Z}=w,re={"--n-width":N&&!_?xe:"initial","--n-height":_?"initial":xe,"--n-font-size":de,"--n-padding":N||_?"initial":te?pe:ye,"--n-icon-size":Me,"--n-icon-margin":A,"--n-border-radius":_?"initial":N||te?xe:Q};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":z,"--n-bezier-ease-out":I,"--n-ripple-duration":O,"--n-opacity-disabled":k,"--n-wave-opacity":Z},be),me),ee),re)}),B=v?Ae("button",R(()=>{let T="";const{dashed:z,type:I,ghost:w,text:O,color:k,round:$,circle:L,textColor:M,secondary:j,tertiary:E,quaternary:U,strong:_}=e;z&&(T+="a"),w&&(T+="b"),O&&(T+="c"),$&&(T+="d"),L&&(T+="e"),j&&(T+="f"),E&&(T+="g"),U&&(T+="h"),_&&(T+="i"),k&&(T+="j"+Ot(k)),M&&(T+="k"+Ot(M));const{value:V}=a;return T+="l"+V[0],T+="m"+I[0],T}),S,e):void 0;return{selfElRef:o,waveElRef:t,mergedClsPrefix:h,mergedFocusable:s,mergedSize:a,showBorder:n,enterPressed:r,rtlEnabled:x,handleMousedown:d,handleKeydown:f,handleBlur:p,handleKeyup:u,handleClick:c,customColorCssVars:R(()=>{const{color:T}=e;if(!T)return null;const z=ut(T);return{"--n-border-color":T,"--n-border-color-hover":z,"--n-border-color-pressed":br(T),"--n-border-color-focus":z,"--n-border-color-disabled":T}}),cssVars:v?void 0:S,themeClass:B==null?void 0:B.themeClass,onRender:B==null?void 0:B.onRender}},render(){const{mergedClsPrefix:e,tag:o,onRender:t}=this;t==null||t();const r=Ee(this.$slots.default,n=>n&&i("span",{class:`${e}-button__content`},n));return i(o,{ref:"selfElRef",class:[this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`],tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:this.cssVars,disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},this.iconPlacement==="right"&&r,i(wt,{width:!0},{default:()=>Ee(this.$slots.icon,n=>(this.loading||this.renderIcon||n)&&i("span",{class:`${e}-button__icon`,style:{margin:ht(this.$slots.default)?"0":""}},i(At,null,{default:()=>this.loading?i(Et,{clsPrefix:e,key:"loading",class:`${e}-icon-slot`,strokeWidth:20}):i("div",{key:"icon",class:`${e}-icon-slot`,role:"none"},this.renderIcon?this.renderIcon():n)})))}),this.iconPlacement==="left"&&r,this.text?null:i(bl,{ref:"waveElRef",clsPrefix:e}),this.showBorder?i("div",{"aria-hidden":!0,class:`${e}-button__border`,style:this.customColorCssVars}):null,this.showBorder?i("div",{"aria-hidden":!0,class:`${e}-button__state-border`,style:this.customColorCssVars}):null)}}),Po=El,pi=El,Xe="0!important",jl="-1px!important";function It(e){return P(e+"-type",[C("& +",[g("button",{},[P(e+"-type",[y("border",{borderLeftWidth:Xe}),y("state-border",{left:jl})])])])])}function Bt(e){return P(e+"-type",[C("& +",[g("button",[P(e+"-type",[y("border",{borderTopWidth:Xe}),y("state-border",{top:jl})])])])])}const cf=g("button-group",` + flex-wrap: nowrap; + display: inline-flex; + position: relative; +`,[je("vertical",{flexDirection:"row"},[je("rtl",[g("button",[C("&:first-child:not(:last-child)",` + margin-right: ${Xe}; + border-top-right-radius: ${Xe}; + border-bottom-right-radius: ${Xe}; + `),C("&:last-child:not(:first-child)",` + margin-left: ${Xe}; + border-top-left-radius: ${Xe}; + border-bottom-left-radius: ${Xe}; + `),C("&:not(:first-child):not(:last-child)",` + margin-left: ${Xe}; + margin-right: ${Xe}; + border-radius: ${Xe}; + `),It("default"),P("ghost",[It("primary"),It("info"),It("success"),It("warning"),It("error")])])])]),P("vertical",{flexDirection:"column"},[g("button",[C("&:first-child:not(:last-child)",` + margin-bottom: ${Xe}; + margin-left: ${Xe}; + margin-right: ${Xe}; + border-bottom-left-radius: ${Xe}; + border-bottom-right-radius: ${Xe}; + `),C("&:last-child:not(:first-child)",` + margin-top: ${Xe}; + margin-left: ${Xe}; + margin-right: ${Xe}; + border-top-left-radius: ${Xe}; + border-top-right-radius: ${Xe}; + `),C("&:not(:first-child):not(:last-child)",` + margin: ${Xe}; + border-radius: ${Xe}; + `),Bt("default"),P("ghost",[Bt("primary"),Bt("info"),Bt("success"),Bt("warning"),Bt("error")])])])]),uf={size:{type:String,default:void 0},vertical:Boolean},ff=q({name:"ButtonGroup",props:uf,setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:t}=ke(e);return Zo("-button-group",cf,o),Oe(Hl,e),{rtlEnabled:to("ButtonGroup",t,o),mergedClsPrefix:o}},render(){const{mergedClsPrefix:e}=this;return i("div",{class:[`${e}-button-group`,this.rtlEnabled&&`${e}-button-group--rtl`,this.vertical&&`${e}-button-group--vertical`],role:"group"},this.$slots)}}),hf={titleFontSize:"22px"},pf=e=>{const{borderRadius:o,fontSize:t,lineHeight:r,textColor2:n,textColor1:l,textColorDisabled:a,dividerColor:s,fontWeightStrong:d,primaryColor:c,baseColor:u,hoverColor:f,cardColor:p,modalColor:v,popoverColor:h}=e;return Object.assign(Object.assign({},hf),{borderRadius:o,borderColor:$e(p,s),borderColorModal:$e(v,s),borderColorPopover:$e(h,s),textColor:n,titleFontWeight:d,titleTextColor:l,dayTextColor:a,fontSize:t,lineHeight:r,dateColorCurrent:c,dateTextColorCurrent:u,cellColorHover:$e(p,f),cellColorHoverModal:$e(v,f),cellColorHoverPopover:$e(h,f),cellColor:p,cellColorModal:v,cellColorPopover:h,barColor:c})},vf={name:"Calendar",common:fe,peers:{Button:$o},self:pf},gf=vf,mf=e=>{const{fontSize:o,boxShadow2:t,popoverColor:r,textColor2:n,borderRadius:l,borderColor:a,heightSmall:s,heightMedium:d,heightLarge:c,fontSizeSmall:u,fontSizeMedium:f,fontSizeLarge:p,dividerColor:v}=e;return{panelFontSize:o,boxShadow:t,color:r,textColor:n,borderRadius:l,border:`1px solid ${a}`,heightSmall:s,heightMedium:d,heightLarge:c,fontSizeSmall:u,fontSizeMedium:f,fontSizeLarge:p,dividerColor:v}},bf={name:"ColorPicker",common:fe,peers:{Input:Ho,Button:$o},self:mf},xf=bf,Cf={paddingSmall:"12px 16px 12px",paddingMedium:"19px 24px 20px",paddingLarge:"23px 32px 24px",paddingHuge:"27px 40px 28px",titleFontSizeSmall:"16px",titleFontSizeMedium:"18px",titleFontSizeLarge:"18px",titleFontSizeHuge:"18px",closeIconSize:"18px",closeSize:"22px"},Wl=e=>{const{primaryColor:o,borderRadius:t,lineHeight:r,fontSize:n,cardColor:l,textColor2:a,textColor1:s,dividerColor:d,fontWeightStrong:c,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:p,closeColorHover:v,closeColorPressed:h,modalColor:m,boxShadow1:b,popoverColor:x,actionColor:S}=e;return Object.assign(Object.assign({},Cf),{lineHeight:r,color:l,colorModal:m,colorPopover:x,colorTarget:o,colorEmbedded:S,colorEmbeddedModal:S,colorEmbeddedPopover:S,textColor:a,titleTextColor:s,borderColor:d,actionColor:S,titleFontWeight:c,closeColorHover:v,closeColorPressed:h,closeBorderRadius:t,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:p,fontSizeSmall:n,fontSizeMedium:n,fontSizeLarge:n,fontSizeHuge:n,boxShadow:b,borderRadius:t})},yf={name:"Card",common:Le,self:Wl},Nl=yf,wf={name:"Card",common:fe,self(e){const o=Wl(e),{cardColor:t,modalColor:r,popoverColor:n}=e;return o.colorEmbedded=t,o.colorEmbeddedModal=r,o.colorEmbeddedPopover=n,o}},Vl=wf,Sf=C([g("card",` + font-size: var(--n-font-size); + line-height: var(--n-line-height); + display: flex; + flex-direction: column; + width: 100%; + box-sizing: border-box; + position: relative; + border-radius: var(--n-border-radius); + background-color: var(--n-color); + color: var(--n-text-color); + word-break: break-word; + transition: + color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier), + border-color .3s var(--n-bezier); + `,[Zi({background:"var(--n-color-modal)"}),P("hoverable",[C("&:hover","box-shadow: var(--n-box-shadow);")]),P("content-segmented",[C(">",[y("content",{paddingTop:"var(--n-padding-bottom)"})])]),P("content-soft-segmented",[C(">",[y("content",` + margin: 0 var(--n-padding-left); + padding: var(--n-padding-bottom) 0; + `)])]),P("footer-segmented",[C(">",[y("footer",{paddingTop:"var(--n-padding-bottom)"})])]),P("footer-soft-segmented",[C(">",[y("footer",` + padding: var(--n-padding-bottom) 0; + margin: 0 var(--n-padding-left); + `)])]),C(">",[g("card-header",` + box-sizing: border-box; + display: flex; + align-items: center; + font-size: var(--n-title-font-size); + padding: + var(--n-padding-top) + var(--n-padding-left) + var(--n-padding-bottom) + var(--n-padding-left); + `,[y("main",` + font-weight: var(--n-title-font-weight); + transition: color .3s var(--n-bezier); + flex: 1; + min-width: 0; + color: var(--n-title-text-color); + `),y("extra",` + display: flex; + align-items: center; + font-size: var(--n-font-size); + font-weight: 400; + transition: color .3s var(--n-bezier); + color: var(--n-text-color); + `),y("close",` + margin: 0 0 0 8px; + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + `)]),y("action",` + box-sizing: border-box; + transition: + background-color .3s var(--n-bezier), + border-color .3s var(--n-bezier); + background-clip: padding-box; + background-color: var(--n-action-color); + `),y("content","flex: 1; min-width: 0;"),y("content, footer",` + box-sizing: border-box; + padding: 0 var(--n-padding-left) var(--n-padding-bottom) var(--n-padding-left); + font-size: var(--n-font-size); + `,[C("&:first-child",{paddingTop:"var(--n-padding-bottom)"})]),y("action",` + background-color: var(--n-action-color); + padding: var(--n-padding-bottom) var(--n-padding-left); + border-bottom-left-radius: var(--n-border-radius); + border-bottom-right-radius: var(--n-border-radius); + `)]),g("card-cover",` + overflow: hidden; + width: 100%; + border-radius: var(--n-border-radius) var(--n-border-radius) 0 0; + `,[C("img",` + display: block; + width: 100%; + `)]),P("bordered",` + border: 1px solid var(--n-border-color); + `,[C("&:target","border-color: var(--n-color-target);")]),P("action-segmented",[C(">",[y("action",[C("&:not(:first-child)",{borderTop:"1px solid var(--n-border-color)"})])])]),P("content-segmented, content-soft-segmented",[C(">",[y("content",{transition:"border-color 0.3s var(--n-bezier)"},[C("&:not(:first-child)",{borderTop:"1px solid var(--n-border-color)"})])])]),P("footer-segmented, footer-soft-segmented",[C(">",[y("footer",{transition:"border-color 0.3s var(--n-bezier)"},[C("&:not(:first-child)",{borderTop:"1px solid var(--n-border-color)"})])])]),P("embedded",` + background-color: var(--n-color-embedded); + `)]),Or(g("card",` + background: var(--n-color-modal); + `,[P("embedded",` + background-color: var(--n-color-embedded-modal); + `)])),gn(g("card",` + background: var(--n-color-popover); + `,[P("embedded",` + background-color: var(--n-color-embedded-popover); + `)]))]),Sn={title:String,contentStyle:[Object,String],headerStyle:[Object,String],headerExtraStyle:[Object,String],footerStyle:[Object,String],embedded:Boolean,segmented:{type:[Boolean,Object],default:!1},size:{type:String,default:"medium"},bordered:{type:Boolean,default:!0},closable:Boolean,hoverable:Boolean,role:String,onClose:[Function,Array],tag:{type:String,default:"div"}},zf=yo(Sn),$f=Object.assign(Object.assign({},ne.props),Sn),Rf=q({name:"Card",props:$f,setup(e){const o=()=>{const{onClose:c}=e;c&&ae(c)},{inlineThemeDisabled:t,mergedClsPrefixRef:r,mergedRtlRef:n}=ke(e),l=ne("Card","-card",Sf,Nl,e,r),a=to("Card",n,r),s=R(()=>{const{size:c}=e,{self:{color:u,colorModal:f,colorTarget:p,textColor:v,titleTextColor:h,titleFontWeight:m,borderColor:b,actionColor:x,borderRadius:S,lineHeight:B,closeIconColor:T,closeIconColorHover:z,closeIconColorPressed:I,closeColorHover:w,closeColorPressed:O,closeBorderRadius:k,closeIconSize:$,closeSize:L,boxShadow:M,colorPopover:j,colorEmbedded:E,colorEmbeddedModal:U,colorEmbeddedPopover:_,[W("padding",c)]:V,[W("fontSize",c)]:te,[W("titleFontSize",c)]:N},common:{cubicBezierEaseInOut:G}}=l.value,{top:Ce,left:X,bottom:ve}=Ko(V);return{"--n-bezier":G,"--n-border-radius":S,"--n-color":u,"--n-color-modal":f,"--n-color-popover":j,"--n-color-embedded":E,"--n-color-embedded-modal":U,"--n-color-embedded-popover":_,"--n-color-target":p,"--n-text-color":v,"--n-line-height":B,"--n-action-color":x,"--n-title-text-color":h,"--n-title-font-weight":m,"--n-close-icon-color":T,"--n-close-icon-color-hover":z,"--n-close-icon-color-pressed":I,"--n-close-color-hover":w,"--n-close-color-pressed":O,"--n-border-color":b,"--n-box-shadow":M,"--n-padding-top":Ce,"--n-padding-bottom":ve,"--n-padding-left":X,"--n-font-size":te,"--n-title-font-size":N,"--n-close-size":L,"--n-close-icon-size":$,"--n-close-border-radius":k}}),d=t?Ae("card",R(()=>e.size[0]),s,e):void 0;return{rtlEnabled:a,mergedClsPrefix:r,mergedTheme:l,handleCloseClick:o,cssVars:t?void 0:s,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{segmented:e,bordered:o,hoverable:t,mergedClsPrefix:r,rtlEnabled:n,onRender:l,embedded:a,tag:s,$slots:d}=this;return l==null||l(),i(s,{class:[`${r}-card`,this.themeClass,a&&`${r}-card--embedded`,{[`${r}-card--rtl`]:n,[`${r}-card--content${typeof e!="boolean"&&e.content==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.content,[`${r}-card--footer${typeof e!="boolean"&&e.footer==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.footer,[`${r}-card--action-segmented`]:e===!0||e!==!1&&e.action,[`${r}-card--bordered`]:o,[`${r}-card--hoverable`]:t}],style:this.cssVars,role:this.role},Ee(d.cover,c=>c&&i("div",{class:`${r}-card-cover`,role:"none"},c)),Ee(d.header,c=>c||this.title||this.closable?i("div",{class:`${r}-card-header`,style:this.headerStyle},i("div",{class:`${r}-card-header__main`,role:"heading"},c||this.title),Ee(d["header-extra"],u=>u&&i("div",{class:`${r}-card-header__extra`,style:this.headerExtraStyle},u)),this.closable?i(St,{clsPrefix:r,class:`${r}-card-header__close`,onClick:this.handleCloseClick,absolute:!0}):null):null),Ee(d.default,c=>c&&i("div",{class:`${r}-card__content`,style:this.contentStyle,role:"none"},c)),Ee(d.footer,c=>c&&[i("div",{class:`${r}-card__footer`,style:this.footerStyle,role:"none"},c)]),Ee(d.action,c=>c&&i("div",{class:`${r}-card__action`,role:"none"},c)))}}),Pf=e=>({dotSize:"8px",dotColor:"rgba(255, 255, 255, .3)",dotColorActive:"rgba(255, 255, 255, 1)",dotColorFocus:"rgba(255, 255, 255, .5)",dotLineWidth:"16px",dotLineWidthActive:"24px",arrowColor:"#eee"}),kf={name:"Carousel",common:fe,self:Pf},If=kf,Bf={sizeSmall:"14px",sizeMedium:"16px",sizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"},Tf=e=>{const{baseColor:o,inputColorDisabled:t,cardColor:r,modalColor:n,popoverColor:l,textColorDisabled:a,borderColor:s,primaryColor:d,textColor2:c,fontSizeSmall:u,fontSizeMedium:f,fontSizeLarge:p,borderRadiusSmall:v,lineHeight:h}=e;return Object.assign(Object.assign({},Bf),{labelLineHeight:h,fontSizeSmall:u,fontSizeMedium:f,fontSizeLarge:p,borderRadius:v,color:o,colorChecked:d,colorDisabled:t,colorDisabledChecked:t,colorTableHeader:r,colorTableHeaderModal:n,colorTableHeaderPopover:l,checkMarkColor:o,checkMarkColorDisabled:a,checkMarkColorDisabledChecked:a,border:`1px solid ${s}`,borderDisabled:`1px solid ${s}`,borderDisabledChecked:`1px solid ${s}`,borderChecked:`1px solid ${d}`,borderFocus:`1px solid ${d}`,boxShadowFocus:`0 0 0 2px ${J(d,{alpha:.3})}`,textColor:c,textColorDisabled:a})},Ff={name:"Checkbox",common:fe,self(e){const{cardColor:o}=e,t=Tf(e);return t.color="#0000",t.checkMarkColor=o,t}},Nt=Ff,Of=e=>{const{borderRadius:o,boxShadow2:t,popoverColor:r,textColor2:n,textColor3:l,primaryColor:a,textColorDisabled:s,dividerColor:d,hoverColor:c,fontSizeMedium:u,heightMedium:f}=e;return{menuBorderRadius:o,menuColor:r,menuBoxShadow:t,menuDividerColor:d,menuHeight:"calc(var(--n-option-height) * 6.6)",optionArrowColor:l,optionHeight:f,optionFontSize:u,optionColorHover:c,optionTextColor:n,optionTextColorActive:a,optionTextColorDisabled:s,optionCheckMarkColor:a,loadingColor:a,columnWidth:"180px"}},Mf={name:"Cascader",common:fe,peers:{InternalSelectMenu:fr,InternalSelection:wn,Scrollbar:zo,Checkbox:Nt,Empty:Cn},self:Of},_f=Mf,Df={name:"Code",common:fe,self(e){const{textColor2:o,fontSize:t,fontWeightStrong:r,textColor3:n}=e;return{textColor:o,fontSize:t,fontWeightStrong:r,"mono-3":"#5c6370","hue-1":"#56b6c2","hue-2":"#61aeee","hue-3":"#c678dd","hue-4":"#98c379","hue-5":"#e06c75","hue-5-2":"#be5046","hue-6":"#d19a66","hue-6-2":"#e6c07b",lineNumberTextColor:n}}},Ul=Df,Lf=e=>{const{fontWeight:o,textColor1:t,textColor2:r,textColorDisabled:n,dividerColor:l,fontSize:a}=e;return{titleFontSize:a,titleFontWeight:o,dividerColor:l,titleTextColor:t,titleTextColorDisabled:n,fontSize:a,textColor:r,arrowColor:r,arrowColorDisabled:n,itemMargin:"16px 0 0 0",titlePadding:"16px 0 0 0"}},Hf={name:"Collapse",common:fe,self:Lf},Af=Hf,Ef=e=>{const{cubicBezierEaseInOut:o}=e;return{bezier:o}},jf={name:"CollapseTransition",common:fe,self:Ef},Wf=jf,Nf={abstract:Boolean,bordered:{type:Boolean,default:void 0},clsPrefix:String,locale:Object,dateLocale:Object,namespace:String,rtl:Array,tag:{type:String,default:"div"},hljs:Object,katex:Object,theme:Object,themeOverrides:Object,componentOptions:Object,icons:Object,breakpoints:Object,preflightStyleDisabled:Boolean,inlineThemeDisabled:{type:Boolean,default:void 0},as:{type:String,validator:()=>(qo("config-provider","`as` is deprecated, please use `tag` instead."),!0),default:void 0}},g1=q({name:"ConfigProvider",alias:["App"],props:Nf,setup(e){const o=Se(Yo,null),t=R(()=>{const{theme:h}=e;if(h===null)return;const m=o==null?void 0:o.mergedThemeRef.value;return h===void 0?m:m===void 0?h:Object.assign({},m,h)}),r=R(()=>{const{themeOverrides:h}=e;if(h!==null){if(h===void 0)return o==null?void 0:o.mergedThemeOverridesRef.value;{const m=o==null?void 0:o.mergedThemeOverridesRef.value;return m===void 0?h:Tt({},m,h)}}}),n=We(()=>{const{namespace:h}=e;return h===void 0?o==null?void 0:o.mergedNamespaceRef.value:h}),l=We(()=>{const{bordered:h}=e;return h===void 0?o==null?void 0:o.mergedBorderedRef.value:h}),a=R(()=>{const{icons:h}=e;return h===void 0?o==null?void 0:o.mergedIconsRef.value:h}),s=R(()=>{const{componentOptions:h}=e;return h!==void 0?h:o==null?void 0:o.mergedComponentPropsRef.value}),d=R(()=>{const{clsPrefix:h}=e;return h!==void 0?h:o==null?void 0:o.mergedClsPrefixRef.value}),c=R(()=>{var h;const{rtl:m}=e;if(m===void 0)return o==null?void 0:o.mergedRtlRef.value;const b={};for(const x of m)b[x.name]=Wn(x),(h=x.peers)===null||h===void 0||h.forEach(S=>{S.name in b||(b[S.name]=Wn(S))});return b}),u=R(()=>e.breakpoints||(o==null?void 0:o.mergedBreakpointsRef.value)),f=e.inlineThemeDisabled||(o==null?void 0:o.inlineThemeDisabled),p=e.preflightStyleDisabled||(o==null?void 0:o.preflightStyleDisabled),v=R(()=>{const{value:h}=t,{value:m}=r,b=m&&Object.keys(m).length!==0,x=h==null?void 0:h.name;return x?b?`${x}-${zr(JSON.stringify(r.value))}`:x:b?zr(JSON.stringify(r.value)):""});return Oe(Yo,{mergedThemeHashRef:v,mergedBreakpointsRef:u,mergedRtlRef:c,mergedIconsRef:a,mergedComponentPropsRef:s,mergedBorderedRef:l,mergedNamespaceRef:n,mergedClsPrefixRef:d,mergedLocaleRef:R(()=>{const{locale:h}=e;if(h!==null)return h===void 0?o==null?void 0:o.mergedLocaleRef.value:h}),mergedDateLocaleRef:R(()=>{const{dateLocale:h}=e;if(h!==null)return h===void 0?o==null?void 0:o.mergedDateLocaleRef.value:h}),mergedHljsRef:R(()=>{const{hljs:h}=e;return h===void 0?o==null?void 0:o.mergedHljsRef.value:h}),mergedKatexRef:R(()=>{const{katex:h}=e;return h===void 0?o==null?void 0:o.mergedKatexRef.value:h}),mergedThemeRef:t,mergedThemeOverridesRef:r,inlineThemeDisabled:f||!1,preflightStyleDisabled:p||!1}),{mergedClsPrefix:d,mergedBordered:l,mergedNamespace:n,mergedTheme:t,mergedThemeOverrides:r}},render(){var e,o,t,r;return this.abstract?(r=(t=this.$slots).default)===null||r===void 0?void 0:r.call(t):i(this.as||this.tag,{class:`${this.mergedClsPrefix||sl}-config-provider`},(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e))}}),Vf=e=>1-Math.pow(1-e,5);function Uf(e){const{from:o,to:t,duration:r,onUpdate:n,onFinish:l}=e,a=()=>{const d=performance.now(),c=Math.min(d-s,r),u=o+(t-o)*Vf(c/r);if(c===r){l();return}n(u),requestAnimationFrame(a)},s=performance.now();a()}const Kf={to:{type:Number,default:0},precision:{type:Number,default:0},showSeparator:Boolean,locale:String,from:{type:Number,default:0},active:{type:Boolean,default:!0},duration:{type:Number,default:2e3},onFinish:Function},m1=q({name:"NumberAnimation",props:Kf,setup(e){const{localeRef:o}=Xo("name"),{duration:t}=e,r=D(e.from),n=R(()=>{const{locale:p}=e;return p!==void 0?p:o.value});let l=!1;const a=p=>{r.value=p},s=()=>{var p;r.value=e.to,l=!1,(p=e.onFinish)===null||p===void 0||p.call(e)},d=(p=e.from,v=e.to)=>{l=!0,r.value=e.from,p!==v&&Uf({from:p,to:v,duration:t,onUpdate:a,onFinish:s})},c=R(()=>{var p;const h=fd(r.value,e.precision).toFixed(e.precision).split("."),m=new Intl.NumberFormat(n.value),b=(p=m.formatToParts(.5).find(B=>B.type==="decimal"))===null||p===void 0?void 0:p.value,x=e.showSeparator?m.format(Number(h[0])):h[0],S=h[1];return{integer:x,decimal:S,decimalSeparator:b}});function u(){l||d()}return mo(()=>{oo(()=>{e.active&&d()})}),Object.assign({formattedValue:c},{play:u})},render(){const{formattedValue:{integer:e,decimal:o,decimalSeparator:t}}=this;return[e,o?t:null,o]}}),Gf={name:"Popselect",common:fe,peers:{Popover:$t,InternalSelectMenu:fr}},Kl=Gf;function qf(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}const Yf={name:"Popselect",common:Le,peers:{Popover:jt,InternalSelectMenu:_r},self:qf},zn=Yf,Gl="n-popselect",Xf=g("popselect-menu",` + box-shadow: var(--n-menu-box-shadow); +`),$n={multiple:Boolean,value:{type:[String,Number,Array],default:null},cancelable:Boolean,options:{type:Array,default:()=>[]},size:{type:String,default:"medium"},scrollable:Boolean,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onMouseenter:Function,onMouseleave:Function,renderLabel:Function,showCheckmark:{type:Boolean,default:void 0},nodeProps:Function,virtualScroll:Boolean,onChange:[Function,Array]},vi=yo($n),Zf=q({name:"PopselectPanel",props:$n,setup(e){const o=Se(Gl),{mergedClsPrefixRef:t,inlineThemeDisabled:r}=ke(e),n=ne("Popselect","-pop-select",Xf,zn,o.props,t),l=R(()=>ar(e.options,Tl("value","children")));function a(p,v){const{onUpdateValue:h,"onUpdate:value":m,onChange:b}=e;h&&ae(h,p,v),m&&ae(m,p,v),b&&ae(b,p,v)}function s(p){c(p.key)}function d(p){pt(p,"action")||p.preventDefault()}function c(p){const{value:{getNode:v}}=l;if(e.multiple)if(Array.isArray(e.value)){const h=[],m=[];let b=!0;e.value.forEach(x=>{if(x===p){b=!1;return}const S=v(x);S&&(h.push(S.key),m.push(S.rawNode))}),b&&(h.push(p),m.push(v(p).rawNode)),a(h,m)}else{const h=v(p);h&&a([p],[h.rawNode])}else if(e.value===p&&e.cancelable)a(null,null);else{const h=v(p);h&&a(p,h.rawNode);const{"onUpdate:show":m,onUpdateShow:b}=o.props;m&&ae(m,!1),b&&ae(b,!1),o.setShow(!1)}io(()=>{o.syncPosition()})}Ke(le(e,"options"),()=>{io(()=>{o.syncPosition()})});const u=R(()=>{const{self:{menuBoxShadow:p}}=n.value;return{"--n-menu-box-shadow":p}}),f=r?Ae("select",void 0,u,o.props):void 0;return{mergedTheme:o.mergedThemeRef,mergedClsPrefix:t,treeMate:l,handleToggle:s,handleMenuMousedown:d,cssVars:r?void 0:u,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),i(yn,{clsPrefix:this.mergedClsPrefix,focusable:!0,nodeProps:this.nodeProps,class:[`${this.mergedClsPrefix}-popselect-menu`,this.themeClass],style:this.cssVars,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,multiple:this.multiple,treeMate:this.treeMate,size:this.size,value:this.value,virtualScroll:this.virtualScroll,scrollable:this.scrollable,renderLabel:this.renderLabel,onToggle:this.handleToggle,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseenter,onMousedown:this.handleMenuMousedown,showCheckmark:this.showCheckmark},{action:()=>{var o,t;return((t=(o=this.$slots).action)===null||t===void 0?void 0:t.call(o))||[]},empty:()=>{var o,t;return((t=(o=this.$slots).empty)===null||t===void 0?void 0:t.call(o))||[]}})}}),Qf=Object.assign(Object.assign(Object.assign(Object.assign({},ne.props),_t(bt,["showArrow","arrow"])),{placement:Object.assign(Object.assign({},bt.placement),{default:"bottom"}),trigger:{type:String,default:"hover"}}),$n),Jf=q({name:"Popselect",props:Qf,inheritAttrs:!1,__popover__:!0,setup(e){const{mergedClsPrefixRef:o}=ke(e),t=ne("Popselect","-popselect",void 0,zn,e,o),r=D(null);function n(){var s;(s=r.value)===null||s===void 0||s.syncPosition()}function l(s){var d;(d=r.value)===null||d===void 0||d.setShow(s)}return Oe(Gl,{props:e,mergedThemeRef:t,syncPosition:n,setShow:l}),Object.assign(Object.assign({},{syncPosition:n,setShow:l}),{popoverInstRef:r,mergedTheme:t})},render(){const{mergedTheme:e}=this,o={theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:{padding:"0"},ref:"popoverInstRef",internalRenderBody:(t,r,n,l,a)=>{const{$attrs:s}=this;return i(Zf,Object.assign({},s,{class:[s.class,t],style:[s.style,n]},go(this.$props,vi),{ref:qi(r),onMouseenter:Zt([l,s.onMouseenter]),onMouseleave:Zt([a,s.onMouseleave])}),{action:()=>{var d,c;return(c=(d=this.$slots).action)===null||c===void 0?void 0:c.call(d)},empty:()=>{var d,c;return(c=(d=this.$slots).empty)===null||c===void 0?void 0:c.call(d)}})}};return i(hr,Object.assign({},_t(this.$props,vi),o,{internalDeactivateImmediately:!0}),{trigger:()=>{var t,r;return(r=(t=this.$slots).default)===null||r===void 0?void 0:r.call(t)}})}});function ql(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}const eh={name:"Select",common:Le,peers:{InternalSelection:Pl,InternalSelectMenu:_r},self:ql},Yl=eh,oh={name:"Select",common:fe,peers:{InternalSelection:wn,InternalSelectMenu:fr},self:ql},Xl=oh,th=C([g("select",` + z-index: auto; + outline: none; + width: 100%; + position: relative; + `),g("select-menu",` + margin: 4px 0; + box-shadow: var(--n-menu-box-shadow); + `,[at({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),rh=Object.assign(Object.assign({},ne.props),{to:Io.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),nh=q({name:"Select",props:rh,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:t,namespaceRef:r,inlineThemeDisabled:n}=ke(e),l=ne("Select","-select",th,Yl,e,o),a=D(e.defaultValue),s=le(e,"value"),d=so(s,a),c=D(!1),u=D(""),f=R(()=>{const{valueField:F,childrenField:K}=e,ie=Tl(F,K);return ar(M.value,ie)}),p=R(()=>xu($.value,e.valueField,e.childrenField)),v=D(!1),h=so(le(e,"show"),v),m=D(null),b=D(null),x=D(null),{localeRef:S}=Xo("Select"),B=R(()=>{var F;return(F=e.placeholder)!==null&&F!==void 0?F:S.value.placeholder}),T=gt(e,["items","options"]),z=[],I=D([]),w=D([]),O=D(new Map),k=R(()=>{const{fallbackOption:F}=e;if(F===void 0){const{labelField:K,valueField:ie}=e;return ze=>({[K]:String(ze),[ie]:ze})}return F===!1?!1:K=>Object.assign(F(K),{value:K})}),$=R(()=>w.value.concat(I.value).concat(T.value)),L=R(()=>{const{filter:F}=e;if(F)return F;const{labelField:K,valueField:ie}=e;return(ze,Pe)=>{if(!Pe)return!1;const Ie=Pe[K];if(typeof Ie=="string")return Yr(ze,Ie);const Te=Pe[ie];return typeof Te=="string"?Yr(ze,Te):typeof Te=="number"?Yr(ze,String(Te)):!1}}),M=R(()=>{if(e.remote)return T.value;{const{value:F}=$,{value:K}=u;return!K.length||!e.filterable?F:bu(F,L.value,K,e.childrenField)}});function j(F){const K=e.remote,{value:ie}=O,{value:ze}=p,{value:Pe}=k,Ie=[];return F.forEach(Te=>{if(ze.has(Te))Ie.push(ze.get(Te));else if(K&&ie.has(Te))Ie.push(ie.get(Te));else if(Pe){const _e=Pe(Te);_e&&Ie.push(_e)}}),Ie}const E=R(()=>{if(e.multiple){const{value:F}=d;return Array.isArray(F)?j(F):[]}return null}),U=R(()=>{const{value:F}=d;return!e.multiple&&!Array.isArray(F)?F===null?null:j([F])[0]||null:null}),_=rt(e),{mergedSizeRef:V,mergedDisabledRef:te,mergedStatusRef:N}=_;function G(F,K){const{onChange:ie,"onUpdate:value":ze,onUpdateValue:Pe}=e,{nTriggerFormChange:Ie,nTriggerFormInput:Te}=_;ie&&ae(ie,F,K),Pe&&ae(Pe,F,K),ze&&ae(ze,F,K),a.value=F,Ie(),Te()}function Ce(F){const{onBlur:K}=e,{nTriggerFormBlur:ie}=_;K&&ae(K,F),ie()}function X(){const{onClear:F}=e;F&&ae(F)}function ve(F){const{onFocus:K,showOnFocus:ie}=e,{nTriggerFormFocus:ze}=_;K&&ae(K,F),ze(),ie&&Re()}function he(F){const{onSearch:K}=e;K&&ae(K,F)}function be(F){const{onScroll:K}=e;K&&ae(K,F)}function me(){var F;const{remote:K,multiple:ie}=e;if(K){const{value:ze}=O;if(ie){const{valueField:Pe}=e;(F=E.value)===null||F===void 0||F.forEach(Ie=>{ze.set(Ie[Pe],Ie)})}else{const Pe=U.value;Pe&&ze.set(Pe[e.valueField],Pe)}}}function se(F){const{onUpdateShow:K,"onUpdate:show":ie}=e;K&&ae(K,F),ie&&ae(ie,F),v.value=F}function Re(){te.value||(se(!0),v.value=!0,e.filterable&&Co())}function ge(){se(!1)}function ee(){u.value="",w.value=z}const xe=D(!1);function de(){e.filterable&&(xe.value=!0)}function ye(){e.filterable&&(xe.value=!1,h.value||ee())}function pe(){te.value||(h.value?e.filterable?Co():ge():Re())}function Me(F){var K,ie;!((ie=(K=x.value)===null||K===void 0?void 0:K.selfRef)===null||ie===void 0)&&ie.contains(F.relatedTarget)||(c.value=!1,Ce(F),ge())}function Q(F){ve(F),c.value=!0}function A(F){c.value=!0}function Z(F){var K;!((K=m.value)===null||K===void 0)&&K.$el.contains(F.relatedTarget)||(c.value=!1,Ce(F),ge())}function re(){var F;(F=m.value)===null||F===void 0||F.focus(),ge()}function ue(F){var K;h.value&&(!((K=m.value)===null||K===void 0)&&K.$el.contains(Qt(F))||ge())}function Y(F){if(!Array.isArray(F))return[];if(k.value)return Array.from(F);{const{remote:K}=e,{value:ie}=p;if(K){const{value:ze}=O;return F.filter(Pe=>ie.has(Pe)||ze.has(Pe))}else return F.filter(ze=>ie.has(ze))}}function ce(F){He(F.rawNode)}function He(F){if(te.value)return;const{tag:K,remote:ie,clearFilterAfterSelect:ze,valueField:Pe}=e;if(K&&!ie){const{value:Ie}=w,Te=Ie[0]||null;if(Te){const _e=I.value;_e.length?_e.push(Te):I.value=[Te],w.value=z}}if(ie&&O.value.set(F[Pe],F),e.multiple){const Ie=Y(d.value),Te=Ie.findIndex(_e=>_e===F[Pe]);if(~Te){if(Ie.splice(Te,1),K&&!ie){const _e=Ve(F[Pe]);~_e&&(I.value.splice(_e,1),ze&&(u.value=""))}}else Ie.push(F[Pe]),ze&&(u.value="");G(Ie,j(Ie))}else{if(K&&!ie){const Ie=Ve(F[Pe]);~Ie?I.value=[I.value[Ie]]:I.value=z}xo(),ge(),G(F[Pe],F)}}function Ve(F){return I.value.findIndex(ie=>ie[e.valueField]===F)}function Ze(F){h.value||Re();const{value:K}=F.target;u.value=K;const{tag:ie,remote:ze}=e;if(he(K),ie&&!ze){if(!K){w.value=z;return}const{onCreate:Pe}=e,Ie=Pe?Pe(K):{[e.labelField]:K,[e.valueField]:K},{valueField:Te}=e;T.value.some(_e=>_e[Te]===Ie[Te])||I.value.some(_e=>_e[Te]===Ie[Te])?w.value=z:w.value=[Ie]}}function po(F){F.stopPropagation();const{multiple:K}=e;!K&&e.filterable&&ge(),X(),K?G([],[]):G(null,null)}function fo(F){!pt(F,"action")&&!pt(F,"empty")&&F.preventDefault()}function Bo(F){be(F)}function To(F){var K,ie,ze,Pe,Ie;if(!e.keyboard){F.preventDefault();return}switch(F.key){case" ":if(e.filterable)break;F.preventDefault();case"Enter":if(!(!((K=m.value)===null||K===void 0)&&K.isComposing)){if(h.value){const Te=(ie=x.value)===null||ie===void 0?void 0:ie.getPendingTmNode();Te?ce(Te):e.filterable||(ge(),xo())}else if(Re(),e.tag&&xe.value){const Te=w.value[0];if(Te){const _e=Te[e.valueField],{value:Qe}=d;e.multiple&&Array.isArray(Qe)&&Qe.some(vo=>vo===_e)||He(Te)}}}F.preventDefault();break;case"ArrowUp":if(F.preventDefault(),e.loading)return;h.value&&((ze=x.value)===null||ze===void 0||ze.prev());break;case"ArrowDown":if(F.preventDefault(),e.loading)return;h.value?(Pe=x.value)===null||Pe===void 0||Pe.next():Re();break;case"Escape":h.value&&(kd(F),ge()),(Ie=m.value)===null||Ie===void 0||Ie.focus();break}}function xo(){var F;(F=m.value)===null||F===void 0||F.focus()}function Co(){var F;(F=m.value)===null||F===void 0||F.focusInput()}function Ao(){var F;h.value&&((F=b.value)===null||F===void 0||F.syncPosition())}me(),Ke(le(e,"options"),me);const Fo={focus:()=>{var F;(F=m.value)===null||F===void 0||F.focus()},blur:()=>{var F;(F=m.value)===null||F===void 0||F.blur()}},co=R(()=>{const{self:{menuBoxShadow:F}}=l.value;return{"--n-menu-box-shadow":F}}),uo=n?Ae("select",void 0,co,e):void 0;return Object.assign(Object.assign({},Fo),{mergedStatus:N,mergedClsPrefix:o,mergedBordered:t,namespace:r,treeMate:f,isMounted:Ct(),triggerRef:m,menuRef:x,pattern:u,uncontrolledShow:v,mergedShow:h,adjustedTo:Io(e),uncontrolledValue:a,mergedValue:d,followerRef:b,localizedPlaceholder:B,selectedOption:U,selectedOptions:E,mergedSize:V,mergedDisabled:te,focused:c,activeWithoutMenuOpen:xe,inlineThemeDisabled:n,onTriggerInputFocus:de,onTriggerInputBlur:ye,handleTriggerOrMenuResize:Ao,handleMenuFocus:A,handleMenuBlur:Z,handleMenuTabOut:re,handleTriggerClick:pe,handleToggle:ce,handleDeleteOption:He,handlePatternInput:Ze,handleClear:po,handleTriggerBlur:Me,handleTriggerFocus:Q,handleKeydown:To,handleMenuAfterLeave:ee,handleMenuClickOutside:ue,handleMenuScroll:Bo,handleMenuKeydown:To,handleMenuMousedown:fo,mergedTheme:l,cssVars:n?void 0:co,themeClass:uo==null?void 0:uo.themeClass,onRender:uo==null?void 0:uo.onRender})},render(){return i("div",{class:`${this.mergedClsPrefix}-select`},i(Ir,null,{default:()=>[i(Br,null,{default:()=>i(ou,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,o;return[(o=(e=this.$slots).arrow)===null||o===void 0?void 0:o.call(e)]}})}),i(kr,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Io.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i(no,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,o,t;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),Lo(i(yn,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(o=this.menuProps)===null||o===void 0?void 0:o.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:"medium",renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(t=this.menuProps)===null||t===void 0?void 0:t.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,n;return[(n=(r=this.$slots).empty)===null||n===void 0?void 0:n.call(r)]},action:()=>{var r,n;return[(n=(r=this.$slots).action)===null||n===void 0?void 0:n.call(r)]}}),this.displayDirective==="show"?[[Go,this.mergedShow],[Ft,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Ft,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),ih={itemPaddingSmall:"0 4px",itemMarginSmall:"0 0 0 8px",itemMarginSmallRtl:"0 8px 0 0",itemPaddingMedium:"0 4px",itemMarginMedium:"0 0 0 8px",itemMarginMediumRtl:"0 8px 0 0",itemPaddingLarge:"0 4px",itemMarginLarge:"0 0 0 8px",itemMarginLargeRtl:"0 8px 0 0",buttonIconSizeSmall:"14px",buttonIconSizeMedium:"16px",buttonIconSizeLarge:"18px",inputWidthSmall:"60px",selectWidthSmall:"unset",inputMarginSmall:"0 0 0 8px",inputMarginSmallRtl:"0 8px 0 0",selectMarginSmall:"0 0 0 8px",prefixMarginSmall:"0 8px 0 0",suffixMarginSmall:"0 0 0 8px",inputWidthMedium:"60px",selectWidthMedium:"unset",inputMarginMedium:"0 0 0 8px",inputMarginMediumRtl:"0 8px 0 0",selectMarginMedium:"0 0 0 8px",prefixMarginMedium:"0 8px 0 0",suffixMarginMedium:"0 0 0 8px",inputWidthLarge:"60px",selectWidthLarge:"unset",inputMarginLarge:"0 0 0 8px",inputMarginLargeRtl:"0 8px 0 0",selectMarginLarge:"0 0 0 8px",prefixMarginLarge:"0 8px 0 0",suffixMarginLarge:"0 0 0 8px"},Zl=e=>{const{textColor2:o,primaryColor:t,primaryColorHover:r,primaryColorPressed:n,inputColorDisabled:l,textColorDisabled:a,borderColor:s,borderRadius:d,fontSizeTiny:c,fontSizeSmall:u,fontSizeMedium:f,heightTiny:p,heightSmall:v,heightMedium:h}=e;return Object.assign(Object.assign({},ih),{buttonColor:"#0000",buttonColorHover:"#0000",buttonColorPressed:"#0000",buttonBorder:`1px solid ${s}`,buttonBorderHover:`1px solid ${s}`,buttonBorderPressed:`1px solid ${s}`,buttonIconColor:o,buttonIconColorHover:o,buttonIconColorPressed:o,itemTextColor:o,itemTextColorHover:r,itemTextColorPressed:n,itemTextColorActive:t,itemTextColorDisabled:a,itemColor:"#0000",itemColorHover:"#0000",itemColorPressed:"#0000",itemColorActive:"#0000",itemColorActiveHover:"#0000",itemColorDisabled:l,itemBorder:"1px solid #0000",itemBorderHover:"1px solid #0000",itemBorderPressed:"1px solid #0000",itemBorderActive:`1px solid ${t}`,itemBorderDisabled:`1px solid ${s}`,itemBorderRadius:d,itemSizeSmall:p,itemSizeMedium:v,itemSizeLarge:h,itemFontSizeSmall:c,itemFontSizeMedium:u,itemFontSizeLarge:f,jumperFontSizeSmall:c,jumperFontSizeMedium:u,jumperFontSizeLarge:f,jumperTextColor:o,jumperTextColorDisabled:a})},lh={name:"Pagination",common:Le,peers:{Select:Yl,Input:pr,Popselect:zn},self:Zl},ah=lh,sh={name:"Pagination",common:fe,peers:{Select:Xl,Input:Ho,Popselect:Kl},self(e){const{primaryColor:o,opacity3:t}=e,r=J(o,{alpha:Number(t)}),n=Zl(e);return n.itemBorderActive=`1px solid ${r}`,n.itemBorderDisabled="1px solid #0000",n}},Ql=sh;function dh(e,o,t){let r=!1,n=!1,l=1,a=o;if(o===1)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:a,fastBackwardTo:l,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}]};if(o===2)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:a,fastBackwardTo:l,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1},{type:"page",label:2,active:e===2,mayBeFastBackward:!0,mayBeFastForward:!1}]};const s=1,d=o;let c=e,u=e;const f=(t-5)/2;u+=Math.ceil(f),u=Math.min(Math.max(u,s+t-3),d-2),c-=Math.floor(f),c=Math.max(Math.min(c,d-t+3),s+2);let p=!1,v=!1;c>s+2&&(p=!0),u=s+1&&h.push({type:"page",label:s+1,mayBeFastBackward:!0,mayBeFastForward:!1,active:e===s+1});for(let m=c;m<=u;++m)h.push({type:"page",label:m,mayBeFastBackward:!1,mayBeFastForward:!1,active:e===m});return v?(n=!0,a=u+1,h.push({type:"fast-forward",active:!1,label:void 0,options:gi(u+1,d-1)})):u===d-2&&h[h.length-1].label!==d-1&&h.push({type:"page",mayBeFastForward:!0,mayBeFastBackward:!1,label:d-1,active:e===d-1}),h[h.length-1].label!==d&&h.push({type:"page",mayBeFastForward:!1,mayBeFastBackward:!1,label:d,active:e===d}),{hasFastBackward:r,hasFastForward:n,fastBackwardTo:l,fastForwardTo:a,items:h}}function gi(e,o){const t=[];for(let r=e;r<=o;++r)t.push({label:`${r}`,value:r});return t}const mi=` + background: var(--n-item-color-hover); + color: var(--n-item-text-color-hover); + border: var(--n-item-border-hover); +`,bi=[P("button",` + background: var(--n-button-color-hover); + border: var(--n-button-border-hover); + color: var(--n-button-icon-color-hover); + `)],ch=g("pagination",` + display: flex; + vertical-align: middle; + font-size: var(--n-item-font-size); + flex-wrap: nowrap; +`,[g("pagination-prefix",` + display: flex; + align-items: center; + margin: var(--n-prefix-margin); + `),g("pagination-suffix",` + display: flex; + align-items: center; + margin: var(--n-suffix-margin); + `),C("> *:not(:first-child)",` + margin: var(--n-item-margin); + `),g("select",` + width: var(--n-select-width); + `),C("&.transition-disabled",[g("pagination-item","transition: none!important;")]),g("pagination-quick-jumper",` + white-space: nowrap; + display: flex; + color: var(--n-jumper-text-color); + transition: color .3s var(--n-bezier); + align-items: center; + font-size: var(--n-jumper-font-size); + `,[g("input",` + margin: var(--n-input-margin); + width: var(--n-input-width); + `)]),g("pagination-item",` + position: relative; + cursor: pointer; + user-select: none; + -webkit-user-select: none; + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + min-width: var(--n-item-size); + height: var(--n-item-size); + padding: var(--n-item-padding); + background-color: var(--n-item-color); + color: var(--n-item-text-color); + border-radius: var(--n-item-border-radius); + border: var(--n-item-border); + fill: var(--n-button-icon-color); + transition: + color .3s var(--n-bezier), + border-color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + fill .3s var(--n-bezier); + `,[P("button",` + background: var(--n-button-color); + color: var(--n-button-icon-color); + border: var(--n-button-border); + padding: 0; + `,[g("base-icon",` + font-size: var(--n-button-icon-size); + `)]),je("disabled",[P("hover",mi,bi),C("&:hover",mi,bi),C("&:active",` + background: var(--n-item-color-pressed); + color: var(--n-item-text-color-pressed); + border: var(--n-item-border-pressed); + `,[P("button",` + background: var(--n-button-color-pressed); + border: var(--n-button-border-pressed); + color: var(--n-button-icon-color-pressed); + `)]),P("active",` + background: var(--n-item-color-active); + color: var(--n-item-text-color-active); + border: var(--n-item-border-active); + `,[C("&:hover",` + background: var(--n-item-color-active-hover); + `)])]),P("disabled",` + cursor: not-allowed; + color: var(--n-item-text-color-disabled); + `,[P("active, button",` + background-color: var(--n-item-color-disabled); + border: var(--n-item-border-disabled); + `)])]),P("disabled",` + cursor: not-allowed; + `,[g("pagination-quick-jumper",` + color: var(--n-jumper-text-color-disabled); + `)]),P("simple",` + display: flex; + align-items: center; + flex-wrap: nowrap; + `,[g("pagination-quick-jumper",[g("input",` + margin: 0; + `)])])]),uh=Object.assign(Object.assign({},ne.props),{simple:Boolean,page:Number,defaultPage:{type:Number,default:1},itemCount:Number,pageCount:Number,defaultPageCount:{type:Number,default:1},showSizePicker:Boolean,pageSize:Number,defaultPageSize:Number,pageSizes:{type:Array,default(){return[10]}},showQuickJumper:Boolean,size:{type:String,default:"medium"},disabled:Boolean,pageSlot:{type:Number,default:9},selectProps:Object,prev:Function,next:Function,goto:Function,prefix:Function,suffix:Function,label:Function,displayOrder:{type:Array,default:["pages","size-picker","quick-jumper"]},to:Io.propTo,"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],onPageSizeChange:[Function,Array],onChange:[Function,Array]}),b1=q({name:"Pagination",props:uh,setup(e){const{mergedComponentPropsRef:o,mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=ke(e),l=ne("Pagination","-pagination",ch,ah,e,t),{localeRef:a}=Xo("Pagination"),s=D(null),d=D(e.defaultPage),u=D((()=>{const{defaultPageSize:ee}=e;if(ee!==void 0)return ee;const xe=e.pageSizes[0];return typeof xe=="number"?xe:xe.value||10})()),f=so(le(e,"page"),d),p=so(le(e,"pageSize"),u),v=R(()=>{const{itemCount:ee}=e;if(ee!==void 0)return Math.max(1,Math.ceil(ee/p.value));const{pageCount:xe}=e;return xe!==void 0?Math.max(xe,1):1}),h=D("");oo(()=>{e.simple,h.value=String(f.value)});const m=D(!1),b=D(!1),x=D(!1),S=D(!1),B=()=>{e.disabled||(m.value=!0,_())},T=()=>{e.disabled||(m.value=!1,_())},z=()=>{b.value=!0,_()},I=()=>{b.value=!1,_()},w=ee=>{V(ee)},O=R(()=>dh(f.value,v.value,e.pageSlot));oo(()=>{O.value.hasFastBackward?O.value.hasFastForward||(m.value=!1,x.value=!1):(b.value=!1,S.value=!1)});const k=R(()=>{const ee=a.value.selectionSuffix;return e.pageSizes.map(xe=>typeof xe=="number"?{label:`${xe} / ${ee}`,value:xe}:xe)}),$=R(()=>{var ee,xe;return((xe=(ee=o==null?void 0:o.value)===null||ee===void 0?void 0:ee.Pagination)===null||xe===void 0?void 0:xe.inputSize)||Un(e.size)}),L=R(()=>{var ee,xe;return((xe=(ee=o==null?void 0:o.value)===null||ee===void 0?void 0:ee.Pagination)===null||xe===void 0?void 0:xe.selectSize)||Un(e.size)}),M=R(()=>(f.value-1)*p.value),j=R(()=>{const ee=f.value*p.value-1,{itemCount:xe}=e;return xe!==void 0&&ee>xe-1?xe-1:ee}),E=R(()=>{const{itemCount:ee}=e;return ee!==void 0?ee:(e.pageCount||1)*p.value}),U=to("Pagination",n,t),_=()=>{io(()=>{var ee;const{value:xe}=s;xe&&(xe.classList.add("transition-disabled"),(ee=s.value)===null||ee===void 0||ee.offsetWidth,xe.classList.remove("transition-disabled"))})};function V(ee){if(ee===f.value)return;const{"onUpdate:page":xe,onUpdatePage:de,onChange:ye,simple:pe}=e;xe&&ae(xe,ee),de&&ae(de,ee),ye&&ae(ye,ee),d.value=ee,pe&&(h.value=String(ee))}function te(ee){if(ee===p.value)return;const{"onUpdate:pageSize":xe,onUpdatePageSize:de,onPageSizeChange:ye}=e;xe&&ae(xe,ee),de&&ae(de,ee),ye&&ae(ye,ee),u.value=ee,v.value{f.value,p.value,_()});const Re=R(()=>{const{size:ee}=e,{self:{buttonBorder:xe,buttonBorderHover:de,buttonBorderPressed:ye,buttonIconColor:pe,buttonIconColorHover:Me,buttonIconColorPressed:Q,itemTextColor:A,itemTextColorHover:Z,itemTextColorPressed:re,itemTextColorActive:ue,itemTextColorDisabled:Y,itemColor:ce,itemColorHover:He,itemColorPressed:Ve,itemColorActive:Ze,itemColorActiveHover:po,itemColorDisabled:fo,itemBorder:Bo,itemBorderHover:To,itemBorderPressed:xo,itemBorderActive:Co,itemBorderDisabled:Ao,itemBorderRadius:Fo,jumperTextColor:co,jumperTextColorDisabled:uo,buttonColor:F,buttonColorHover:K,buttonColorPressed:ie,[W("itemPadding",ee)]:ze,[W("itemMargin",ee)]:Pe,[W("inputWidth",ee)]:Ie,[W("selectWidth",ee)]:Te,[W("inputMargin",ee)]:_e,[W("selectMargin",ee)]:Qe,[W("jumperFontSize",ee)]:vo,[W("prefixMargin",ee)]:Wo,[W("suffixMargin",ee)]:No,[W("itemSize",ee)]:st,[W("buttonIconSize",ee)]:Kt,[W("itemFontSize",ee)]:Rt,[`${W("itemMargin",ee)}Rtl`]:Vo,[`${W("inputMargin",ee)}Rtl`]:H},common:{cubicBezierEaseInOut:oe}}=l.value;return{"--n-prefix-margin":Wo,"--n-suffix-margin":No,"--n-item-font-size":Rt,"--n-select-width":Te,"--n-select-margin":Qe,"--n-input-width":Ie,"--n-input-margin":_e,"--n-input-margin-rtl":H,"--n-item-size":st,"--n-item-text-color":A,"--n-item-text-color-disabled":Y,"--n-item-text-color-hover":Z,"--n-item-text-color-active":ue,"--n-item-text-color-pressed":re,"--n-item-color":ce,"--n-item-color-hover":He,"--n-item-color-disabled":fo,"--n-item-color-active":Ze,"--n-item-color-active-hover":po,"--n-item-color-pressed":Ve,"--n-item-border":Bo,"--n-item-border-hover":To,"--n-item-border-disabled":Ao,"--n-item-border-active":Co,"--n-item-border-pressed":xo,"--n-item-padding":ze,"--n-item-border-radius":Fo,"--n-bezier":oe,"--n-jumper-font-size":vo,"--n-jumper-text-color":co,"--n-jumper-text-color-disabled":uo,"--n-item-margin":Pe,"--n-item-margin-rtl":Vo,"--n-button-icon-size":Kt,"--n-button-icon-color":pe,"--n-button-icon-color-hover":Me,"--n-button-icon-color-pressed":Q,"--n-button-color-hover":K,"--n-button-color":F,"--n-button-color-pressed":ie,"--n-button-border":xe,"--n-button-border-hover":de,"--n-button-border-pressed":ye}}),ge=r?Ae("pagination",R(()=>{let ee="";const{size:xe}=e;return ee+=xe[0],ee}),Re,e):void 0;return{rtlEnabled:U,mergedClsPrefix:t,locale:a,selfRef:s,mergedPage:f,pageItems:R(()=>O.value.items),mergedItemCount:E,jumperValue:h,pageSizeOptions:k,mergedPageSize:p,inputSize:$,selectSize:L,mergedTheme:l,mergedPageCount:v,startIndex:M,endIndex:j,showFastForwardMenu:x,showFastBackwardMenu:S,fastForwardActive:m,fastBackwardActive:b,handleMenuSelect:w,handleFastForwardMouseenter:B,handleFastForwardMouseleave:T,handleFastBackwardMouseenter:z,handleFastBackwardMouseleave:I,handleJumperInput:se,handleBackwardClick:G,handleForwardClick:N,handlePageItemClick:me,handleSizePickerChange:ve,handleQuickJumperChange:be,cssVars:r?void 0:Re,themeClass:ge==null?void 0:ge.themeClass,onRender:ge==null?void 0:ge.onRender}},render(){const{$slots:e,mergedClsPrefix:o,disabled:t,cssVars:r,mergedPage:n,mergedPageCount:l,pageItems:a,showSizePicker:s,showQuickJumper:d,mergedTheme:c,locale:u,inputSize:f,selectSize:p,mergedPageSize:v,pageSizeOptions:h,jumperValue:m,simple:b,prev:x,next:S,prefix:B,suffix:T,label:z,goto:I,handleJumperInput:w,handleSizePickerChange:O,handleBackwardClick:k,handlePageItemClick:$,handleForwardClick:L,handleQuickJumperChange:M,onRender:j}=this;j==null||j();const E=e.prefix||B,U=e.suffix||T,_=x||e.prev,V=S||e.next,te=z||e.label;return i("div",{ref:"selfRef",class:[`${o}-pagination`,this.themeClass,this.rtlEnabled&&`${o}-pagination--rtl`,t&&`${o}-pagination--disabled`,b&&`${o}-pagination--simple`],style:r},E?i("div",{class:`${o}-pagination-prefix`},E({page:n,pageSize:v,pageCount:l,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null,this.displayOrder.map(N=>{switch(N){case"pages":return i(ao,null,i("div",{class:[`${o}-pagination-item`,!_&&`${o}-pagination-item--button`,(n<=1||n>l||t)&&`${o}-pagination-item--disabled`],onClick:k},_?_({page:n,pageSize:v,pageCount:l,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount}):i(De,{clsPrefix:o},{default:()=>this.rtlEnabled?i(ni,null):i(oi,null)})),b?i(ao,null,i("div",{class:`${o}-pagination-quick-jumper`},i(xt,{value:m,onUpdateValue:w,size:f,placeholder:"",disabled:t,theme:c.peers.Input,themeOverrides:c.peerOverrides.Input,onChange:M}))," / ",l):a.map((G,Ce)=>{let X,ve,he;const{type:be}=G;switch(be){case"page":const se=G.label;te?X=te({type:"page",node:se,active:G.active}):X=se;break;case"fast-forward":const Re=this.fastForwardActive?i(De,{clsPrefix:o},{default:()=>this.rtlEnabled?i(ti,null):i(ri,null)}):i(De,{clsPrefix:o},{default:()=>i(ii,null)});te?X=te({type:"fast-forward",node:Re,active:this.fastForwardActive||this.showFastForwardMenu}):X=Re,ve=this.handleFastForwardMouseenter,he=this.handleFastForwardMouseleave;break;case"fast-backward":const ge=this.fastBackwardActive?i(De,{clsPrefix:o},{default:()=>this.rtlEnabled?i(ri,null):i(ti,null)}):i(De,{clsPrefix:o},{default:()=>i(ii,null)});te?X=te({type:"fast-backward",node:ge,active:this.fastBackwardActive||this.showFastBackwardMenu}):X=ge,ve=this.handleFastBackwardMouseenter,he=this.handleFastBackwardMouseleave;break}const me=i("div",{key:Ce,class:[`${o}-pagination-item`,G.active&&`${o}-pagination-item--active`,be!=="page"&&(be==="fast-backward"&&this.showFastBackwardMenu||be==="fast-forward"&&this.showFastForwardMenu)&&`${o}-pagination-item--hover`,t&&`${o}-pagination-item--disabled`,be==="page"&&`${o}-pagination-item--clickable`],onClick:()=>{$(G)},onMouseenter:ve,onMouseleave:he},X);if(be==="page"&&!G.mayBeFastBackward&&!G.mayBeFastForward)return me;{const se=G.type==="page"?G.mayBeFastBackward?"fast-backward":"fast-forward":G.type;return i(Jf,{to:this.to,key:se,disabled:t,trigger:"hover",virtualScroll:!0,style:{width:"60px"},theme:c.peers.Popselect,themeOverrides:c.peerOverrides.Popselect,builtinThemeOverrides:{peers:{InternalSelectMenu:{height:"calc(var(--n-option-height) * 4.6)"}}},nodeProps:()=>({style:{justifyContent:"center"}}),show:be==="page"?!1:be==="fast-backward"?this.showFastBackwardMenu:this.showFastForwardMenu,onUpdateShow:Re=>{be!=="page"&&(Re?be==="fast-backward"?this.showFastBackwardMenu=Re:this.showFastForwardMenu=Re:(this.showFastBackwardMenu=!1,this.showFastForwardMenu=!1))},options:G.type!=="page"?G.options:[],onUpdateValue:this.handleMenuSelect,scrollable:!0,showCheckmark:!1},{default:()=>me})}}),i("div",{class:[`${o}-pagination-item`,!V&&`${o}-pagination-item--button`,{[`${o}-pagination-item--disabled`]:n<1||n>=l||t}],onClick:L},V?V({page:n,pageSize:v,pageCount:l,itemCount:this.mergedItemCount,startIndex:this.startIndex,endIndex:this.endIndex}):i(De,{clsPrefix:o},{default:()=>this.rtlEnabled?i(oi,null):i(ni,null)})));case"size-picker":return!b&&s?i(nh,Object.assign({consistentMenuWidth:!1,placeholder:"",showCheckmark:!1,to:this.to},this.selectProps,{size:p,options:h,value:v,disabled:t,theme:c.peers.Select,themeOverrides:c.peerOverrides.Select,onUpdateValue:O})):null;case"quick-jumper":return!b&&d?i("div",{class:`${o}-pagination-quick-jumper`},I?I():lo(this.$slots.goto,()=>[u.goto]),i(xt,{value:m,onUpdateValue:w,size:f,placeholder:"",disabled:t,theme:c.peers.Input,themeOverrides:c.peerOverrides.Input,onChange:M})):null;default:return null}}),U?i("div",{class:`${o}-pagination-suffix`},U({page:n,pageSize:v,pageCount:l,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null)}}),Jl={padding:"8px 14px"},fh={name:"Tooltip",common:fe,peers:{Popover:$t},self(e){const{borderRadius:o,boxShadow2:t,popoverColor:r,textColor2:n}=e;return Object.assign(Object.assign({},Jl),{borderRadius:o,boxShadow:t,color:r,textColor:n})}},Dr=fh,hh=e=>{const{borderRadius:o,boxShadow2:t,baseColor:r}=e;return Object.assign(Object.assign({},Jl),{borderRadius:o,boxShadow:t,color:$e(r,"rgba(0, 0, 0, .85)"),textColor:r})},ph={name:"Tooltip",common:Le,peers:{Popover:jt},self:hh},Lr=ph,vh={name:"Ellipsis",common:fe,peers:{Tooltip:Dr}},ea=vh,gh={name:"Ellipsis",common:Le,peers:{Tooltip:Lr}},mh=gh,oa={radioSizeSmall:"14px",radioSizeMedium:"16px",radioSizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"},bh={name:"Radio",common:fe,self(e){const{borderColor:o,primaryColor:t,baseColor:r,textColorDisabled:n,inputColorDisabled:l,textColor2:a,opacityDisabled:s,borderRadius:d,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:f,heightSmall:p,heightMedium:v,heightLarge:h,lineHeight:m}=e;return Object.assign(Object.assign({},oa),{labelLineHeight:m,buttonHeightSmall:p,buttonHeightMedium:v,buttonHeightLarge:h,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:f,boxShadow:`inset 0 0 0 1px ${o}`,boxShadowActive:`inset 0 0 0 1px ${t}`,boxShadowFocus:`inset 0 0 0 1px ${t}, 0 0 0 2px ${J(t,{alpha:.3})}`,boxShadowHover:`inset 0 0 0 1px ${t}`,boxShadowDisabled:`inset 0 0 0 1px ${o}`,color:"#0000",colorDisabled:l,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:t,dotColorDisabled:o,buttonBorderColor:o,buttonBorderColorActive:t,buttonBorderColorHover:t,buttonColor:"#0000",buttonColorActive:t,buttonTextColor:a,buttonTextColorActive:r,buttonTextColorHover:t,opacityDisabled:s,buttonBoxShadowFocus:`inset 0 0 0 1px ${t}, 0 0 0 2px ${J(t,{alpha:.3})}`,buttonBoxShadowHover:`inset 0 0 0 1px ${t}`,buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:d})}},ta=bh,xh=e=>{const{borderColor:o,primaryColor:t,baseColor:r,textColorDisabled:n,inputColorDisabled:l,textColor2:a,opacityDisabled:s,borderRadius:d,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:f,heightSmall:p,heightMedium:v,heightLarge:h,lineHeight:m}=e;return Object.assign(Object.assign({},oa),{labelLineHeight:m,buttonHeightSmall:p,buttonHeightMedium:v,buttonHeightLarge:h,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:f,boxShadow:`inset 0 0 0 1px ${o}`,boxShadowActive:`inset 0 0 0 1px ${t}`,boxShadowFocus:`inset 0 0 0 1px ${t}, 0 0 0 2px ${J(t,{alpha:.2})}`,boxShadowHover:`inset 0 0 0 1px ${t}`,boxShadowDisabled:`inset 0 0 0 1px ${o}`,color:r,colorDisabled:l,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:t,dotColorDisabled:o,buttonBorderColor:o,buttonBorderColorActive:t,buttonBorderColorHover:o,buttonColor:r,buttonColorActive:r,buttonTextColor:a,buttonTextColorActive:t,buttonTextColorHover:t,opacityDisabled:s,buttonBoxShadowFocus:`inset 0 0 0 1px ${t}, 0 0 0 2px ${J(t,{alpha:.3})}`,buttonBoxShadowHover:"inset 0 0 0 1px #0000",buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:d})},Ch={name:"Radio",common:Le,self:xh},ra=Ch,yh={padding:"4px 0",optionIconSizeSmall:"14px",optionIconSizeMedium:"16px",optionIconSizeLarge:"16px",optionIconSizeHuge:"18px",optionSuffixWidthSmall:"14px",optionSuffixWidthMedium:"14px",optionSuffixWidthLarge:"16px",optionSuffixWidthHuge:"16px",optionIconSuffixWidthSmall:"32px",optionIconSuffixWidthMedium:"32px",optionIconSuffixWidthLarge:"36px",optionIconSuffixWidthHuge:"36px",optionPrefixWidthSmall:"14px",optionPrefixWidthMedium:"14px",optionPrefixWidthLarge:"16px",optionPrefixWidthHuge:"16px",optionIconPrefixWidthSmall:"36px",optionIconPrefixWidthMedium:"36px",optionIconPrefixWidthLarge:"40px",optionIconPrefixWidthHuge:"40px"},na=e=>{const{primaryColor:o,textColor2:t,dividerColor:r,hoverColor:n,popoverColor:l,invertedColor:a,borderRadius:s,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,fontSizeHuge:f,heightSmall:p,heightMedium:v,heightLarge:h,heightHuge:m,textColor3:b,opacityDisabled:x}=e;return Object.assign(Object.assign({},yh),{optionHeightSmall:p,optionHeightMedium:v,optionHeightLarge:h,optionHeightHuge:m,borderRadius:s,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,fontSizeHuge:f,optionTextColor:t,optionTextColorHover:t,optionTextColorActive:o,optionTextColorChildActive:o,color:l,dividerColor:r,suffixColor:t,prefixColor:t,optionColorHover:n,optionColorActive:J(o,{alpha:.1}),groupHeaderTextColor:b,optionTextColorInverted:"#BBB",optionTextColorHoverInverted:"#FFF",optionTextColorActiveInverted:"#FFF",optionTextColorChildActiveInverted:"#FFF",colorInverted:a,dividerColorInverted:"#BBB",suffixColorInverted:"#BBB",prefixColorInverted:"#BBB",optionColorHoverInverted:o,optionColorActiveInverted:o,groupHeaderTextColorInverted:"#AAA",optionOpacityDisabled:x})},wh={name:"Dropdown",common:Le,peers:{Popover:jt},self:na},ia=wh,Sh={name:"Dropdown",common:fe,peers:{Popover:$t},self(e){const{primaryColorSuppl:o,primaryColor:t,popoverColor:r}=e,n=na(e);return n.colorInverted=r,n.optionColorActive=J(t,{alpha:.15}),n.optionColorActiveInverted=o,n.optionColorHoverInverted=o,n}},Rn=Sh,zh={thPaddingSmall:"8px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"8px",tdPaddingMedium:"12px",tdPaddingLarge:"12px",sorterSize:"15px",resizableContainerSize:"8px",resizableSize:"2px",filterSize:"15px",paginationMargin:"12px 0 0 0",emptyPadding:"48px 0",actionPadding:"8px 12px",actionButtonMargin:"0 8px 0 0"},$h=e=>{const{cardColor:o,modalColor:t,popoverColor:r,textColor2:n,textColor1:l,tableHeaderColor:a,tableColorHover:s,iconColor:d,primaryColor:c,fontWeightStrong:u,borderRadius:f,lineHeight:p,fontSizeSmall:v,fontSizeMedium:h,fontSizeLarge:m,dividerColor:b,heightSmall:x,opacityDisabled:S,tableColorStriped:B}=e;return Object.assign(Object.assign({},zh),{actionDividerColor:b,lineHeight:p,borderRadius:f,fontSizeSmall:v,fontSizeMedium:h,fontSizeLarge:m,borderColor:$e(o,b),tdColorHover:$e(o,s),tdColorStriped:$e(o,B),thColor:$e(o,a),thColorHover:$e($e(o,a),s),tdColor:o,tdTextColor:n,thTextColor:l,thFontWeight:u,thButtonColorHover:s,thIconColor:d,thIconColorActive:c,borderColorModal:$e(t,b),tdColorHoverModal:$e(t,s),tdColorStripedModal:$e(t,B),thColorModal:$e(t,a),thColorHoverModal:$e($e(t,a),s),tdColorModal:t,borderColorPopover:$e(r,b),tdColorHoverPopover:$e(r,s),tdColorStripedPopover:$e(r,B),thColorPopover:$e(r,a),thColorHoverPopover:$e($e(r,a),s),tdColorPopover:r,boxShadowBefore:"inset -12px 0 8px -12px rgba(0, 0, 0, .18)",boxShadowAfter:"inset 12px 0 8px -12px rgba(0, 0, 0, .18)",loadingColor:c,loadingSize:x,opacityLoading:S})},Rh={name:"DataTable",common:fe,peers:{Button:$o,Checkbox:Nt,Radio:ta,Pagination:Ql,Scrollbar:zo,Empty:zt,Popover:$t,Ellipsis:ea,Dropdown:Rn},self(e){const o=$h(e);return o.boxShadowAfter="inset 12px 0 8px -12px rgba(0, 0, 0, .36)",o.boxShadowBefore="inset -12px 0 8px -12px rgba(0, 0, 0, .36)",o}},Ph=Rh,kh=Object.assign(Object.assign({},bt),ne.props),Pn=q({name:"Tooltip",props:kh,__popover__:!0,setup(e){const{mergedClsPrefixRef:o}=ke(e),t=ne("Tooltip","-tooltip",void 0,Lr,e,o),r=D(null);return Object.assign(Object.assign({},{syncPosition(){r.value.syncPosition()},setShow(l){r.value.setShow(l)}}),{popoverRef:r,mergedTheme:t,popoverThemeOverrides:R(()=>t.value.self)})},render(){const{mergedTheme:e,internalExtraClass:o}=this;return i(hr,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:o.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),Ih=g("ellipsis",{overflow:"hidden"},[je("line-clamp",` + white-space: nowrap; + display: inline-block; + vertical-align: bottom; + max-width: 100%; + `),P("line-clamp",` + display: -webkit-inline-box; + -webkit-box-orient: vertical; + `),P("cursor-pointer",` + cursor: pointer; + `)]);function xi(e){return`${e}-ellipsis--line-clamp`}function Ci(e,o){return`${e}-ellipsis--cursor-${o}`}const Bh=Object.assign(Object.assign({},ne.props),{expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Boolean,Object],default:!0}}),x1=q({name:"Ellipsis",inheritAttrs:!1,props:Bh,setup(e,{slots:o,attrs:t}){const{mergedClsPrefixRef:r}=ke(e),n=ne("Ellipsis","-ellipsis",Ih,mh,e,r),l=D(null),a=D(null),s=D(null),d=D(!1),c=R(()=>{const{lineClamp:b}=e,{value:x}=d;return b!==void 0?{textOverflow:"","-webkit-line-clamp":x?"":b}:{textOverflow:x?"":"ellipsis","-webkit-line-clamp":""}});function u(){let b=!1;const{value:x}=d;if(x)return!0;const{value:S}=l;if(S){const{lineClamp:B}=e;if(v(S),B!==void 0)b=S.scrollHeight<=S.offsetHeight;else{const{value:T}=a;T&&(b=T.getBoundingClientRect().width<=S.getBoundingClientRect().width)}h(S,b)}return b}const f=R(()=>e.expandTrigger==="click"?()=>{var b;const{value:x}=d;x&&((b=s.value)===null||b===void 0||b.setShow(!1)),d.value=!x}:void 0);ji(()=>{var b;e.tooltip&&((b=s.value)===null||b===void 0||b.setShow(!1))});const p=()=>i("span",Object.assign({},ko(t,{class:[`${r.value}-ellipsis`,e.lineClamp!==void 0?xi(r.value):void 0,e.expandTrigger==="click"?Ci(r.value,"pointer"):void 0],style:c.value}),{ref:"triggerRef",onClick:f.value,onMouseenter:e.expandTrigger==="click"?u:void 0}),e.lineClamp?o:i("span",{ref:"triggerInnerRef"},o));function v(b){if(!b)return;const x=c.value,S=xi(r.value);e.lineClamp!==void 0?m(b,S,"add"):m(b,S,"remove");for(const B in x)b.style[B]!==x[B]&&(b.style[B]=x[B])}function h(b,x){const S=Ci(r.value,"pointer");e.expandTrigger==="click"&&!x?m(b,S,"add"):m(b,S,"remove")}function m(b,x,S){S==="add"?b.classList.contains(x)||b.classList.add(x):b.classList.contains(x)&&b.classList.remove(x)}return{mergedTheme:n,triggerRef:l,triggerInnerRef:a,tooltipRef:s,handleClick:f,renderTrigger:p,getTooltipDisabled:u}},render(){var e;const{tooltip:o,renderTrigger:t,$slots:r}=this;if(o){const{mergedTheme:n}=this;return i(Pn,Object.assign({ref:"tooltipRef",placement:"top"},o,{getDisabled:this.getTooltipDisabled,theme:n.peers.Tooltip,themeOverrides:n.peerOverrides.Tooltip}),{trigger:t,default:(e=r.tooltip)!==null&&e!==void 0?e:r.default})}else return t()}}),Th={name:String,value:{type:[String,Number,Boolean],default:"on"},checked:{type:Boolean,default:void 0},defaultChecked:Boolean,disabled:{type:Boolean,default:void 0},label:String,size:String,onUpdateChecked:[Function,Array],"onUpdate:checked":[Function,Array],checkedValue:{type:Boolean,default:void 0}},la="n-radio-group";function Fh(e){const o=rt(e,{mergedSize(S){const{size:B}=e;if(B!==void 0)return B;if(a){const{mergedSizeRef:{value:T}}=a;if(T!==void 0)return T}return S?S.mergedSize.value:"medium"},mergedDisabled(S){return!!(e.disabled||a!=null&&a.disabledRef.value||S!=null&&S.disabled.value)}}),{mergedSizeRef:t,mergedDisabledRef:r}=o,n=D(null),l=D(null),a=Se(la,null),s=D(e.defaultChecked),d=le(e,"checked"),c=so(d,s),u=We(()=>a?a.valueRef.value===e.value:c.value),f=We(()=>{const{name:S}=e;if(S!==void 0)return S;if(a)return a.nameRef.value}),p=D(!1);function v(){if(a){const{doUpdateValue:S}=a,{value:B}=e;ae(S,B)}else{const{onUpdateChecked:S,"onUpdate:checked":B}=e,{nTriggerFormInput:T,nTriggerFormChange:z}=o;S&&ae(S,!0),B&&ae(B,!0),T(),z(),s.value=!0}}function h(){r.value||u.value||v()}function m(){h()}function b(){p.value=!1}function x(){p.value=!0}return{mergedClsPrefix:a?a.mergedClsPrefixRef:ke(e).mergedClsPrefixRef,inputRef:n,labelRef:l,mergedName:f,mergedDisabled:r,uncontrolledChecked:s,renderSafeChecked:u,focus:p,mergedSize:t,handleRadioInputChange:m,handleRadioInputBlur:b,handleRadioInputFocus:x}}const Oh=g("radio",` + line-height: var(--n-label-line-height); + outline: none; + position: relative; + user-select: none; + -webkit-user-select: none; + display: inline-flex; + align-items: flex-start; + flex-wrap: nowrap; + font-size: var(--n-font-size); + word-break: break-word; +`,[P("checked",[y("dot",` + background-color: var(--n-color-active); + `)]),y("dot-wrapper",` + position: relative; + flex-shrink: 0; + flex-grow: 0; + width: var(--n-radio-size); + `),g("radio-input",` + position: absolute; + border: 0; + border-radius: inherit; + left: 0; + right: 0; + top: 0; + bottom: 0; + opacity: 0; + z-index: 1; + cursor: pointer; + `),y("dot",` + position: absolute; + top: 50%; + left: 0; + transform: translateY(-50%); + height: var(--n-radio-size); + width: var(--n-radio-size); + background: var(--n-color); + box-shadow: var(--n-box-shadow); + border-radius: 50%; + transition: + background-color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); + `,[C("&::before",` + content: ""; + opacity: 0; + position: absolute; + left: 4px; + top: 4px; + height: calc(100% - 8px); + width: calc(100% - 8px); + border-radius: 50%; + transform: scale(.8); + background: var(--n-dot-color-active); + transition: + opacity .3s var(--n-bezier), + background-color .3s var(--n-bezier), + transform .3s var(--n-bezier); + `),P("checked",{boxShadow:"var(--n-box-shadow-active)"},[C("&::before",` + opacity: 1; + transform: scale(1); + `)])]),y("label",` + color: var(--n-text-color); + padding: var(--n-label-padding); + font-weight: var(--n-label-font-weight); + display: inline-block; + transition: color .3s var(--n-bezier); + `),je("disabled",` + cursor: pointer; + `,[C("&:hover",[y("dot",{boxShadow:"var(--n-box-shadow-hover)"})]),P("focus",[C("&:not(:active)",[y("dot",{boxShadow:"var(--n-box-shadow-focus)"})])])]),P("disabled",` + cursor: not-allowed; + `,[y("dot",{boxShadow:"var(--n-box-shadow-disabled)",backgroundColor:"var(--n-color-disabled)"},[C("&::before",{backgroundColor:"var(--n-dot-color-disabled)"}),P("checked",` + opacity: 1; + `)]),y("label",{color:"var(--n-text-color-disabled)"}),g("radio-input",` + cursor: not-allowed; + `)])]),C1=q({name:"Radio",props:Object.assign(Object.assign({},ne.props),Th),setup(e){const o=Fh(e),t=ne("Radio","-radio",Oh,ra,e,o.mergedClsPrefix),r=R(()=>{const{mergedSize:{value:c}}=o,{common:{cubicBezierEaseInOut:u},self:{boxShadow:f,boxShadowActive:p,boxShadowDisabled:v,boxShadowFocus:h,boxShadowHover:m,color:b,colorDisabled:x,colorActive:S,textColor:B,textColorDisabled:T,dotColorActive:z,dotColorDisabled:I,labelPadding:w,labelLineHeight:O,labelFontWeight:k,[W("fontSize",c)]:$,[W("radioSize",c)]:L}}=t.value;return{"--n-bezier":u,"--n-label-line-height":O,"--n-label-font-weight":k,"--n-box-shadow":f,"--n-box-shadow-active":p,"--n-box-shadow-disabled":v,"--n-box-shadow-focus":h,"--n-box-shadow-hover":m,"--n-color":b,"--n-color-active":S,"--n-color-disabled":x,"--n-dot-color-active":z,"--n-dot-color-disabled":I,"--n-font-size":$,"--n-radio-size":L,"--n-text-color":B,"--n-text-color-disabled":T,"--n-label-padding":w}}),{inlineThemeDisabled:n,mergedClsPrefixRef:l,mergedRtlRef:a}=ke(e),s=to("Radio",a,l),d=n?Ae("radio",R(()=>o.mergedSize.value[0]),r,e):void 0;return Object.assign(o,{rtlEnabled:s,cssVars:n?void 0:r,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender})},render(){const{$slots:e,mergedClsPrefix:o,onRender:t,label:r}=this;return t==null||t(),i("label",{class:[`${o}-radio`,this.themeClass,{[`${o}-radio--rtl`]:this.rtlEnabled,[`${o}-radio--disabled`]:this.mergedDisabled,[`${o}-radio--checked`]:this.renderSafeChecked,[`${o}-radio--focus`]:this.focus}],style:this.cssVars},i("input",{ref:"inputRef",type:"radio",class:`${o}-radio-input`,value:this.value,name:this.mergedName,checked:this.renderSafeChecked,disabled:this.mergedDisabled,onChange:this.handleRadioInputChange,onFocus:this.handleRadioInputFocus,onBlur:this.handleRadioInputBlur}),i("div",{class:`${o}-radio__dot-wrapper`}," ",i("div",{class:[`${o}-radio__dot`,this.renderSafeChecked&&`${o}-radio__dot--checked`]})),Ee(e.default,n=>!n&&!r?null:i("div",{ref:"labelRef",class:`${o}-radio__label`},n||r)))}}),Mh=g("radio-group",` + display: inline-block; + font-size: var(--n-font-size); +`,[y("splitor",` + display: inline-block; + vertical-align: bottom; + width: 1px; + transition: + background-color .3s var(--n-bezier), + opacity .3s var(--n-bezier); + background: var(--n-button-border-color); + `,[P("checked",{backgroundColor:"var(--n-button-border-color-active)"}),P("disabled",{opacity:"var(--n-opacity-disabled)"})]),P("button-group",` + white-space: nowrap; + height: var(--n-height); + line-height: var(--n-height); + `,[g("radio-button",{height:"var(--n-height)",lineHeight:"var(--n-height)"}),y("splitor",{height:"var(--n-height)"})]),g("radio-button",` + vertical-align: bottom; + outline: none; + position: relative; + user-select: none; + -webkit-user-select: none; + display: inline-block; + box-sizing: border-box; + padding-left: 14px; + padding-right: 14px; + white-space: nowrap; + transition: + background-color .3s var(--n-bezier), + opacity .3s var(--n-bezier), + border-color .3s var(--n-bezier), + color .3s var(--n-bezier); + color: var(--n-button-text-color); + border-top: 1px solid var(--n-button-border-color); + border-bottom: 1px solid var(--n-button-border-color); + `,[g("radio-input",` + pointer-events: none; + position: absolute; + border: 0; + border-radius: inherit; + left: 0; + right: 0; + top: 0; + bottom: 0; + opacity: 0; + z-index: 1; + `),y("state-border",` + z-index: 1; + pointer-events: none; + position: absolute; + box-shadow: var(--n-button-box-shadow); + transition: box-shadow .3s var(--n-bezier); + left: -1px; + bottom: -1px; + right: -1px; + top: -1px; + `),C("&:first-child",` + border-top-left-radius: var(--n-button-border-radius); + border-bottom-left-radius: var(--n-button-border-radius); + border-left: 1px solid var(--n-button-border-color); + `,[y("state-border",` + border-top-left-radius: var(--n-button-border-radius); + border-bottom-left-radius: var(--n-button-border-radius); + `)]),C("&:last-child",` + border-top-right-radius: var(--n-button-border-radius); + border-bottom-right-radius: var(--n-button-border-radius); + border-right: 1px solid var(--n-button-border-color); + `,[y("state-border",` + border-top-right-radius: var(--n-button-border-radius); + border-bottom-right-radius: var(--n-button-border-radius); + `)]),je("disabled",` + cursor: pointer; + `,[C("&:hover",[y("state-border",` + transition: box-shadow .3s var(--n-bezier); + box-shadow: var(--n-button-box-shadow-hover); + `),je("checked",{color:"var(--n-button-text-color-hover)"})]),P("focus",[C("&:not(:active)",[y("state-border",{boxShadow:"var(--n-button-box-shadow-focus)"})])])]),P("checked",` + background: var(--n-button-color-active); + color: var(--n-button-text-color-active); + border-color: var(--n-button-border-color-active); + `),P("disabled",` + cursor: not-allowed; + opacity: var(--n-opacity-disabled); + `)])]);function _h(e,o,t){var r;const n=[];let l=!1;for(let a=0;a{const{value:z}=t,{common:{cubicBezierEaseInOut:I},self:{buttonBorderColor:w,buttonBorderColorActive:O,buttonBorderRadius:k,buttonBoxShadow:$,buttonBoxShadowFocus:L,buttonBoxShadowHover:M,buttonColorActive:j,buttonTextColor:E,buttonTextColorActive:U,buttonTextColorHover:_,opacityDisabled:V,[W("buttonHeight",z)]:te,[W("fontSize",z)]:N}}=f.value;return{"--n-font-size":N,"--n-bezier":I,"--n-button-border-color":w,"--n-button-border-color-active":O,"--n-button-border-radius":k,"--n-button-box-shadow":$,"--n-button-box-shadow-focus":L,"--n-button-box-shadow-hover":M,"--n-button-color-active":j,"--n-button-text-color":E,"--n-button-text-color-hover":_,"--n-button-text-color-active":U,"--n-height":te,"--n-opacity-disabled":V}}),T=c?Ae("radio-group",R(()=>t.value[0]),B,e):void 0;return{selfElRef:o,rtlEnabled:S,mergedClsPrefix:d,mergedValue:h,handleFocusout:x,handleFocusin:b,cssVars:c?void 0:B,themeClass:T==null?void 0:T.themeClass,onRender:T==null?void 0:T.onRender}},render(){var e;const{mergedValue:o,mergedClsPrefix:t,handleFocusin:r,handleFocusout:n}=this,{children:l,isButtonGroup:a}=_h(tt(vn(this)),o,t);return(e=this.onRender)===null||e===void 0||e.call(this),i("div",{onFocusin:r,onFocusout:n,ref:"selfElRef",class:[`${t}-radio-group`,this.rtlEnabled&&`${t}-radio-group--rtl`,this.themeClass,a&&`${t}-radio-group--button-group`],style:this.cssVars},l)}}),aa=q({name:"DropdownDivider",props:{clsPrefix:{type:String,required:!0}},render(){return i("div",{class:`${this.clsPrefix}-dropdown-divider`})}}),sa=e=>{const{textColorBase:o,opacity1:t,opacity2:r,opacity3:n,opacity4:l,opacity5:a}=e;return{color:o,opacity1Depth:t,opacity2Depth:r,opacity3Depth:n,opacity4Depth:l,opacity5Depth:a}},Lh={name:"Icon",common:Le,self:sa},Hh=Lh,Ah={name:"Icon",common:fe,self:sa},Eh=Ah,jh=g("icon",` + height: 1em; + width: 1em; + line-height: 1em; + text-align: center; + display: inline-block; + position: relative; + fill: currentColor; + transform: translateZ(0); +`,[P("color-transition",{transition:"color .3s var(--n-bezier)"}),P("depth",{color:"var(--n-color)"},[C("svg",{opacity:"var(--n-opacity)",transition:"opacity .3s var(--n-bezier)"})]),C("svg",{height:"1em",width:"1em"})]),Wh=Object.assign(Object.assign({},ne.props),{depth:[String,Number],size:[Number,String],color:String,component:Object}),Nh=q({_n_icon__:!0,name:"Icon",inheritAttrs:!1,props:Wh,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Icon","-icon",jh,Hh,e,o),n=R(()=>{const{depth:a}=e,{common:{cubicBezierEaseInOut:s},self:d}=r.value;if(a!==void 0){const{color:c,[`opacity${a}Depth`]:u}=d;return{"--n-bezier":s,"--n-color":c,"--n-opacity":u}}return{"--n-bezier":s,"--n-color":"","--n-opacity":""}}),l=t?Ae("icon",R(()=>`${e.depth||"d"}`),n,e):void 0;return{mergedClsPrefix:o,mergedStyle:R(()=>{const{size:a,color:s}=e;return{fontSize:eo(a),color:s}}),cssVars:t?void 0:n,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e;const{$parent:o,depth:t,mergedClsPrefix:r,component:n,onRender:l,themeClass:a}=this;return!((e=o==null?void 0:o.$options)===null||e===void 0)&&e._n_icon__&&qo("icon","don't wrap `n-icon` inside `n-icon`"),l==null||l(),i("i",ko(this.$attrs,{role:"img",class:[`${r}-icon`,a,{[`${r}-icon--depth`]:t,[`${r}-icon--color-transition`]:t!==void 0}],style:[this.cssVars,this.mergedStyle]}),n?i(n):this.$slots)}}),kn="n-dropdown-menu",Hr="n-dropdown",yi="n-dropdown-option";function cn(e,o){return e.type==="submenu"||e.type===void 0&&e[o]!==void 0}function Vh(e){return e.type==="group"}function da(e){return e.type==="divider"}function Uh(e){return e.type==="render"}const ca=q({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(e){const o=Se(Hr),{hoverKeyRef:t,keyboardKeyRef:r,lastToggledSubmenuKeyRef:n,pendingKeyPathRef:l,activeKeyPathRef:a,animatedRef:s,mergedShowRef:d,renderLabelRef:c,renderIconRef:u,labelFieldRef:f,childrenFieldRef:p,renderOptionRef:v,nodePropsRef:h,menuPropsRef:m}=o,b=Se(yi,null),x=Se(kn),S=Se(Dt),B=R(()=>e.tmNode.rawNode),T=R(()=>{const{value:V}=p;return cn(e.tmNode.rawNode,V)}),z=R(()=>{const{disabled:V}=e.tmNode;return V}),I=R(()=>{if(!T.value)return!1;const{key:V,disabled:te}=e.tmNode;if(te)return!1;const{value:N}=t,{value:G}=r,{value:Ce}=n,{value:X}=l;return N!==null?X.includes(V):G!==null?X.includes(V)&&X[X.length-1]!==V:Ce!==null?X.includes(V):!1}),w=R(()=>r.value===null&&!s.value),O=Bd(I,300,w),k=R(()=>!!(b!=null&&b.enteringSubmenuRef.value)),$=D(!1);Oe(yi,{enteringSubmenuRef:$});function L(){$.value=!0}function M(){$.value=!1}function j(){const{parentKey:V,tmNode:te}=e;te.disabled||d.value&&(n.value=V,r.value=null,t.value=te.key)}function E(){const{tmNode:V}=e;V.disabled||d.value&&t.value!==V.key&&j()}function U(V){if(e.tmNode.disabled||!d.value)return;const{relatedTarget:te}=V;te&&!pt({target:te},"dropdownOption")&&!pt({target:te},"scrollbarRail")&&(t.value=null)}function _(){const{value:V}=T,{tmNode:te}=e;d.value&&!V&&!te.disabled&&(o.doSelect(te.key,te.rawNode),o.doUpdateShow(!1))}return{labelField:f,renderLabel:c,renderIcon:u,siblingHasIcon:x.showIconRef,siblingHasSubmenu:x.hasSubmenuRef,menuProps:m,popoverBody:S,animated:s,mergedShowSubmenu:R(()=>O.value&&!k.value),rawNode:B,hasSubmenu:T,pending:We(()=>{const{value:V}=l,{key:te}=e.tmNode;return V.includes(te)}),childActive:We(()=>{const{value:V}=a,{key:te}=e.tmNode,N=V.findIndex(G=>te===G);return N===-1?!1:N{const{value:V}=a,{key:te}=e.tmNode,N=V.findIndex(G=>te===G);return N===-1?!1:N===V.length-1}),mergedDisabled:z,renderOption:v,nodeProps:h,handleClick:_,handleMouseMove:E,handleMouseEnter:j,handleMouseLeave:U,handleSubmenuBeforeEnter:L,handleSubmenuAfterEnter:M}},render(){var e,o;const{animated:t,rawNode:r,mergedShowSubmenu:n,clsPrefix:l,siblingHasIcon:a,siblingHasSubmenu:s,renderLabel:d,renderIcon:c,renderOption:u,nodeProps:f,props:p,scrollable:v}=this;let h=null;if(n){const S=(e=this.menuProps)===null||e===void 0?void 0:e.call(this,r,r.children);h=i(ua,Object.assign({},S,{clsPrefix:l,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const m={class:[`${l}-dropdown-option-body`,this.pending&&`${l}-dropdown-option-body--pending`,this.active&&`${l}-dropdown-option-body--active`,this.childActive&&`${l}-dropdown-option-body--child-active`,this.mergedDisabled&&`${l}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},b=f==null?void 0:f(r),x=i("div",Object.assign({class:[`${l}-dropdown-option`,b==null?void 0:b.class],"data-dropdown-option":!0},b),i("div",ko(m,p),[i("div",{class:[`${l}-dropdown-option-body__prefix`,a&&`${l}-dropdown-option-body__prefix--show-icon`]},[c?c(r):qe(r.icon)]),i("div",{"data-dropdown-option":!0,class:`${l}-dropdown-option-body__label`},d?d(r):qe((o=r[this.labelField])!==null&&o!==void 0?o:r.title)),i("div",{"data-dropdown-option":!0,class:[`${l}-dropdown-option-body__suffix`,s&&`${l}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?i(Nh,null,{default:()=>i(Nd,null)}):null)]),this.hasSubmenu?i(Ir,null,{default:()=>[i(Br,null,{default:()=>i("div",{class:`${l}-dropdown-offset-container`},i(kr,{show:this.mergedShowSubmenu,placement:this.placement,to:v&&this.popoverBody||void 0,teleportDisabled:!v},{default:()=>i("div",{class:`${l}-dropdown-menu-wrapper`},t?i(no,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>h}):h)}))})]}):null);return u?u({node:x,option:r}):x}}),Kh=q({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:e,hasSubmenuRef:o}=Se(kn),{renderLabelRef:t,labelFieldRef:r,nodePropsRef:n,renderOptionRef:l}=Se(Hr);return{labelField:r,showIcon:e,hasSubmenu:o,renderLabel:t,nodeProps:n,renderOption:l}},render(){var e;const{clsPrefix:o,hasSubmenu:t,showIcon:r,nodeProps:n,renderLabel:l,renderOption:a}=this,{rawNode:s}=this.tmNode,d=i("div",Object.assign({class:`${o}-dropdown-option`},n==null?void 0:n(s)),i("div",{class:`${o}-dropdown-option-body ${o}-dropdown-option-body--group`},i("div",{"data-dropdown-option":!0,class:[`${o}-dropdown-option-body__prefix`,r&&`${o}-dropdown-option-body__prefix--show-icon`]},qe(s.icon)),i("div",{class:`${o}-dropdown-option-body__label`,"data-dropdown-option":!0},l?l(s):qe((e=s.title)!==null&&e!==void 0?e:s[this.labelField])),i("div",{class:[`${o}-dropdown-option-body__suffix`,t&&`${o}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return a?a({node:d,option:s}):d}}),Gh=q({name:"NDropdownGroup",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){const{tmNode:e,parentKey:o,clsPrefix:t}=this,{children:r}=e;return i(ao,null,i(Kh,{clsPrefix:t,tmNode:e,key:e.key}),r==null?void 0:r.map(n=>{const{rawNode:l}=n;return l.show===!1?null:da(l)?i(aa,{clsPrefix:t,key:n.key}):n.isGroup?(qo("dropdown","`group` node is not allowed to be put in `group` node."),null):i(ca,{clsPrefix:t,tmNode:n,parentKey:o,key:n.key})}))}}),qh=q({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:e,props:o}}=this.tmNode;return i("div",o,[e==null?void 0:e()])}}),ua=q({name:"DropdownMenu",props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(e){const{renderIconRef:o,childrenFieldRef:t}=Se(Hr);Oe(kn,{showIconRef:R(()=>{const n=o.value;return e.tmNodes.some(l=>{var a;if(l.isGroup)return(a=l.children)===null||a===void 0?void 0:a.some(({rawNode:d})=>n?n(d):d.icon);const{rawNode:s}=l;return n?n(s):s.icon})}),hasSubmenuRef:R(()=>{const{value:n}=t;return e.tmNodes.some(l=>{var a;if(l.isGroup)return(a=l.children)===null||a===void 0?void 0:a.some(({rawNode:d})=>cn(d,n));const{rawNode:s}=l;return cn(s,n)})})});const r=D(null);return Oe(dr,null),Oe(cr,null),Oe(Dt,r),{bodyRef:r}},render(){const{parentKey:e,clsPrefix:o,scrollable:t}=this,r=this.tmNodes.map(n=>{const{rawNode:l}=n;return l.show===!1?null:Uh(l)?i(qh,{tmNode:n,key:n.key}):da(l)?i(aa,{clsPrefix:o,key:n.key}):Vh(l)?i(Gh,{clsPrefix:o,tmNode:n,parentKey:e,key:n.key}):i(ca,{clsPrefix:o,tmNode:n,parentKey:e,key:n.key,props:l.props,scrollable:t})});return i("div",{class:[`${o}-dropdown-menu`,t&&`${o}-dropdown-menu--scrollable`],ref:"bodyRef"},t?i(gl,{contentClass:`${o}-dropdown-menu__content`},{default:()=>r}):r,this.showArrow?yl({clsPrefix:o,arrowStyle:this.arrowStyle}):null)}}),Yh=g("dropdown-menu",` + transform-origin: var(--v-transform-origin); + background-color: var(--n-color); + border-radius: var(--n-border-radius); + box-shadow: var(--n-box-shadow); + position: relative; + transition: + background-color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); +`,[at(),g("dropdown-option",` + position: relative; + `,[C("a",` + text-decoration: none; + color: inherit; + outline: none; + `,[C("&::before",` + content: ""; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + `)]),g("dropdown-option-body",` + display: flex; + cursor: pointer; + position: relative; + height: var(--n-option-height); + line-height: var(--n-option-height); + font-size: var(--n-font-size); + color: var(--n-option-text-color); + transition: color .3s var(--n-bezier); + `,[C("&::before",` + content: ""; + position: absolute; + top: 0; + bottom: 0; + left: 4px; + right: 4px; + transition: background-color .3s var(--n-bezier); + border-radius: var(--n-border-radius); + `),je("disabled",[P("pending",` + color: var(--n-option-text-color-hover); + `,[y("prefix, suffix",` + color: var(--n-option-text-color-hover); + `),C("&::before","background-color: var(--n-option-color-hover);")]),P("active",` + color: var(--n-option-text-color-active); + `,[y("prefix, suffix",` + color: var(--n-option-text-color-active); + `),C("&::before","background-color: var(--n-option-color-active);")]),P("child-active",` + color: var(--n-option-text-color-child-active); + `,[y("prefix, suffix",` + color: var(--n-option-text-color-child-active); + `)])]),P("disabled",` + cursor: not-allowed; + opacity: var(--n-option-opacity-disabled); + `),P("group",` + font-size: calc(var(--n-font-size) - 1px); + color: var(--n-group-header-text-color); + `,[y("prefix",` + width: calc(var(--n-option-prefix-width) / 2); + `,[P("show-icon",` + width: calc(var(--n-option-icon-prefix-width) / 2); + `)])]),y("prefix",` + width: var(--n-option-prefix-width); + display: flex; + justify-content: center; + align-items: center; + color: var(--n-prefix-color); + transition: color .3s var(--n-bezier); + z-index: 1; + `,[P("show-icon",` + width: var(--n-option-icon-prefix-width); + `),g("icon",` + font-size: var(--n-option-icon-size); + `)]),y("label",` + white-space: nowrap; + flex: 1; + z-index: 1; + `),y("suffix",` + box-sizing: border-box; + flex-grow: 0; + flex-shrink: 0; + display: flex; + justify-content: flex-end; + align-items: center; + min-width: var(--n-option-suffix-width); + padding: 0 8px; + transition: color .3s var(--n-bezier); + color: var(--n-suffix-color); + z-index: 1; + `,[P("has-submenu",` + width: var(--n-option-icon-suffix-width); + `),g("icon",` + font-size: var(--n-option-icon-size); + `)]),g("dropdown-menu","pointer-events: all;")]),g("dropdown-offset-container",` + pointer-events: none; + position: absolute; + left: 0; + right: 0; + top: -4px; + bottom: -4px; + `)]),g("dropdown-divider",` + transition: background-color .3s var(--n-bezier); + background-color: var(--n-divider-color); + height: 1px; + margin: 4px 0; + `),g("dropdown-menu-wrapper",` + transform-origin: var(--v-transform-origin); + width: fit-content; + `),C(">",[g("scrollbar",` + height: inherit; + max-height: inherit; + `)]),je("scrollable",` + padding: var(--n-padding); + `),P("scrollable",[y("content",` + padding: var(--n-padding); + `)])]),Xh={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:{type:String,default:"medium"},inverted:Boolean,placement:{type:String,default:"bottom"},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},value:[String,Number]},Zh=Object.keys(bt),Qh=Object.assign(Object.assign(Object.assign({},bt),Xh),ne.props),Jh=q({name:"Dropdown",inheritAttrs:!1,props:Qh,setup(e){const o=D(!1),t=so(le(e,"show"),o),r=R(()=>{const{keyField:M,childrenField:j}=e;return ar(e.options,{getKey(E){return E[M]},getDisabled(E){return E.disabled===!0},getIgnored(E){return E.type==="divider"||E.type==="render"},getChildren(E){return E[j]}})}),n=R(()=>r.value.treeNodes),l=D(null),a=D(null),s=D(null),d=R(()=>{var M,j,E;return(E=(j=(M=l.value)!==null&&M!==void 0?M:a.value)!==null&&j!==void 0?j:s.value)!==null&&E!==void 0?E:null}),c=R(()=>r.value.getPath(d.value).keyPath),u=R(()=>r.value.getPath(e.value).keyPath),f=We(()=>e.keyboard&&t.value);ad({keydown:{ArrowUp:{prevent:!0,handler:z},ArrowRight:{prevent:!0,handler:T},ArrowDown:{prevent:!0,handler:I},ArrowLeft:{prevent:!0,handler:B},Enter:{prevent:!0,handler:w},Escape:S}},f);const{mergedClsPrefixRef:p,inlineThemeDisabled:v}=ke(e),h=ne("Dropdown","-dropdown",Yh,ia,e,p);Oe(Hr,{labelFieldRef:le(e,"labelField"),childrenFieldRef:le(e,"childrenField"),renderLabelRef:le(e,"renderLabel"),renderIconRef:le(e,"renderIcon"),hoverKeyRef:l,keyboardKeyRef:a,lastToggledSubmenuKeyRef:s,pendingKeyPathRef:c,activeKeyPathRef:u,animatedRef:le(e,"animated"),mergedShowRef:t,nodePropsRef:le(e,"nodeProps"),renderOptionRef:le(e,"renderOption"),menuPropsRef:le(e,"menuProps"),doSelect:m,doUpdateShow:b}),Ke(t,M=>{!e.animated&&!M&&x()});function m(M,j){const{onSelect:E}=e;E&&ae(E,M,j)}function b(M){const{"onUpdate:show":j,onUpdateShow:E}=e;j&&ae(j,M),E&&ae(E,M),o.value=M}function x(){l.value=null,a.value=null,s.value=null}function S(){b(!1)}function B(){k("left")}function T(){k("right")}function z(){k("up")}function I(){k("down")}function w(){const M=O();M!=null&&M.isLeaf&&t.value&&(m(M.key,M.rawNode),b(!1))}function O(){var M;const{value:j}=r,{value:E}=d;return!j||E===null?null:(M=j.getNode(E))!==null&&M!==void 0?M:null}function k(M){const{value:j}=d,{value:{getFirstAvailableNode:E}}=r;let U=null;if(j===null){const _=E();_!==null&&(U=_.key)}else{const _=O();if(_){let V;switch(M){case"down":V=_.getNext();break;case"up":V=_.getPrev();break;case"right":V=_.getChild();break;case"left":V=_.getParent();break}V&&(U=V.key)}}U!==null&&(l.value=null,a.value=U)}const $=R(()=>{const{size:M,inverted:j}=e,{common:{cubicBezierEaseInOut:E},self:U}=h.value,{padding:_,dividerColor:V,borderRadius:te,optionOpacityDisabled:N,[W("optionIconSuffixWidth",M)]:G,[W("optionSuffixWidth",M)]:Ce,[W("optionIconPrefixWidth",M)]:X,[W("optionPrefixWidth",M)]:ve,[W("fontSize",M)]:he,[W("optionHeight",M)]:be,[W("optionIconSize",M)]:me}=U,se={"--n-bezier":E,"--n-font-size":he,"--n-padding":_,"--n-border-radius":te,"--n-option-height":be,"--n-option-prefix-width":ve,"--n-option-icon-prefix-width":X,"--n-option-suffix-width":Ce,"--n-option-icon-suffix-width":G,"--n-option-icon-size":me,"--n-divider-color":V,"--n-option-opacity-disabled":N};return j?(se["--n-color"]=U.colorInverted,se["--n-option-color-hover"]=U.optionColorHoverInverted,se["--n-option-color-active"]=U.optionColorActiveInverted,se["--n-option-text-color"]=U.optionTextColorInverted,se["--n-option-text-color-hover"]=U.optionTextColorHoverInverted,se["--n-option-text-color-active"]=U.optionTextColorActiveInverted,se["--n-option-text-color-child-active"]=U.optionTextColorChildActiveInverted,se["--n-prefix-color"]=U.prefixColorInverted,se["--n-suffix-color"]=U.suffixColorInverted,se["--n-group-header-text-color"]=U.groupHeaderTextColorInverted):(se["--n-color"]=U.color,se["--n-option-color-hover"]=U.optionColorHover,se["--n-option-color-active"]=U.optionColorActive,se["--n-option-text-color"]=U.optionTextColor,se["--n-option-text-color-hover"]=U.optionTextColorHover,se["--n-option-text-color-active"]=U.optionTextColorActive,se["--n-option-text-color-child-active"]=U.optionTextColorChildActive,se["--n-prefix-color"]=U.prefixColor,se["--n-suffix-color"]=U.suffixColor,se["--n-group-header-text-color"]=U.groupHeaderTextColor),se}),L=v?Ae("dropdown",R(()=>`${e.size[0]}${e.inverted?"i":""}`),$,e):void 0;return{mergedClsPrefix:p,mergedTheme:h,tmNodes:n,mergedShow:t,handleAfterLeave:()=>{e.animated&&x()},doUpdateShow:b,cssVars:v?void 0:$,themeClass:L==null?void 0:L.themeClass,onRender:L==null?void 0:L.onRender}},render(){const e=(r,n,l,a,s)=>{var d;const{mergedClsPrefix:c,menuProps:u}=this;(d=this.onRender)===null||d===void 0||d.call(this);const f=(u==null?void 0:u(void 0,this.tmNodes.map(v=>v.rawNode)))||{},p={ref:qi(n),class:[r,`${c}-dropdown`,this.themeClass],clsPrefix:c,tmNodes:this.tmNodes,style:[l,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:a,onMouseleave:s};return i(ua,ko(this.$attrs,p,f))},{mergedTheme:o}=this,t={show:this.mergedShow,theme:o.peers.Popover,themeOverrides:o.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:e,onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return i(hr,Object.assign({},go(this.$props,Zh),t),{trigger:()=>{var r,n;return(n=(r=this.$slots).default)===null||n===void 0?void 0:n.call(r)}})}}),ep={itemFontSize:"12px",itemHeight:"36px",itemWidth:"52px",panelActionPadding:"8px 0"},op=e=>{const{popoverColor:o,textColor2:t,primaryColor:r,hoverColor:n,dividerColor:l,opacityDisabled:a,boxShadow2:s,borderRadius:d,iconColor:c,iconColorDisabled:u}=e;return Object.assign(Object.assign({},ep),{panelColor:o,panelBoxShadow:s,panelDividerColor:l,itemTextColor:t,itemTextColorActive:r,itemColorHover:n,itemOpacityDisabled:a,itemBorderRadius:d,borderRadius:d,iconColor:c,iconColorDisabled:u})},tp={name:"TimePicker",common:fe,peers:{Scrollbar:zo,Button:$o,Input:Ho},self:op},fa=tp,rp={itemSize:"24px",itemCellWidth:"38px",itemCellHeight:"32px",scrollItemWidth:"80px",scrollItemHeight:"40px",panelExtraFooterPadding:"8px 12px",panelActionPadding:"8px 12px",calendarTitlePadding:"0",calendarTitleHeight:"28px",arrowSize:"14px",panelHeaderPadding:"8px 12px",calendarDaysHeight:"32px",calendarTitleGridTempateColumns:"28px 28px 1fr 28px 28px",calendarLeftPaddingDate:"6px 12px 4px 12px",calendarLeftPaddingDatetime:"4px 12px",calendarLeftPaddingDaterange:"6px 12px 4px 12px",calendarLeftPaddingDatetimerange:"4px 12px",calendarLeftPaddingMonth:"0",calendarLeftPaddingYear:"0",calendarLeftPaddingQuarter:"0",calendarLeftPaddingMonthrange:"0",calendarLeftPaddingQuarterrange:"0",calendarLeftPaddingYearrange:"0",calendarRightPaddingDate:"6px 12px 4px 12px",calendarRightPaddingDatetime:"4px 12px",calendarRightPaddingDaterange:"6px 12px 4px 12px",calendarRightPaddingDatetimerange:"4px 12px",calendarRightPaddingMonth:"0",calendarRightPaddingYear:"0",calendarRightPaddingQuarter:"0",calendarRightPaddingMonthrange:"0",calendarRightPaddingQuarterrange:"0",calendarRightPaddingYearrange:"0"},np=e=>{const{hoverColor:o,fontSize:t,textColor2:r,textColorDisabled:n,popoverColor:l,primaryColor:a,borderRadiusSmall:s,iconColor:d,iconColorDisabled:c,textColor1:u,dividerColor:f,boxShadow2:p,borderRadius:v,fontWeightStrong:h}=e;return Object.assign(Object.assign({},rp),{itemFontSize:t,calendarDaysFontSize:t,calendarTitleFontSize:t,itemTextColor:r,itemTextColorDisabled:n,itemTextColorActive:l,itemTextColorCurrent:a,itemColorIncluded:J(a,{alpha:.1}),itemColorHover:o,itemColorDisabled:o,itemColorActive:a,itemBorderRadius:s,panelColor:l,panelTextColor:r,arrowColor:d,calendarTitleTextColor:u,calendarTitleColorHover:o,calendarDaysTextColor:r,panelHeaderDividerColor:f,calendarDaysDividerColor:f,calendarDividerColor:f,panelActionDividerColor:f,panelBoxShadow:p,panelBorderRadius:v,calendarTitleFontWeight:h,scrollItemBorderRadius:v,iconColor:d,iconColorDisabled:c})},ip={name:"DatePicker",common:fe,peers:{Input:Ho,Button:$o,TimePicker:fa,Scrollbar:zo},self(e){const{popoverColor:o,hoverColor:t,primaryColor:r}=e,n=np(e);return n.itemColorDisabled=$e(o,t),n.itemColorIncluded=J(r,{alpha:.15}),n.itemColorHover=$e(o,t),n}},lp=ip,ap={thPaddingBorderedSmall:"8px 12px",thPaddingBorderedMedium:"12px 16px",thPaddingBorderedLarge:"16px 24px",thPaddingSmall:"0",thPaddingMedium:"0",thPaddingLarge:"0",tdPaddingBorderedSmall:"8px 12px",tdPaddingBorderedMedium:"12px 16px",tdPaddingBorderedLarge:"16px 24px",tdPaddingSmall:"0 0 8px 0",tdPaddingMedium:"0 0 12px 0",tdPaddingLarge:"0 0 16px 0"},sp=e=>{const{tableHeaderColor:o,textColor2:t,textColor1:r,cardColor:n,modalColor:l,popoverColor:a,dividerColor:s,borderRadius:d,fontWeightStrong:c,lineHeight:u,fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:v}=e;return Object.assign(Object.assign({},ap),{lineHeight:u,fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:v,titleTextColor:r,thColor:$e(n,o),thColorModal:$e(l,o),thColorPopover:$e(a,o),thTextColor:r,thFontWeight:c,tdTextColor:t,tdColor:n,tdColorModal:l,tdColorPopover:a,borderColor:$e(n,s),borderColorModal:$e(l,s),borderColorPopover:$e(a,s),borderRadius:d})},dp={name:"Descriptions",common:fe,self:sp},cp=dp,up={titleFontSize:"18px",padding:"16px 28px 20px 28px",iconSize:"28px",actionSpace:"12px",contentMargin:"8px 0 16px 0",iconMargin:"0 4px 0 0",iconMarginIconTop:"4px 0 8px 0",closeSize:"22px",closeIconSize:"18px",closeMargin:"20px 26px 0 0",closeMarginIconTop:"10px 16px 0 0"},ha=e=>{const{textColor1:o,textColor2:t,modalColor:r,closeIconColor:n,closeIconColorHover:l,closeIconColorPressed:a,closeColorHover:s,closeColorPressed:d,infoColor:c,successColor:u,warningColor:f,errorColor:p,primaryColor:v,dividerColor:h,borderRadius:m,fontWeightStrong:b,lineHeight:x,fontSize:S}=e;return Object.assign(Object.assign({},up),{fontSize:S,lineHeight:x,border:`1px solid ${h}`,titleTextColor:o,textColor:t,color:r,closeColorHover:s,closeColorPressed:d,closeIconColor:n,closeIconColorHover:l,closeIconColorPressed:a,closeBorderRadius:m,iconColor:v,iconColorInfo:c,iconColorSuccess:u,iconColorWarning:f,iconColorError:p,borderRadius:m,titleFontWeight:b})},fp={name:"Dialog",common:Le,peers:{Button:Wt},self:ha},pa=fp,hp={name:"Dialog",common:fe,peers:{Button:$o},self:ha},va=hp,Ar={icon:Function,type:{type:String,default:"default"},title:[String,Function],closable:{type:Boolean,default:!0},negativeText:String,positiveText:String,positiveButtonProps:Object,negativeButtonProps:Object,content:[String,Function],action:Function,showIcon:{type:Boolean,default:!0},loading:Boolean,bordered:Boolean,iconPlacement:String,onPositiveClick:Function,onNegativeClick:Function,onClose:Function},ga=yo(Ar),pp=C([g("dialog",` + word-break: break-word; + line-height: var(--n-line-height); + position: relative; + background: var(--n-color); + color: var(--n-text-color); + box-sizing: border-box; + margin: auto; + border-radius: var(--n-border-radius); + padding: var(--n-padding); + transition: + border-color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + `,[y("icon",{color:"var(--n-icon-color)"}),P("bordered",{border:"var(--n-border)"}),P("icon-top",[y("close",{margin:"var(--n-close-margin)"}),y("icon",{margin:"var(--n-icon-margin)"}),y("content",{textAlign:"center"}),y("title",{justifyContent:"center"}),y("action",{justifyContent:"center"})]),P("icon-left",[y("icon",{margin:"var(--n-icon-margin)"}),P("closable",[y("title",` + padding-right: calc(var(--n-close-size) + 6px); + `)])]),y("close",` + position: absolute; + right: 0; + top: 0; + margin: var(--n-close-margin); + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + z-index: 1; + `),y("content",` + font-size: var(--n-font-size); + margin: var(--n-content-margin); + position: relative; + word-break: break-word; + `,[P("last","margin-bottom: 0;")]),y("action",` + display: flex; + justify-content: flex-end; + `,[C("> *:not(:last-child)",{marginRight:"var(--n-action-space)"})]),y("icon",{fontSize:"var(--n-icon-size)",transition:"color .3s var(--n-bezier)"}),y("title",` + transition: color .3s var(--n-bezier); + display: flex; + align-items: center; + font-size: var(--n-title-font-size); + font-weight: var(--n-title-font-weight); + color: var(--n-title-text-color); + `),g("dialog-icon-container",{display:"flex",justifyContent:"center"})]),Or(g("dialog",` + width: 446px; + max-width: calc(100vw - 32px); + `)),g("dialog",[Zi(` + width: 446px; + max-width: calc(100vw - 32px); + `)])]),vp={default:()=>i(mt,null),info:()=>i(mt,null),success:()=>i(Ht,null),warning:()=>i(yt,null),error:()=>i(Lt,null)},ma=q({name:"Dialog",alias:["NimbusConfirmCard","Confirm"],props:Object.assign(Object.assign({},ne.props),Ar),setup(e){const{mergedComponentPropsRef:o,mergedClsPrefixRef:t,inlineThemeDisabled:r}=ke(e),n=R(()=>{var f,p;const{iconPlacement:v}=e;return v||((p=(f=o==null?void 0:o.value)===null||f===void 0?void 0:f.Dialog)===null||p===void 0?void 0:p.iconPlacement)||"left"});function l(f){const{onPositiveClick:p}=e;p&&p(f)}function a(f){const{onNegativeClick:p}=e;p&&p(f)}function s(){const{onClose:f}=e;f&&f()}const d=ne("Dialog","-dialog",pp,pa,e,t),c=R(()=>{const{type:f}=e,p=n.value,{common:{cubicBezierEaseInOut:v},self:{fontSize:h,lineHeight:m,border:b,titleTextColor:x,textColor:S,color:B,closeBorderRadius:T,closeColorHover:z,closeColorPressed:I,closeIconColor:w,closeIconColorHover:O,closeIconColorPressed:k,closeIconSize:$,borderRadius:L,titleFontWeight:M,titleFontSize:j,padding:E,iconSize:U,actionSpace:_,contentMargin:V,closeSize:te,[p==="top"?"iconMarginIconTop":"iconMargin"]:N,[p==="top"?"closeMarginIconTop":"closeMargin"]:G,[W("iconColor",f)]:Ce}}=d.value;return{"--n-font-size":h,"--n-icon-color":Ce,"--n-bezier":v,"--n-close-margin":G,"--n-icon-margin":N,"--n-icon-size":U,"--n-close-size":te,"--n-close-icon-size":$,"--n-close-border-radius":T,"--n-close-color-hover":z,"--n-close-color-pressed":I,"--n-close-icon-color":w,"--n-close-icon-color-hover":O,"--n-close-icon-color-pressed":k,"--n-color":B,"--n-text-color":S,"--n-border-radius":L,"--n-padding":E,"--n-line-height":m,"--n-border":b,"--n-content-margin":V,"--n-title-font-size":j,"--n-title-font-weight":M,"--n-title-text-color":x,"--n-action-space":_}}),u=r?Ae("dialog",R(()=>`${e.type[0]}${n.value[0]}`),c,e):void 0;return{mergedClsPrefix:t,mergedIconPlacement:n,mergedTheme:d,handlePositiveClick:l,handleNegativeClick:a,handleCloseClick:s,cssVars:r?void 0:c,themeClass:u==null?void 0:u.themeClass,onRender:u==null?void 0:u.onRender}},render(){var e;const{bordered:o,mergedIconPlacement:t,cssVars:r,closable:n,showIcon:l,title:a,content:s,action:d,negativeText:c,positiveText:u,positiveButtonProps:f,negativeButtonProps:p,handlePositiveClick:v,handleNegativeClick:h,mergedTheme:m,loading:b,type:x,mergedClsPrefix:S}=this;(e=this.onRender)===null||e===void 0||e.call(this);const B=l?i(De,{clsPrefix:S,class:`${S}-dialog__icon`},{default:()=>Ee(this.$slots.icon,z=>z||(this.icon?qe(this.icon):vp[this.type]()))}):null,T=Ee(this.$slots.action,z=>z||u||c||d?i("div",{class:`${S}-dialog__action`},z||(d?[qe(d)]:[this.negativeText&&i(Po,Object.assign({theme:m.peers.Button,themeOverrides:m.peerOverrides.Button,ghost:!0,size:"small",onClick:h},p),{default:()=>qe(this.negativeText)}),this.positiveText&&i(Po,Object.assign({theme:m.peers.Button,themeOverrides:m.peerOverrides.Button,size:"small",type:x==="default"?"primary":x,disabled:b,loading:b,onClick:v},f),{default:()=>qe(this.positiveText)})])):null);return i("div",{class:[`${S}-dialog`,this.themeClass,this.closable&&`${S}-dialog--closable`,`${S}-dialog--icon-${t}`,o&&`${S}-dialog--bordered`],style:r,role:"dialog"},n?i(St,{clsPrefix:S,class:`${S}-dialog__close`,onClick:this.handleCloseClick}):null,l&&t==="top"?i("div",{class:`${S}-dialog-icon-container`},B):null,i("div",{class:`${S}-dialog__title`},l&&t==="left"?B:null,lo(this.$slots.header,()=>[qe(a)])),i("div",{class:[`${S}-dialog__content`,T?"":`${S}-dialog__content--last`]},lo(this.$slots.default,()=>[qe(s)])),T)}}),ba="n-dialog-provider",xa="n-dialog-api",gp="n-dialog-reactive-list",Ca=e=>{const{modalColor:o,textColor2:t,boxShadow3:r}=e;return{color:o,textColor:t,boxShadow:r}},mp={name:"Modal",common:Le,peers:{Scrollbar:Mr,Dialog:pa,Card:Nl},self:Ca},bp=mp,xp={name:"Modal",common:fe,peers:{Scrollbar:zo,Dialog:va,Card:Vl},self:Ca},Cp=xp,In=Object.assign(Object.assign({},Sn),Ar),yp=yo(In),wp=q({name:"ModalBody",inheritAttrs:!1,props:Object.assign(Object.assign({show:{type:Boolean,required:!0},preset:String,displayDirective:{type:String,required:!0},trapFocus:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},blockScroll:Boolean},In),{renderMask:Function,onClickoutside:Function,onBeforeLeave:{type:Function,required:!0},onAfterLeave:{type:Function,required:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0},onClose:{type:Function,required:!0},onAfterEnter:Function,onEsc:Function}),setup(e){const o=D(null),t=D(null),r=D(e.show),n=D(null),l=D(null);Ke(le(e,"show"),b=>{b&&(r.value=!0)}),il(R(()=>e.blockScroll&&r.value));const a=Se(ol);function s(){if(a.transformOriginRef.value==="center")return"";const{value:b}=n,{value:x}=l;if(b===null||x===null)return"";if(t.value){const S=t.value.containerScrollTop;return`${b}px ${x+S}px`}return""}function d(b){if(a.transformOriginRef.value==="center")return;const x=a.getMousePosition();if(!x||!t.value)return;const S=t.value.containerScrollTop,{offsetLeft:B,offsetTop:T}=b;if(x){const z=x.y,I=x.x;n.value=-(B-I),l.value=-(T-z-S)}b.style.transformOrigin=s()}function c(b){io(()=>{d(b)})}function u(b){b.style.transformOrigin=s(),e.onBeforeLeave()}function f(){r.value=!1,n.value=null,l.value=null,e.onAfterLeave()}function p(){const{onClose:b}=e;b&&b()}function v(){e.onNegativeClick()}function h(){e.onPositiveClick()}const m=D(null);return Ke(m,b=>{b&&io(()=>{const x=b.el;x&&o.value!==x&&(o.value=x)})}),Oe(dr,o),Oe(cr,null),Oe(Dt,null),{mergedTheme:a.mergedThemeRef,appear:a.appearRef,isMounted:a.isMountedRef,mergedClsPrefix:a.mergedClsPrefixRef,bodyRef:o,scrollbarRef:t,displayed:r,childNodeRef:m,handlePositiveClick:h,handleNegativeClick:v,handleCloseClick:p,handleAfterLeave:f,handleBeforeLeave:u,handleEnter:c}},render(){const{$slots:e,$attrs:o,handleEnter:t,handleAfterLeave:r,handleBeforeLeave:n,preset:l,mergedClsPrefix:a}=this;let s=null;if(!l){if(s=ln(e),!s){qo("modal","default slot is empty");return}s=Jt(s),s.props=ko({class:`${a}-modal`},o,s.props||{})}return this.displayDirective==="show"||this.displayed||this.show?Lo(i("div",{role:"none",class:`${a}-modal-body-wrapper`},i(ur,{ref:"scrollbarRef",theme:this.mergedTheme.peers.Scrollbar,themeOverrides:this.mergedTheme.peerOverrides.Scrollbar,contentClass:`${a}-modal-scroll-content`},{default:()=>{var d;return[(d=this.renderMask)===null||d===void 0?void 0:d.call(this),i(hn,{disabled:!this.trapFocus,active:this.show,onEsc:this.onEsc,autoFocus:this.autoFocus},{default:()=>{var c;return i(no,{name:"fade-in-scale-up-transition",appear:(c=this.appear)!==null&&c!==void 0?c:this.isMounted,onEnter:t,onAfterEnter:this.onAfterEnter,onAfterLeave:r,onBeforeLeave:n},{default:()=>{const u=[[Go,this.show]],{onClickoutside:f}=this;return f&&u.push([Ft,this.onClickoutside,void 0,{capture:!0}]),Lo(this.preset==="confirm"||this.preset==="dialog"?i(ma,Object.assign({},this.$attrs,{class:[`${a}-modal`,this.$attrs.class],ref:"bodyRef",theme:this.mergedTheme.peers.Dialog,themeOverrides:this.mergedTheme.peerOverrides.Dialog},go(this.$props,ga),{"aria-modal":"true"}),e):this.preset==="card"?i(Rf,Object.assign({},this.$attrs,{ref:"bodyRef",class:[`${a}-modal`,this.$attrs.class],theme:this.mergedTheme.peers.Card,themeOverrides:this.mergedTheme.peerOverrides.Card},go(this.$props,zf),{"aria-modal":"true",role:"dialog"}),e):this.childNodeRef=s,u)}})}})]}})),[[Go,this.displayDirective==="if"||this.displayed||this.show]]):null}}),Sp=C([g("modal-container",` + position: fixed; + left: 0; + top: 0; + height: 0; + width: 0; + display: flex; + `),g("modal-mask",` + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + background-color: rgba(0, 0, 0, .4); + `,[Mt({enterDuration:".25s",leaveDuration:".25s",enterCubicBezier:"var(--n-bezier-ease-out)",leaveCubicBezier:"var(--n-bezier-ease-out)"})]),g("modal-body-wrapper",` + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + overflow: visible; + `,[g("modal-scroll-content",` + min-height: 100%; + display: flex; + position: relative; + `)]),g("modal",` + position: relative; + align-self: center; + color: var(--n-text-color); + margin: auto; + box-shadow: var(--n-box-shadow); + `,[at({duration:".25s",enterScale:".5"})])]),zp=Object.assign(Object.assign(Object.assign(Object.assign({},ne.props),{show:Boolean,unstableShowMask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},preset:String,to:[String,Object],displayDirective:{type:String,default:"if"},transformOrigin:{type:String,default:"mouse"},zIndex:Number,autoFocus:{type:Boolean,default:!0},trapFocus:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!0}}),In),{onEsc:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onAfterEnter:Function,onBeforeLeave:Function,onAfterLeave:Function,onClose:Function,onPositiveClick:Function,onNegativeClick:Function,onMaskClick:Function,internalDialog:Boolean,internalAppear:{type:Boolean,default:void 0},overlayStyle:[String,Object],onBeforeHide:Function,onAfterHide:Function,onHide:Function}),$p=q({name:"Modal",inheritAttrs:!1,props:zp,setup(e){const o=D(null),{mergedClsPrefixRef:t,namespaceRef:r,inlineThemeDisabled:n}=ke(e),l=ne("Modal","-modal",Sp,bp,e,t),a=Vi(64),s=Ui(),d=Ct(),c=e.internalDialog?Se(ba,null):null,u=ll();function f(z){const{onUpdateShow:I,"onUpdate:show":w,onHide:O}=e;I&&ae(I,z),w&&ae(w,z),O&&!z&&O(z)}function p(){const{onClose:z}=e;z?Promise.resolve(z()).then(I=>{I!==!1&&f(!1)}):f(!1)}function v(){const{onPositiveClick:z}=e;z?Promise.resolve(z()).then(I=>{I!==!1&&f(!1)}):f(!1)}function h(){const{onNegativeClick:z}=e;z?Promise.resolve(z()).then(I=>{I!==!1&&f(!1)}):f(!1)}function m(){const{onBeforeLeave:z,onBeforeHide:I}=e;z&&ae(z),I&&I()}function b(){const{onAfterLeave:z,onAfterHide:I}=e;z&&ae(z),I&&I()}function x(z){var I;const{onMaskClick:w}=e;w&&w(z),e.maskClosable&&!((I=o.value)===null||I===void 0)&&I.contains(Qt(z))&&f(!1)}function S(z){var I;(I=e.onEsc)===null||I===void 0||I.call(e),e.show&&e.closeOnEsc&&Ji(z)&&!u.value&&f(!1)}Oe(ol,{getMousePosition:()=>{if(c){const{clickedRef:z,clickPositionRef:I}=c;if(z.value&&I.value)return I.value}return a.value?s.value:null},mergedClsPrefixRef:t,mergedThemeRef:l,isMountedRef:d,appearRef:le(e,"internalAppear"),transformOriginRef:le(e,"transformOrigin")});const B=R(()=>{const{common:{cubicBezierEaseOut:z},self:{boxShadow:I,color:w,textColor:O}}=l.value;return{"--n-bezier-ease-out":z,"--n-box-shadow":I,"--n-color":w,"--n-text-color":O}}),T=n?Ae("theme-class",void 0,B,e):void 0;return{mergedClsPrefix:t,namespace:r,isMounted:d,containerRef:o,presetProps:R(()=>go(e,yp)),handleEsc:S,handleAfterLeave:b,handleClickoutside:x,handleBeforeLeave:m,doUpdateShow:f,handleNegativeClick:h,handlePositiveClick:v,handleCloseClick:p,cssVars:n?void 0:B,themeClass:T==null?void 0:T.themeClass,onRender:T==null?void 0:T.onRender}},render(){const{mergedClsPrefix:e}=this;return i(pn,{to:this.to,show:this.show},{default:()=>{var o;(o=this.onRender)===null||o===void 0||o.call(this);const{unstableShowMask:t}=this;return Lo(i("div",{role:"none",ref:"containerRef",class:[`${e}-modal-container`,this.themeClass,this.namespace],style:this.cssVars},i(wp,Object.assign({style:this.overlayStyle},this.$attrs,{ref:"bodyWrapper",displayDirective:this.displayDirective,show:this.show,preset:this.preset,autoFocus:this.autoFocus,trapFocus:this.trapFocus,blockScroll:this.blockScroll},this.presetProps,{onEsc:this.handleEsc,onClose:this.handleCloseClick,onNegativeClick:this.handleNegativeClick,onPositiveClick:this.handlePositiveClick,onBeforeLeave:this.handleBeforeLeave,onAfterEnter:this.onAfterEnter,onAfterLeave:this.handleAfterLeave,onClickoutside:t?void 0:this.handleClickoutside,renderMask:t?()=>{var r;return i(no,{name:"fade-in-transition",key:"mask",appear:(r=this.internalAppear)!==null&&r!==void 0?r:this.isMounted},{default:()=>this.show?i("div",{"aria-hidden":!0,ref:"containerRef",class:`${e}-modal-mask`,onClick:this.handleClickoutside}):null})}:void 0}),this.$slots)),[[Tr,{zIndex:this.zIndex,enabled:this.show}]])}})}}),Rp=Object.assign(Object.assign({},Ar),{onAfterEnter:Function,onAfterLeave:Function,transformOrigin:String,blockScroll:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},internalStyle:[String,Object],maskClosable:{type:Boolean,default:!0},onPositiveClick:Function,onNegativeClick:Function,onClose:Function,onMaskClick:Function}),Pp=q({name:"DialogEnvironment",props:Object.assign(Object.assign({},Rp),{internalKey:{type:String,required:!0},to:[String,Object],onInternalAfterLeave:{type:Function,required:!0}}),setup(e){const o=D(!0);function t(){const{onInternalAfterLeave:u,internalKey:f,onAfterLeave:p}=e;u&&u(f),p&&p()}function r(u){const{onPositiveClick:f}=e;f?Promise.resolve(f(u)).then(p=>{p!==!1&&d()}):d()}function n(u){const{onNegativeClick:f}=e;f?Promise.resolve(f(u)).then(p=>{p!==!1&&d()}):d()}function l(){const{onClose:u}=e;u?Promise.resolve(u()).then(f=>{f!==!1&&d()}):d()}function a(u){const{onMaskClick:f,maskClosable:p}=e;f&&(f(u),p&&d())}function s(){const{onEsc:u}=e;u&&u()}function d(){o.value=!1}function c(u){o.value=u}return{show:o,hide:d,handleUpdateShow:c,handleAfterLeave:t,handleCloseClick:l,handleNegativeClick:n,handlePositiveClick:r,handleMaskClick:a,handleEsc:s}},render(){const{handlePositiveClick:e,handleUpdateShow:o,handleNegativeClick:t,handleCloseClick:r,handleAfterLeave:n,handleMaskClick:l,handleEsc:a,to:s,maskClosable:d,show:c}=this;return i($p,{show:c,onUpdateShow:o,onMaskClick:l,onEsc:a,to:s,maskClosable:d,onAfterEnter:this.onAfterEnter,onAfterLeave:n,closeOnEsc:this.closeOnEsc,blockScroll:this.blockScroll,autoFocus:this.autoFocus,transformOrigin:this.transformOrigin,internalAppear:!0,internalDialog:!0},{default:()=>i(ma,Object.assign({},go(this.$props,ga),{style:this.internalStyle,onClose:r,onNegativeClick:t,onPositiveClick:e}))})}}),kp={injectionKey:String,to:[String,Object]},w1=q({name:"DialogProvider",props:kp,setup(){const e=D([]),o={};function t(s={}){const d=it(),c=Wi(Object.assign(Object.assign({},s),{key:d,destroy:()=>{o[`n-dialog-${d}`].hide()}}));return e.value.push(c),c}const r=["info","success","warning","error"].map(s=>d=>t(Object.assign(Object.assign({},d),{type:s})));function n(s){const{value:d}=e;d.splice(d.findIndex(c=>c.key===s),1)}function l(){Object.values(o).forEach(s=>{s.hide()})}const a={create:t,destroyAll:l,info:r[0],success:r[1],warning:r[2],error:r[3]};return Oe(xa,a),Oe(ba,{clickedRef:Vi(64),clickPositionRef:Ui()}),Oe(gp,e),Object.assign(Object.assign({},a),{dialogList:e,dialogInstRefs:o,handleAfterLeave:n})},render(){var e,o;return i(ao,null,[this.dialogList.map(t=>i(Pp,_t(t,["destroy","style"],{internalStyle:t.style,to:this.to,ref:r=>{r===null?delete this.dialogInstRefs[`n-dialog-${t.key}`]:this.dialogInstRefs[`n-dialog-${t.key}`]=r},internalKey:t.key,onInternalAfterLeave:this.handleAfterLeave}))),(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e)])}});function S1(){const e=Se(xa,null);return e===null&&Eo("use-dialog","No outer founded."),e}const ya=e=>{const{textColor1:o,dividerColor:t,fontWeightStrong:r}=e;return{textColor:o,color:t,fontWeight:r}},Ip={name:"Divider",common:Le,self:ya},Bp=Ip,Tp={name:"Divider",common:fe,self:ya},Fp=Tp,Op=g("divider",` + position: relative; + display: flex; + width: 100%; + box-sizing: border-box; + font-size: 16px; + color: var(--n-text-color); + transition: + color .3s var(--n-bezier), + background-color .3s var(--n-bezier); +`,[je("vertical",` + margin-top: 24px; + margin-bottom: 24px; + `,[je("no-title",` + display: flex; + align-items: center; + `)]),y("title",` + display: flex; + align-items: center; + margin-left: 12px; + margin-right: 12px; + white-space: nowrap; + font-weight: var(--n-font-weight); + `),P("title-position-left",[y("line",[P("left",{width:"28px"})])]),P("title-position-right",[y("line",[P("right",{width:"28px"})])]),P("dashed",[y("line",` + background-color: #0000; + height: 0px; + width: 100%; + border-style: dashed; + border-width: 1px 0 0; + `)]),P("vertical",` + display: inline-block; + height: 1em; + margin: 0 8px; + vertical-align: middle; + width: 1px; + `),y("line",` + border: none; + transition: background-color .3s var(--n-bezier), border-color .3s var(--n-bezier); + height: 1px; + width: 100%; + margin: 0; + `),je("dashed",[y("line",{backgroundColor:"var(--n-color)"})]),P("dashed",[y("line",{borderColor:"var(--n-color)"})]),P("vertical",{backgroundColor:"var(--n-color)"})]),Mp=Object.assign(Object.assign({},ne.props),{titlePlacement:{type:String,default:"center"},dashed:Boolean,vertical:Boolean}),z1=q({name:"Divider",props:Mp,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Divider","-divider",Op,Bp,e,o),n=R(()=>{const{common:{cubicBezierEaseInOut:a},self:{color:s,textColor:d,fontWeight:c}}=r.value;return{"--n-bezier":a,"--n-color":s,"--n-text-color":d,"--n-font-weight":c}}),l=t?Ae("divider",void 0,n,e):void 0;return{mergedClsPrefix:o,cssVars:t?void 0:n,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e;const{$slots:o,titlePlacement:t,vertical:r,dashed:n,cssVars:l,mergedClsPrefix:a}=this;return(e=this.onRender)===null||e===void 0||e.call(this),i("div",{role:"separator",class:[`${a}-divider`,this.themeClass,{[`${a}-divider--vertical`]:r,[`${a}-divider--no-title`]:!o.default,[`${a}-divider--dashed`]:n,[`${a}-divider--title-position-${t}`]:o.default&&t}],style:l},r?null:i("div",{class:`${a}-divider__line ${a}-divider__line--left`}),!r&&o.default?i(ao,null,i("div",{class:`${a}-divider__title`},this.$slots),i("div",{class:`${a}-divider__line ${a}-divider__line--right`})):null)}}),wa=e=>{const{modalColor:o,textColor1:t,textColor2:r,boxShadow3:n,lineHeight:l,fontWeightStrong:a,dividerColor:s,closeColorHover:d,closeColorPressed:c,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:p,borderRadius:v,primaryColorHover:h}=e;return{bodyPadding:"16px 24px",headerPadding:"16px 24px",footerPadding:"16px 24px",color:o,textColor:r,titleTextColor:t,titleFontSize:"18px",titleFontWeight:a,boxShadow:n,lineHeight:l,headerBorderBottom:`1px solid ${s}`,footerBorderTop:`1px solid ${s}`,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:p,closeSize:"22px",closeIconSize:"18px",closeColorHover:d,closeColorPressed:c,closeBorderRadius:v,resizableTriggerColorHover:h}},_p={name:"Drawer",common:Le,peers:{Scrollbar:Mr},self:wa},Dp=_p,Lp={name:"Drawer",common:fe,peers:{Scrollbar:zo},self:wa},Hp=Lp,Ap=q({name:"NDrawerContent",inheritAttrs:!1,props:{blockScroll:Boolean,show:{type:Boolean,default:void 0},displayDirective:{type:String,required:!0},placement:{type:String,required:!0},contentStyle:[Object,String],nativeScrollbar:{type:Boolean,required:!0},scrollbarProps:Object,trapFocus:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},showMask:{type:[Boolean,String],required:!0},resizable:Boolean,onClickoutside:Function,onAfterLeave:Function,onAfterEnter:Function,onEsc:Function},setup(e){const o=D(!!e.show),t=D(null),r=Se(bn);let n=0,l="",a=null;const s=D(!1),d=D(!1),c=R(()=>e.placement==="top"||e.placement==="bottom"),{mergedClsPrefixRef:u,mergedRtlRef:f}=ke(e),p=to("Drawer",f,u),v=w=>{d.value=!0,n=c.value?w.clientY:w.clientX,l=document.body.style.cursor,document.body.style.cursor=c.value?"ns-resize":"ew-resize",document.body.addEventListener("mousemove",S),document.body.addEventListener("mouseleave",T),document.body.addEventListener("mouseup",B)},h=()=>{a!==null&&(window.clearTimeout(a),a=null),d.value?s.value=!0:a=window.setTimeout(()=>{s.value=!0},300)},m=()=>{a!==null&&(window.clearTimeout(a),a=null),s.value=!1},{doUpdateHeight:b,doUpdateWidth:x}=r,S=w=>{var O,k;if(d.value)if(c.value){let $=((O=t.value)===null||O===void 0?void 0:O.offsetHeight)||0;const L=n-w.clientY;$+=e.placement==="bottom"?L:-L,b($),n=w.clientY}else{let $=((k=t.value)===null||k===void 0?void 0:k.offsetWidth)||0;const L=n-w.clientX;$+=e.placement==="right"?L:-L,x($),n=w.clientX}},B=()=>{d.value&&(n=0,d.value=!1,document.body.style.cursor=l,document.body.removeEventListener("mousemove",S),document.body.removeEventListener("mouseup",B),document.body.removeEventListener("mouseleave",T))},T=B;oo(()=>{e.show&&(o.value=!0)}),Ke(()=>e.show,w=>{w||B()}),wo(()=>{B()});const z=R(()=>{const{show:w}=e,O=[[Go,w]];return e.showMask||O.push([Ft,e.onClickoutside,void 0,{capture:!0}]),O});function I(){var w;o.value=!1,(w=e.onAfterLeave)===null||w===void 0||w.call(e)}return il(R(()=>e.blockScroll&&o.value)),Oe(cr,t),Oe(Dt,null),Oe(dr,null),{bodyRef:t,rtlEnabled:p,mergedClsPrefix:r.mergedClsPrefixRef,isMounted:r.isMountedRef,mergedTheme:r.mergedThemeRef,displayed:o,transitionName:R(()=>({right:"slide-in-from-right-transition",left:"slide-in-from-left-transition",top:"slide-in-from-top-transition",bottom:"slide-in-from-bottom-transition"})[e.placement]),handleAfterLeave:I,bodyDirectives:z,handleMousedownResizeTrigger:v,handleMouseenterResizeTrigger:h,handleMouseleaveResizeTrigger:m,isDragging:d,isHoverOnResizeTrigger:s}},render(){const{$slots:e,mergedClsPrefix:o}=this;return this.displayDirective==="show"||this.displayed||this.show?Lo(i("div",{role:"none"},i(hn,{disabled:!this.showMask||!this.trapFocus,active:this.show,autoFocus:this.autoFocus,onEsc:this.onEsc},{default:()=>i(no,{name:this.transitionName,appear:this.isMounted,onAfterEnter:this.onAfterEnter,onAfterLeave:this.handleAfterLeave},{default:()=>Lo(i("div",ko(this.$attrs,{role:"dialog",ref:"bodyRef","aria-modal":"true",class:[`${o}-drawer`,this.rtlEnabled&&`${o}-drawer--rtl`,`${o}-drawer--${this.placement}-placement`,this.isDragging&&`${o}-drawer--unselectable`,this.nativeScrollbar&&`${o}-drawer--native-scrollbar`]}),[this.resizable?i("div",{class:[`${o}-drawer__resize-trigger`,(this.isDragging||this.isHoverOnResizeTrigger)&&`${o}-drawer__resize-trigger--hover`],onMouseenter:this.handleMouseenterResizeTrigger,onMouseleave:this.handleMouseleaveResizeTrigger,onMousedown:this.handleMousedownResizeTrigger}):null,this.nativeScrollbar?i("div",{class:`${o}-drawer-content-wrapper`,style:this.contentStyle,role:"none"},e):i(ur,Object.assign({},this.scrollbarProps,{contentStyle:this.contentStyle,contentClass:`${o}-drawer-content-wrapper`,theme:this.mergedTheme.peers.Scrollbar,themeOverrides:this.mergedTheme.peerOverrides.Scrollbar}),e)]),this.bodyDirectives)})})),[[Go,this.displayDirective==="if"||this.displayed||this.show]]):null}}),{cubicBezierEaseIn:Ep,cubicBezierEaseOut:jp}=So;function Wp({duration:e="0.3s",leaveDuration:o="0.2s",name:t="slide-in-from-right"}={}){return[C(`&.${t}-transition-leave-active`,{transition:`transform ${o} ${Ep}`}),C(`&.${t}-transition-enter-active`,{transition:`transform ${e} ${jp}`}),C(`&.${t}-transition-enter-to`,{transform:"translateX(0)"}),C(`&.${t}-transition-enter-from`,{transform:"translateX(100%)"}),C(`&.${t}-transition-leave-from`,{transform:"translateX(0)"}),C(`&.${t}-transition-leave-to`,{transform:"translateX(100%)"})]}const{cubicBezierEaseIn:Np,cubicBezierEaseOut:Vp}=So;function Up({duration:e="0.3s",leaveDuration:o="0.2s",name:t="slide-in-from-left"}={}){return[C(`&.${t}-transition-leave-active`,{transition:`transform ${o} ${Np}`}),C(`&.${t}-transition-enter-active`,{transition:`transform ${e} ${Vp}`}),C(`&.${t}-transition-enter-to`,{transform:"translateX(0)"}),C(`&.${t}-transition-enter-from`,{transform:"translateX(-100%)"}),C(`&.${t}-transition-leave-from`,{transform:"translateX(0)"}),C(`&.${t}-transition-leave-to`,{transform:"translateX(-100%)"})]}const{cubicBezierEaseIn:Kp,cubicBezierEaseOut:Gp}=So;function qp({duration:e="0.3s",leaveDuration:o="0.2s",name:t="slide-in-from-top"}={}){return[C(`&.${t}-transition-leave-active`,{transition:`transform ${o} ${Kp}`}),C(`&.${t}-transition-enter-active`,{transition:`transform ${e} ${Gp}`}),C(`&.${t}-transition-enter-to`,{transform:"translateY(0)"}),C(`&.${t}-transition-enter-from`,{transform:"translateY(-100%)"}),C(`&.${t}-transition-leave-from`,{transform:"translateY(0)"}),C(`&.${t}-transition-leave-to`,{transform:"translateY(-100%)"})]}const{cubicBezierEaseIn:Yp,cubicBezierEaseOut:Xp}=So;function Zp({duration:e="0.3s",leaveDuration:o="0.2s",name:t="slide-in-from-bottom"}={}){return[C(`&.${t}-transition-leave-active`,{transition:`transform ${o} ${Yp}`}),C(`&.${t}-transition-enter-active`,{transition:`transform ${e} ${Xp}`}),C(`&.${t}-transition-enter-to`,{transform:"translateY(0)"}),C(`&.${t}-transition-enter-from`,{transform:"translateY(100%)"}),C(`&.${t}-transition-leave-from`,{transform:"translateY(0)"}),C(`&.${t}-transition-leave-to`,{transform:"translateY(100%)"})]}const Qp=C([g("drawer",` + word-break: break-word; + line-height: var(--n-line-height); + position: absolute; + pointer-events: all; + box-shadow: var(--n-box-shadow); + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + background-color: var(--n-color); + color: var(--n-text-color); + box-sizing: border-box; + `,[Wp(),Up(),qp(),Zp(),P("unselectable",` + user-select: none; + -webkit-user-select: none; + `),P("native-scrollbar",[g("drawer-content-wrapper",` + overflow: auto; + height: 100%; + `)]),y("resize-trigger",` + position: absolute; + background-color: #0000; + transition: background-color .3s var(--n-bezier); + `,[P("hover",` + background-color: var(--n-resize-trigger-color-hover); + `)]),g("drawer-content-wrapper",` + box-sizing: border-box; + `),g("drawer-content",` + height: 100%; + display: flex; + flex-direction: column; + `,[P("native-scrollbar",[g("drawer-body-content-wrapper",` + height: 100%; + overflow: auto; + `)]),g("drawer-body",` + flex: 1 0 0; + overflow: hidden; + `),g("drawer-body-content-wrapper",` + box-sizing: border-box; + padding: var(--n-body-padding); + `),g("drawer-header",` + font-weight: var(--n-title-font-weight); + line-height: 1; + font-size: var(--n-title-font-size); + color: var(--n-title-text-color); + padding: var(--n-header-padding); + transition: border .3s var(--n-bezier); + border-bottom: 1px solid var(--n-divider-color); + border-bottom: var(--n-header-border-bottom); + display: flex; + justify-content: space-between; + align-items: center; + `,[y("close",` + margin-left: 6px; + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + `)]),g("drawer-footer",` + display: flex; + justify-content: flex-end; + border-top: var(--n-footer-border-top); + transition: border .3s var(--n-bezier); + padding: var(--n-footer-padding); + `)]),P("right-placement",` + top: 0; + bottom: 0; + right: 0; + `,[y("resize-trigger",` + width: 3px; + height: 100%; + top: 0; + left: 0; + transform: translateX(-1.5px); + cursor: ew-resize; + `)]),P("left-placement",` + top: 0; + bottom: 0; + left: 0; + `,[y("resize-trigger",` + width: 3px; + height: 100%; + top: 0; + right: 0; + transform: translateX(1.5px); + cursor: ew-resize; + `)]),P("top-placement",` + top: 0; + left: 0; + right: 0; + `,[y("resize-trigger",` + width: 100%; + height: 3px; + bottom: 0; + left: 0; + transform: translateY(1.5px); + cursor: ns-resize; + `)]),P("bottom-placement",` + left: 0; + bottom: 0; + right: 0; + `,[y("resize-trigger",` + width: 100%; + height: 3px; + top: 0; + left: 0; + transform: translateY(-1.5px); + cursor: ns-resize; + `)])]),C("body",[C(">",[g("drawer-container",{position:"fixed"})])]),g("drawer-container",` + position: relative; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + pointer-events: none; + `,[C("> *",{pointerEvents:"all"})]),g("drawer-mask",` + background-color: rgba(0, 0, 0, .3); + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + `,[P("invisible",` + background-color: rgba(0, 0, 0, 0) + `),Mt({enterDuration:"0.2s",leaveDuration:"0.2s",enterCubicBezier:"var(--n-bezier-in)",leaveCubicBezier:"var(--n-bezier-out)"})])]),Jp=Object.assign(Object.assign({},ne.props),{show:Boolean,width:[Number,String],height:[Number,String],placement:{type:String,default:"right"},maskClosable:{type:Boolean,default:!0},showMask:{type:[Boolean,String],default:!0},to:[String,Object],displayDirective:{type:String,default:"if"},nativeScrollbar:{type:Boolean,default:!0},zIndex:Number,onMaskClick:Function,scrollbarProps:Object,contentStyle:[Object,String],trapFocus:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!0},resizable:Boolean,defaultWidth:{type:[Number,String],default:251},defaultHeight:{type:[Number,String],default:251},onUpdateWidth:[Function,Array],onUpdateHeight:[Function,Array],"onUpdate:width":[Function,Array],"onUpdate:height":[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onAfterEnter:Function,onAfterLeave:Function,drawerStyle:[String,Object],drawerClass:String,target:null,onShow:Function,onHide:Function}),$1=q({name:"Drawer",inheritAttrs:!1,props:Jp,setup(e){const{mergedClsPrefixRef:o,namespaceRef:t,inlineThemeDisabled:r}=ke(e),n=Ct(),l=ne("Drawer","-drawer",Qp,Dp,e,o),a=D(e.defaultWidth),s=D(e.defaultHeight),d=so(le(e,"width"),a),c=so(le(e,"height"),s),u=R(()=>{const{placement:z}=e;return z==="top"||z==="bottom"?"":eo(d.value)}),f=R(()=>{const{placement:z}=e;return z==="left"||z==="right"?"":eo(c.value)}),p=z=>{const{onUpdateWidth:I,"onUpdate:width":w}=e;I&&ae(I,z),w&&ae(w,z),a.value=z},v=z=>{const{onUpdateHeight:I,"onUpdate:width":w}=e;I&&ae(I,z),w&&ae(w,z),s.value=z},h=R(()=>[{width:u.value,height:f.value},e.drawerStyle||""]);function m(z){const{onMaskClick:I,maskClosable:w}=e;w&&S(!1),I&&I(z)}const b=ll();function x(z){var I;(I=e.onEsc)===null||I===void 0||I.call(e),e.show&&e.closeOnEsc&&Ji(z)&&!b.value&&S(!1)}function S(z){const{onHide:I,onUpdateShow:w,"onUpdate:show":O}=e;w&&ae(w,z),O&&ae(O,z),I&&!z&&ae(I,z)}Oe(bn,{isMountedRef:n,mergedThemeRef:l,mergedClsPrefixRef:o,doUpdateShow:S,doUpdateHeight:v,doUpdateWidth:p});const B=R(()=>{const{common:{cubicBezierEaseInOut:z,cubicBezierEaseIn:I,cubicBezierEaseOut:w},self:{color:O,textColor:k,boxShadow:$,lineHeight:L,headerPadding:M,footerPadding:j,bodyPadding:E,titleFontSize:U,titleTextColor:_,titleFontWeight:V,headerBorderBottom:te,footerBorderTop:N,closeIconColor:G,closeIconColorHover:Ce,closeIconColorPressed:X,closeColorHover:ve,closeColorPressed:he,closeIconSize:be,closeSize:me,closeBorderRadius:se,resizableTriggerColorHover:Re}}=l.value;return{"--n-line-height":L,"--n-color":O,"--n-text-color":k,"--n-box-shadow":$,"--n-bezier":z,"--n-bezier-out":w,"--n-bezier-in":I,"--n-header-padding":M,"--n-body-padding":E,"--n-footer-padding":j,"--n-title-text-color":_,"--n-title-font-size":U,"--n-title-font-weight":V,"--n-header-border-bottom":te,"--n-footer-border-top":N,"--n-close-icon-color":G,"--n-close-icon-color-hover":Ce,"--n-close-icon-color-pressed":X,"--n-close-size":me,"--n-close-color-hover":ve,"--n-close-color-pressed":he,"--n-close-icon-size":be,"--n-close-border-radius":se,"--n-resize-trigger-color-hover":Re}}),T=r?Ae("drawer",void 0,B,e):void 0;return{mergedClsPrefix:o,namespace:t,mergedBodyStyle:h,handleMaskClick:m,handleEsc:x,mergedTheme:l,cssVars:r?void 0:B,themeClass:T==null?void 0:T.themeClass,onRender:T==null?void 0:T.onRender,isMounted:n}},render(){const{mergedClsPrefix:e}=this;return i(pn,{to:this.to,show:this.show},{default:()=>{var o;return(o=this.onRender)===null||o===void 0||o.call(this),Lo(i("div",{class:[`${e}-drawer-container`,this.namespace,this.themeClass],style:this.cssVars,role:"none"},this.showMask?i(no,{name:"fade-in-transition",appear:this.isMounted},{default:()=>this.show?i("div",{"aria-hidden":!0,class:[`${e}-drawer-mask`,this.showMask==="transparent"&&`${e}-drawer-mask--invisible`],onClick:this.handleMaskClick}):null}):null,i(Ap,Object.assign({},this.$attrs,{class:[this.drawerClass,this.$attrs.class],style:[this.mergedBodyStyle,this.$attrs.style],blockScroll:this.blockScroll,contentStyle:this.contentStyle,placement:this.placement,scrollbarProps:this.scrollbarProps,show:this.show,displayDirective:this.displayDirective,nativeScrollbar:this.nativeScrollbar,onAfterEnter:this.onAfterEnter,onAfterLeave:this.onAfterLeave,trapFocus:this.trapFocus,autoFocus:this.autoFocus,resizable:this.resizable,showMask:this.showMask,onEsc:this.handleEsc,onClickoutside:this.handleMaskClick}),this.$slots)),[[Tr,{zIndex:this.zIndex,enabled:this.show}]])}})}}),ev={title:{type:String},headerStyle:[Object,String],footerStyle:[Object,String],bodyStyle:[Object,String],bodyContentStyle:[Object,String],nativeScrollbar:{type:Boolean,default:!0},scrollbarProps:Object,closable:Boolean},R1=q({name:"DrawerContent",props:ev,setup(){const e=Se(bn,null);e||Eo("drawer-content","`n-drawer-content` must be placed inside `n-drawer`.");const{doUpdateShow:o}=e;function t(){o(!1)}return{handleCloseClick:t,mergedTheme:e.mergedThemeRef,mergedClsPrefix:e.mergedClsPrefixRef}},render(){const{title:e,mergedClsPrefix:o,nativeScrollbar:t,mergedTheme:r,bodyStyle:n,bodyContentStyle:l,headerStyle:a,footerStyle:s,scrollbarProps:d,closable:c,$slots:u}=this;return i("div",{role:"none",class:[`${o}-drawer-content`,t&&`${o}-drawer-content--native-scrollbar`]},u.header||e||c?i("div",{class:`${o}-drawer-header`,style:a,role:"none"},i("div",{class:`${o}-drawer-header__main`,role:"heading","aria-level":"1"},u.header!==void 0?u.header():e),c&&i(St,{onClick:this.handleCloseClick,clsPrefix:o,class:`${o}-drawer-header__close`,absolute:!0})):null,t?i("div",{class:`${o}-drawer-body`,style:n,role:"none"},i("div",{class:`${o}-drawer-body-content-wrapper`,style:l,role:"none"},u)):i(ur,Object.assign({themeOverrides:r.peerOverrides.Scrollbar,theme:r.peers.Scrollbar},d,{class:`${o}-drawer-body`,contentClass:`${o}-drawer-body-content-wrapper`,contentStyle:l}),u),u.footer?i("div",{class:`${o}-drawer-footer`,style:s,role:"none"},u.footer()):null)}}),Sa={actionMargin:"0 0 0 20px",actionMarginRtl:"0 20px 0 0"},ov={name:"DynamicInput",common:fe,peers:{Input:Ho,Button:$o},self(){return Sa}},tv=ov,rv=()=>Sa,nv={name:"DynamicInput",common:Le,peers:{Input:pr,Button:Wt},self:rv},iv=nv,Bn="n-dynamic-input",lv=q({name:"DynamicInputInputPreset",props:{clsPrefix:{type:String,required:!0},value:{type:String,default:""},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(){const{mergedThemeRef:e,placeholderRef:o}=Se(Bn);return{mergedTheme:e,placeholder:o}},render(){const{mergedTheme:e,placeholder:o,value:t,clsPrefix:r,onUpdateValue:n,disabled:l}=this;return i("div",{class:`${r}-dynamic-input-preset-input`},i(xt,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:t,placeholder:o,onUpdateValue:n,disabled:l}))}}),av=q({name:"DynamicInputPairPreset",props:{clsPrefix:{type:String,required:!0},value:{type:Object,default:()=>({key:"",value:""})},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(e){const{mergedThemeRef:o,keyPlaceholderRef:t,valuePlaceholderRef:r}=Se(Bn);return{mergedTheme:o,keyPlaceholder:t,valuePlaceholder:r,handleKeyInput(n){e.onUpdateValue({key:n,value:e.value.value})},handleValueInput(n){e.onUpdateValue({key:e.value.key,value:n})}}},render(){const{mergedTheme:e,keyPlaceholder:o,valuePlaceholder:t,value:r,clsPrefix:n,disabled:l}=this;return i("div",{class:`${n}-dynamic-input-preset-pair`},i(xt,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:r.key,class:`${n}-dynamic-input-pair-input`,placeholder:o,onUpdateValue:this.handleKeyInput,disabled:l}),i(xt,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:r.value,class:`${n}-dynamic-input-pair-input`,placeholder:t,onUpdateValue:this.handleValueInput,disabled:l}))}}),sv=g("dynamic-input",{width:"100%"},[g("dynamic-input-item",` + margin-bottom: 10px; + display: flex; + flex-wrap: nowrap; + `,[g("dynamic-input-preset-input",{flex:1,alignItems:"center"}),g("dynamic-input-preset-pair",` + flex: 1; + display: flex; + align-items: center; + `,[g("dynamic-input-pair-input",[C("&:first-child",{"margin-right":"12px"})])]),y("action",` + align-self: flex-start; + display: flex; + justify-content: flex-end; + flex-shrink: 0; + flex-grow: 0; + margin: var(--action-margin); + `,[P("icon",{cursor:"pointer"})]),C("&:last-child",{marginBottom:0})]),g("form-item",` + padding-top: 0 !important; + margin-right: 0 !important; + `,[g("form-item-blank",{paddingTop:"0 !important"})])]),xr=new WeakMap,dv=Object.assign(Object.assign({},ne.props),{max:Number,min:{type:Number,default:0},value:Array,defaultValue:{type:Array,default:()=>[]},preset:{type:String,default:"input"},keyField:String,itemStyle:[String,Object],keyPlaceholder:{type:String,default:""},valuePlaceholder:{type:String,default:""},placeholder:{type:String,default:""},disabled:Boolean,showSortButton:Boolean,createButtonProps:Object,onCreate:Function,onRemove:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClear:Function,onInput:[Function,Array]}),P1=q({name:"DynamicInput",props:dv,setup(e,{slots:o}){const{mergedComponentPropsRef:t,mergedClsPrefixRef:r,mergedRtlRef:n,inlineThemeDisabled:l}=ke(),a=Se($r,null),s=D(e.defaultValue),d=le(e,"value"),c=so(d,s),u=ne("DynamicInput","-dynamic-input",sv,iv,e,r),f=R(()=>{const{value:k}=c;if(Array.isArray(k)){const{max:$}=e;return $!==void 0&&k.length>=$}return!1}),p=R(()=>{const{value:k}=c;return Array.isArray(k)?k.length<=e.min:!0}),v=R(()=>{var k,$;return($=(k=t==null?void 0:t.value)===null||k===void 0?void 0:k.DynamicInput)===null||$===void 0?void 0:$.buttonSize});function h(k){const{onInput:$,"onUpdate:value":L,onUpdateValue:M}=e;$&&ae($,k),L&&ae(L,k),M&&ae(M,k),s.value=k}function m(k,$){if(k==null||typeof k!="object")return $;const L=Nr(k)?Vr(k):k;let M=xr.get(L);return M===void 0&&xr.set(L,M=it()),M}function b(k,$){const{value:L}=c,M=Array.from(L??[]),j=M[k];if(M[k]=$,j&&$&&typeof j=="object"&&typeof $=="object"){const E=Nr(j)?Vr(j):j,U=Nr($)?Vr($):$,_=xr.get(E);_!==void 0&&xr.set(U,_)}h(M)}function x(){S(-1)}function S(k){const{value:$}=c,{onCreate:L}=e,M=Array.from($??[]);if(L)M.splice(k+1,0,L(k+1)),h(M);else if(o.default)M.splice(k+1,0,null),h(M);else switch(e.preset){case"input":M.splice(k+1,0,""),h(M);break;case"pair":M.splice(k+1,0,{key:"",value:""}),h(M);break}}function B(k){const{value:$}=c;if(!Array.isArray($))return;const{min:L}=e;if($.length<=L)return;const{onRemove:M}=e;M&&M(k);const j=Array.from($);j.splice(k,1),h(j)}function T(k,$,L){if($<0||L<0||$>=k.length||L>=k.length||$===L)return;const M=k[$];k[$]=k[L],k[L]=M}function z(k,$){const{value:L}=c;if(!Array.isArray(L))return;const M=Array.from(L);k==="up"&&T(M,$,$-1),k==="down"&&T(M,$,$+1),h(M)}Oe(Bn,{mergedThemeRef:u,keyPlaceholderRef:le(e,"keyPlaceholder"),valuePlaceholderRef:le(e,"valuePlaceholder"),placeholderRef:le(e,"placeholder")});const I=to("DynamicInput",n,r),w=R(()=>{const{self:{actionMargin:k,actionMarginRtl:$}}=u.value;return{"--action-margin":k,"--action-margin-rtl":$}}),O=l?Ae("dynamic-input",void 0,w,e):void 0;return{locale:Xo("DynamicInput").localeRef,rtlEnabled:I,buttonSize:v,mergedClsPrefix:r,NFormItem:a,uncontrolledValue:s,mergedValue:c,insertionDisabled:f,removeDisabled:p,handleCreateClick:x,ensureKey:m,handleValueChange:b,remove:B,move:z,createItem:S,mergedTheme:u,cssVars:l?void 0:w,themeClass:O==null?void 0:O.themeClass,onRender:O==null?void 0:O.onRender}},render(){const{$slots:e,buttonSize:o,mergedClsPrefix:t,mergedValue:r,locale:n,mergedTheme:l,keyField:a,itemStyle:s,preset:d,showSortButton:c,NFormItem:u,ensureKey:f,handleValueChange:p,remove:v,createItem:h,move:m,onRender:b,disabled:x}=this;return b==null||b(),i("div",{class:[`${t}-dynamic-input`,this.rtlEnabled&&`${t}-dynamic-input--rtl`,this.themeClass],style:this.cssVars},!Array.isArray(r)||r.length===0?i(Po,Object.assign({block:!0,ghost:!0,dashed:!0,size:o},this.createButtonProps,{disabled:this.insertionDisabled||x,theme:l.peers.Button,themeOverrides:l.peerOverrides.Button,onClick:this.handleCreateClick}),{default:()=>lo(e["create-button-default"],()=>[n.create]),icon:()=>lo(e["create-button-icon"],()=>[i(De,{clsPrefix:t},{default:()=>i(tr,null)})])}):r.map((S,B)=>i("div",{key:a?S[a]:f(S,B),"data-key":a?S[a]:f(S,B),class:`${t}-dynamic-input-item`,style:s},an(e.default,{value:r[B],index:B},()=>[d==="input"?i(lv,{disabled:x,clsPrefix:t,value:r[B],parentPath:u?u.path.value:void 0,path:u!=null&&u.path.value?`${u.path.value}[${B}]`:void 0,onUpdateValue:T=>{p(B,T)}}):d==="pair"?i(av,{disabled:x,clsPrefix:t,value:r[B],parentPath:u?u.path.value:void 0,path:u!=null&&u.path.value?`${u.path.value}[${B}]`:void 0,onUpdateValue:T=>{p(B,T)}}):null]),an(e.action,{value:r[B],index:B,create:h,remove:v,move:m},()=>[i("div",{class:`${t}-dynamic-input-item__action`},i(ff,{size:o},{default:()=>[i(Po,{disabled:this.removeDisabled||x,theme:l.peers.Button,themeOverrides:l.peerOverrides.Button,circle:!0,onClick:()=>{v(B)}},{icon:()=>i(De,{clsPrefix:t},{default:()=>i(cl,null)})}),i(Po,{disabled:this.insertionDisabled||x,circle:!0,theme:l.peers.Button,themeOverrides:l.peerOverrides.Button,onClick:()=>{h(B)}},{icon:()=>i(De,{clsPrefix:t},{default:()=>i(tr,null)})}),c?i(Po,{disabled:B===0||x,circle:!0,theme:l.peers.Button,themeOverrides:l.peerOverrides.Button,onClick:()=>{m("up",B)}},{icon:()=>i(De,{clsPrefix:t},{default:()=>i(Ed,null)})}):null,c?i(Po,{disabled:B===r.length-1||x,circle:!0,theme:l.peers.Button,themeOverrides:l.peerOverrides.Button,onClick:()=>{m("down",B)}},{icon:()=>i(De,{clsPrefix:t},{default:()=>i(Ad,null)})}):null]}))]))))}}),za={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},cv={name:"Space",self(){return za}},$a=cv,uv=()=>za,fv={name:"Space",self:uv},hv=fv;let Jr;const pv=()=>{if(!jo)return!0;if(Jr===void 0){const e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e);const o=e.scrollHeight===1;return document.body.removeChild(e),Jr=o}return Jr},vv=Object.assign(Object.assign({},ne.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,size:{type:[String,Number,Array],default:"medium"},wrapItem:{type:Boolean,default:!0},itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),k1=q({name:"Space",props:vv,setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:t}=ke(e),r=ne("Space","-space",void 0,hv,e,o),n=to("Space",t,o);return{useGap:pv(),rtlEnabled:n,mergedClsPrefix:o,margin:R(()=>{const{size:l}=e;if(Array.isArray(l))return{horizontal:l[0],vertical:l[1]};if(typeof l=="number")return{horizontal:l,vertical:l};const{self:{[W("gap",l)]:a}}=r.value,{row:s,col:d}=Qs(a);return{horizontal:Mo(d),vertical:Mo(s)}})}},render(){const{vertical:e,align:o,inline:t,justify:r,itemStyle:n,margin:l,wrap:a,mergedClsPrefix:s,rtlEnabled:d,useGap:c,wrapItem:u,internalUseGap:f}=this,p=tt(vn(this));if(!p.length)return null;const v=`${l.horizontal}px`,h=`${l.horizontal/2}px`,m=`${l.vertical}px`,b=`${l.vertical/2}px`,x=p.length-1,S=r.startsWith("space-");return i("div",{role:"none",class:[`${s}-space`,d&&`${s}-space--rtl`],style:{display:t?"inline-flex":"flex",flexDirection:e?"column":"row",justifyContent:["start","end"].includes(r)?"flex-"+r:r,flexWrap:!a||e?"nowrap":"wrap",marginTop:c||e?"":`-${b}`,marginBottom:c||e?"":`-${b}`,alignItems:o,gap:c?`${l.vertical}px ${l.horizontal}px`:""}},!u&&(c||f)?p:p.map((B,T)=>i("div",{role:"none",style:[n,{maxWidth:"100%"},c?"":e?{marginBottom:T!==x?m:""}:d?{marginLeft:S?r==="space-between"&&T===x?"":h:T!==x?v:"",marginRight:S?r==="space-between"&&T===0?"":h:"",paddingTop:b,paddingBottom:b}:{marginRight:S?r==="space-between"&&T===x?"":h:T!==x?v:"",marginLeft:S?r==="space-between"&&T===0?"":h:"",paddingTop:b,paddingBottom:b}]},B)))}}),gv={name:"DynamicTags",common:fe,peers:{Input:Ho,Button:$o,Tag:Sl,Space:$a},self(){return{inputWidth:"64px"}}},mv=gv,bv={name:"Element",common:fe},xv=bv,Cv={feedbackPadding:"4px 0 0 2px",feedbackHeightSmall:"24px",feedbackHeightMedium:"24px",feedbackHeightLarge:"26px",feedbackFontSizeSmall:"13px",feedbackFontSizeMedium:"14px",feedbackFontSizeLarge:"14px",labelFontSizeLeftSmall:"14px",labelFontSizeLeftMedium:"14px",labelFontSizeLeftLarge:"15px",labelFontSizeTopSmall:"13px",labelFontSizeTopMedium:"14px",labelFontSizeTopLarge:"14px",labelHeightSmall:"24px",labelHeightMedium:"26px",labelHeightLarge:"28px",labelPaddingVertical:"0 0 6px 2px",labelPaddingHorizontal:"0 12px 0 0",labelTextAlignVertical:"left",labelTextAlignHorizontal:"right",labelFontWeight:"400"},Ra=e=>{const{heightSmall:o,heightMedium:t,heightLarge:r,textColor1:n,errorColor:l,warningColor:a,lineHeight:s,textColor3:d}=e;return Object.assign(Object.assign({},Cv),{blankHeightSmall:o,blankHeightMedium:t,blankHeightLarge:r,lineHeight:s,labelTextColor:n,asteriskColor:l,feedbackTextColorError:l,feedbackTextColorWarning:a,feedbackTextColor:d})},yv={name:"Form",common:Le,self:Ra},Pa=yv,wv={name:"Form",common:fe,self:Ra},Sv=wv,zv=g("form",[P("inline",` + width: 100%; + display: inline-flex; + align-items: flex-start; + align-content: space-around; + `,[g("form-item",{width:"auto",marginRight:"18px"},[C("&:last-child",{marginRight:0})])])]),vr="n-form",ka="n-form-item-insts";var $v=globalThis&&globalThis.__awaiter||function(e,o,t,r){function n(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function d(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?l(u.value):n(u.value).then(s,d)}c((r=r.apply(e,o||[])).next())})};const Rv=Object.assign(Object.assign({},ne.props),{inline:Boolean,labelWidth:[Number,String],labelAlign:String,labelPlacement:{type:String,default:"top"},model:{type:Object,default:()=>{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:e=>{e.preventDefault()}},showLabel:{type:Boolean,default:void 0},validateMessages:Object}),I1=q({name:"Form",props:Rv,setup(e){const{mergedClsPrefixRef:o}=ke(e);ne("Form","-form",zv,Pa,e,o);const t={},r=D(void 0),n=d=>{const c=r.value;(c===void 0||d>=c)&&(r.value=d)};function l(d,c=()=>!0){return $v(this,void 0,void 0,function*(){yield new Promise((u,f)=>{const p=[];for(const v of yo(t)){const h=t[v];for(const m of h)m.path&&p.push(m.internalValidate(null,c))}Promise.all(p).then(v=>{if(v.some(h=>!h.valid)){const h=v.filter(m=>m.errors).map(m=>m.errors);d&&d(h),f(h)}else d&&d(),u()})})})}function a(){for(const d of yo(t)){const c=t[d];for(const u of c)u.restoreValidation()}}return Oe(vr,{props:e,maxChildLabelWidthRef:r,deriveMaxChildLabelWidth:n}),Oe(ka,{formItems:t}),Object.assign({validate:l,restoreValidation:a},{mergedClsPrefix:o})},render(){const{mergedClsPrefix:e}=this;return i("form",{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function Pv(e){const o=Se(vr,null);return{mergedSize:R(()=>e.size!==void 0?e.size:(o==null?void 0:o.props.size)!==void 0?o.props.size:"medium")}}function kv(e){const o=Se(vr,null),t=R(()=>{const{labelPlacement:v}=e;return v!==void 0?v:o!=null&&o.props.labelPlacement?o.props.labelPlacement:"top"}),r=R(()=>t.value==="left"&&(e.labelWidth==="auto"||(o==null?void 0:o.props.labelWidth)==="auto")),n=R(()=>{if(t.value==="top")return;const{labelWidth:v}=e;if(v!==void 0&&v!=="auto")return eo(v);if(r.value){const h=o==null?void 0:o.maxChildLabelWidthRef.value;return h!==void 0?eo(h):void 0}if((o==null?void 0:o.props.labelWidth)!==void 0)return eo(o.props.labelWidth)}),l=R(()=>{const{labelAlign:v}=e;if(v)return v;if(o!=null&&o.props.labelAlign)return o.props.labelAlign}),a=R(()=>{var v;return[(v=e.labelProps)===null||v===void 0?void 0:v.style,e.labelStyle,{width:n.value}]}),s=R(()=>{const{showRequireMark:v}=e;return v!==void 0?v:o==null?void 0:o.props.showRequireMark}),d=R(()=>{const{requireMarkPlacement:v}=e;return v!==void 0?v:(o==null?void 0:o.props.requireMarkPlacement)||"right"}),c=D(!1),u=R(()=>{const{validationStatus:v}=e;if(v!==void 0)return v;if(c.value)return"error"}),f=R(()=>{const{showFeedback:v}=e;return v!==void 0?v:(o==null?void 0:o.props.showFeedback)!==void 0?o.props.showFeedback:!0}),p=R(()=>{const{showLabel:v}=e;return v!==void 0?v:(o==null?void 0:o.props.showLabel)!==void 0?o.props.showLabel:!0});return{validationErrored:c,mergedLabelStyle:a,mergedLabelPlacement:t,mergedLabelAlign:l,mergedShowRequireMark:s,mergedRequireMarkPlacement:d,mergedValidationStatus:u,mergedShowFeedback:f,mergedShowLabel:p,isAutoLabelWidth:r}}function Iv(e){const o=Se(vr,null),t=R(()=>{const{rulePath:a}=e;if(a!==void 0)return a;const{path:s}=e;if(s!==void 0)return s}),r=R(()=>{const a=[],{rule:s}=e;if(s!==void 0&&(Array.isArray(s)?a.push(...s):a.push(s)),o){const{rules:d}=o.props,{value:c}=t;if(d!==void 0&&c!==void 0){const u=Ki(d,c);u!==void 0&&(Array.isArray(u)?a.push(...u):a.push(u))}}return a}),n=R(()=>r.value.some(a=>a.required)),l=R(()=>n.value||e.required);return{mergedRules:r,mergedRequired:l}}const{cubicBezierEaseInOut:wi}=So;function Bv({name:e="fade-down",fromOffset:o="-4px",enterDuration:t=".3s",leaveDuration:r=".3s",enterCubicBezier:n=wi,leaveCubicBezier:l=wi}={}){return[C(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0,transform:`translateY(${o})`}),C(`&.${e}-transition-enter-to, &.${e}-transition-leave-from`,{opacity:1,transform:"translateY(0)"}),C(`&.${e}-transition-leave-active`,{transition:`opacity ${r} ${l}, transform ${r} ${l}`}),C(`&.${e}-transition-enter-active`,{transition:`opacity ${t} ${n}, transform ${t} ${n}`})]}const Tv=g("form-item",` + display: grid; + line-height: var(--n-line-height); +`,[g("form-item-label",` + grid-area: label; + align-items: center; + line-height: 1.25; + text-align: var(--n-label-text-align); + font-size: var(--n-label-font-size); + min-height: var(--n-label-height); + padding: var(--n-label-padding); + color: var(--n-label-text-color); + transition: color .3s var(--n-bezier); + box-sizing: border-box; + font-weight: var(--n-label-font-weight); + `,[y("asterisk",` + white-space: nowrap; + user-select: none; + -webkit-user-select: none; + color: var(--n-asterisk-color); + transition: color .3s var(--n-bezier); + `),y("asterisk-placeholder",` + grid-area: mark; + user-select: none; + -webkit-user-select: none; + visibility: hidden; + `)]),g("form-item-blank",` + grid-area: blank; + min-height: var(--n-blank-height); + `),P("auto-label-width",[g("form-item-label","white-space: nowrap;")]),P("left-labelled",` + grid-template-areas: + "label blank" + "label feedback"; + grid-template-columns: auto minmax(0, 1fr); + grid-template-rows: auto 1fr; + align-items: start; + `,[g("form-item-label",` + display: grid; + grid-template-columns: 1fr auto; + min-height: var(--n-blank-height); + height: auto; + box-sizing: border-box; + flex-shrink: 0; + flex-grow: 0; + `,[P("reverse-columns-space",` + grid-template-columns: auto 1fr; + `),P("left-mark",` + grid-template-areas: + "mark text" + ". text"; + `),P("right-mark",` + grid-template-areas: + "text mark" + "text ."; + `),P("right-hanging-mark",` + grid-template-areas: + "text mark" + "text ."; + `),y("text",` + grid-area: text; + `),y("asterisk",` + grid-area: mark; + align-self: end; + `)])]),P("top-labelled",` + grid-template-areas: + "label" + "blank" + "feedback"; + grid-template-rows: minmax(var(--n-label-height), auto) 1fr; + grid-template-columns: minmax(0, 100%); + `,[P("no-label",` + grid-template-areas: + "blank" + "feedback"; + grid-template-rows: 1fr; + `),g("form-item-label",` + display: flex; + align-items: flex-start; + justify-content: var(--n-label-text-align); + `)]),g("form-item-blank",` + box-sizing: border-box; + display: flex; + align-items: center; + position: relative; + `),g("form-item-feedback-wrapper",` + grid-area: feedback; + box-sizing: border-box; + min-height: var(--n-feedback-height); + font-size: var(--n-feedback-font-size); + line-height: 1.25; + transform-origin: top left; + `,[C("&:not(:empty)",` + padding: var(--n-feedback-padding); + `),g("form-item-feedback",{transition:"color .3s var(--n-bezier)",color:"var(--n-feedback-text-color)"},[P("warning",{color:"var(--n-feedback-text-color-warning)"}),P("error",{color:"var(--n-feedback-text-color-error)"}),Bv({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]);var Si=globalThis&&globalThis.__awaiter||function(e,o,t,r){function n(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function d(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?l(u.value):n(u.value).then(s,d)}c((r=r.apply(e,o||[])).next())})};const Tn=Object.assign(Object.assign({},ne.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,showLabel:{type:Boolean,default:void 0},labelProps:Object}),Fv=yo(Tn);function zi(e,o){return(...t)=>{try{const r=e(...t);return!o&&(typeof r=="boolean"||r instanceof Error||Array.isArray(r))||r!=null&&r.then?r:(r===void 0||qo("form-item/validate",`You return a ${typeof r} typed value in the validator method, which is not recommended. Please use `+(o?"`Promise`":"`boolean`, `Error` or `Promise`")+" typed value instead."),!0)}catch(r){qo("form-item/validate","An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation."),console.error(r);return}}}const Ov=q({name:"FormItem",props:Tn,setup(e){Id(ka,"formItems",le(e,"path"));const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=Se(vr,null),n=Pv(e),l=kv(e),{validationErrored:a}=l,{mergedRequired:s,mergedRules:d}=Iv(e),{mergedSize:c}=n,{mergedLabelPlacement:u,mergedLabelAlign:f,mergedRequireMarkPlacement:p}=l,v=D([]),h=D(it()),m=r?le(r.props,"disabled"):D(!1),b=ne("Form","-form-item",Tv,Pa,e,o);Ke(le(e,"path"),()=>{e.ignorePathChange||x()});function x(){v.value=[],a.value=!1,e.feedback&&(h.value=it())}function S(){w("blur")}function B(){w("change")}function T(){w("focus")}function z(){w("input")}function I(j,E){return Si(this,void 0,void 0,function*(){let U,_,V,te;typeof j=="string"?(U=j,_=E):j!==null&&typeof j=="object"&&(U=j.trigger,_=j.callback,V=j.shouldRuleBeApplied,te=j.options),yield new Promise((N,G)=>{w(U,V,te).then(({valid:Ce,errors:X})=>{Ce?(_&&_(),N()):(_&&_(X),G(X))})})})}const w=(j=null,E=()=>!0,U={suppressWarning:!0})=>Si(this,void 0,void 0,function*(){const{path:_}=e;U?U.first||(U.first=e.first):U={};const{value:V}=d,te=r?Ki(r.props.model,_||""):void 0,N={},G={},Ce=(j?V.filter(be=>Array.isArray(be.trigger)?be.trigger.includes(j):be.trigger===j):V).filter(E).map((be,me)=>{const se=Object.assign({},be);if(se.validator&&(se.validator=zi(se.validator,!1)),se.asyncValidator&&(se.asyncValidator=zi(se.asyncValidator,!0)),se.renderMessage){const Re=`__renderMessage__${me}`;G[Re]=se.message,se.message=Re,N[Re]=se.renderMessage}return se});if(!Ce.length)return{valid:!0};const X=_??"__n_no_path__",ve=new gd({[X]:Ce}),{validateMessages:he}=(r==null?void 0:r.props)||{};return he&&ve.messages(he),yield new Promise(be=>{ve.validate({[X]:te},U,me=>{me!=null&&me.length?(v.value=me.map(se=>{const Re=(se==null?void 0:se.message)||"";return{key:Re,render:()=>Re.startsWith("__renderMessage__")?N[Re]():Re}}),me.forEach(se=>{var Re;!((Re=se.message)===null||Re===void 0)&&Re.startsWith("__renderMessage__")&&(se.message=G[se.message])}),a.value=!0,be({valid:!1,errors:me})):(x(),be({valid:!0}))})})});Oe($r,{path:le(e,"path"),disabled:m,mergedSize:n.mergedSize,mergedValidationStatus:l.mergedValidationStatus,restoreValidation:x,handleContentBlur:S,handleContentChange:B,handleContentFocus:T,handleContentInput:z});const O={validate:I,restoreValidation:x,internalValidate:w},k=D(null);mo(()=>{if(!l.isAutoLabelWidth.value)return;const j=k.value;if(j!==null){const E=j.style.whiteSpace;j.style.whiteSpace="nowrap",j.style.width="",r==null||r.deriveMaxChildLabelWidth(Number(getComputedStyle(j).width.slice(0,-2))),j.style.whiteSpace=E}});const $=R(()=>{var j;const{value:E}=c,{value:U}=u,_=U==="top"?"vertical":"horizontal",{common:{cubicBezierEaseInOut:V},self:{labelTextColor:te,asteriskColor:N,lineHeight:G,feedbackTextColor:Ce,feedbackTextColorWarning:X,feedbackTextColorError:ve,feedbackPadding:he,labelFontWeight:be,[W("labelHeight",E)]:me,[W("blankHeight",E)]:se,[W("feedbackFontSize",E)]:Re,[W("feedbackHeight",E)]:ge,[W("labelPadding",_)]:ee,[W("labelTextAlign",_)]:xe,[W(W("labelFontSize",U),E)]:de}}=b.value;let ye=(j=f.value)!==null&&j!==void 0?j:xe;return U==="top"&&(ye=ye==="right"?"flex-end":"flex-start"),{"--n-bezier":V,"--n-line-height":G,"--n-blank-height":se,"--n-label-font-size":de,"--n-label-text-align":ye,"--n-label-height":me,"--n-label-padding":ee,"--n-label-font-weight":be,"--n-asterisk-color":N,"--n-label-text-color":te,"--n-feedback-padding":he,"--n-feedback-font-size":Re,"--n-feedback-height":ge,"--n-feedback-text-color":Ce,"--n-feedback-text-color-warning":X,"--n-feedback-text-color-error":ve}}),L=t?Ae("form-item",R(()=>{var j;return`${c.value[0]}${u.value[0]}${((j=f.value)===null||j===void 0?void 0:j[0])||""}`}),$,e):void 0,M=R(()=>u.value==="left"&&p.value==="left"&&f.value==="left");return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:k,mergedClsPrefix:o,mergedRequired:s,feedbackId:h,renderExplains:v,reverseColSpace:M},l),n),O),{cssVars:t?void 0:$,themeClass:L==null?void 0:L.themeClass,onRender:L==null?void 0:L.onRender})},render(){const{$slots:e,mergedClsPrefix:o,mergedShowLabel:t,mergedShowRequireMark:r,mergedRequireMarkPlacement:n,onRender:l}=this,a=r!==void 0?r:this.mergedRequired;l==null||l();const s=()=>{const d=this.$slots.label?this.$slots.label():this.label;if(!d)return null;const c=i("span",{class:`${o}-form-item-label__text`},d),u=a?i("span",{class:`${o}-form-item-label__asterisk`},n!=="left"?" *":"* "):n==="right-hanging"&&i("span",{class:`${o}-form-item-label__asterisk-placeholder`}," *"),{labelProps:f}=this;return i("label",Object.assign({},f,{class:[f==null?void 0:f.class,`${o}-form-item-label`,`${o}-form-item-label--${n}-mark`,this.reverseColSpace&&`${o}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:"labelElementRef"}),n==="left"?[u,c]:[c,u])};return i("div",{class:[`${o}-form-item`,this.themeClass,`${o}-form-item--${this.mergedSize}-size`,`${o}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${o}-form-item--auto-label-width`,!t&&`${o}-form-item--no-label`],style:this.cssVars},t&&s(),i("div",{class:[`${o}-form-item-blank`,this.mergedValidationStatus&&`${o}-form-item-blank--${this.mergedValidationStatus}`]},e),this.mergedShowFeedback?i("div",{key:this.feedbackId,class:`${o}-form-item-feedback-wrapper`},i(no,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:d}=this;return Ee(e.feedback,c=>{var u;const{feedback:f}=this,p=c||f?i("div",{key:"__feedback__",class:`${o}-form-item-feedback__line`},c||f):this.renderExplains.length?(u=this.renderExplains)===null||u===void 0?void 0:u.map(({key:v,render:h})=>i("div",{key:v,class:`${o}-form-item-feedback__line`},h())):null;return p?d==="warning"?i("div",{key:"controlled-warning",class:`${o}-form-item-feedback ${o}-form-item-feedback--warning`},p):d==="error"?i("div",{key:"controlled-error",class:`${o}-form-item-feedback ${o}-form-item-feedback--error`},p):d==="success"?i("div",{key:"controlled-success",class:`${o}-form-item-feedback ${o}-form-item-feedback--success`},p):i("div",{key:"controlled-default",class:`${o}-form-item-feedback`},p):null})}})):null)}}),$i=1,Ia="n-grid",Ba=1,Mv={span:{type:[Number,String],default:Ba},offset:{type:[Number,String],default:0},suffix:Boolean,privateOffset:Number,privateSpan:Number,privateColStart:Number,privateShow:{type:Boolean,default:!0}},B1=q({__GRID_ITEM__:!0,name:"GridItem",alias:["Gi"],props:Mv,setup(){const{isSsrRef:e,xGapRef:o,itemStyleRef:t,overflowRef:r,layoutShiftDisabledRef:n}=Se(Ia),l=Pr();return{overflow:r,itemStyle:t,layoutShiftDisabled:n,mergedXGap:R(()=>_o(o.value||0)),deriveStyle:()=>{e.value;const{privateSpan:a=Ba,privateShow:s=!0,privateColStart:d=void 0,privateOffset:c=0}=l.vnode.props,{value:u}=o,f=_o(u||0);return{display:s?"":"none",gridColumn:`${d??`span ${a}`} / span ${a}`,marginLeft:c?`calc((100% - (${a} - 1) * ${f}) / ${a} * ${c} + ${f} * ${c})`:""}}}},render(){var e,o;if(this.layoutShiftDisabled){const{span:t,offset:r,mergedXGap:n}=this;return i("div",{style:{gridColumn:`span ${t} / span ${t}`,marginLeft:r?`calc((100% - (${t} - 1) * ${n}) / ${t} * ${r} + ${n} * ${r})`:""}},this.$slots)}return i("div",{style:[this.itemStyle,this.deriveStyle()]},(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e,{overflow:this.overflow}))}}),_v=Array.apply(null,{length:24}).map((e,o)=>{const t=o+1,r=`calc(100% / 24 * ${t})`;return[P(`${t}-span`,{width:r}),P(`${t}-offset`,{marginLeft:r}),P(`${t}-push`,{left:r}),P(`${t}-pull`,{right:r})]}),Dv=C([g("row",{width:"100%",display:"flex",flexWrap:"wrap"}),g("col",{verticalAlign:"top",boxSizing:"border-box",display:"inline-block",position:"relative",zIndex:"auto"},[y("box",{position:"relative",zIndex:"auto",width:"100%",height:"100%"}),_v])]),Ta="n-row",Fn={gutter:{type:[Array,Number,String],default:0},alignItems:String,justifyContent:String},Lv=yo(Fn),Hv=q({name:"Row",props:Fn,setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:t}=ke(e);Zo("-legacy-grid",Dv,o);const r=to("Row",t,o),n=We(()=>{const{gutter:a}=e;return Array.isArray(a)&&a[1]||0}),l=We(()=>{const{gutter:a}=e;return Array.isArray(a)?a[0]:Number(a)});return Oe(Ta,{mergedClsPrefixRef:o,gutterRef:le(e,"gutter"),verticalGutterRef:n,horizontalGutterRef:l}),{mergedClsPrefix:o,rtlEnabled:r,styleMargin:We(()=>`-${eo(n.value,{c:.5})} -${eo(l.value,{c:.5})}`),styleWidth:We(()=>`calc(100% + ${eo(l.value)})`)}},render(){return i("div",{class:[`${this.mergedClsPrefix}-row`,this.rtlEnabled&&`${this.mergedClsPrefix}-row--rtl`],style:{margin:this.styleMargin,width:this.styleWidth,alignItems:this.alignItems,justifyContent:this.justifyContent}},this.$slots)}}),On={span:{type:[String,Number],default:1},push:{type:[String,Number],default:0},pull:{type:[String,Number],default:0},offset:{type:[String,Number],default:0}},Av=yo(On),Ev=q({name:"Col",props:On,setup(e){const o=Se(Ta,null);return o||Eo("col","`n-col` must be placed inside `n-row`."),{mergedClsPrefix:o.mergedClsPrefixRef,gutter:o.gutterRef,stylePadding:R(()=>`${eo(o.verticalGutterRef.value,{c:.5})} ${eo(o.horizontalGutterRef.value,{c:.5})}`),mergedPush:R(()=>Number(e.push)-Number(e.pull))}},render(){const{$slots:e,span:o,mergedPush:t,offset:r,stylePadding:n,gutter:l,mergedClsPrefix:a}=this;return i("div",{class:[`${a}-col`,{[`${a}-col--${o}-span`]:!0,[`${a}-col--${t}-push`]:t>0,[`${a}-col--${-t}-pull`]:t<0,[`${a}-col--${r}-offset`]:r}],style:{padding:n}},l?i("div",null,e):e)}}),Mn=Object.assign(Object.assign({},On),Tn),jv=yo(Mn),Wv=q({name:"FormItemCol",props:Mn,setup(){const e=D(null);return{formItemInstRef:e,validate:(...r)=>{const{value:n}=e;if(n)return n.validate(...r)},restoreValidation:()=>{const{value:r}=e;r&&r.restoreValidation()}}},render(){return i(Ev,go(this.$props,Av),{default:()=>{const e=go(this.$props,Fv);return i(Ov,Object.assign({ref:"formItemInstRef"},e),this.$slots)}})}}),Nv=Object.assign(Object.assign({},Fn),Mn),T1=q({name:"FormItemRow",props:Nv,setup(){const e=D(null);return{formItemColInstRef:e,validate:(...r)=>{const{value:n}=e;if(n)return n.validate(...r)},restoreValidation:()=>{const{value:r}=e;r&&r.restoreValidation()}}},render(){return i(Hv,go(this.$props,Lv),{default:()=>{const e=go(this.$props,jv);return i(Wv,Object.assign(Object.assign({ref:"formItemColInstRef"},e),{span:24}),this.$slots)}})}}),F1=q({name:"GlobalStyle",setup(){if(typeof document>"u")return;const e=Se(Yo,null),{body:o}=document,{style:t}=o;let r=!1,n=!0;lr(()=>{oo(()=>{var l,a;const{textColor2:s,fontSize:d,fontFamily:c,bodyColor:u,cubicBezierEaseInOut:f,lineHeight:p}=e?Tt({},((l=e.mergedThemeRef.value)===null||l===void 0?void 0:l.common)||Le,(a=e.mergedThemeOverridesRef.value)===null||a===void 0?void 0:a.common):Le;if(r||!o.hasAttribute("n-styled")){t.setProperty("-webkit-text-size-adjust","100%"),t.setProperty("-webkit-tap-highlight-color","transparent"),t.padding="0",t.margin="0",t.backgroundColor=u,t.color=s,t.fontSize=d,t.fontFamily=c,t.lineHeight=p;const v=`color .3s ${f}, background-color .3s ${f}`;n?setTimeout(()=>{t.transition=v},0):t.transition=v,o.setAttribute("n-styled",""),r=!0,n=!1}})}),td(()=>{r&&o.removeAttribute("n-styled")})},render(){return null}}),Vv={name:"GradientText",common:fe,self(e){const{primaryColor:o,successColor:t,warningColor:r,errorColor:n,infoColor:l,primaryColorSuppl:a,successColorSuppl:s,warningColorSuppl:d,errorColorSuppl:c,infoColorSuppl:u,fontWeightStrong:f}=e;return{fontWeight:f,rotate:"252deg",colorStartPrimary:o,colorEndPrimary:a,colorStartInfo:l,colorEndInfo:u,colorStartWarning:r,colorEndWarning:d,colorStartError:n,colorEndError:c,colorStartSuccess:t,colorEndSuccess:s}}},Uv=Vv,Kv=e=>{const{primaryColor:o,successColor:t,warningColor:r,errorColor:n,infoColor:l,fontWeightStrong:a}=e;return{fontWeight:a,rotate:"252deg",colorStartPrimary:J(o,{alpha:.6}),colorEndPrimary:o,colorStartInfo:J(l,{alpha:.6}),colorEndInfo:l,colorStartWarning:J(r,{alpha:.6}),colorEndWarning:r,colorStartError:J(n,{alpha:.6}),colorEndError:n,colorStartSuccess:J(t,{alpha:.6}),colorEndSuccess:t}},Gv={name:"GradientText",common:Le,self:Kv},qv=Gv,Yv=g("gradient-text",` + display: inline-block; + font-weight: var(--n-font-weight); + -webkit-background-clip: text; + background-clip: text; + color: #0000; + white-space: nowrap; + background-image: linear-gradient(var(--n-rotate), var(--n-color-start) 0%, var(--n-color-end) 100%); + transition: + --n-color-start .3s var(--n-bezier), + --n-color-end .3s var(--n-bezier); +`),Xv=Object.assign(Object.assign({},ne.props),{size:[String,Number],fontSize:[String,Number],type:{type:String,default:"primary"},color:[Object,String],gradient:[Object,String]}),O1=q({name:"GradientText",props:Xv,setup(e){rl();const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=R(()=>{const{type:c}=e;return c==="danger"?"error":c}),n=R(()=>{let c=e.size||e.fontSize;return c&&(c=eo(c)),c||void 0}),l=R(()=>{const c=e.color||e.gradient;if(typeof c=="string")return c;if(c){const u=c.deg||0,f=c.from,p=c.to;return`linear-gradient(${u}deg, ${f} 0%, ${p} 100%)`}}),a=ne("GradientText","-gradient-text",Yv,qv,e,o),s=R(()=>{const{value:c}=r,{common:{cubicBezierEaseInOut:u},self:{rotate:f,[W("colorStart",c)]:p,[W("colorEnd",c)]:v,fontWeight:h}}=a.value;return{"--n-bezier":u,"--n-rotate":f,"--n-color-start":p,"--n-color-end":v,"--n-font-weight":h}}),d=t?Ae("gradient-text",R(()=>r.value[0]),s,e):void 0;return{mergedClsPrefix:o,compatibleType:r,styleFontSize:n,styleBgImage:l,cssVars:t?void 0:s,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{mergedClsPrefix:e,onRender:o}=this;return o==null||o(),i("span",{class:[`${e}-gradient-text`,`${e}-gradient-text--${this.compatibleType}-type`,this.themeClass],style:[{fontSize:this.styleFontSize,backgroundImage:this.styleBgImage},this.cssVars]},this.$slots)}}),Zv={xs:0,s:640,m:1024,l:1280,xl:1536,xxl:1920},Fa=24,en="__ssr__",Qv={layoutShiftDisabled:Boolean,responsive:{type:[String,Boolean],default:"self"},cols:{type:[Number,String],default:Fa},itemResponsive:Boolean,collapsed:Boolean,collapsedRows:{type:Number,default:1},itemStyle:[Object,String],xGap:{type:[Number,String],default:0},yGap:{type:[Number,String],default:0}},M1=q({name:"Grid",inheritAttrs:!1,props:Qv,setup(e){const{mergedClsPrefixRef:o,mergedBreakpointsRef:t}=ke(e),r=/^\d+$/,n=D(void 0),l=sd((t==null?void 0:t.value)||Zv),a=We(()=>!!(e.itemResponsive||!r.test(e.cols.toString())||!r.test(e.xGap.toString())||!r.test(e.yGap.toString()))),s=R(()=>{if(a.value)return e.responsive==="self"?n.value:l.value}),d=We(()=>{var x;return(x=Number(qt(e.cols.toString(),s.value)))!==null&&x!==void 0?x:Fa}),c=We(()=>qt(e.xGap.toString(),s.value)),u=We(()=>qt(e.yGap.toString(),s.value)),f=x=>{n.value=x.contentRect.width},p=x=>{Ai(f,x)},v=D(!1),h=R(()=>{if(e.responsive==="self")return p}),m=D(!1),b=D();return mo(()=>{const{value:x}=b;x&&x.hasAttribute(en)&&(x.removeAttribute(en),m.value=!0)}),Oe(Ia,{layoutShiftDisabledRef:le(e,"layoutShiftDisabled"),isSsrRef:m,itemStyleRef:le(e,"itemStyle"),xGapRef:c,overflowRef:v}),{isSsr:!jo,contentEl:b,mergedClsPrefix:o,style:R(()=>e.layoutShiftDisabled?{width:"100%",display:"grid",gridTemplateColumns:`repeat(${e.cols}, minmax(0, 1fr))`,columnGap:_o(e.xGap),rowGap:_o(e.yGap)}:{width:"100%",display:"grid",gridTemplateColumns:`repeat(${d.value}, minmax(0, 1fr))`,columnGap:_o(c.value),rowGap:_o(u.value)}),isResponsive:a,responsiveQuery:s,responsiveCols:d,handleResize:h,overflow:v}},render(){if(this.layoutShiftDisabled)return i("div",ko({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style},this.$attrs),this.$slots);const e=()=>{var o,t,r,n,l,a,s;this.overflow=!1;const d=tt(vn(this)),c=[],{collapsed:u,collapsedRows:f,responsiveCols:p,responsiveQuery:v}=this;d.forEach(S=>{var B,T,z,I;if(((B=S==null?void 0:S.type)===null||B===void 0?void 0:B.__GRID_ITEM__)!==!0)return;if(yd(S)){const k=Jt(S);k.props?k.props.privateShow=!1:k.props={privateShow:!1},c.push({child:k,rawChildSpan:0});return}S.dirs=((T=S.dirs)===null||T===void 0?void 0:T.filter(({dir:k})=>k!==Go))||null;const w=Jt(S),O=Number((I=qt((z=w.props)===null||z===void 0?void 0:z.span,v))!==null&&I!==void 0?I:$i);O!==0&&c.push({child:w,rawChildSpan:O})});let h=0;const m=(o=c[c.length-1])===null||o===void 0?void 0:o.child;if(m!=null&&m.props){const S=(t=m.props)===null||t===void 0?void 0:t.suffix;S!==void 0&&S!==!1&&(h=(n=(r=m.props)===null||r===void 0?void 0:r.span)!==null&&n!==void 0?n:$i,m.props.privateSpan=h,m.props.privateColStart=p+1-h,m.props.privateShow=(l=m.props.privateShow)!==null&&l!==void 0?l:!0)}let b=0,x=!1;for(const{child:S,rawChildSpan:B}of c){if(x&&(this.overflow=!0),!x){const T=Number((s=qt((a=S.props)===null||a===void 0?void 0:a.offset,v))!==null&&s!==void 0?s:0),z=Math.min(B+T,p);if(S.props?(S.props.privateSpan=z,S.props.privateOffset=T):S.props={privateSpan:z,privateOffset:T},u){const I=b%p;z+I>p&&(b+=p-I),z+b+h>f*p?x=!0:b+=z}}x&&(S.props?S.props.privateShow!==!0&&(S.props.privateShow=!1):S.props={privateShow:!1})}return i("div",ko({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style,[en]:this.isSsr||void 0},this.$attrs),c.map(({child:S})=>S))};return this.isResponsive&&this.responsive==="self"?i(vt,{onResize:this.handleResize},{default:e}):e()}}),Jv=e=>{const{primaryColor:o,baseColor:t}=e;return{color:o,iconColor:t}},eg={name:"IconWrapper",common:fe,self:Jv},og=eg,_n=Object.assign(Object.assign({},ne.props),{showToolbar:{type:Boolean,default:!0},showToolbarTooltip:Boolean}),Oa="n-image";function tg(){return{toolbarIconColor:"rgba(255, 255, 255, .9)",toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}const rg={name:"Image",common:Le,peers:{Tooltip:Lr},self:tg},ng={closeMargin:"16px 12px",closeSize:"20px",closeIconSize:"16px",width:"365px",padding:"16px",titleFontSize:"16px",metaFontSize:"12px",descriptionFontSize:"12px"},ig=e=>{const{textColor2:o,successColor:t,infoColor:r,warningColor:n,errorColor:l,popoverColor:a,closeIconColor:s,closeIconColorHover:d,closeIconColorPressed:c,closeColorHover:u,closeColorPressed:f,textColor1:p,textColor3:v,borderRadius:h,fontWeightStrong:m,boxShadow2:b,lineHeight:x,fontSize:S}=e;return Object.assign(Object.assign({},ng),{borderRadius:h,lineHeight:x,fontSize:S,headerFontWeight:m,iconColor:o,iconColorSuccess:t,iconColorInfo:r,iconColorWarning:n,iconColorError:l,color:a,textColor:o,closeIconColor:s,closeIconColorHover:d,closeIconColorPressed:c,closeBorderRadius:h,closeColorHover:u,closeColorPressed:f,headerTextColor:p,descriptionTextColor:v,actionTextColor:o,boxShadow:b})},lg={name:"Notification",common:fe,peers:{Scrollbar:zo},self:ig},ag=lg,sg={margin:"0 0 8px 0",padding:"10px 20px",maxWidth:"720px",minWidth:"420px",iconMargin:"0 10px 0 0",closeMargin:"0 0 0 10px",closeSize:"20px",closeIconSize:"16px",iconSize:"20px",fontSize:"14px"},Ma=e=>{const{textColor2:o,closeIconColor:t,closeIconColorHover:r,closeIconColorPressed:n,infoColor:l,successColor:a,errorColor:s,warningColor:d,popoverColor:c,boxShadow2:u,primaryColor:f,lineHeight:p,borderRadius:v,closeColorHover:h,closeColorPressed:m}=e;return Object.assign(Object.assign({},sg),{closeBorderRadius:v,textColor:o,textColorInfo:o,textColorSuccess:o,textColorError:o,textColorWarning:o,textColorLoading:o,color:c,colorInfo:c,colorSuccess:c,colorError:c,colorWarning:c,colorLoading:c,boxShadow:u,boxShadowInfo:u,boxShadowSuccess:u,boxShadowError:u,boxShadowWarning:u,boxShadowLoading:u,iconColor:o,iconColorInfo:l,iconColorSuccess:a,iconColorWarning:d,iconColorError:s,iconColorLoading:f,closeColorHover:h,closeColorPressed:m,closeIconColor:t,closeIconColorHover:r,closeIconColorPressed:n,closeColorHoverInfo:h,closeColorPressedInfo:m,closeIconColorInfo:t,closeIconColorHoverInfo:r,closeIconColorPressedInfo:n,closeColorHoverSuccess:h,closeColorPressedSuccess:m,closeIconColorSuccess:t,closeIconColorHoverSuccess:r,closeIconColorPressedSuccess:n,closeColorHoverError:h,closeColorPressedError:m,closeIconColorError:t,closeIconColorHoverError:r,closeIconColorPressedError:n,closeColorHoverWarning:h,closeColorPressedWarning:m,closeIconColorWarning:t,closeIconColorHoverWarning:r,closeIconColorPressedWarning:n,closeColorHoverLoading:h,closeColorPressedLoading:m,closeIconColorLoading:t,closeIconColorHoverLoading:r,closeIconColorPressedLoading:n,loadingColor:f,lineHeight:p,borderRadius:v})},dg={name:"Message",common:Le,self:Ma},cg=dg,ug={name:"Message",common:fe,self:Ma},fg=ug,hg={name:"ButtonGroup",common:fe},pg=hg,vg={name:"InputNumber",common:fe,peers:{Button:$o,Input:Ho},self(e){const{textColorDisabled:o}=e;return{iconColorDisabled:o}}},gg=vg,mg=e=>{const{textColorDisabled:o}=e;return{iconColorDisabled:o}},bg={name:"InputNumber",common:Le,peers:{Button:Wt,Input:pr},self:mg},xg=bg,Cg={name:"Layout",common:fe,peers:{Scrollbar:zo},self(e){const{textColor2:o,bodyColor:t,popoverColor:r,cardColor:n,dividerColor:l,scrollbarColor:a,scrollbarColorHover:s}=e;return{textColor:o,textColorInverted:o,color:t,colorEmbedded:t,headerColor:n,headerColorInverted:n,footerColor:n,footerColorInverted:n,headerBorderColor:l,headerBorderColorInverted:l,footerBorderColor:l,footerBorderColorInverted:l,siderBorderColor:l,siderBorderColorInverted:l,siderColor:n,siderColorInverted:n,siderToggleButtonBorder:"1px solid transparent",siderToggleButtonColor:r,siderToggleButtonIconColor:o,siderToggleButtonIconColorInverted:o,siderToggleBarColor:$e(t,a),siderToggleBarColorHover:$e(t,s),__invertScrollbar:"false"}}},yg=Cg,_a=e=>{const{textColor2:o,cardColor:t,modalColor:r,popoverColor:n,dividerColor:l,borderRadius:a,fontSize:s,hoverColor:d}=e;return{textColor:o,color:t,colorHover:d,colorModal:r,colorHoverModal:$e(r,d),colorPopover:n,colorHoverPopover:$e(n,d),borderColor:l,borderColorModal:$e(r,l),borderColorPopover:$e(n,l),borderRadius:a,fontSize:s}},wg={name:"List",common:Le,self:_a},Sg=wg,zg={name:"List",common:fe,self:_a},$g=zg,Rg={name:"LoadingBar",common:fe,self(e){const{primaryColor:o}=e;return{colorError:"red",colorLoading:o,height:"2px"}}},Pg=Rg,kg={name:"Log",common:fe,peers:{Scrollbar:zo,Code:Ul},self(e){const{textColor2:o,inputColor:t,fontSize:r,primaryColor:n}=e;return{loaderFontSize:r,loaderTextColor:o,loaderColor:t,loaderBorder:"1px solid #0000",loadingColor:n}}},Ig=kg,Bg={name:"Mention",common:fe,peers:{InternalSelectMenu:fr,Input:Ho},self(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}},Tg=Bg,Fg=e=>{const{boxShadow2:o}=e;return{menuBoxShadow:o}},Og={name:"Mention",common:Le,peers:{InternalSelectMenu:_r,Input:pr},self:Fg},Mg=Og;function _g(e,o,t,r){return{itemColorHoverInverted:"#0000",itemColorActiveInverted:o,itemColorActiveHoverInverted:o,itemColorActiveCollapsedInverted:o,itemTextColorInverted:e,itemTextColorHoverInverted:t,itemTextColorChildActiveInverted:t,itemTextColorChildActiveHoverInverted:t,itemTextColorActiveInverted:t,itemTextColorActiveHoverInverted:t,itemTextColorHorizontalInverted:e,itemTextColorHoverHorizontalInverted:t,itemTextColorChildActiveHorizontalInverted:t,itemTextColorChildActiveHoverHorizontalInverted:t,itemTextColorActiveHorizontalInverted:t,itemTextColorActiveHoverHorizontalInverted:t,itemIconColorInverted:e,itemIconColorHoverInverted:t,itemIconColorActiveInverted:t,itemIconColorActiveHoverInverted:t,itemIconColorChildActiveInverted:t,itemIconColorChildActiveHoverInverted:t,itemIconColorCollapsedInverted:e,itemIconColorHorizontalInverted:e,itemIconColorHoverHorizontalInverted:t,itemIconColorActiveHorizontalInverted:t,itemIconColorActiveHoverHorizontalInverted:t,itemIconColorChildActiveHorizontalInverted:t,itemIconColorChildActiveHoverHorizontalInverted:t,arrowColorInverted:e,arrowColorHoverInverted:t,arrowColorActiveInverted:t,arrowColorActiveHoverInverted:t,arrowColorChildActiveInverted:t,arrowColorChildActiveHoverInverted:t,groupTextColorInverted:r}}const Da=e=>{const{borderRadius:o,textColor3:t,primaryColor:r,textColor2:n,textColor1:l,fontSize:a,dividerColor:s,hoverColor:d,primaryColorHover:c}=e;return Object.assign({borderRadius:o,color:"#0000",groupTextColor:t,itemColorHover:d,itemColorActive:J(r,{alpha:.1}),itemColorActiveHover:J(r,{alpha:.1}),itemColorActiveCollapsed:J(r,{alpha:.1}),itemTextColor:n,itemTextColorHover:n,itemTextColorActive:r,itemTextColorActiveHover:r,itemTextColorChildActive:r,itemTextColorChildActiveHover:r,itemTextColorHorizontal:n,itemTextColorHoverHorizontal:c,itemTextColorActiveHorizontal:r,itemTextColorActiveHoverHorizontal:r,itemTextColorChildActiveHorizontal:r,itemTextColorChildActiveHoverHorizontal:r,itemIconColor:l,itemIconColorHover:l,itemIconColorActive:r,itemIconColorActiveHover:r,itemIconColorChildActive:r,itemIconColorChildActiveHover:r,itemIconColorCollapsed:l,itemIconColorHorizontal:l,itemIconColorHoverHorizontal:c,itemIconColorActiveHorizontal:r,itemIconColorActiveHoverHorizontal:r,itemIconColorChildActiveHorizontal:r,itemIconColorChildActiveHoverHorizontal:r,itemHeight:"42px",arrowColor:n,arrowColorHover:n,arrowColorActive:r,arrowColorActiveHover:r,arrowColorChildActive:r,arrowColorChildActiveHover:r,colorInverted:"#0000",borderColorHorizontal:"#0000",fontSize:a,dividerColor:s},_g("#BBB",r,"#FFF","#AAA"))},Dg={name:"Menu",common:Le,peers:{Tooltip:Lr,Dropdown:ia},self:Da},Lg=Dg,Hg={name:"Menu",common:fe,peers:{Tooltip:Dr,Dropdown:Rn},self(e){const{primaryColor:o,primaryColorSuppl:t}=e,r=Da(e);return r.itemColorActive=J(o,{alpha:.15}),r.itemColorActiveHover=J(o,{alpha:.15}),r.itemColorActiveCollapsed=J(o,{alpha:.15}),r.itemColorActiveInverted=t,r.itemColorActiveHoverInverted=t,r.itemColorActiveCollapsedInverted=t,r}},Ag=Hg,Eg={titleFontSize:"18px",backSize:"22px"};function jg(e){const{textColor1:o,textColor2:t,textColor3:r,fontSize:n,fontWeightStrong:l,primaryColorHover:a,primaryColorPressed:s}=e;return Object.assign(Object.assign({},Eg),{titleFontWeight:l,fontSize:n,titleTextColor:o,backColor:t,backColorHover:a,backColorPressed:s,subtitleTextColor:r})}const Wg={name:"PageHeader",common:fe,self:jg},Ng={iconSize:"22px"},La=e=>{const{fontSize:o,warningColor:t}=e;return Object.assign(Object.assign({},Ng),{fontSize:o,iconColor:t})},Vg={name:"Popconfirm",common:Le,peers:{Button:Wt,Popover:jt},self:La},Ug=Vg,Kg={name:"Popconfirm",common:fe,peers:{Button:$o,Popover:$t},self:La},Gg=Kg,Ha=e=>{const{infoColor:o,successColor:t,warningColor:r,errorColor:n,textColor2:l,progressRailColor:a,fontSize:s,fontWeight:d}=e;return{fontSize:s,fontSizeCircle:"28px",fontWeightCircle:d,railColor:a,railHeight:"8px",iconSizeCircle:"36px",iconSizeLine:"18px",iconColor:o,iconColorInfo:o,iconColorSuccess:t,iconColorWarning:r,iconColorError:n,textColorCircle:l,textColorLineInner:"rgb(255, 255, 255)",textColorLineOuter:l,fillColor:o,fillColorInfo:o,fillColorSuccess:t,fillColorWarning:r,fillColorError:n,lineBgProcessing:"linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)"}},qg={name:"Progress",common:Le,self:Ha},Aa=qg,Yg={name:"Progress",common:fe,self(e){const o=Ha(e);return o.textColorLineInner="rgb(0, 0, 0)",o.lineBgProcessing="linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)",o}},Ea=Yg,Xg={name:"Rate",common:fe,self(e){const{railColor:o}=e;return{itemColor:o,itemColorActive:"#CCAA33",itemSize:"20px",sizeSmall:"16px",sizeMedium:"20px",sizeLarge:"24px"}}},Zg=Xg,Qg={titleFontSizeSmall:"26px",titleFontSizeMedium:"32px",titleFontSizeLarge:"40px",titleFontSizeHuge:"48px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",iconSizeSmall:"64px",iconSizeMedium:"80px",iconSizeLarge:"100px",iconSizeHuge:"125px",iconColor418:void 0,iconColor404:void 0,iconColor403:void 0,iconColor500:void 0},ja=e=>{const{textColor2:o,textColor1:t,errorColor:r,successColor:n,infoColor:l,warningColor:a,lineHeight:s,fontWeightStrong:d}=e;return Object.assign(Object.assign({},Qg),{lineHeight:s,titleFontWeight:d,titleTextColor:t,textColor:o,iconColorError:r,iconColorSuccess:n,iconColorInfo:l,iconColorWarning:a})},Jg={name:"Result",common:Le,self:ja},em=Jg,om={name:"Result",common:fe,self:ja},tm=om,rm={railHeight:"4px",railWidthVertical:"4px",handleSize:"18px",dotHeight:"8px",dotWidth:"8px",dotBorderRadius:"4px"},nm={name:"Slider",common:fe,self(e){const o="0 2px 8px 0 rgba(0, 0, 0, 0.12)",{railColor:t,modalColor:r,primaryColorSuppl:n,popoverColor:l,textColor2:a,cardColor:s,borderRadius:d,fontSize:c,opacityDisabled:u}=e;return Object.assign(Object.assign({},rm),{fontSize:c,markFontSize:c,railColor:t,railColorHover:t,fillColor:n,fillColorHover:n,opacityDisabled:u,handleColor:"#FFF",dotColor:s,dotColorModal:r,dotColorPopover:l,handleBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowHover:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowActive:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowFocus:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",indicatorColor:l,indicatorBoxShadow:o,indicatorTextColor:a,indicatorBorderRadius:d,dotBorder:`2px solid ${t}`,dotBorderActive:`2px solid ${n}`,dotBoxShadow:""})}},im=nm,Wa=e=>{const{opacityDisabled:o,heightTiny:t,heightSmall:r,heightMedium:n,heightLarge:l,heightHuge:a,primaryColor:s,fontSize:d}=e;return{fontSize:d,textColor:s,sizeTiny:t,sizeSmall:r,sizeMedium:n,sizeLarge:l,sizeHuge:a,color:s,opacitySpinning:o}},lm={name:"Spin",common:Le,self:Wa},am=lm,sm={name:"Spin",common:fe,self:Wa},dm=sm,Na=e=>{const{textColor2:o,textColor3:t,fontSize:r,fontWeight:n}=e;return{labelFontSize:r,labelFontWeight:n,valueFontWeight:n,valueFontSize:"24px",labelTextColor:t,valuePrefixTextColor:o,valueSuffixTextColor:o,valueTextColor:o}},cm={name:"Statistic",common:Le,self:Na},um=cm,fm={name:"Statistic",common:fe,self:Na},hm=fm,pm={stepHeaderFontSizeSmall:"14px",stepHeaderFontSizeMedium:"16px",indicatorIndexFontSizeSmall:"14px",indicatorIndexFontSizeMedium:"16px",indicatorSizeSmall:"22px",indicatorSizeMedium:"28px",indicatorIconSizeSmall:"14px",indicatorIconSizeMedium:"18px"},vm=e=>{const{fontWeightStrong:o,baseColor:t,textColorDisabled:r,primaryColor:n,errorColor:l,textColor1:a,textColor2:s}=e;return Object.assign(Object.assign({},pm),{stepHeaderFontWeight:o,indicatorTextColorProcess:t,indicatorTextColorWait:r,indicatorTextColorFinish:n,indicatorTextColorError:l,indicatorBorderColorProcess:n,indicatorBorderColorWait:r,indicatorBorderColorFinish:n,indicatorBorderColorError:l,indicatorColorProcess:n,indicatorColorWait:"#0000",indicatorColorFinish:"#0000",indicatorColorError:"#0000",splitorColorProcess:r,splitorColorWait:r,splitorColorFinish:n,splitorColorError:r,headerTextColorProcess:a,headerTextColorWait:r,headerTextColorFinish:r,headerTextColorError:l,descriptionTextColorProcess:s,descriptionTextColorWait:r,descriptionTextColorFinish:r,descriptionTextColorError:l})},gm={name:"Steps",common:fe,self:vm},mm=gm,Va={buttonHeightSmall:"14px",buttonHeightMedium:"18px",buttonHeightLarge:"22px",buttonWidthSmall:"14px",buttonWidthMedium:"18px",buttonWidthLarge:"22px",buttonWidthPressedSmall:"20px",buttonWidthPressedMedium:"24px",buttonWidthPressedLarge:"28px",railHeightSmall:"18px",railHeightMedium:"22px",railHeightLarge:"26px",railWidthSmall:"32px",railWidthMedium:"40px",railWidthLarge:"48px"},bm={name:"Switch",common:fe,self(e){const{primaryColorSuppl:o,opacityDisabled:t,borderRadius:r,primaryColor:n,textColor2:l,baseColor:a}=e,s="rgba(255, 255, 255, .20)";return Object.assign(Object.assign({},Va),{iconColor:a,textColor:l,loadingColor:o,opacityDisabled:t,railColor:s,railColorActive:o,buttonBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",buttonColor:"#FFF",railBorderRadiusSmall:r,railBorderRadiusMedium:r,railBorderRadiusLarge:r,buttonBorderRadiusSmall:r,buttonBorderRadiusMedium:r,buttonBorderRadiusLarge:r,boxShadowFocus:`0 0 8px 0 ${J(n,{alpha:.3})}`})}},xm=bm,Cm=e=>{const{primaryColor:o,opacityDisabled:t,borderRadius:r,textColor3:n}=e,l="rgba(0, 0, 0, .14)";return Object.assign(Object.assign({},Va),{iconColor:n,textColor:"white",loadingColor:o,opacityDisabled:t,railColor:l,railColorActive:o,buttonBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",buttonColor:"#FFF",railBorderRadiusSmall:r,railBorderRadiusMedium:r,railBorderRadiusLarge:r,buttonBorderRadiusSmall:r,buttonBorderRadiusMedium:r,buttonBorderRadiusLarge:r,boxShadowFocus:`0 0 0 2px ${J(o,{alpha:.2})}`})},ym={name:"Switch",common:Le,self:Cm},wm=ym,Sm={thPaddingSmall:"6px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"6px",tdPaddingMedium:"12px",tdPaddingLarge:"12px"},zm=e=>{const{dividerColor:o,cardColor:t,modalColor:r,popoverColor:n,tableHeaderColor:l,tableColorStriped:a,textColor1:s,textColor2:d,borderRadius:c,fontWeightStrong:u,lineHeight:f,fontSizeSmall:p,fontSizeMedium:v,fontSizeLarge:h}=e;return Object.assign(Object.assign({},Sm),{fontSizeSmall:p,fontSizeMedium:v,fontSizeLarge:h,lineHeight:f,borderRadius:c,borderColor:$e(t,o),borderColorModal:$e(r,o),borderColorPopover:$e(n,o),tdColor:t,tdColorModal:r,tdColorPopover:n,tdColorStriped:$e(t,a),tdColorStripedModal:$e(r,a),tdColorStripedPopover:$e(n,a),thColor:$e(t,l),thColorModal:$e(r,l),thColorPopover:$e(n,l),thTextColor:s,tdTextColor:d,thFontWeight:u})},$m={name:"Table",common:fe,self:zm},Rm=$m,Pm={tabFontSizeSmall:"14px",tabFontSizeMedium:"14px",tabFontSizeLarge:"16px",tabGapSmallLine:"36px",tabGapMediumLine:"36px",tabGapLargeLine:"36px",tabGapSmallLineVertical:"8px",tabGapMediumLineVertical:"8px",tabGapLargeLineVertical:"8px",tabPaddingSmallLine:"6px 0",tabPaddingMediumLine:"10px 0",tabPaddingLargeLine:"14px 0",tabPaddingVerticalSmallLine:"6px 12px",tabPaddingVerticalMediumLine:"8px 16px",tabPaddingVerticalLargeLine:"10px 20px",tabGapSmallBar:"36px",tabGapMediumBar:"36px",tabGapLargeBar:"36px",tabGapSmallBarVertical:"8px",tabGapMediumBarVertical:"8px",tabGapLargeBarVertical:"8px",tabPaddingSmallBar:"4px 0",tabPaddingMediumBar:"6px 0",tabPaddingLargeBar:"10px 0",tabPaddingVerticalSmallBar:"6px 12px",tabPaddingVerticalMediumBar:"8px 16px",tabPaddingVerticalLargeBar:"10px 20px",tabGapSmallCard:"4px",tabGapMediumCard:"4px",tabGapLargeCard:"4px",tabGapSmallCardVertical:"4px",tabGapMediumCardVertical:"4px",tabGapLargeCardVertical:"4px",tabPaddingSmallCard:"8px 16px",tabPaddingMediumCard:"10px 20px",tabPaddingLargeCard:"12px 24px",tabPaddingSmallSegment:"4px 0",tabPaddingMediumSegment:"6px 0",tabPaddingLargeSegment:"8px 0",tabPaddingVerticalLargeSegment:"0 8px",tabPaddingVerticalSmallCard:"8px 12px",tabPaddingVerticalMediumCard:"10px 16px",tabPaddingVerticalLargeCard:"12px 20px",tabPaddingVerticalSmallSegment:"0 4px",tabPaddingVerticalMediumSegment:"0 6px",tabGapSmallSegment:"0",tabGapMediumSegment:"0",tabGapLargeSegment:"0",tabGapSmallSegmentVertical:"0",tabGapMediumSegmentVertical:"0",tabGapLargeSegmentVertical:"0",panePaddingSmall:"8px 0 0 0",panePaddingMedium:"12px 0 0 0",panePaddingLarge:"16px 0 0 0",closeSize:"18px",closeIconSize:"14px"},Ua=e=>{const{textColor2:o,primaryColor:t,textColorDisabled:r,closeIconColor:n,closeIconColorHover:l,closeIconColorPressed:a,closeColorHover:s,closeColorPressed:d,tabColor:c,baseColor:u,dividerColor:f,fontWeight:p,textColor1:v,borderRadius:h,fontSize:m,fontWeightStrong:b}=e;return Object.assign(Object.assign({},Pm),{colorSegment:c,tabFontSizeCard:m,tabTextColorLine:v,tabTextColorActiveLine:t,tabTextColorHoverLine:t,tabTextColorDisabledLine:r,tabTextColorSegment:v,tabTextColorActiveSegment:o,tabTextColorHoverSegment:o,tabTextColorDisabledSegment:r,tabTextColorBar:v,tabTextColorActiveBar:t,tabTextColorHoverBar:t,tabTextColorDisabledBar:r,tabTextColorCard:v,tabTextColorHoverCard:v,tabTextColorActiveCard:t,tabTextColorDisabledCard:r,barColor:t,closeIconColor:n,closeIconColorHover:l,closeIconColorPressed:a,closeColorHover:s,closeColorPressed:d,closeBorderRadius:h,tabColor:c,tabColorSegment:u,tabBorderColor:f,tabFontWeightActive:p,tabFontWeight:p,tabBorderRadius:h,paneTextColor:o,fontWeightStrong:b})},km={name:"Tabs",common:Le,self:Ua},Im=km,Bm={name:"Tabs",common:fe,self(e){const o=Ua(e),{inputColor:t}=e;return o.colorSegment=t,o.tabColorSegment=t,o}},Tm=Bm,Ka=e=>{const{textColor1:o,textColor2:t,fontWeightStrong:r,fontSize:n}=e;return{fontSize:n,titleTextColor:o,textColor:t,titleFontWeight:r}},Fm={name:"Thing",common:Le,self:Ka},Om=Fm,Mm={name:"Thing",common:fe,self:Ka},_m=Mm,Dm={titleMarginMedium:"0 0 6px 0",titleMarginLarge:"-2px 0 6px 0",titleFontSizeMedium:"14px",titleFontSizeLarge:"16px",iconSizeMedium:"14px",iconSizeLarge:"14px"},Lm={name:"Timeline",common:fe,self(e){const{textColor3:o,infoColorSuppl:t,errorColorSuppl:r,successColorSuppl:n,warningColorSuppl:l,textColor1:a,textColor2:s,railColor:d,fontWeightStrong:c,fontSize:u}=e;return Object.assign(Object.assign({},Dm),{contentFontSize:u,titleFontWeight:c,circleBorder:`2px solid ${o}`,circleBorderInfo:`2px solid ${t}`,circleBorderError:`2px solid ${r}`,circleBorderSuccess:`2px solid ${n}`,circleBorderWarning:`2px solid ${l}`,iconColor:o,iconColorInfo:t,iconColorError:r,iconColorSuccess:n,iconColorWarning:l,titleTextColor:a,contentTextColor:s,metaTextColor:o,lineColor:d})}},Hm=Lm,Am={extraFontSizeSmall:"12px",extraFontSizeMedium:"12px",extraFontSizeLarge:"14px",titleFontSizeSmall:"14px",titleFontSizeMedium:"16px",titleFontSizeLarge:"16px",closeSize:"20px",closeIconSize:"16px",headerHeightSmall:"44px",headerHeightMedium:"44px",headerHeightLarge:"50px"},Em={name:"Transfer",common:fe,peers:{Checkbox:Nt,Scrollbar:zo,Input:Ho,Empty:zt,Button:$o},self(e){const{fontWeight:o,fontSizeLarge:t,fontSizeMedium:r,fontSizeSmall:n,heightLarge:l,heightMedium:a,borderRadius:s,inputColor:d,tableHeaderColor:c,textColor1:u,textColorDisabled:f,textColor2:p,textColor3:v,hoverColor:h,closeColorHover:m,closeColorPressed:b,closeIconColor:x,closeIconColorHover:S,closeIconColorPressed:B,dividerColor:T}=e;return Object.assign(Object.assign({},Am),{itemHeightSmall:a,itemHeightMedium:a,itemHeightLarge:l,fontSizeSmall:n,fontSizeMedium:r,fontSizeLarge:t,borderRadius:s,dividerColor:T,borderColor:"#0000",listColor:d,headerColor:c,titleTextColor:u,titleTextColorDisabled:f,extraTextColor:v,extraTextColorDisabled:f,itemTextColor:p,itemTextColorDisabled:f,itemColorPending:h,titleFontWeight:o,closeColorHover:m,closeColorPressed:b,closeIconColor:x,closeIconColorHover:S,closeIconColorPressed:B})}},jm=Em,Wm=e=>{const{borderRadiusSmall:o,hoverColor:t,pressedColor:r,primaryColor:n,textColor3:l,textColor2:a,textColorDisabled:s,fontSize:d}=e;return{fontSize:d,nodeBorderRadius:o,nodeColorHover:t,nodeColorPressed:r,nodeColorActive:J(n,{alpha:.1}),arrowColor:l,nodeTextColor:a,nodeTextColorDisabled:s,loadingColor:n,dropMarkColor:n}},Nm={name:"Tree",common:fe,peers:{Checkbox:Nt,Scrollbar:zo,Empty:zt},self(e){const{primaryColor:o}=e,t=Wm(e);return t.nodeColorActive=J(o,{alpha:.15}),t}},Ga=Nm,Vm={name:"TreeSelect",common:fe,peers:{Tree:Ga,Empty:zt,InternalSelection:wn}},Um=Vm,Km={headerFontSize1:"30px",headerFontSize2:"22px",headerFontSize3:"18px",headerFontSize4:"16px",headerFontSize5:"16px",headerFontSize6:"16px",headerMargin1:"28px 0 20px 0",headerMargin2:"28px 0 20px 0",headerMargin3:"28px 0 20px 0",headerMargin4:"28px 0 18px 0",headerMargin5:"28px 0 18px 0",headerMargin6:"28px 0 18px 0",headerPrefixWidth1:"16px",headerPrefixWidth2:"16px",headerPrefixWidth3:"12px",headerPrefixWidth4:"12px",headerPrefixWidth5:"12px",headerPrefixWidth6:"12px",headerBarWidth1:"4px",headerBarWidth2:"4px",headerBarWidth3:"3px",headerBarWidth4:"3px",headerBarWidth5:"3px",headerBarWidth6:"3px",pMargin:"16px 0 16px 0",liMargin:".25em 0 0 0",olPadding:"0 0 0 2em",ulPadding:"0 0 0 2em"},qa=e=>{const{primaryColor:o,textColor2:t,borderColor:r,lineHeight:n,fontSize:l,borderRadiusSmall:a,dividerColor:s,fontWeightStrong:d,textColor1:c,textColor3:u,infoColor:f,warningColor:p,errorColor:v,successColor:h,codeColor:m}=e;return Object.assign(Object.assign({},Km),{aTextColor:o,blockquoteTextColor:t,blockquotePrefixColor:r,blockquoteLineHeight:n,blockquoteFontSize:l,codeBorderRadius:a,liTextColor:t,liLineHeight:n,liFontSize:l,hrColor:s,headerFontWeight:d,headerTextColor:c,pTextColor:t,pTextColor1Depth:c,pTextColor2Depth:t,pTextColor3Depth:u,pLineHeight:n,pFontSize:l,headerBarColor:o,headerBarColorPrimary:o,headerBarColorInfo:f,headerBarColorError:v,headerBarColorWarning:p,headerBarColorSuccess:h,textColor:t,textColor1Depth:c,textColor2Depth:t,textColor3Depth:u,textColorPrimary:o,textColorInfo:f,textColorSuccess:h,textColorWarning:p,textColorError:v,codeTextColor:t,codeColor:m,codeBorder:"1px solid #0000"})},Gm={name:"Typography",common:Le,self:qa},Ya=Gm,qm={name:"Typography",common:fe,self:qa},Ym=qm,Xa=e=>{const{iconColor:o,primaryColor:t,errorColor:r,textColor2:n,successColor:l,opacityDisabled:a,actionColor:s,borderColor:d,hoverColor:c,lineHeight:u,borderRadius:f,fontSize:p}=e;return{fontSize:p,lineHeight:u,borderRadius:f,draggerColor:s,draggerBorder:`1px dashed ${d}`,draggerBorderHover:`1px dashed ${t}`,itemColorHover:c,itemColorHoverError:J(r,{alpha:.06}),itemTextColor:n,itemTextColorError:r,itemTextColorSuccess:l,itemIconColor:o,itemDisabledOpacity:a,itemBorderImageCardError:`1px solid ${r}`,itemBorderImageCard:`1px solid ${d}`}},Xm={name:"Upload",common:Le,peers:{Button:Wt,Progress:Aa},self:Xa},Zm=Xm,Qm={name:"Upload",common:fe,peers:{Button:$o,Progress:Ea},self(e){const{errorColor:o}=e,t=Xa(e);return t.itemColorHoverError=J(o,{alpha:.09}),t}},Jm=Qm,eb={name:"Watermark",common:fe,self(e){const{fontFamily:o}=e;return{fontFamily:o}}},ob=eb,tb={name:"Row",common:fe},rb=tb,nb={name:"Image",common:fe,peers:{Tooltip:Dr},self:e=>{const{textColor2:o}=e;return{toolbarIconColor:o,toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}},ib=i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M6 5C5.75454 5 5.55039 5.17688 5.50806 5.41012L5.5 5.5V14.5C5.5 14.7761 5.72386 15 6 15C6.24546 15 6.44961 14.8231 6.49194 14.5899L6.5 14.5V5.5C6.5 5.22386 6.27614 5 6 5ZM13.8536 5.14645C13.68 4.97288 13.4106 4.9536 13.2157 5.08859L13.1464 5.14645L8.64645 9.64645C8.47288 9.82001 8.4536 10.0894 8.58859 10.2843L8.64645 10.3536L13.1464 14.8536C13.3417 15.0488 13.6583 15.0488 13.8536 14.8536C14.0271 14.68 14.0464 14.4106 13.9114 14.2157L13.8536 14.1464L9.70711 10L13.8536 5.85355C14.0488 5.65829 14.0488 5.34171 13.8536 5.14645Z",fill:"currentColor"})),lb=i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M13.5 5C13.7455 5 13.9496 5.17688 13.9919 5.41012L14 5.5V14.5C14 14.7761 13.7761 15 13.5 15C13.2545 15 13.0504 14.8231 13.0081 14.5899L13 14.5V5.5C13 5.22386 13.2239 5 13.5 5ZM5.64645 5.14645C5.82001 4.97288 6.08944 4.9536 6.28431 5.08859L6.35355 5.14645L10.8536 9.64645C11.0271 9.82001 11.0464 10.0894 10.9114 10.2843L10.8536 10.3536L6.35355 14.8536C6.15829 15.0488 5.84171 15.0488 5.64645 14.8536C5.47288 14.68 5.4536 14.4106 5.58859 14.2157L5.64645 14.1464L9.79289 10L5.64645 5.85355C5.45118 5.65829 5.45118 5.34171 5.64645 5.14645Z",fill:"currentColor"})),ab=i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M4.089 4.216l.057-.07a.5.5 0 0 1 .638-.057l.07.057L10 9.293l5.146-5.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 .057.638l-.057.07L10.707 10l5.147 5.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.638.057l-.07-.057L10 10.707l-5.146 5.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1-.057-.638l.057-.07L9.293 10L4.146 4.854a.5.5 0 0 1-.057-.638l.057-.07l-.057.07z",fill:"currentColor"})),sb=C([C("body >",[g("image-container","position: fixed;")]),g("image-preview-container",` + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + display: flex; + `),g("image-preview-overlay",` + z-index: -1; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + background: rgba(0, 0, 0, .3); + `,[Mt()]),g("image-preview-toolbar",` + z-index: 1; + position: absolute; + left: 50%; + transform: translateX(-50%); + border-radius: var(--n-toolbar-border-radius); + height: 48px; + bottom: 40px; + padding: 0 12px; + background: var(--n-toolbar-color); + box-shadow: var(--n-toolbar-box-shadow); + color: var(--n-toolbar-icon-color); + transition: color .3s var(--n-bezier); + display: flex; + align-items: center; + `,[g("base-icon",` + padding: 0 8px; + font-size: 28px; + cursor: pointer; + `),Mt()]),g("image-preview-wrapper",` + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + display: flex; + pointer-events: none; + `,[at()]),g("image-preview",` + user-select: none; + -webkit-user-select: none; + pointer-events: all; + margin: auto; + max-height: calc(100vh - 32px); + max-width: calc(100vw - 32px); + transition: transform .3s var(--n-bezier); + `),g("image",` + display: inline-flex; + max-height: 100%; + max-width: 100%; + `,[je("preview-disabled",` + cursor: pointer; + `),C("img",` + border-radius: inherit; + `)])]),Cr=32,Za=q({name:"ImagePreview",props:Object.assign(Object.assign({},_n),{onNext:Function,onPrev:Function,clsPrefix:{type:String,required:!0}}),setup(e){const o=ne("Image","-image",sb,rg,e,le(e,"clsPrefix"));let t=null;const r=D(null),n=D(null),l=D(void 0),a=D(!1),s=D(!1),{localeRef:d}=Xo("Image");function c(){const{value:de}=n;if(!t||!de)return;const{style:ye}=de,pe=t.getBoundingClientRect(),Me=pe.left+pe.width/2,Q=pe.top+pe.height/2;ye.transformOrigin=`${Me}px ${Q}px`}function u(de){var ye,pe;switch(de.key){case" ":de.preventDefault();break;case"ArrowLeft":(ye=e.onPrev)===null||ye===void 0||ye.call(e);break;case"ArrowRight":(pe=e.onNext)===null||pe===void 0||pe.call(e);break;case"Escape":be();break}}Ke(a,de=>{de?Do("keydown",document,u):Ro("keydown",document,u)}),wo(()=>{Ro("keydown",document,u)});let f=0,p=0,v=0,h=0,m=0,b=0,x=0,S=0,B=!1;function T(de){const{clientX:ye,clientY:pe}=de;v=ye-f,h=pe-p,Ai(he)}function z(de){const{mouseUpClientX:ye,mouseUpClientY:pe,mouseDownClientX:Me,mouseDownClientY:Q}=de,A=Me-ye,Z=Q-pe,re=`vertical${Z>0?"Top":"Bottom"}`,ue=`horizontal${A>0?"Left":"Right"}`;return{moveVerticalDirection:re,moveHorizontalDirection:ue,deltaHorizontal:A,deltaVertical:Z}}function I(de){const{value:ye}=r;if(!ye)return{offsetX:0,offsetY:0};const pe=ye.getBoundingClientRect(),{moveVerticalDirection:Me,moveHorizontalDirection:Q,deltaHorizontal:A,deltaVertical:Z}=de||{};let re=0,ue=0;return pe.width<=window.innerWidth?re=0:pe.left>0?re=(pe.width-window.innerWidth)/2:pe.right0?ue=(pe.height-window.innerHeight)/2:pe.bottom.5){const de=j;M-=1,j=Math.max(.5,Math.pow(L,M));const ye=de-j;he(!1);const pe=I();j+=ye,he(!1),j-=ye,v=pe.offsetX,h=pe.offsetY,he()}}function he(de=!0){var ye;const{value:pe}=r;if(!pe)return;const{style:Me}=pe,Q=rd((ye=O==null?void 0:O.previewedImgPropsRef.value)===null||ye===void 0?void 0:ye.style);let A="";if(typeof Q=="string")A=Q+";";else for(const re in Q)A+=`${hd(re)}: ${Q[re]};`;const Z=`transform-origin: center; transform: translateX(${v}px) translateY(${h}px) rotate(${E}deg) scale(${j});`;B?Me.cssText=A+"cursor: grabbing; transition: none;"+Z:Me.cssText=A+"cursor: grab;"+Z+(de?"":"transition: none;"),de||pe.offsetHeight}function be(){a.value=!a.value,s.value=!0}function me(){j=Ce(),M=Math.ceil(Math.log(j)/Math.log(L)),v=0,h=0,he()}const se={setPreviewSrc:de=>{l.value=de},setThumbnailEl:de=>{t=de},toggleShow:be};function Re(de,ye){if(e.showToolbarTooltip){const{value:pe}=o;return i(Pn,{to:!1,theme:pe.peers.Tooltip,themeOverrides:pe.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>d.value[ye],trigger:()=>de})}else return de}const ge=R(()=>{const{common:{cubicBezierEaseInOut:de},self:{toolbarIconColor:ye,toolbarBorderRadius:pe,toolbarBoxShadow:Me,toolbarColor:Q}}=o.value;return{"--n-bezier":de,"--n-toolbar-icon-color":ye,"--n-toolbar-color":Q,"--n-toolbar-border-radius":pe,"--n-toolbar-box-shadow":Me}}),{inlineThemeDisabled:ee}=ke(),xe=ee?Ae("image-preview",void 0,ge,e):void 0;return Object.assign({previewRef:r,previewWrapperRef:n,previewSrc:l,show:a,appear:Ct(),displayed:s,previewedImgProps:O==null?void 0:O.previewedImgPropsRef,handleWheel(de){de.preventDefault()},handlePreviewMousedown:k,handlePreviewDblclick:$,syncTransformOrigin:c,handleAfterLeave:()=>{U(),E=0,s.value=!1},handleDragStart:de=>{var ye,pe;(pe=(ye=O==null?void 0:O.previewedImgPropsRef.value)===null||ye===void 0?void 0:ye.onDragstart)===null||pe===void 0||pe.call(ye,de),de.preventDefault()},zoomIn:X,zoomOut:ve,rotateCounterclockwise:te,rotateClockwise:N,handleSwitchPrev:_,handleSwitchNext:V,withTooltip:Re,resizeToOrignalImageSize:me,cssVars:ee?void 0:ge,themeClass:xe==null?void 0:xe.themeClass,onRender:xe==null?void 0:xe.onRender},se)},render(){var e,o;const{clsPrefix:t}=this;return i(ao,null,(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e),i(pn,{show:this.show},{default:()=>{var r;return this.show||this.displayed?((r=this.onRender)===null||r===void 0||r.call(this),Lo(i("div",{class:[`${t}-image-preview-container`,this.themeClass],style:this.cssVars,onWheel:this.handleWheel},i(no,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?i("div",{class:`${t}-image-preview-overlay`,onClick:this.toggleShow}):null}),this.showToolbar?i(no,{name:"fade-in-transition",appear:this.appear},{default:()=>{if(!this.show)return null;const{withTooltip:n}=this;return i("div",{class:`${t}-image-preview-toolbar`},this.onPrev?i(ao,null,n(i(De,{clsPrefix:t,onClick:this.handleSwitchPrev},{default:()=>ib}),"tipPrevious"),n(i(De,{clsPrefix:t,onClick:this.handleSwitchNext},{default:()=>lb}),"tipNext")):null,n(i(De,{clsPrefix:t,onClick:this.rotateCounterclockwise},{default:()=>i(oc,null)}),"tipCounterclockwise"),n(i(De,{clsPrefix:t,onClick:this.rotateClockwise},{default:()=>i(ec,null)}),"tipClockwise"),n(i(De,{clsPrefix:t,onClick:this.resizeToOrignalImageSize},{default:()=>i(nc,null)}),"tipOriginalSize"),n(i(De,{clsPrefix:t,onClick:this.zoomOut},{default:()=>i(rc,null)}),"tipZoomOut"),n(i(De,{clsPrefix:t,onClick:this.zoomIn},{default:()=>i(tc,null)}),"tipZoomIn"),n(i(De,{clsPrefix:t,onClick:this.toggleShow},{default:()=>ab}),"tipClose"))}}):null,i(no,{name:"fade-in-scale-up-transition",onAfterLeave:this.handleAfterLeave,appear:this.appear,onEnter:this.syncTransformOrigin,onBeforeLeave:this.syncTransformOrigin},{default:()=>{const{previewedImgProps:n={}}=this;return Lo(i("div",{class:`${t}-image-preview-wrapper`,ref:"previewWrapperRef"},i("img",Object.assign({},n,{draggable:!1,onMousedown:this.handlePreviewMousedown,onDblclick:this.handlePreviewDblclick,class:[`${t}-image-preview`,n.class],key:this.previewSrc,src:this.previewSrc,ref:"previewRef",onDragstart:this.handleDragStart}))),[[Go,this.show]])}})),[[Tr,{enabled:this.show}]])):null}}))}}),Qa="n-image-group",db=_n,cb=q({name:"ImageGroup",props:db,setup(e){let o;const{mergedClsPrefixRef:t}=ke(e),r=`c${it()}`,n=Pr(),l=d=>{var c;o=d,(c=s.value)===null||c===void 0||c.setPreviewSrc(d)};function a(d){if(!(n!=null&&n.proxy))return;const u=n.proxy.$el.parentElement.querySelectorAll(`[data-group-id=${r}]:not([data-error=true])`);if(!u.length)return;const f=Array.from(u).findIndex(p=>p.dataset.previewSrc===o);~f?l(u[(f+d+u.length)%u.length].dataset.previewSrc):l(u[0].dataset.previewSrc)}Oe(Qa,{mergedClsPrefixRef:t,setPreviewSrc:l,setThumbnailEl:d=>{var c;(c=s.value)===null||c===void 0||c.setThumbnailEl(d)},toggleShow:()=>{var d;(d=s.value)===null||d===void 0||d.toggleShow()},groupId:r});const s=D(null);return{mergedClsPrefix:t,previewInstRef:s,next:()=>{a(1)},prev:()=>{a(-1)}}},render(){return i(Za,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:this.mergedClsPrefix,ref:"previewInstRef",onPrev:this.prev,onNext:this.next,showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip},this.$slots)}}),ub=Object.assign({alt:String,height:[String,Number],imgProps:Object,previewedImgProps:Object,lazy:Boolean,intersectionObserverOptions:Object,objectFit:{type:String,default:"fill"},previewSrc:String,fallbackSrc:String,width:[String,Number],src:String,previewDisabled:Boolean,loadDescription:String,onError:Function,onLoad:Function},_n),fb=q({name:"Image",props:ub,inheritAttrs:!1,setup(e){const o=D(null),t=D(!1),r=D(null),n=Se(Qa,null),{mergedClsPrefixRef:l}=n||ke(e),a={click:()=>{if(e.previewDisabled||t.value)return;const c=e.previewSrc||e.src;if(n){n.setPreviewSrc(c),n.setThumbnailEl(o.value),n.toggleShow();return}const{value:u}=r;u&&(u.setPreviewSrc(c),u.setThumbnailEl(o.value),u.toggleShow())}},s=D(!e.lazy);mo(()=>{var c;(c=o.value)===null||c===void 0||c.setAttribute("data-group-id",(n==null?void 0:n.groupId)||"")}),mo(()=>{if(e.lazy&&e.intersectionObserverOptions){let c;const u=oo(()=>{c==null||c(),c=void 0,c=_l(o.value,e.intersectionObserverOptions,s)});wo(()=>{u(),c==null||c()})}}),oo(()=>{var c;e.src,(c=e.imgProps)===null||c===void 0||c.src,t.value=!1});const d=D(!1);return Oe(Oa,{previewedImgPropsRef:le(e,"previewedImgProps")}),Object.assign({mergedClsPrefix:l,groupId:n==null?void 0:n.groupId,previewInstRef:r,imageRef:o,showError:t,shouldStartLoading:s,loaded:d,mergedOnClick:c=>{var u,f;a.click(),(f=(u=e.imgProps)===null||u===void 0?void 0:u.onClick)===null||f===void 0||f.call(u,c)},mergedOnError:c=>{if(!s.value)return;t.value=!0;const{onError:u,imgProps:{onError:f}={}}=e;u==null||u(c),f==null||f(c)},mergedOnLoad:c=>{const{onLoad:u,imgProps:{onLoad:f}={}}=e;u==null||u(c),f==null||f(c),d.value=!0}},a)},render(){var e,o;const{mergedClsPrefix:t,imgProps:r={},loaded:n,$attrs:l,lazy:a}=this,s=(o=(e=this.$slots).placeholder)===null||o===void 0?void 0:o.call(e),d=this.src||r.src,c=i("img",Object.assign(Object.assign({},r),{ref:"imageRef",width:this.width||r.width,height:this.height||r.height,src:this.showError?this.fallbackSrc:a&&this.intersectionObserverOptions?this.shouldStartLoading?d:void 0:d,alt:this.alt||r.alt,"aria-label":this.alt||r.alt,onClick:this.mergedOnClick,onError:this.mergedOnError,onLoad:this.mergedOnLoad,loading:Sr&&a&&!this.intersectionObserverOptions?"lazy":"eager",style:[r.style||"",s&&!n?{height:"0",width:"0",visibility:"hidden"}:"",{objectFit:this.objectFit}],"data-error":this.showError,"data-preview-src":this.previewSrc||this.src}));return i("div",Object.assign({},l,{role:"none",class:[l.class,`${t}-image`,(this.previewDisabled||this.showError)&&`${t}-image--preview-disabled`]}),this.groupId?c:i(Za,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:t,ref:"previewInstRef",showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip},{default:()=>c}),!n&&s)}});function hb(e){return e==null||typeof e=="string"&&e.trim()===""?null:Number(e)}function pb(e){return e.includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^\.\d+$/.test(e))}function on(e){return e==null?!0:!Number.isNaN(e)}function Ri(e,o){return e==null?"":o===void 0?String(e):e.toFixed(o)}function tn(e){if(e===null)return null;if(typeof e=="number")return e;{const o=Number(e);return Number.isNaN(o)?null:o}}const vb=C([g("input-number-suffix",` + display: inline-block; + margin-right: 10px; + `),g("input-number-prefix",` + display: inline-block; + margin-left: 10px; + `)]),Pi=800,ki=100,gb=Object.assign(Object.assign({},ne.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:"right"},readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),_1=q({name:"InputNumber",props:gb,setup(e){const{mergedBorderedRef:o,mergedClsPrefixRef:t,mergedRtlRef:r}=ke(e),n=ne("InputNumber","-input-number",vb,xg,e,t),{localeRef:l}=Xo("InputNumber"),a=rt(e),{mergedSizeRef:s,mergedDisabledRef:d,mergedStatusRef:c}=a,u=D(null),f=D(null),p=D(null),v=D(e.defaultValue),h=le(e,"value"),m=so(h,v),b=D(""),x=A=>{const Z=String(A).split(".")[1];return Z?Z.length:0},S=A=>{const Z=[e.min,e.max,e.step,A].map(re=>re===void 0?0:x(re));return Math.max(...Z)},B=We(()=>{const{placeholder:A}=e;return A!==void 0?A:l.value.placeholder}),T=We(()=>{const A=tn(e.step);return A!==null?A===0?1:Math.abs(A):1}),z=We(()=>{const A=tn(e.min);return A!==null?A:null}),I=We(()=>{const A=tn(e.max);return A!==null?A:null}),w=A=>{const{value:Z}=m;if(A===Z){k();return}const{"onUpdate:value":re,onUpdateValue:ue,onChange:Y}=e,{nTriggerFormInput:ce,nTriggerFormChange:He}=a;Y&&ae(Y,A),ue&&ae(ue,A),re&&ae(re,A),v.value=A,ce(),He()},O=({offset:A,doUpdateIfValid:Z,fixPrecision:re,isInputing:ue})=>{const{value:Y}=b;if(ue&&pb(Y))return!1;const ce=(e.parse||hb)(Y);if(ce===null)return Z&&w(null),null;if(on(ce)){const He=x(ce),{precision:Ve}=e;if(Ve!==void 0&&Vepo){if(!Z||ue)return!1;Ze=po}if(fo!==null&&Ze{const{value:A}=m;if(on(A)){const{format:Z,precision:re}=e;Z?b.value=Z(A):A===null||re===void 0||x(A)>re?b.value=Ri(A,void 0):b.value=Ri(A,re)}else b.value=String(A)};k();const $=We(()=>O({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),L=We(()=>{const{value:A}=m;if(e.validator&&A===null)return!1;const{value:Z}=T;return O({offset:-Z,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),M=We(()=>{const{value:A}=m;if(e.validator&&A===null)return!1;const{value:Z}=T;return O({offset:+Z,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function j(A){const{onFocus:Z}=e,{nTriggerFormFocus:re}=a;Z&&ae(Z,A),re()}function E(A){var Z,re;if(A.target===((Z=u.value)===null||Z===void 0?void 0:Z.wrapperElRef))return;const ue=O({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(ue!==!1){const He=(re=u.value)===null||re===void 0?void 0:re.inputElRef;He&&(He.value=String(ue||"")),m.value===ue&&k()}else k();const{onBlur:Y}=e,{nTriggerFormBlur:ce}=a;Y&&ae(Y,A),ce(),io(()=>{k()})}function U(A){const{onClear:Z}=e;Z&&ae(Z,A)}function _(){const{value:A}=M;if(!A){se();return}const{value:Z}=m;if(Z===null)e.validator||w(G());else{const{value:re}=T;O({offset:re,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function V(){const{value:A}=L;if(!A){me();return}const{value:Z}=m;if(Z===null)e.validator||w(G());else{const{value:re}=T;O({offset:-re,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const te=j,N=E;function G(){if(e.validator)return null;const{value:A}=z,{value:Z}=I;return A!==null?Math.max(0,A):Z!==null?Math.min(0,Z):0}function Ce(A){U(A),w(null)}function X(A){var Z,re,ue;!((Z=p.value)===null||Z===void 0)&&Z.$el.contains(A.target)&&A.preventDefault(),!((re=f.value)===null||re===void 0)&&re.$el.contains(A.target)&&A.preventDefault(),(ue=u.value)===null||ue===void 0||ue.activate()}let ve=null,he=null,be=null;function me(){be&&(window.clearTimeout(be),be=null),ve&&(window.clearInterval(ve),ve=null)}function se(){ge&&(window.clearTimeout(ge),ge=null),he&&(window.clearInterval(he),he=null)}function Re(){me(),be=window.setTimeout(()=>{ve=window.setInterval(()=>{V()},ki)},Pi),Do("mouseup",document,me,{once:!0})}let ge=null;function ee(){se(),ge=window.setTimeout(()=>{he=window.setInterval(()=>{_()},ki)},Pi),Do("mouseup",document,se,{once:!0})}const xe=()=>{he||_()},de=()=>{ve||V()};function ye(A){var Z,re;if(A.key==="Enter"){if(A.target===((Z=u.value)===null||Z===void 0?void 0:Z.wrapperElRef))return;O({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((re=u.value)===null||re===void 0||re.deactivate())}else if(A.key==="ArrowUp"){if(!M.value||e.keyboard.ArrowUp===!1)return;A.preventDefault(),O({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&_()}else if(A.key==="ArrowDown"){if(!L.value||e.keyboard.ArrowDown===!1)return;A.preventDefault(),O({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&V()}}function pe(A){b.value=A,e.updateValueOnInput&&!e.format&&!e.parse&&e.precision===void 0&&O({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}Ke(m,()=>{k()});const Me={focus:()=>{var A;return(A=u.value)===null||A===void 0?void 0:A.focus()},blur:()=>{var A;return(A=u.value)===null||A===void 0?void 0:A.blur()}},Q=to("InputNumber",r,t);return Object.assign(Object.assign({},Me),{rtlEnabled:Q,inputInstRef:u,minusButtonInstRef:f,addButtonInstRef:p,mergedClsPrefix:t,mergedBordered:o,uncontrolledValue:v,mergedValue:m,mergedPlaceholder:B,displayedValueInvalid:$,mergedSize:s,mergedDisabled:d,displayedValue:b,addable:M,minusable:L,mergedStatus:c,handleFocus:te,handleBlur:N,handleClear:Ce,handleMouseDown:X,handleAddClick:xe,handleMinusClick:de,handleAddMousedown:ee,handleMinusMousedown:Re,handleKeyDown:ye,handleUpdateDisplayedValue:pe,mergedTheme:n,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:R(()=>{const{self:{iconColorDisabled:A}}=n.value,[Z,re,ue,Y]=ir(A);return{textColorTextDisabled:`rgb(${Z}, ${re}, ${ue})`,opacityDisabled:`${Y}`}})})},render(){const{mergedClsPrefix:e,$slots:o}=this,t=()=>i(pi,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:"minusButtonInstRef"},{icon:()=>lo(o["minus-icon"],()=>[i(De,{clsPrefix:e},{default:()=>i(cl,null)})])}),r=()=>i(pi,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:"addButtonInstRef"},{icon:()=>lo(o["add-icon"],()=>[i(De,{clsPrefix:e},{default:()=>i(tr,null)})])});return i("div",{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},i(xt,{ref:"inputInstRef",autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,textDecoration:this.displayedValueInvalid?"line-through":void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,internalLoadingBeforeSuffix:!0},{prefix:()=>{var n;return this.showButton&&this.buttonPlacement==="both"?[t(),Ee(o.prefix,l=>l?i("span",{class:`${e}-input-number-prefix`},l):null)]:(n=o.prefix)===null||n===void 0?void 0:n.call(o)},suffix:()=>{var n;return this.showButton?[Ee(o.suffix,l=>l?i("span",{class:`${e}-input-number-suffix`},l):null),this.buttonPlacement==="right"?t():null,r()]:(n=o.suffix)===null||n===void 0?void 0:n.call(o)}}))}}),mb="n-layout-sider",bb={extraFontSize:"12px",width:"440px"},xb={name:"Transfer",common:fe,peers:{Checkbox:Nt,Scrollbar:zo,Input:Ho,Empty:zt,Button:$o},self(e){const{iconColorDisabled:o,iconColor:t,fontWeight:r,fontSizeLarge:n,fontSizeMedium:l,fontSizeSmall:a,heightLarge:s,heightMedium:d,heightSmall:c,borderRadius:u,inputColor:f,tableHeaderColor:p,textColor1:v,textColorDisabled:h,textColor2:m,hoverColor:b}=e;return Object.assign(Object.assign({},bb),{itemHeightSmall:c,itemHeightMedium:d,itemHeightLarge:s,fontSizeSmall:a,fontSizeMedium:l,fontSizeLarge:n,borderRadius:u,borderColor:"#0000",listColor:f,headerColor:p,titleTextColor:v,titleTextColorDisabled:h,extraTextColor:m,filterDividerColor:"#0000",itemTextColor:m,itemTextColorDisabled:h,itemColorPending:b,titleFontWeight:r,iconColor:t,iconColorDisabled:o})}},Cb=xb,yb=C([g("list",` + --n-merged-border-color: var(--n-border-color); + --n-merged-color: var(--n-color); + --n-merged-color-hover: var(--n-color-hover); + margin: 0; + font-size: var(--n-font-size); + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier), + border-color .3s var(--n-bezier); + padding: 0; + list-style-type: none; + color: var(--n-text-color); + background-color: var(--n-merged-color); + `,[P("show-divider",[g("list-item",[C("&:not(:last-child)",[y("divider",` + background-color: var(--n-merged-border-color); + `)])])]),P("clickable",[g("list-item",` + cursor: pointer; + `)]),P("bordered",` + border: 1px solid var(--n-merged-border-color); + border-radius: var(--n-border-radius); + `),P("hoverable",[g("list-item",` + border-radius: var(--n-border-radius); + `,[C("&:hover",` + background-color: var(--n-merged-color-hover); + `,[y("divider",` + background-color: transparent; + `)])])]),P("bordered, hoverable",[g("list-item",` + padding: 12px 20px; + `),y("header, footer",` + padding: 12px 20px; + `)]),y("header, footer",` + padding: 12px 0; + box-sizing: border-box; + transition: border-color .3s var(--n-bezier); + `,[C("&:not(:last-child)",` + border-bottom: 1px solid var(--n-merged-border-color); + `)]),g("list-item",` + position: relative; + padding: 12px 0; + box-sizing: border-box; + display: flex; + flex-wrap: nowrap; + align-items: center; + transition: + background-color .3s var(--n-bezier), + border-color .3s var(--n-bezier); + `,[y("prefix",` + margin-right: 20px; + flex: 0; + `),y("suffix",` + margin-left: 20px; + flex: 0; + `),y("main",` + flex: 1; + `),y("divider",` + height: 1px; + position: absolute; + bottom: 0; + left: 0; + right: 0; + background-color: transparent; + transition: background-color .3s var(--n-bezier); + pointer-events: none; + `)])]),Or(g("list",` + --n-merged-color-hover: var(--n-color-hover-modal); + --n-merged-color: var(--n-color-modal); + --n-merged-border-color: var(--n-border-color-modal); + `)),gn(g("list",` + --n-merged-color-hover: var(--n-color-hover-popover); + --n-merged-color: var(--n-color-popover); + --n-merged-border-color: var(--n-border-color-popover); + `))]),wb=Object.assign(Object.assign({},ne.props),{size:{type:String,default:"medium"},bordered:Boolean,clickable:Boolean,hoverable:Boolean,showDivider:{type:Boolean,default:!0}}),Ja="n-list",D1=q({name:"List",props:wb,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t,mergedRtlRef:r}=ke(e),n=to("List",r,o),l=ne("List","-list",yb,Sg,e,o);Oe(Ja,{showDividerRef:le(e,"showDivider"),mergedClsPrefixRef:o});const a=R(()=>{const{common:{cubicBezierEaseInOut:d},self:{fontSize:c,textColor:u,color:f,colorModal:p,colorPopover:v,borderColor:h,borderColorModal:m,borderColorPopover:b,borderRadius:x,colorHover:S,colorHoverModal:B,colorHoverPopover:T}}=l.value;return{"--n-font-size":c,"--n-bezier":d,"--n-text-color":u,"--n-color":f,"--n-border-radius":x,"--n-border-color":h,"--n-border-color-modal":m,"--n-border-color-popover":b,"--n-color-modal":p,"--n-color-popover":v,"--n-color-hover":S,"--n-color-hover-modal":B,"--n-color-hover-popover":T}}),s=t?Ae("list",void 0,a,e):void 0;return{mergedClsPrefix:o,rtlEnabled:n,cssVars:t?void 0:a,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){var e;const{$slots:o,mergedClsPrefix:t,onRender:r}=this;return r==null||r(),i("ul",{class:[`${t}-list`,this.rtlEnabled&&`${t}-list--rtl`,this.bordered&&`${t}-list--bordered`,this.showDivider&&`${t}-list--show-divider`,this.hoverable&&`${t}-list--hoverable`,this.clickable&&`${t}-list--clickable`,this.themeClass],style:this.cssVars},o.header?i("div",{class:`${t}-list__header`},o.header()):null,(e=o.default)===null||e===void 0?void 0:e.call(o),o.footer?i("div",{class:`${t}-list__footer`},o.footer()):null)}}),L1=q({name:"ListItem",setup(){const e=Se(Ja,null);return e||Eo("list-item","`n-list-item` must be placed in `n-list`."),{showDivider:e.showDividerRef,mergedClsPrefix:e.mergedClsPrefixRef}},render(){const{$slots:e,mergedClsPrefix:o}=this;return i("li",{class:`${o}-list-item`},e.prefix?i("div",{class:`${o}-list-item__prefix`},e.prefix()):null,e.default?i("div",{class:`${o}-list-item__main`},e):null,e.suffix?i("div",{class:`${o}-list-item__suffix`},e.suffix()):null,this.showDivider&&i("div",{class:`${o}-list-item__divider`}))}}),gr="n-menu",Dn="n-submenu",Ln="n-menu-item-group",yr=8;function Hn(e){const o=Se(gr),{props:t,mergedCollapsedRef:r}=o,n=Se(Dn,null),l=Se(Ln,null),a=R(()=>t.mode==="horizontal"),s=R(()=>a.value?t.dropdownPlacement:"tmNodes"in e?"right-start":"right"),d=R(()=>{var p;return Math.max((p=t.collapsedIconSize)!==null&&p!==void 0?p:t.iconSize,t.iconSize)}),c=R(()=>{var p;return!a.value&&e.root&&r.value&&(p=t.collapsedIconSize)!==null&&p!==void 0?p:t.iconSize}),u=R(()=>{if(a.value)return;const{collapsedWidth:p,indent:v,rootIndent:h}=t,{root:m,isGroup:b}=e,x=h===void 0?v:h;if(m)return r.value?p/2-d.value/2:x;if(l)return v/2+l.paddingLeftRef.value;if(n)return(b?v/2:v)+n.paddingLeftRef.value}),f=R(()=>{const{collapsedWidth:p,indent:v,rootIndent:h}=t,{value:m}=d,{root:b}=e;return a.value||!b||!r.value?yr:(h===void 0?v:h)+m+yr-(p+m)/2});return{dropdownPlacement:s,activeIconSize:c,maxIconSize:d,paddingLeft:u,iconMarginRight:f,NMenu:o,NSubmenu:n}}const An={internalKey:{type:[String,Number],required:!0},root:Boolean,isGroup:Boolean,level:{type:Number,required:!0},title:[String,Function],extra:[String,Function]},es=Object.assign(Object.assign({},An),{tmNode:{type:Object,required:!0},tmNodes:{type:Array,required:!0}}),Sb=q({name:"MenuOptionGroup",props:es,setup(e){Oe(Dn,null);const o=Hn(e);Oe(Ln,{paddingLeftRef:o.paddingLeft});const{mergedClsPrefixRef:t,props:r}=Se(gr);return function(){const{value:n}=t,l=o.paddingLeft.value,{nodeProps:a}=r,s=a==null?void 0:a(e.tmNode.rawNode);return i("div",{class:`${n}-menu-item-group`,role:"group"},i("div",Object.assign({},s,{class:[`${n}-menu-item-group-title`,s==null?void 0:s.class],style:[(s==null?void 0:s.style)||"",l!==void 0?`padding-left: ${l}px;`:""]}),qe(e.title),e.extra?i(ao,null," ",qe(e.extra)):null),i("div",null,e.tmNodes.map(d=>En(d,r))))}}}),os=q({name:"MenuOptionContent",props:{collapsed:Boolean,disabled:Boolean,title:[String,Function],icon:Function,extra:[String,Function],showArrow:Boolean,childActive:Boolean,hover:Boolean,paddingLeft:Number,selected:Boolean,maxIconSize:{type:Number,required:!0},activeIconSize:{type:Number,required:!0},iconMarginRight:{type:Number,required:!0},clsPrefix:{type:String,required:!0},onClick:Function,tmNode:{type:Object,required:!0}},setup(e){const{props:o}=Se(gr);return{menuProps:o,style:R(()=>{const{paddingLeft:t}=e;return{paddingLeft:t&&`${t}px`}}),iconStyle:R(()=>{const{maxIconSize:t,activeIconSize:r,iconMarginRight:n}=e;return{width:`${t}px`,height:`${t}px`,fontSize:`${r}px`,marginRight:`${n}px`}})}},render(){const{clsPrefix:e,tmNode:o,menuProps:{renderIcon:t,renderLabel:r,renderExtra:n,expandIcon:l}}=this,a=t?t(o.rawNode):qe(this.icon);return i("div",{onClick:s=>{var d;(d=this.onClick)===null||d===void 0||d.call(this,s)},role:"none",class:[`${e}-menu-item-content`,{[`${e}-menu-item-content--selected`]:this.selected,[`${e}-menu-item-content--collapsed`]:this.collapsed,[`${e}-menu-item-content--child-active`]:this.childActive,[`${e}-menu-item-content--disabled`]:this.disabled,[`${e}-menu-item-content--hover`]:this.hover}],style:this.style},a&&i("div",{class:`${e}-menu-item-content__icon`,style:this.iconStyle,role:"none"},[a]),i("div",{class:`${e}-menu-item-content-header`,role:"none"},r?r(o.rawNode):qe(this.title),this.extra||n?i("span",{class:`${e}-menu-item-content-header__extra`}," ",n?n(o.rawNode):qe(this.extra)):null),this.showArrow?i(De,{ariaHidden:!0,class:`${e}-menu-item-content__arrow`,clsPrefix:e},{default:()=>l?l(o.rawNode):i(Qd,null)}):null)}}),ts=Object.assign(Object.assign({},An),{rawNodes:{type:Array,default:()=>[]},tmNodes:{type:Array,default:()=>[]},tmNode:{type:Object,required:!0},disabled:{type:Boolean,default:!1},icon:Function,onClick:Function}),zb=q({name:"Submenu",props:ts,setup(e){const o=Hn(e),{NMenu:t,NSubmenu:r}=o,{props:n,mergedCollapsedRef:l,mergedThemeRef:a}=t,s=R(()=>{const{disabled:p}=e;return r!=null&&r.mergedDisabledRef.value||n.disabled?!0:p}),d=D(!1);Oe(Dn,{paddingLeftRef:o.paddingLeft,mergedDisabledRef:s}),Oe(Ln,null);function c(){const{onClick:p}=e;p&&p()}function u(){s.value||(l.value||t.toggleExpand(e.internalKey),c())}function f(p){d.value=p}return{menuProps:n,mergedTheme:a,doSelect:t.doSelect,inverted:t.invertedRef,isHorizontal:t.isHorizontalRef,mergedClsPrefix:t.mergedClsPrefixRef,maxIconSize:o.maxIconSize,activeIconSize:o.activeIconSize,iconMarginRight:o.iconMarginRight,dropdownPlacement:o.dropdownPlacement,dropdownShow:d,paddingLeft:o.paddingLeft,mergedDisabled:s,mergedValue:t.mergedValueRef,childActive:We(()=>t.activePathRef.value.includes(e.internalKey)),collapsed:R(()=>n.mode==="horizontal"?!1:l.value?!0:!t.mergedExpandedKeysRef.value.includes(e.internalKey)),dropdownEnabled:R(()=>!s.value&&(n.mode==="horizontal"||l.value)),handlePopoverShowChange:f,handleClick:u}},render(){var e;const{mergedClsPrefix:o,menuProps:{renderIcon:t,renderLabel:r}}=this,n=()=>{const{isHorizontal:a,paddingLeft:s,collapsed:d,mergedDisabled:c,maxIconSize:u,activeIconSize:f,title:p,childActive:v,icon:h,handleClick:m,menuProps:{nodeProps:b},dropdownShow:x,iconMarginRight:S,tmNode:B,mergedClsPrefix:T}=this,z=b==null?void 0:b(B.rawNode);return i("div",Object.assign({},z,{class:[`${T}-menu-item`,z==null?void 0:z.class],role:"menuitem"}),i(os,{tmNode:B,paddingLeft:s,collapsed:d,disabled:c,iconMarginRight:S,maxIconSize:u,activeIconSize:f,title:p,extra:this.extra,showArrow:!a,childActive:v,clsPrefix:T,icon:h,hover:x,onClick:m}))},l=()=>i(wt,null,{default:()=>{const{tmNodes:a,collapsed:s}=this;return s?null:i("div",{class:`${o}-submenu-children`,role:"menu"},a.map(d=>En(d,this.menuProps)))}});return this.root?i(Jh,Object.assign({size:"large",trigger:"hover"},(e=this.menuProps)===null||e===void 0?void 0:e.dropdownProps,{themeOverrides:this.mergedTheme.peerOverrides.Dropdown,theme:this.mergedTheme.peers.Dropdown,builtinThemeOverrides:{fontSizeLarge:"14px",optionIconSizeLarge:"18px"},value:this.mergedValue,disabled:!this.dropdownEnabled,placement:this.dropdownPlacement,keyField:this.menuProps.keyField,labelField:this.menuProps.labelField,childrenField:this.menuProps.childrenField,onUpdateShow:this.handlePopoverShowChange,options:this.rawNodes,onSelect:this.doSelect,inverted:this.inverted,renderIcon:t,renderLabel:r}),{default:()=>i("div",{class:`${o}-submenu`,role:"menuitem","aria-expanded":!this.collapsed},n(),this.isHorizontal?null:l())}):i("div",{class:`${o}-submenu`,role:"menuitem","aria-expanded":!this.collapsed},n(),l())}}),rs=Object.assign(Object.assign({},An),{tmNode:{type:Object,required:!0},disabled:Boolean,icon:Function,onClick:Function}),$b=q({name:"MenuOption",props:rs,setup(e){const o=Hn(e),{NSubmenu:t,NMenu:r}=o,{props:n,mergedClsPrefixRef:l,mergedCollapsedRef:a}=r,s=t?t.mergedDisabledRef:{value:!1},d=R(()=>s.value||e.disabled);function c(f){const{onClick:p}=e;p&&p(f)}function u(f){d.value||(r.doSelect(e.internalKey,e.tmNode.rawNode),c(f))}return{mergedClsPrefix:l,dropdownPlacement:o.dropdownPlacement,paddingLeft:o.paddingLeft,iconMarginRight:o.iconMarginRight,maxIconSize:o.maxIconSize,activeIconSize:o.activeIconSize,mergedTheme:r.mergedThemeRef,menuProps:n,dropdownEnabled:We(()=>e.root&&a.value&&n.mode!=="horizontal"&&!d.value),selected:We(()=>r.mergedValueRef.value===e.internalKey),mergedDisabled:d,handleClick:u}},render(){const{mergedClsPrefix:e,mergedTheme:o,tmNode:t,menuProps:{renderLabel:r,nodeProps:n}}=this,l=n==null?void 0:n(t.rawNode);return i("div",Object.assign({},l,{role:"menuitem",class:[`${e}-menu-item`,l==null?void 0:l.class]}),i(Pn,{theme:o.peers.Tooltip,themeOverrides:o.peerOverrides.Tooltip,trigger:"hover",placement:this.dropdownPlacement,disabled:!this.dropdownEnabled||this.title===void 0,internalExtraClass:["menu-tooltip"]},{default:()=>r?r(t.rawNode):qe(this.title),trigger:()=>i(os,{tmNode:t,clsPrefix:e,paddingLeft:this.paddingLeft,iconMarginRight:this.iconMarginRight,maxIconSize:this.maxIconSize,activeIconSize:this.activeIconSize,selected:this.selected,title:this.title,extra:this.extra,disabled:this.mergedDisabled,icon:this.icon,onClick:this.handleClick})}))}}),Rb=q({name:"MenuDivider",setup(){const e=Se(gr),{mergedClsPrefixRef:o,isHorizontalRef:t}=e;return()=>t.value?null:i("div",{class:`${o.value}-menu-divider`})}}),Pb=yo(es),kb=yo(rs),Ib=yo(ts);function ns(e){return e.type==="divider"||e.type==="render"}function Bb(e){return e.type==="divider"}function En(e,o){const{rawNode:t}=e,{show:r}=t;if(r===!1)return null;if(ns(t))return Bb(t)?i(Rb,Object.assign({key:e.key},t.props)):null;const{labelField:n}=o,{key:l,level:a,isGroup:s}=e,d=Object.assign(Object.assign({},t),{title:t.title||t[n],extra:t.titleExtra||t.extra,key:l,internalKey:l,level:a,root:a===0,isGroup:s});return e.children?e.isGroup?i(Sb,go(d,Pb,{tmNode:e,tmNodes:e.children,key:l})):i(zb,go(d,Ib,{key:l,rawNodes:t[o.childrenField],tmNodes:e.children,tmNode:e})):i($b,go(d,kb,{key:l,tmNode:e}))}const Ii=[C("&::before","background-color: var(--n-item-color-hover);"),y("arrow",` + color: var(--n-arrow-color-hover); + `),y("icon",` + color: var(--n-item-icon-color-hover); + `),g("menu-item-content-header",` + color: var(--n-item-text-color-hover); + `,[C("a",` + color: var(--n-item-text-color-hover); + `),y("extra",` + color: var(--n-item-text-color-hover); + `)])],Bi=[y("icon",` + color: var(--n-item-icon-color-hover-horizontal); + `),g("menu-item-content-header",` + color: var(--n-item-text-color-hover-horizontal); + `,[C("a",` + color: var(--n-item-text-color-hover-horizontal); + `),y("extra",` + color: var(--n-item-text-color-hover-horizontal); + `)])],Tb=C([g("menu",` + background-color: var(--n-color); + color: var(--n-item-text-color); + overflow: hidden; + transition: background-color .3s var(--n-bezier); + box-sizing: border-box; + font-size: var(--n-font-size); + padding-bottom: 6px; + `,[P("horizontal",` + display: inline-flex; + padding-bottom: 0; + `,[g("submenu","margin: 0;"),g("menu-item","margin: 0;"),g("menu-item-content",` + padding: 0 20px; + border-bottom: 2px solid #0000; + `,[C("&::before","display: none;"),P("selected","border-bottom: 2px solid var(--n-border-color-horizontal)")]),g("menu-item-content",[P("selected",[y("icon","color: var(--n-item-icon-color-active-horizontal);"),g("menu-item-content-header",` + color: var(--n-item-text-color-active-horizontal); + `,[C("a","color: var(--n-item-text-color-active-horizontal);"),y("extra","color: var(--n-item-text-color-active-horizontal);")])]),P("child-active",` + border-bottom: 2px solid var(--n-border-color-horizontal); + `,[g("menu-item-content-header",` + color: var(--n-item-text-color-child-active-horizontal); + `,[C("a",` + color: var(--n-item-text-color-child-active-horizontal); + `),y("extra",` + color: var(--n-item-text-color-child-active-horizontal); + `)]),y("icon",` + color: var(--n-item-icon-color-child-active-horizontal); + `)]),je("disabled",[je("selected, child-active",[C("&:focus-within",Bi)]),P("selected",[ft(null,[y("icon","color: var(--n-item-icon-color-active-hover-horizontal);"),g("menu-item-content-header",` + color: var(--n-item-text-color-active-hover-horizontal); + `,[C("a","color: var(--n-item-text-color-active-hover-horizontal);"),y("extra","color: var(--n-item-text-color-active-hover-horizontal);")])])]),P("child-active",[ft(null,[y("icon","color: var(--n-item-icon-color-child-active-hover-horizontal);"),g("menu-item-content-header",` + color: var(--n-item-text-color-child-active-hover-horizontal); + `,[C("a","color: var(--n-item-text-color-child-active-hover-horizontal);"),y("extra","color: var(--n-item-text-color-child-active-hover-horizontal);")])])]),ft("border-bottom: 2px solid var(--n-border-color-horizontal);",Bi)]),g("menu-item-content-header",[C("a","color: var(--n-item-text-color-horizontal);")])])]),P("collapsed",[g("menu-item-content",[P("selected",[C("&::before",` + background-color: var(--n-item-color-active-collapsed) !important; + `)]),g("menu-item-content-header","opacity: 0;"),y("arrow","opacity: 0;"),y("icon","color: var(--n-item-icon-color-collapsed);")])]),g("menu-item",` + height: var(--n-item-height); + margin-top: 6px; + position: relative; + `),g("menu-item-content",` + box-sizing: border-box; + line-height: 1.75; + height: 100%; + display: grid; + grid-template-areas: "icon content arrow"; + grid-template-columns: auto 1fr auto; + align-items: center; + cursor: pointer; + position: relative; + padding-right: 18px; + transition: + background-color .3s var(--n-bezier), + padding-left .3s var(--n-bezier), + border-color .3s var(--n-bezier); + `,[C("> *","z-index: 1;"),C("&::before",` + z-index: auto; + content: ""; + background-color: #0000; + position: absolute; + left: 8px; + right: 8px; + top: 0; + bottom: 0; + pointer-events: none; + border-radius: var(--n-border-radius); + transition: background-color .3s var(--n-bezier); + `),P("disabled",` + opacity: .45; + cursor: not-allowed; + `),P("collapsed",[y("arrow","transform: rotate(0);")]),P("selected",[C("&::before","background-color: var(--n-item-color-active);"),y("arrow","color: var(--n-arrow-color-active);"),y("icon","color: var(--n-item-icon-color-active);"),g("menu-item-content-header",` + color: var(--n-item-text-color-active); + `,[C("a","color: var(--n-item-text-color-active);"),y("extra","color: var(--n-item-text-color-active);")])]),P("child-active",[g("menu-item-content-header",` + color: var(--n-item-text-color-child-active); + `,[C("a",` + color: var(--n-item-text-color-child-active); + `),y("extra",` + color: var(--n-item-text-color-child-active); + `)]),y("arrow",` + color: var(--n-arrow-color-child-active); + `),y("icon",` + color: var(--n-item-icon-color-child-active); + `)]),je("disabled",[je("selected, child-active",[C("&:focus-within",Ii)]),P("selected",[ft(null,[y("arrow","color: var(--n-arrow-color-active-hover);"),y("icon","color: var(--n-item-icon-color-active-hover);"),g("menu-item-content-header",` + color: var(--n-item-text-color-active-hover); + `,[C("a","color: var(--n-item-text-color-active-hover);"),y("extra","color: var(--n-item-text-color-active-hover);")])])]),P("child-active",[ft(null,[y("arrow","color: var(--n-arrow-color-child-active-hover);"),y("icon","color: var(--n-item-icon-color-child-active-hover);"),g("menu-item-content-header",` + color: var(--n-item-text-color-child-active-hover); + `,[C("a","color: var(--n-item-text-color-child-active-hover);"),y("extra","color: var(--n-item-text-color-child-active-hover);")])])]),P("selected",[ft(null,[C("&::before","background-color: var(--n-item-color-active-hover);")])]),ft(null,Ii)]),y("icon",` + grid-area: icon; + color: var(--n-item-icon-color); + transition: + color .3s var(--n-bezier), + font-size .3s var(--n-bezier), + margin-right .3s var(--n-bezier); + box-sizing: content-box; + display: inline-flex; + align-items: center; + justify-content: center; + `),y("arrow",` + grid-area: arrow; + font-size: 16px; + color: var(--n-arrow-color); + transform: rotate(180deg); + opacity: 1; + transition: + color .3s var(--n-bezier), + transform 0.2s var(--n-bezier), + opacity 0.2s var(--n-bezier); + `),g("menu-item-content-header",` + grid-area: content; + transition: + color .3s var(--n-bezier), + opacity .3s var(--n-bezier); + opacity: 1; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: var(--n-item-text-color); + `,[C("a",` + outline: none; + text-decoration: none; + transition: color .3s var(--n-bezier); + color: var(--n-item-text-color); + `,[C("&::before",` + content: ""; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + `)]),y("extra",` + font-size: .93em; + color: var(--n-group-text-color); + transition: color .3s var(--n-bezier); + `)])]),g("submenu",` + cursor: pointer; + position: relative; + margin-top: 6px; + `,[g("menu-item-content",` + height: var(--n-item-height); + `),g("submenu-children",` + overflow: hidden; + padding: 0; + `,[rr({duration:".2s"})])]),g("menu-item-group",[g("menu-item-group-title",` + margin-top: 6px; + color: var(--n-group-text-color); + cursor: default; + font-size: .93em; + height: 36px; + display: flex; + align-items: center; + transition: + padding-left .3s var(--n-bezier), + color .3s var(--n-bezier); + `)])]),g("menu-tooltip",[C("a",` + color: inherit; + text-decoration: none; + `)]),g("menu-divider",` + transition: background-color .3s var(--n-bezier); + background-color: var(--n-divider-color); + height: 1px; + margin: 6px 18px; + `)]);function ft(e,o){return[P("hover",e,o),C("&:hover",e,o)]}const Fb=Object.assign(Object.assign({},ne.props),{options:{type:Array,default:()=>[]},collapsed:{type:Boolean,default:void 0},collapsedWidth:{type:Number,default:48},iconSize:{type:Number,default:20},collapsedIconSize:{type:Number,default:24},rootIndent:Number,indent:{type:Number,default:32},labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},disabledField:{type:String,default:"disabled"},defaultExpandAll:Boolean,defaultExpandedKeys:Array,expandedKeys:Array,value:[String,Number],defaultValue:{type:[String,Number],default:null},mode:{type:String,default:"vertical"},watchProps:{type:Array,default:void 0},disabled:Boolean,show:{type:Boolean,default:!0},inverted:Boolean,"onUpdate:expandedKeys":[Function,Array],onUpdateExpandedKeys:[Function,Array],onUpdateValue:[Function,Array],"onUpdate:value":[Function,Array],expandIcon:Function,renderIcon:Function,renderLabel:Function,renderExtra:Function,dropdownProps:Object,accordion:Boolean,nodeProps:Function,items:Array,onOpenNamesChange:[Function,Array],onSelect:[Function,Array],onExpandedNamesChange:[Function,Array],expandedNames:Array,defaultExpandedNames:Array,dropdownPlacement:{type:String,default:"bottom"}}),H1=q({name:"Menu",props:Fb,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Menu","-menu",Tb,Lg,e,o),n=Se(mb,null),l=R(()=>{var O;const{collapsed:k}=e;if(k!==void 0)return k;if(n){const{collapseModeRef:$,collapsedRef:L}=n;if($.value==="width")return(O=L.value)!==null&&O!==void 0?O:!1}return!1}),a=R(()=>{const{keyField:O,childrenField:k,disabledField:$}=e;return ar(e.items||e.options,{getIgnored(L){return ns(L)},getChildren(L){return L[k]},getDisabled(L){return L[$]},getKey(L){var M;return(M=L[O])!==null&&M!==void 0?M:L.name}})}),s=R(()=>new Set(a.value.treeNodes.map(O=>O.key))),{watchProps:d}=e,c=D(null);d!=null&&d.includes("defaultValue")?oo(()=>{c.value=e.defaultValue}):c.value=e.defaultValue;const u=le(e,"value"),f=so(u,c),p=D([]),v=()=>{p.value=e.defaultExpandAll?a.value.getNonLeafKeys():e.defaultExpandedNames||e.defaultExpandedKeys||a.value.getPath(f.value,{includeSelf:!1}).keyPath};d!=null&&d.includes("defaultExpandedKeys")?oo(v):v();const h=gt(e,["expandedNames","expandedKeys"]),m=so(h,p),b=R(()=>a.value.treeNodes),x=R(()=>a.value.getPath(f.value).keyPath);Oe(gr,{props:e,mergedCollapsedRef:l,mergedThemeRef:r,mergedValueRef:f,mergedExpandedKeysRef:m,activePathRef:x,mergedClsPrefixRef:o,isHorizontalRef:R(()=>e.mode==="horizontal"),invertedRef:le(e,"inverted"),doSelect:S,toggleExpand:T});function S(O,k){const{"onUpdate:value":$,onUpdateValue:L,onSelect:M}=e;L&&ae(L,O,k),$&&ae($,O,k),M&&ae(M,O,k),c.value=O}function B(O){const{"onUpdate:expandedKeys":k,onUpdateExpandedKeys:$,onExpandedNamesChange:L,onOpenNamesChange:M}=e;k&&ae(k,O),$&&ae($,O),L&&ae(L,O),M&&ae(M,O),p.value=O}function T(O){const k=Array.from(m.value),$=k.findIndex(L=>L===O);if(~$)k.splice($,1);else{if(e.accordion&&s.value.has(O)){const L=k.findIndex(M=>s.value.has(M));L>-1&&k.splice(L,1)}k.push(O)}B(k)}const z=O=>{const k=a.value.getPath(O??f.value,{includeSelf:!1}).keyPath;if(!k.length)return;const $=Array.from(m.value),L=new Set([...$,...k]);e.accordion&&s.value.forEach(M=>{L.has(M)&&!k.includes(M)&&L.delete(M)}),B(Array.from(L))},I=R(()=>{const{inverted:O}=e,{common:{cubicBezierEaseInOut:k},self:$}=r.value,{borderRadius:L,borderColorHorizontal:M,fontSize:j,itemHeight:E,dividerColor:U}=$,_={"--n-divider-color":U,"--n-bezier":k,"--n-font-size":j,"--n-border-color-horizontal":M,"--n-border-radius":L,"--n-item-height":E};return O?(_["--n-group-text-color"]=$.groupTextColorInverted,_["--n-color"]=$.colorInverted,_["--n-item-text-color"]=$.itemTextColorInverted,_["--n-item-text-color-hover"]=$.itemTextColorHoverInverted,_["--n-item-text-color-active"]=$.itemTextColorActiveInverted,_["--n-item-text-color-child-active"]=$.itemTextColorChildActiveInverted,_["--n-item-text-color-child-active-hover"]=$.itemTextColorChildActiveInverted,_["--n-item-text-color-active-hover"]=$.itemTextColorActiveHoverInverted,_["--n-item-icon-color"]=$.itemIconColorInverted,_["--n-item-icon-color-hover"]=$.itemIconColorHoverInverted,_["--n-item-icon-color-active"]=$.itemIconColorActiveInverted,_["--n-item-icon-color-active-hover"]=$.itemIconColorActiveHoverInverted,_["--n-item-icon-color-child-active"]=$.itemIconColorChildActiveInverted,_["--n-item-icon-color-child-active-hover"]=$.itemIconColorChildActiveHoverInverted,_["--n-item-icon-color-collapsed"]=$.itemIconColorCollapsedInverted,_["--n-item-text-color-horizontal"]=$.itemTextColorHorizontalInverted,_["--n-item-text-color-hover-horizontal"]=$.itemTextColorHoverHorizontalInverted,_["--n-item-text-color-active-horizontal"]=$.itemTextColorActiveHorizontalInverted,_["--n-item-text-color-child-active-horizontal"]=$.itemTextColorChildActiveHorizontalInverted,_["--n-item-text-color-child-active-hover-horizontal"]=$.itemTextColorChildActiveHoverHorizontalInverted,_["--n-item-text-color-active-hover-horizontal"]=$.itemTextColorActiveHoverHorizontalInverted,_["--n-item-icon-color-horizontal"]=$.itemIconColorHorizontalInverted,_["--n-item-icon-color-hover-horizontal"]=$.itemIconColorHoverHorizontalInverted,_["--n-item-icon-color-active-horizontal"]=$.itemIconColorActiveHorizontalInverted,_["--n-item-icon-color-active-hover-horizontal"]=$.itemIconColorActiveHoverHorizontalInverted,_["--n-item-icon-color-child-active-horizontal"]=$.itemIconColorChildActiveHorizontalInverted,_["--n-item-icon-color-child-active-hover-horizontal"]=$.itemIconColorChildActiveHoverHorizontalInverted,_["--n-arrow-color"]=$.arrowColorInverted,_["--n-arrow-color-hover"]=$.arrowColorHoverInverted,_["--n-arrow-color-active"]=$.arrowColorActiveInverted,_["--n-arrow-color-active-hover"]=$.arrowColorActiveHoverInverted,_["--n-arrow-color-child-active"]=$.arrowColorChildActiveInverted,_["--n-arrow-color-child-active-hover"]=$.arrowColorChildActiveHoverInverted,_["--n-item-color-hover"]=$.itemColorHoverInverted,_["--n-item-color-active"]=$.itemColorActiveInverted,_["--n-item-color-active-hover"]=$.itemColorActiveHoverInverted,_["--n-item-color-active-collapsed"]=$.itemColorActiveCollapsedInverted):(_["--n-group-text-color"]=$.groupTextColor,_["--n-color"]=$.color,_["--n-item-text-color"]=$.itemTextColor,_["--n-item-text-color-hover"]=$.itemTextColorHover,_["--n-item-text-color-active"]=$.itemTextColorActive,_["--n-item-text-color-child-active"]=$.itemTextColorChildActive,_["--n-item-text-color-child-active-hover"]=$.itemTextColorChildActiveHover,_["--n-item-text-color-active-hover"]=$.itemTextColorActiveHover,_["--n-item-icon-color"]=$.itemIconColor,_["--n-item-icon-color-hover"]=$.itemIconColorHover,_["--n-item-icon-color-active"]=$.itemIconColorActive,_["--n-item-icon-color-active-hover"]=$.itemIconColorActiveHover,_["--n-item-icon-color-child-active"]=$.itemIconColorChildActive,_["--n-item-icon-color-child-active-hover"]=$.itemIconColorChildActiveHover,_["--n-item-icon-color-collapsed"]=$.itemIconColorCollapsed,_["--n-item-text-color-horizontal"]=$.itemTextColorHorizontal,_["--n-item-text-color-hover-horizontal"]=$.itemTextColorHoverHorizontal,_["--n-item-text-color-active-horizontal"]=$.itemTextColorActiveHorizontal,_["--n-item-text-color-child-active-horizontal"]=$.itemTextColorChildActiveHorizontal,_["--n-item-text-color-child-active-hover-horizontal"]=$.itemTextColorChildActiveHoverHorizontal,_["--n-item-text-color-active-hover-horizontal"]=$.itemTextColorActiveHoverHorizontal,_["--n-item-icon-color-horizontal"]=$.itemIconColorHorizontal,_["--n-item-icon-color-hover-horizontal"]=$.itemIconColorHoverHorizontal,_["--n-item-icon-color-active-horizontal"]=$.itemIconColorActiveHorizontal,_["--n-item-icon-color-active-hover-horizontal"]=$.itemIconColorActiveHoverHorizontal,_["--n-item-icon-color-child-active-horizontal"]=$.itemIconColorChildActiveHorizontal,_["--n-item-icon-color-child-active-hover-horizontal"]=$.itemIconColorChildActiveHoverHorizontal,_["--n-arrow-color"]=$.arrowColor,_["--n-arrow-color-hover"]=$.arrowColorHover,_["--n-arrow-color-active"]=$.arrowColorActive,_["--n-arrow-color-active-hover"]=$.arrowColorActiveHover,_["--n-arrow-color-child-active"]=$.arrowColorChildActive,_["--n-arrow-color-child-active-hover"]=$.arrowColorChildActiveHover,_["--n-item-color-hover"]=$.itemColorHover,_["--n-item-color-active"]=$.itemColorActive,_["--n-item-color-active-hover"]=$.itemColorActiveHover,_["--n-item-color-active-collapsed"]=$.itemColorActiveCollapsed),_}),w=t?Ae("menu",R(()=>e.inverted?"a":"b"),I,e):void 0;return{mergedClsPrefix:o,controlledExpandedKeys:h,uncontrolledExpanededKeys:p,mergedExpandedKeys:m,uncontrolledValue:c,mergedValue:f,activePath:x,tmNodes:b,mergedTheme:r,mergedCollapsed:l,cssVars:t?void 0:I,themeClass:w==null?void 0:w.themeClass,onRender:w==null?void 0:w.onRender,showOption:z}},render(){const{mergedClsPrefix:e,mode:o,themeClass:t,onRender:r}=this;return r==null||r(),i("div",{role:o==="horizontal"?"menubar":"menu",class:[`${e}-menu`,t,`${e}-menu--${o}`,this.mergedCollapsed&&`${e}-menu--collapsed`],style:this.cssVars},this.tmNodes.map(n=>En(n,this.$props)))}});function Ob(e,o={debug:!1,useSelectionEnd:!1,checkWidthOverflow:!0}){const t=e.selectionStart!==null?e.selectionStart:0,r=e.selectionEnd!==null?e.selectionEnd:0,n=o.useSelectionEnd?r:t,l=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],a=navigator.userAgent.toLowerCase().includes("firefox");if(!jo)throw new Error("textarea-caret-position#getCaretPosition should only be called in a browser");const s=o==null?void 0:o.debug;if(s){const h=document.querySelector("#input-textarea-caret-position-mirror-div");h!=null&&h.parentNode&&h.parentNode.removeChild(h)}const d=document.createElement("div");d.id="input-textarea-caret-position-mirror-div",document.body.appendChild(d);const c=d.style,u=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,f=e.nodeName==="INPUT";c.whiteSpace=f?"nowrap":"pre-wrap",f||(c.wordWrap="break-word"),c.position="absolute",s||(c.visibility="hidden"),l.forEach(h=>{if(f&&h==="lineHeight")if(u.boxSizing==="border-box"){const m=parseInt(u.height),b=parseInt(u.paddingTop)+parseInt(u.paddingBottom)+parseInt(u.borderTopWidth)+parseInt(u.borderBottomWidth),x=b+parseInt(u.lineHeight);m>x?c.lineHeight=`${m-b}px`:m===x?c.lineHeight=u.lineHeight:c.lineHeight="0"}else c.lineHeight=u.height;else c[h]=u[h]}),a?e.scrollHeight>parseInt(u.height)&&(c.overflowY="scroll"):c.overflow="hidden",d.textContent=e.value.substring(0,n),f&&d.textContent&&(d.textContent=d.textContent.replace(/\s/g," "));const p=document.createElement("span");p.textContent=e.value.substring(n)||".",p.style.position="relative",p.style.left=`${-e.scrollLeft}px`,p.style.top=`${-e.scrollTop}px`,d.appendChild(p);const v={top:p.offsetTop+parseInt(u.borderTopWidth),left:p.offsetLeft+parseInt(u.borderLeftWidth),absolute:!1,height:parseInt(u.fontSize)*1.5};return s?p.style.backgroundColor="#aaa":document.body.removeChild(d),v.left>=e.clientWidth&&o.checkWidthOverflow&&(v.left=e.clientWidth),v}const Mb=C([g("mention","width: 100%; z-index: auto; position: relative;"),g("mention-menu",` + box-shadow: var(--n-menu-box-shadow); + `,[at({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),_b=Object.assign(Object.assign({},ne.props),{to:Io.propTo,autosize:[Boolean,Object],options:{type:Array,default:[]},type:{type:String,default:"text"},separator:{type:String,validator:e=>e.length!==1?(qo("mention","`separator`'s length must be 1."),!1):!0,default:" "},bordered:{type:Boolean,default:void 0},disabled:Boolean,value:String,defaultValue:{type:String,default:""},loading:Boolean,prefix:{type:[String,Array],default:"@"},placeholder:{type:String,default:""},placement:{type:String,default:"bottom-start"},size:String,renderLabel:Function,status:String,"onUpdate:show":[Array,Function],onUpdateShow:[Array,Function],"onUpdate:value":[Array,Function],onUpdateValue:[Array,Function],onSearch:Function,onSelect:Function,onFocus:Function,onBlur:Function,internalDebug:Boolean}),A1=q({name:"Mention",props:_b,setup(e){const{namespaceRef:o,mergedClsPrefixRef:t,mergedBorderedRef:r,inlineThemeDisabled:n}=ke(e),l=ne("Mention","-mention",Mb,Mg,e,t),a=rt(e),s=D(null),d=D(null),c=D(null),u=D("");let f=null,p=null,v=null;const h=R(()=>{const{value:X}=u;return e.options.filter(ve=>X?typeof ve.label=="string"?ve.label.startsWith(X):typeof ve.value=="string"?ve.value.startsWith(X):!1:!0)}),m=R(()=>ar(h.value,{getKey:X=>X.value})),b=D(null),x=D(!1),S=D(e.defaultValue),B=le(e,"value"),T=so(B,S),z=R(()=>{const{self:{menuBoxShadow:X}}=l.value;return{"--n-menu-box-shadow":X}}),I=n?Ae("mention",void 0,z,e):void 0;function w(X){if(e.disabled)return;const{onUpdateShow:ve,"onUpdate:show":he}=e;ve&&ae(ve,X),he&&ae(he,X),X||(f=null,p=null,v=null),x.value=X}function O(X){const{onUpdateValue:ve,"onUpdate:value":he}=e,{nTriggerFormChange:be,nTriggerFormInput:me}=a;he&&ae(he,X),ve&&ae(ve,X),me(),be(),S.value=X}function k(){return e.type==="text"?s.value.inputElRef:s.value.textareaElRef}function $(){var X;const ve=k();if(document.activeElement!==ve){w(!1);return}const{selectionEnd:he}=ve;if(he===null){w(!1);return}const be=ve.value,{separator:me}=e,{prefix:se}=e,Re=typeof se=="string"?[se]:se;for(let ge=he-1;ge>=0;--ge){const ee=be[ge];if(ee===me||ee===` +`||ee==="\r"){w(!1);return}if(Re.includes(ee)){const xe=be.slice(ge+1,he);w(!0),(X=e.onSearch)===null||X===void 0||X.call(e,xe,ee),u.value=xe,f=ee,p=ge+1,v=he;return}}w(!1)}function L(){const{value:X}=d;if(!X)return;const ve=k(),he=Ob(ve);he.left+=ve.parentElement.offsetLeft,X.style.left=`${he.left}px`,X.style.top=`${he.top+he.height}px`}function M(){var X;x.value&&((X=c.value)===null||X===void 0||X.syncPosition())}function j(X){O(X),E()}function E(){setTimeout(()=>{L(),$(),io().then(M)},0)}function U(X){var ve,he;if(X.key==="ArrowLeft"||X.key==="ArrowRight"){if(!((ve=s.value)===null||ve===void 0)&&ve.isCompositing)return;E()}else if(X.key==="ArrowUp"||X.key==="ArrowDown"||X.key==="Enter"){if(!((he=s.value)===null||he===void 0)&&he.isCompositing)return;const{value:be}=b;if(x.value){if(be)if(X.preventDefault(),X.key==="ArrowUp")be.prev();else if(X.key==="ArrowDown")be.next();else{const me=be.getPendingTmNode();me?G(me):w(!1)}}else E()}}function _(X){const{onFocus:ve}=e;ve==null||ve(X);const{nTriggerFormFocus:he}=a;he(),E()}function V(){var X;(X=s.value)===null||X===void 0||X.focus()}function te(){var X;(X=s.value)===null||X===void 0||X.blur()}function N(X){const{onBlur:ve}=e;ve==null||ve(X);const{nTriggerFormBlur:he}=a;he(),w(!1)}function G(X){var ve;if(f===null||p===null||v===null)return;const{rawNode:{value:he=""}}=X,be=k(),me=be.value,{separator:se}=e,Re=me.slice(v),ge=Re.startsWith(se),ee=`${he}${ge?"":se}`;O(me.slice(0,p)+ee+Re),(ve=e.onSelect)===null||ve===void 0||ve.call(e,X.rawNode,f);const xe=p+ee.length+(ge?1:0);io().then(()=>{be.selectionStart=xe,be.selectionEnd=xe,$()})}function Ce(){e.disabled||E()}return{namespace:o,mergedClsPrefix:t,mergedBordered:r,mergedSize:a.mergedSizeRef,mergedStatus:a.mergedStatusRef,mergedTheme:l,treeMate:m,selectMenuInstRef:b,inputInstRef:s,cursorRef:d,followerRef:c,showMenu:x,adjustedTo:Io(e),isMounted:Ct(),mergedValue:T,handleInputFocus:_,handleInputBlur:N,handleInputUpdateValue:j,handleInputKeyDown:U,handleSelect:G,handleInputMouseDown:Ce,focus:V,blur:te,cssVars:n?void 0:z,themeClass:I==null?void 0:I.themeClass,onRender:I==null?void 0:I.onRender}},render(){const{mergedTheme:e,mergedClsPrefix:o,$slots:t}=this;return i("div",{class:`${o}-mention`},i(xt,{status:this.mergedStatus,themeOverrides:e.peerOverrides.Input,theme:e.peers.Input,size:this.mergedSize,autosize:this.autosize,type:this.type,ref:"inputInstRef",placeholder:this.placeholder,onMousedown:this.handleInputMouseDown,onUpdateValue:this.handleInputUpdateValue,onKeydown:this.handleInputKeyDown,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,bordered:this.mergedBordered,disabled:this.disabled,value:this.mergedValue}),i(Ir,null,{default:()=>[i(Br,null,{default:()=>i("div",{style:{position:"absolute",width:0,height:0},ref:"cursorRef"})}),i(kr,{ref:"followerRef",placement:this.placement,show:this.showMenu,containerClass:this.namespace,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Io.tdkey},{default:()=>i(no,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>{const{mergedTheme:r,onRender:n}=this;return n==null||n(),this.showMenu?i(yn,{clsPrefix:o,theme:r.peers.InternalSelectMenu,themeOverrides:r.peerOverrides.InternalSelectMenu,autoPending:!0,ref:"selectMenuInstRef",class:[`${o}-mention-menu`,this.themeClass],loading:this.loading,treeMate:this.treeMate,virtualScroll:!1,style:this.cssVars,onToggle:this.handleSelect,renderLabel:this.renderLabel},t):null}})})]}))}}),is={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},ls="n-message-api",as="n-message-provider",Db=C([g("message-wrapper",` + margin: var(--n-margin); + z-index: 0; + transform-origin: top center; + display: flex; + `,[rr({overflow:"visible",originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.85)"}})]),g("message",` + box-sizing: border-box; + display: flex; + align-items: center; + transition: + color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier), + opacity .3s var(--n-bezier), + transform .3s var(--n-bezier), + margin-bottom .3s var(--n-bezier); + padding: var(--n-padding); + border-radius: var(--n-border-radius); + flex-wrap: nowrap; + overflow: hidden; + max-width: var(--n-max-width); + color: var(--n-text-color); + background-color: var(--n-color); + box-shadow: var(--n-box-shadow); + `,[y("content",` + display: inline-block; + line-height: var(--n-line-height); + font-size: var(--n-font-size); + `),y("icon",` + position: relative; + margin: var(--n-icon-margin); + height: var(--n-icon-size); + width: var(--n-icon-size); + font-size: var(--n-icon-size); + flex-shrink: 0; + `,[["default","info","success","warning","error","loading"].map(e=>P(`${e}-type`,[C("> *",` + color: var(--n-icon-color-${e}); + transition: color .3s var(--n-bezier); + `)])),C("> *",` + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + `,[lt()])]),y("close",` + margin: var(--n-close-margin); + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + flex-shrink: 0; + `,[C("&:hover",` + color: var(--n-close-icon-color-hover); + `),C("&:active",` + color: var(--n-close-icon-color-pressed); + `)])]),g("message-container",` + z-index: 6000; + position: fixed; + height: 0; + overflow: visible; + display: flex; + flex-direction: column; + align-items: center; + `,[P("top",` + top: 12px; + left: 0; + right: 0; + `),P("top-left",` + top: 12px; + left: 12px; + right: 0; + align-items: flex-start; + `),P("top-right",` + top: 12px; + left: 0; + right: 12px; + align-items: flex-end; + `),P("bottom",` + bottom: 4px; + left: 0; + right: 0; + justify-content: flex-end; + `),P("bottom-left",` + bottom: 4px; + left: 12px; + right: 0; + justify-content: flex-end; + align-items: flex-start; + `),P("bottom-right",` + bottom: 4px; + left: 0; + right: 12px; + justify-content: flex-end; + align-items: flex-end; + `)])]),Lb={info:()=>i(mt,null),success:()=>i(Ht,null),warning:()=>i(yt,null),error:()=>i(Lt,null),default:()=>null},Hb=q({name:"Message",props:Object.assign(Object.assign({},is),{render:Function}),setup(e){const{inlineThemeDisabled:o,mergedRtlRef:t}=ke(e),{props:r,mergedClsPrefixRef:n}=Se(as),l=to("Message",t,n),a=ne("Message","-message",Db,cg,r,n),s=R(()=>{const{type:c}=e,{common:{cubicBezierEaseInOut:u},self:{padding:f,margin:p,maxWidth:v,iconMargin:h,closeMargin:m,closeSize:b,iconSize:x,fontSize:S,lineHeight:B,borderRadius:T,iconColorInfo:z,iconColorSuccess:I,iconColorWarning:w,iconColorError:O,iconColorLoading:k,closeIconSize:$,closeBorderRadius:L,[W("textColor",c)]:M,[W("boxShadow",c)]:j,[W("color",c)]:E,[W("closeColorHover",c)]:U,[W("closeColorPressed",c)]:_,[W("closeIconColor",c)]:V,[W("closeIconColorPressed",c)]:te,[W("closeIconColorHover",c)]:N}}=a.value;return{"--n-bezier":u,"--n-margin":p,"--n-padding":f,"--n-max-width":v,"--n-font-size":S,"--n-icon-margin":h,"--n-icon-size":x,"--n-close-icon-size":$,"--n-close-border-radius":L,"--n-close-size":b,"--n-close-margin":m,"--n-text-color":M,"--n-color":E,"--n-box-shadow":j,"--n-icon-color-info":z,"--n-icon-color-success":I,"--n-icon-color-warning":w,"--n-icon-color-error":O,"--n-icon-color-loading":k,"--n-close-color-hover":U,"--n-close-color-pressed":_,"--n-close-icon-color":V,"--n-close-icon-color-pressed":te,"--n-close-icon-color-hover":N,"--n-line-height":B,"--n-border-radius":T}}),d=o?Ae("message",R(()=>e.type[0]),s,{}):void 0;return{mergedClsPrefix:n,rtlEnabled:l,messageProviderProps:r,handleClose(){var c;(c=e.onClose)===null||c===void 0||c.call(e)},cssVars:o?void 0:s,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender,placement:r.placement}},render(){const{render:e,type:o,closable:t,content:r,mergedClsPrefix:n,cssVars:l,themeClass:a,onRender:s,icon:d,handleClose:c,showIcon:u}=this;s==null||s();let f;return i("div",{class:[`${n}-message-wrapper`,a],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},l]},e?e(this.$props):i("div",{class:[`${n}-message ${n}-message--${o}-type`,this.rtlEnabled&&`${n}-message--rtl`]},(f=Ab(d,o,n))&&u?i("div",{class:`${n}-message__icon ${n}-message__icon--${o}-type`},i(At,null,{default:()=>f})):null,i("div",{class:`${n}-message__content`},qe(r)),t?i(St,{clsPrefix:n,class:`${n}-message__close`,onClick:c,absolute:!0}):null))}});function Ab(e,o,t){if(typeof e=="function")return e();{const r=o==="loading"?i(Et,{clsPrefix:t,strokeWidth:24,scale:.85}):Lb[o]();return r?i(De,{clsPrefix:t,key:o},{default:()=>r}):null}}const Eb=q({name:"MessageEnvironment",props:Object.assign(Object.assign({},is),{duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function}),setup(e){let o=null;const t=D(!0);mo(()=>{r()});function r(){const{duration:u}=e;u&&(o=window.setTimeout(a,u))}function n(u){u.currentTarget===u.target&&o!==null&&(window.clearTimeout(o),o=null)}function l(u){u.currentTarget===u.target&&r()}function a(){const{onHide:u}=e;t.value=!1,o&&(window.clearTimeout(o),o=null),u&&u()}function s(){const{onClose:u}=e;u&&u(),a()}function d(){const{onAfterLeave:u,onInternalAfterLeave:f,onAfterHide:p,internalKey:v}=e;u&&u(),f&&f(v),p&&p()}function c(){a()}return{show:t,hide:a,handleClose:s,handleAfterLeave:d,handleMouseleave:l,handleMouseenter:n,deactivate:c}},render(){return i(wt,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?i(Hb,{content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0}):null]})}}),jb=Object.assign(Object.assign({},ne.props),{to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:"top"},closable:Boolean,containerStyle:[String,Object]}),E1=q({name:"MessageProvider",props:jb,setup(e){const{mergedClsPrefixRef:o}=ke(e),t=D([]),r=D({}),n={create(d,c){return l(d,Object.assign({type:"default"},c))},info(d,c){return l(d,Object.assign(Object.assign({},c),{type:"info"}))},success(d,c){return l(d,Object.assign(Object.assign({},c),{type:"success"}))},warning(d,c){return l(d,Object.assign(Object.assign({},c),{type:"warning"}))},error(d,c){return l(d,Object.assign(Object.assign({},c),{type:"error"}))},loading(d,c){return l(d,Object.assign(Object.assign({},c),{type:"loading"}))},destroyAll:s};Oe(as,{props:e,mergedClsPrefixRef:o}),Oe(ls,n);function l(d,c){const u=it(),f=Wi(Object.assign(Object.assign({},c),{content:d,key:u,destroy:()=>{var v;(v=r.value[u])===null||v===void 0||v.hide()}})),{max:p}=e;return p&&t.value.length>=p&&t.value.shift(),t.value.push(f),f}function a(d){t.value.splice(t.value.findIndex(c=>c.key===d),1),delete r.value[d]}function s(){Object.values(r.value).forEach(d=>{d.hide()})}return Object.assign({mergedClsPrefix:o,messageRefs:r,messageList:t,handleAfterLeave:a},n)},render(){var e,o,t;return i(ao,null,(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e),this.messageList.length?i(Ni,{to:(t=this.to)!==null&&t!==void 0?t:"body"},i("div",{class:[`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`],key:"message-container",style:this.containerStyle},this.messageList.map(r=>i(Eb,Object.assign({ref:n=>{n&&(this.messageRefs[r.key]=n)},internalKey:r.key,onInternalAfterLeave:this.handleAfterLeave},_t(r,["destroy"],void 0),{duration:r.duration===void 0?this.duration:r.duration,keepAliveOnHover:r.keepAliveOnHover===void 0?this.keepAliveOnHover:r.keepAliveOnHover,closable:r.closable===void 0?this.closable:r.closable}))))):null)}});function j1(){const e=Se(ls,null);return e===null&&Eo("use-message","No outer founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A."),e}const ss="n-popconfirm",ds={positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0}},Ti=yo(ds),Wb=q({name:"NPopconfirmPanel",props:ds,setup(e){const{localeRef:o}=Xo("Popconfirm"),{inlineThemeDisabled:t}=ke(),{mergedClsPrefixRef:r,mergedThemeRef:n,props:l}=Se(ss),a=R(()=>{const{common:{cubicBezierEaseInOut:d},self:{fontSize:c,iconSize:u,iconColor:f}}=n.value;return{"--n-bezier":d,"--n-font-size":c,"--n-icon-size":u,"--n-icon-color":f}}),s=t?Ae("popconfirm-panel",void 0,a,l):void 0;return Object.assign(Object.assign({},Xo("Popconfirm")),{mergedClsPrefix:r,cssVars:t?void 0:a,localizedPositiveText:R(()=>e.positiveText||o.value.positiveText),localizedNegativeText:R(()=>e.negativeText||o.value.negativeText),positiveButtonProps:le(l,"positiveButtonProps"),negativeButtonProps:le(l,"negativeButtonProps"),handlePositiveClick(d){e.onPositiveClick(d)},handleNegativeClick(d){e.onNegativeClick(d)},themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender})},render(){var e;const{mergedClsPrefix:o,showIcon:t,$slots:r}=this,n=lo(r.action,()=>this.negativeText===null&&this.positiveText===null?[]:[this.negativeText!==null&&i(Po,Object.assign({size:"small",onClick:this.handleNegativeClick},this.negativeButtonProps),{default:()=>this.localizedNegativeText}),this.positiveText!==null&&i(Po,Object.assign({size:"small",type:"primary",onClick:this.handlePositiveClick},this.positiveButtonProps),{default:()=>this.localizedPositiveText})]);return(e=this.onRender)===null||e===void 0||e.call(this),i("div",{class:[`${o}-popconfirm__panel`,this.themeClass],style:this.cssVars},Ee(r.default,l=>t||l?i("div",{class:`${o}-popconfirm__body`},t?i("div",{class:`${o}-popconfirm__icon`},lo(r.icon,()=>[i(De,{clsPrefix:o},{default:()=>i(yt,null)})])):null,l):null),n?i("div",{class:[`${o}-popconfirm__action`]},n):null)}}),Nb=g("popconfirm",[y("body",` + font-size: var(--n-font-size); + display: flex; + align-items: center; + flex-wrap: nowrap; + position: relative; + `,[y("icon",` + display: flex; + font-size: var(--n-icon-size); + color: var(--n-icon-color); + transition: color .3s var(--n-bezier); + margin: 0 8px 0 0; + `)]),y("action",` + display: flex; + justify-content: flex-end; + `,[C("&:not(:first-child)","margin-top: 8px"),g("button",[C("&:not(:last-child)","margin-right: 8px;")])])]),Vb=Object.assign(Object.assign(Object.assign({},ne.props),bt),{positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},trigger:{type:String,default:"click"},positiveButtonProps:Object,negativeButtonProps:Object,onPositiveClick:Function,onNegativeClick:Function}),W1=q({name:"Popconfirm",props:Vb,__popover__:!0,setup(e){const{mergedClsPrefixRef:o}=ke(),t=ne("Popconfirm","-popconfirm",Nb,Ug,e,o),r=D(null);function n(s){const{onPositiveClick:d,"onUpdate:show":c}=e;Promise.resolve(d?d(s):!0).then(u=>{var f;u!==!1&&((f=r.value)===null||f===void 0||f.setShow(!1),c&&ae(c,!1))})}function l(s){const{onNegativeClick:d,"onUpdate:show":c}=e;Promise.resolve(d?d(s):!0).then(u=>{var f;u!==!1&&((f=r.value)===null||f===void 0||f.setShow(!1),c&&ae(c,!1))})}return Oe(ss,{mergedThemeRef:t,mergedClsPrefixRef:o,props:e}),Object.assign(Object.assign({},{setShow(s){var d;(d=r.value)===null||d===void 0||d.setShow(s)},syncPosition(){var s;(s=r.value)===null||s===void 0||s.syncPosition()}}),{mergedTheme:t,popoverInstRef:r,handlePositiveClick:n,handleNegativeClick:l})},render(){const{$slots:e,$props:o,mergedTheme:t}=this;return i(hr,_t(o,Ti,{theme:t.peers.Popover,themeOverrides:t.peerOverrides.Popover,internalExtraClass:["popconfirm"],ref:"popoverInstRef"}),{trigger:e.activator||e.trigger,default:()=>{const r=go(o,Ti);return i(Wb,Object.assign(Object.assign({},r),{onPositiveClick:this.handlePositiveClick,onNegativeClick:this.handleNegativeClick}),e)}})}}),Ub=C([g("progress",{display:"inline-block"},[g("progress-icon",` + color: var(--n-icon-color); + transition: color .3s var(--n-bezier); + `),P("line",` + width: 100%; + display: block; + `,[g("progress-content",` + display: flex; + align-items: center; + `,[g("progress-graph",{flex:1})]),g("progress-custom-content",{marginLeft:"14px"}),g("progress-icon",` + width: 30px; + padding-left: 14px; + height: var(--n-icon-size-line); + line-height: var(--n-icon-size-line); + font-size: var(--n-icon-size-line); + `,[P("as-text",` + color: var(--n-text-color-line-outer); + text-align: center; + width: 40px; + font-size: var(--n-font-size); + padding-left: 4px; + transition: color .3s var(--n-bezier); + `)])]),P("circle, dashboard",{width:"120px"},[g("progress-custom-content",` + position: absolute; + left: 50%; + top: 50%; + transform: translateX(-50%) translateY(-50%); + display: flex; + align-items: center; + justify-content: center; + `),g("progress-text",` + position: absolute; + left: 50%; + top: 50%; + transform: translateX(-50%) translateY(-50%); + display: flex; + align-items: center; + color: inherit; + font-size: var(--n-font-size-circle); + color: var(--n-text-color-circle); + font-weight: var(--n-font-weight-circle); + transition: color .3s var(--n-bezier); + white-space: nowrap; + `),g("progress-icon",` + position: absolute; + left: 50%; + top: 50%; + transform: translateX(-50%) translateY(-50%); + display: flex; + align-items: center; + color: var(--n-icon-color); + font-size: var(--n-icon-size-circle); + `)]),P("multiple-circle",` + width: 200px; + color: inherit; + `,[g("progress-text",` + font-weight: var(--n-font-weight-circle); + color: var(--n-text-color-circle); + position: absolute; + left: 50%; + top: 50%; + transform: translateX(-50%) translateY(-50%); + display: flex; + align-items: center; + justify-content: center; + transition: color .3s var(--n-bezier); + `)]),g("progress-content",{position:"relative"}),g("progress-graph",{position:"relative"},[g("progress-graph-circle",[C("svg",{verticalAlign:"bottom"}),g("progress-graph-circle-fill",` + stroke: var(--n-fill-color); + transition: + opacity .3s var(--n-bezier), + stroke .3s var(--n-bezier), + stroke-dasharray .3s var(--n-bezier); + `,[P("empty",{opacity:0})]),g("progress-graph-circle-rail",` + transition: stroke .3s var(--n-bezier); + overflow: hidden; + stroke: var(--n-rail-color); + `)]),g("progress-graph-line",[P("indicator-inside",[g("progress-graph-line-rail",` + height: 16px; + line-height: 16px; + border-radius: 10px; + `,[g("progress-graph-line-fill",` + height: inherit; + border-radius: 10px; + `),g("progress-graph-line-indicator",` + background: #0000; + white-space: nowrap; + text-align: right; + margin-left: 14px; + margin-right: 14px; + height: inherit; + font-size: 12px; + color: var(--n-text-color-line-inner); + transition: color .3s var(--n-bezier); + `)])]),P("indicator-inside-label",` + height: 16px; + display: flex; + align-items: center; + `,[g("progress-graph-line-rail",` + flex: 1; + transition: background-color .3s var(--n-bezier); + `),g("progress-graph-line-indicator",` + background: var(--n-fill-color); + font-size: 12px; + transform: translateZ(0); + display: flex; + vertical-align: middle; + height: 16px; + line-height: 16px; + padding: 0 10px; + border-radius: 10px; + position: absolute; + white-space: nowrap; + color: var(--n-text-color-line-inner); + transition: + right .2s var(--n-bezier), + color .3s var(--n-bezier), + background-color .3s var(--n-bezier); + `)]),g("progress-graph-line-rail",` + position: relative; + overflow: hidden; + height: var(--n-rail-height); + border-radius: 5px; + background-color: var(--n-rail-color); + transition: background-color .3s var(--n-bezier); + `,[g("progress-graph-line-fill",` + background: var(--n-fill-color); + position: relative; + border-radius: 5px; + height: inherit; + width: 100%; + max-width: 0%; + transition: + background-color .3s var(--n-bezier), + max-width .2s var(--n-bezier); + `,[P("processing",[C("&::after",` + content: ""; + background-image: var(--n-line-bg-processing); + animation: progress-processing-animation 2s var(--n-bezier) infinite; + `)])])])])])]),C("@keyframes progress-processing-animation",` + 0% { + position: absolute; + left: 0; + top: 0; + bottom: 0; + right: 100%; + opacity: 1; + } + 66% { + position: absolute; + left: 0; + top: 0; + bottom: 0; + right: 0; + opacity: 0; + } + 100% { + position: absolute; + left: 0; + top: 0; + bottom: 0; + right: 0; + opacity: 0; + } + `)]),Kb={success:i(Ht,null),error:i(Lt,null),warning:i(yt,null),info:i(mt,null)},Gb=q({name:"ProgressLine",props:{clsPrefix:{type:String,required:!0},percentage:{type:Number,default:0},railColor:String,railStyle:[String,Object],fillColor:String,status:{type:String,required:!0},indicatorPlacement:{type:String,required:!0},indicatorTextColor:String,unit:{type:String,default:"%"},processing:{type:Boolean,required:!0},showIndicator:{type:Boolean,required:!0},height:[String,Number],railBorderRadius:[String,Number],fillBorderRadius:[String,Number]},setup(e,{slots:o}){const t=R(()=>eo(e.height)),r=R(()=>e.railBorderRadius!==void 0?eo(e.railBorderRadius):e.height!==void 0?eo(e.height,{c:.5}):""),n=R(()=>e.fillBorderRadius!==void 0?eo(e.fillBorderRadius):e.railBorderRadius!==void 0?eo(e.railBorderRadius):e.height!==void 0?eo(e.height,{c:.5}):"");return()=>{const{indicatorPlacement:l,railColor:a,railStyle:s,percentage:d,unit:c,indicatorTextColor:u,status:f,showIndicator:p,fillColor:v,processing:h,clsPrefix:m}=e;return i("div",{class:`${m}-progress-content`,role:"none"},i("div",{class:`${m}-progress-graph`,"aria-hidden":!0},i("div",{class:[`${m}-progress-graph-line`,{[`${m}-progress-graph-line--indicator-${l}`]:!0}]},i("div",{class:`${m}-progress-graph-line-rail`,style:[{backgroundColor:a,height:t.value,borderRadius:r.value},s]},i("div",{class:[`${m}-progress-graph-line-fill`,h&&`${m}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,backgroundColor:v,height:t.value,lineHeight:t.value,borderRadius:n.value}},l==="inside"?i("div",{class:`${m}-progress-graph-line-indicator`,style:{color:u}},d,c):null)))),p&&l==="outside"?i("div",null,o.default?i("div",{class:`${m}-progress-custom-content`,style:{color:u},role:"none"},o.default()):f==="default"?i("div",{role:"none",class:`${m}-progress-icon ${m}-progress-icon--as-text`,style:{color:u}},d,c):i("div",{class:`${m}-progress-icon`,"aria-hidden":!0},i(De,{clsPrefix:m},{default:()=>Kb[f]}))):null)}}}),qb={success:i(Ht,null),error:i(Lt,null),warning:i(yt,null),info:i(mt,null)},Yb=q({name:"ProgressCircle",props:{clsPrefix:{type:String,required:!0},status:{type:String,required:!0},strokeWidth:{type:Number,required:!0},fillColor:String,railColor:String,railStyle:[String,Object],percentage:{type:Number,default:0},offsetDegree:{type:Number,default:0},showIndicator:{type:Boolean,required:!0},indicatorTextColor:String,unit:String,viewBoxWidth:{type:Number,required:!0},gapDegree:{type:Number,required:!0},gapOffsetDegree:{type:Number,default:0}},setup(e,{slots:o}){function t(r,n,l){const{gapDegree:a,viewBoxWidth:s,strokeWidth:d}=e,c=50,u=0,f=c,p=0,v=2*c,h=50+d/2,m=`M ${h},${h} m ${u},${f} + a ${c},${c} 0 1 1 ${p},${-v} + a ${c},${c} 0 1 1 ${-p},${v}`,b=Math.PI*2*c,x={stroke:l,strokeDasharray:`${r/100*(b-a)}px ${s*8}px`,strokeDashoffset:`-${a/2}px`,transformOrigin:n?"center":void 0,transform:n?`rotate(${n}deg)`:void 0};return{pathString:m,pathStyle:x}}return()=>{const{fillColor:r,railColor:n,strokeWidth:l,offsetDegree:a,status:s,percentage:d,showIndicator:c,indicatorTextColor:u,unit:f,gapOffsetDegree:p,clsPrefix:v}=e,{pathString:h,pathStyle:m}=t(100,0,n),{pathString:b,pathStyle:x}=t(d,a,r),S=100+l;return i("div",{class:`${v}-progress-content`,role:"none"},i("div",{class:`${v}-progress-graph`,"aria-hidden":!0},i("div",{class:`${v}-progress-graph-circle`,style:{transform:p?`rotate(${p}deg)`:void 0}},i("svg",{viewBox:`0 0 ${S} ${S}`},i("g",null,i("path",{class:`${v}-progress-graph-circle-rail`,d:h,"stroke-width":l,"stroke-linecap":"round",fill:"none",style:m})),i("g",null,i("path",{class:[`${v}-progress-graph-circle-fill`,d===0&&`${v}-progress-graph-circle-fill--empty`],d:b,"stroke-width":l,"stroke-linecap":"round",fill:"none",style:x}))))),c?i("div",null,o.default?i("div",{class:`${v}-progress-custom-content`,role:"none"},o.default()):s!=="default"?i("div",{class:`${v}-progress-icon`,"aria-hidden":!0},i(De,{clsPrefix:v},{default:()=>qb[s]})):i("div",{class:`${v}-progress-text`,style:{color:u},role:"none"},i("span",{class:`${v}-progress-text__percentage`},d),i("span",{class:`${v}-progress-text__unit`},f))):null)}}});function Fi(e,o,t=100){return`m ${t/2} ${t/2-e} a ${e} ${e} 0 1 1 0 ${2*e} a ${e} ${e} 0 1 1 0 -${2*e}`}const Xb=q({name:"ProgressMultipleCircle",props:{clsPrefix:{type:String,required:!0},viewBoxWidth:{type:Number,required:!0},percentage:{type:Array,default:[0]},strokeWidth:{type:Number,required:!0},circleGap:{type:Number,required:!0},showIndicator:{type:Boolean,required:!0},fillColor:{type:Array,default:()=>[]},railColor:{type:Array,default:()=>[]},railStyle:{type:Array,default:()=>[]}},setup(e,{slots:o}){const t=R(()=>e.percentage.map((n,l)=>`${Math.PI*n/100*(e.viewBoxWidth/2-e.strokeWidth/2*(1+2*l)-e.circleGap*l)*2}, ${e.viewBoxWidth*8}`));return()=>{const{viewBoxWidth:r,strokeWidth:n,circleGap:l,showIndicator:a,fillColor:s,railColor:d,railStyle:c,percentage:u,clsPrefix:f}=e;return i("div",{class:`${f}-progress-content`,role:"none"},i("div",{class:`${f}-progress-graph`,"aria-hidden":!0},i("div",{class:`${f}-progress-graph-circle`},i("svg",{viewBox:`0 0 ${r} ${r}`},u.map((p,v)=>i("g",{key:v},i("path",{class:`${f}-progress-graph-circle-rail`,d:Fi(r/2-n/2*(1+2*v)-l*v,n,r),"stroke-width":n,"stroke-linecap":"round",fill:"none",style:[{strokeDashoffset:0,stroke:d[v]},c[v]]}),i("path",{class:[`${f}-progress-graph-circle-fill`,p===0&&`${f}-progress-graph-circle-fill--empty`],d:Fi(r/2-n/2*(1+2*v)-l*v,n,r),"stroke-width":n,"stroke-linecap":"round",fill:"none",style:{strokeDasharray:t.value[v],strokeDashoffset:0,stroke:s[v]}})))))),a&&o.default?i("div",null,i("div",{class:`${f}-progress-text`},o.default())):null)}}}),Zb=Object.assign(Object.assign({},ne.props),{processing:Boolean,type:{type:String,default:"line"},gapDegree:Number,gapOffsetDegree:Number,status:{type:String,default:"default"},railColor:[String,Array],railStyle:[String,Array],color:[String,Array],viewBoxWidth:{type:Number,default:100},strokeWidth:{type:Number,default:7},percentage:[Number,Array],unit:{type:String,default:"%"},showIndicator:{type:Boolean,default:!0},indicatorPosition:{type:String,default:"outside"},indicatorPlacement:{type:String,default:"outside"},indicatorTextColor:String,circleGap:{type:Number,default:1},height:Number,borderRadius:[String,Number],fillBorderRadius:[String,Number],offsetDegree:Number}),Qb=q({name:"Progress",props:Zb,setup(e){const o=R(()=>e.indicatorPlacement||e.indicatorPosition),t=R(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type==="dashboard")return 75}),{mergedClsPrefixRef:r,inlineThemeDisabled:n}=ke(e),l=ne("Progress","-progress",Ub,Aa,e,r),a=R(()=>{const{status:d}=e,{common:{cubicBezierEaseInOut:c},self:{fontSize:u,fontSizeCircle:f,railColor:p,railHeight:v,iconSizeCircle:h,iconSizeLine:m,textColorCircle:b,textColorLineInner:x,textColorLineOuter:S,lineBgProcessing:B,fontWeightCircle:T,[W("iconColor",d)]:z,[W("fillColor",d)]:I}}=l.value;return{"--n-bezier":c,"--n-fill-color":I,"--n-font-size":u,"--n-font-size-circle":f,"--n-font-weight-circle":T,"--n-icon-color":z,"--n-icon-size-circle":h,"--n-icon-size-line":m,"--n-line-bg-processing":B,"--n-rail-color":p,"--n-rail-height":v,"--n-text-color-circle":b,"--n-text-color-line-inner":x,"--n-text-color-line-outer":S}}),s=n?Ae("progress",R(()=>e.status[0]),a,e):void 0;return{mergedClsPrefix:r,mergedIndicatorPlacement:o,gapDeg:t,cssVars:n?void 0:a,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){const{type:e,cssVars:o,indicatorTextColor:t,showIndicator:r,status:n,railColor:l,railStyle:a,color:s,percentage:d,viewBoxWidth:c,strokeWidth:u,mergedIndicatorPlacement:f,unit:p,borderRadius:v,fillBorderRadius:h,height:m,processing:b,circleGap:x,mergedClsPrefix:S,gapDeg:B,gapOffsetDegree:T,themeClass:z,$slots:I,onRender:w}=this;return w==null||w(),i("div",{class:[z,`${S}-progress`,`${S}-progress--${e}`,`${S}-progress--${n}`],style:o,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":d,role:e==="circle"||e==="line"||e==="dashboard"?"progressbar":"none"},e==="circle"||e==="dashboard"?i(Yb,{clsPrefix:S,status:n,showIndicator:r,indicatorTextColor:t,railColor:l,fillColor:s,railStyle:a,offsetDegree:this.offsetDegree,percentage:d,viewBoxWidth:c,strokeWidth:u,gapDegree:B===void 0?e==="dashboard"?75:0:B,gapOffsetDegree:T,unit:p},I):e==="line"?i(Gb,{clsPrefix:S,status:n,showIndicator:r,indicatorTextColor:t,railColor:l,fillColor:s,railStyle:a,percentage:d,processing:b,indicatorPlacement:f,unit:p,fillBorderRadius:h,railBorderRadius:v,height:m},I):e==="multiple-circle"?i(Xb,{clsPrefix:S,strokeWidth:u,railColor:l,fillColor:s,railStyle:a,viewBoxWidth:c,percentage:d,showIndicator:r,circleGap:x},I):null)}}),Jb=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},i("circle",{fill:"#FFCB4C",cx:"18",cy:"17.018",r:"17"}),i("path",{fill:"#65471B",d:"M14.524 21.036c-.145-.116-.258-.274-.312-.464-.134-.46.13-.918.59-1.021 4.528-1.021 7.577 1.363 7.706 1.465.384.306.459.845.173 1.205-.286.358-.828.401-1.211.097-.11-.084-2.523-1.923-6.182-1.098-.274.061-.554-.016-.764-.184z"}),i("ellipse",{fill:"#65471B",cx:"13.119",cy:"11.174",rx:"2.125",ry:"2.656"}),i("ellipse",{fill:"#65471B",cx:"24.375",cy:"12.236",rx:"2.125",ry:"2.656"}),i("path",{fill:"#F19020",d:"M17.276 35.149s1.265-.411 1.429-1.352c.173-.972-.624-1.167-.624-1.167s1.041-.208 1.172-1.376c.123-1.101-.861-1.363-.861-1.363s.97-.4 1.016-1.539c.038-.959-.995-1.428-.995-1.428s5.038-1.221 5.556-1.341c.516-.12 1.32-.615 1.069-1.694-.249-1.08-1.204-1.118-1.697-1.003-.494.115-6.744 1.566-8.9 2.068l-1.439.334c-.54.127-.785-.11-.404-.512.508-.536.833-1.129.946-2.113.119-1.035-.232-2.313-.433-2.809-.374-.921-1.005-1.649-1.734-1.899-1.137-.39-1.945.321-1.542 1.561.604 1.854.208 3.375-.833 4.293-2.449 2.157-3.588 3.695-2.83 6.973.828 3.575 4.377 5.876 7.952 5.048l3.152-.681z"}),i("path",{fill:"#65471B",d:"M9.296 6.351c-.164-.088-.303-.224-.391-.399-.216-.428-.04-.927.393-1.112 4.266-1.831 7.699-.043 7.843.034.433.231.608.747.391 1.154-.216.405-.74.546-1.173.318-.123-.063-2.832-1.432-6.278.047-.257.109-.547.085-.785-.042zm12.135 3.75c-.156-.098-.286-.243-.362-.424-.187-.442.023-.927.468-1.084 4.381-1.536 7.685.48 7.823.567.415.26.555.787.312 1.178-.242.39-.776.495-1.191.238-.12-.072-2.727-1.621-6.267-.379-.266.091-.553.046-.783-.096z"})),e0=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},i("path",{fill:"#FFCC4D",d:"M36 18c0 9.941-8.059 18-18 18-9.94 0-18-8.059-18-18C0 8.06 8.06 0 18 0c9.941 0 18 8.06 18 18"}),i("ellipse",{fill:"#664500",cx:"18",cy:"27",rx:"5",ry:"6"}),i("path",{fill:"#664500",d:"M5.999 11c-.208 0-.419-.065-.599-.2-.442-.331-.531-.958-.2-1.4C8.462 5.05 12.816 5 13 5c.552 0 1 .448 1 1 0 .551-.445.998-.996 1-.155.002-3.568.086-6.204 3.6-.196.262-.497.4-.801.4zm24.002 0c-.305 0-.604-.138-.801-.4-2.64-3.521-6.061-3.598-6.206-3.6-.55-.006-.994-.456-.991-1.005C22.006 5.444 22.45 5 23 5c.184 0 4.537.05 7.8 4.4.332.442.242 1.069-.2 1.4-.18.135-.39.2-.599.2zm-16.087 4.5l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L12.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L13.914 15.5zm11 0l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L23.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L24.914 15.5z"})),o0=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},i("ellipse",{fill:"#292F33",cx:"18",cy:"26",rx:"18",ry:"10"}),i("ellipse",{fill:"#66757F",cx:"18",cy:"24",rx:"18",ry:"10"}),i("path",{fill:"#E1E8ED",d:"M18 31C3.042 31 1 16 1 12h34c0 2-1.958 19-17 19z"}),i("path",{fill:"#77B255",d:"M35 12.056c0 5.216-7.611 9.444-17 9.444S1 17.271 1 12.056C1 6.84 8.611 3.611 18 3.611s17 3.229 17 8.445z"}),i("ellipse",{fill:"#A6D388",cx:"18",cy:"13",rx:"15",ry:"7"}),i("path",{d:"M21 17c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.739-1.109.9-2.246.478-3.377-.461-1.236-1.438-1.996-1.731-2.077-.553 0-.958-.443-.958-.996 0-.552.491-.995 1.043-.995.997 0 2.395 1.153 3.183 2.625 1.034 1.933.91 4.039-.351 5.929-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.196-.451.294-.707.294zm-6-2c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.727-1.091.893-2.083.494-2.947-.444-.961-1.431-1.469-1.684-1.499-.552 0-.989-.447-.989-1 0-.552.458-1 1.011-1 .997 0 2.585.974 3.36 2.423.481.899 1.052 2.761-.528 5.131-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.197-.451.295-.707.295z",fill:"#5C913B"})),t0=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},i("path",{fill:"#EF9645",d:"M15.5 2.965c1.381 0 2.5 1.119 2.5 2.5v.005L20.5.465c1.381 0 2.5 1.119 2.5 2.5V4.25l2.5-1.535c1.381 0 2.5 1.119 2.5 2.5V8.75L29 18H15.458L15.5 2.965z"}),i("path",{fill:"#FFDC5D",d:"M4.625 16.219c1.381-.611 3.354.208 4.75 2.188.917 1.3 1.187 3.151 2.391 3.344.46.073 1.234-.313 1.234-1.397V4.5s0-2 2-2 2 2 2 2v11.633c0-.029 1-.064 1-.082V2s0-2 2-2 2 2 2 2v14.053c0 .017 1 .041 1 .069V4.25s0-2 2-2 2 2 2 2v12.638c0 .118 1 .251 1 .398V8.75s0-2 2-2 2 2 2 2V24c0 6.627-5.373 12-12 12-4.775 0-8.06-2.598-9.896-5.292C8.547 28.423 8.096 26.051 8 25.334c0 0-.123-1.479-1.156-2.865-1.469-1.969-2.5-3.156-3.125-3.866-.317-.359-.625-1.707.906-2.384z"})),r0=g("result",` + color: var(--n-text-color); + line-height: var(--n-line-height); + font-size: var(--n-font-size); + transition: + color .3s var(--n-bezier); +`,[g("result-icon",` + display: flex; + justify-content: center; + transition: color .3s var(--n-bezier); + `,[y("status-image",` + font-size: var(--n-icon-size); + width: 1em; + height: 1em; + `),g("base-icon",` + color: var(--n-icon-color); + font-size: var(--n-icon-size); + `)]),g("result-content",{marginTop:"24px"}),g("result-footer",` + margin-top: 24px; + text-align: center; + `),g("result-header",[y("title",` + margin-top: 16px; + font-weight: var(--n-title-font-weight); + transition: color .3s var(--n-bezier); + text-align: center; + color: var(--n-title-text-color); + font-size: var(--n-title-font-size); + `),y("description",` + margin-top: 4px; + text-align: center; + font-size: var(--n-font-size); + `)])]),n0={403:t0,404:Jb,418:o0,500:e0,info:i(mt,null),success:i(Ht,null),warning:i(yt,null),error:i(Lt,null)},i0=Object.assign(Object.assign({},ne.props),{size:{type:String,default:"medium"},status:{type:String,default:"info"},title:String,description:String}),N1=q({name:"Result",props:i0,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Result","-result",r0,em,e,o),n=R(()=>{const{size:a,status:s}=e,{common:{cubicBezierEaseInOut:d},self:{textColor:c,lineHeight:u,titleTextColor:f,titleFontWeight:p,[W("iconColor",s)]:v,[W("fontSize",a)]:h,[W("titleFontSize",a)]:m,[W("iconSize",a)]:b}}=r.value;return{"--n-bezier":d,"--n-font-size":h,"--n-icon-size":b,"--n-line-height":u,"--n-text-color":c,"--n-title-font-size":m,"--n-title-font-weight":p,"--n-title-text-color":f,"--n-icon-color":v||""}}),l=t?Ae("result",R(()=>{const{size:a,status:s}=e;let d="";return a&&(d+=a[0]),s&&(d+=s[0]),d}),n,e):void 0;return{mergedClsPrefix:o,cssVars:t?void 0:n,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e;const{status:o,$slots:t,mergedClsPrefix:r,onRender:n}=this;return n==null||n(),i("div",{class:[`${r}-result`,this.themeClass],style:this.cssVars},i("div",{class:`${r}-result-icon`},((e=t.icon)===null||e===void 0?void 0:e.call(t))||i(De,{clsPrefix:r},{default:()=>n0[o]})),i("div",{class:`${r}-result-header`},this.title?i("div",{class:`${r}-result-header__title`},this.title):null,this.description?i("div",{class:`${r}-result-header__description`},this.description):null),t.default&&i("div",{class:`${r}-result-content`},t),t.footer&&i("div",{class:`${r}-result-footer`},t.footer()))}}),l0={name:"Skeleton",common:fe,self(e){const{heightSmall:o,heightMedium:t,heightLarge:r,borderRadius:n}=e;return{color:"rgba(255, 255, 255, 0.12)",colorEnd:"rgba(255, 255, 255, 0.18)",borderRadius:n,heightSmall:o,heightMedium:t,heightLarge:r}}},a0=e=>{const{heightSmall:o,heightMedium:t,heightLarge:r,borderRadius:n}=e;return{color:"#eee",colorEnd:"#ddd",borderRadius:n,heightSmall:o,heightMedium:t,heightLarge:r}},s0={name:"Skeleton",common:Le,self:a0},d0=C([g("skeleton",` + height: 1em; + width: 100%; + transition: background-color .3s var(--n-bezier); + transition: + --n-color-start .3s var(--n-bezier), + --n-color-end .3s var(--n-bezier), + background-color .3s var(--n-bezier); + animation: 2s skeleton-loading infinite cubic-bezier(0.36, 0, 0.64, 1); + background-color: var(--n-color-start); + `),C("@keyframes skeleton-loading",` + 0% { + background: var(--n-color-start); + } + 40% { + background: var(--n-color-end); + } + 80% { + background: var(--n-color-start); + } + 100% { + background: var(--n-color-start); + } + `)]),c0=Object.assign(Object.assign({},ne.props),{text:Boolean,round:Boolean,circle:Boolean,height:[String,Number],width:[String,Number],size:String,repeat:{type:Number,default:1},animated:{type:Boolean,default:!0},sharp:{type:Boolean,default:!0}}),V1=q({name:"Skeleton",inheritAttrs:!1,props:c0,setup(e){rl();const{mergedClsPrefixRef:o}=ke(e),t=ne("Skeleton","-skeleton",d0,s0,e,o);return{mergedClsPrefix:o,style:R(()=>{var r,n;const l=t.value,{common:{cubicBezierEaseInOut:a}}=l,s=l.self,{color:d,colorEnd:c,borderRadius:u}=s;let f;const{circle:p,sharp:v,round:h,width:m,height:b,size:x,text:S,animated:B}=e;x!==void 0&&(f=s[W("height",x)]);const T=p?(r=m??b)!==null&&r!==void 0?r:f:m,z=(n=p?m??b:b)!==null&&n!==void 0?n:f;return{display:S?"inline-block":"",verticalAlign:S?"-0.125em":"",borderRadius:p?"50%":h?"4096px":v?"":u,width:typeof T=="number"?_o(T):T,height:typeof z=="number"?_o(z):z,animation:B?"":"none","--n-bezier":a,"--n-color-start":d,"--n-color-end":c}})}},render(){const{repeat:e,style:o,mergedClsPrefix:t,$attrs:r}=this,n=i("div",ko({class:`${t}-skeleton`,style:o},r));return e>1?i(ao,null,Array.apply(null,{length:e}).map(l=>[n,` +`])):n}}),u0=C([C("@keyframes spin-rotate",` + from { + transform: rotate(0); + } + to { + transform: rotate(360deg); + } + `),g("spin-container",{position:"relative"},[g("spin-body",` + position: absolute; + top: 50%; + left: 50%; + transform: translateX(-50%) translateY(-50%); + `,[Mt()])]),g("spin-body",` + display: inline-flex; + align-items: center; + justify-content: center; + flex-direction: column; + `),g("spin",` + display: inline-flex; + height: var(--n-size); + width: var(--n-size); + font-size: var(--n-size); + color: var(--n-color); + `,[P("rotate",` + animation: spin-rotate 2s linear infinite; + `)]),g("spin-description",` + display: inline-block; + font-size: var(--n-font-size); + color: var(--n-text-color); + transition: color .3s var(--n-bezier); + margin-top: 8px; + `),g("spin-content",` + opacity: 1; + transition: opacity .3s var(--n-bezier); + pointer-events: all; + `,[P("spinning",` + user-select: none; + -webkit-user-select: none; + pointer-events: none; + opacity: var(--n-opacity-spinning); + `)])]),f0={small:20,medium:18,large:16},h0=Object.assign(Object.assign({},ne.props),{description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0}}),U1=q({name:"Spin",props:h0,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Spin","-spin",u0,am,e,o),n=R(()=>{const{size:a}=e,{common:{cubicBezierEaseInOut:s},self:d}=r.value,{opacitySpinning:c,color:u,textColor:f}=d,p=typeof a=="number"?_o(a):d[W("size",a)];return{"--n-bezier":s,"--n-opacity-spinning":c,"--n-size":p,"--n-color":u,"--n-text-color":f}}),l=t?Ae("spin",R(()=>{const{size:a}=e;return typeof a=="number"?String(a):a[0]}),n,e):void 0;return{mergedClsPrefix:o,compitableShow:gt(e,["spinning","show"]),mergedStrokeWidth:R(()=>{const{strokeWidth:a}=e;if(a!==void 0)return a;const{size:s}=e;return f0[typeof s=="number"?"medium":s]}),cssVars:t?void 0:n,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e,o;const{$slots:t,mergedClsPrefix:r,description:n}=this,l=t.icon&&this.rotate,a=(n||t.description)&&i("div",{class:`${r}-spin-description`},n||((e=t.description)===null||e===void 0?void 0:e.call(t))),s=t.icon?i("div",{class:[`${r}-spin-body`,this.themeClass]},i("div",{class:[`${r}-spin`,l&&`${r}-spin--rotate`],style:t.default?"":this.cssVars},t.icon()),a):i("div",{class:[`${r}-spin-body`,this.themeClass]},i(Et,{clsPrefix:r,style:t.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${r}-spin`}),a);return(o=this.onRender)===null||o===void 0||o.call(this),t.default?i("div",{class:[`${r}-spin-container`,this.themeClass],style:this.cssVars},i("div",{class:[`${r}-spin-content`,this.compitableShow&&`${r}-spin-content--spinning`]},t),i(no,{name:"fade-in-transition"},{default:()=>this.compitableShow?s:null})):s}}),p0=g("statistic",[y("label",` + font-weight: var(--n-label-font-weight); + transition: .3s color var(--n-bezier); + font-size: var(--n-label-font-size); + color: var(--n-label-text-color); + `),g("statistic-value",` + margin-top: 4px; + font-weight: var(--n-value-font-weight); + `,[y("prefix",` + margin: 0 4px 0 0; + font-size: var(--n-value-font-size); + transition: .3s color var(--n-bezier); + color: var(--n-value-prefix-text-color); + `,[g("icon",{verticalAlign:"-0.125em"})]),y("content",` + font-size: var(--n-value-font-size); + transition: .3s color var(--n-bezier); + color: var(--n-value-text-color); + `),y("suffix",` + margin: 0 0 0 4px; + font-size: var(--n-value-font-size); + transition: .3s color var(--n-bezier); + color: var(--n-value-suffix-text-color); + `,[g("icon",{verticalAlign:"-0.125em"})])])]),v0=Object.assign(Object.assign({},ne.props),{tabularNums:Boolean,label:String,value:[String,Number]}),K1=q({name:"Statistic",props:v0,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t,mergedRtlRef:r}=ke(e),n=ne("Statistic","-statistic",p0,um,e,o),l=to("Statistic",r,o),a=R(()=>{const{self:{labelFontWeight:d,valueFontSize:c,valueFontWeight:u,valuePrefixTextColor:f,labelTextColor:p,valueSuffixTextColor:v,valueTextColor:h,labelFontSize:m},common:{cubicBezierEaseInOut:b}}=n.value;return{"--n-bezier":b,"--n-label-font-size":m,"--n-label-font-weight":d,"--n-label-text-color":p,"--n-value-font-weight":u,"--n-value-font-size":c,"--n-value-prefix-text-color":f,"--n-value-suffix-text-color":v,"--n-value-text-color":h}}),s=t?Ae("statistic",void 0,a,e):void 0;return{rtlEnabled:l,mergedClsPrefix:o,cssVars:t?void 0:a,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){var e;const{mergedClsPrefix:o,$slots:{default:t,label:r,prefix:n,suffix:l}}=this;return(e=this.onRender)===null||e===void 0||e.call(this),i("div",{class:[`${o}-statistic`,this.themeClass,this.rtlEnabled&&`${o}-statistic--rtl`],style:this.cssVars},Ee(r,a=>i("div",{class:`${o}-statistic__label`},this.label||a)),i("div",{class:`${o}-statistic-value`,style:{fontVariantNumeric:this.tabularNums?"tabular-nums":""}},Ee(n,a=>a&&i("span",{class:`${o}-statistic-value__prefix`},a)),this.value!==void 0?i("span",{class:`${o}-statistic-value__content`},this.value):Ee(t,a=>a&&i("span",{class:`${o}-statistic-value__content`},a)),Ee(l,a=>a&&i("span",{class:`${o}-statistic-value__suffix`},a))))}}),g0=g("switch",` + height: var(--n-height); + min-width: var(--n-width); + vertical-align: middle; + user-select: none; + -webkit-user-select: none; + display: inline-flex; + outline: none; + justify-content: center; + align-items: center; +`,[y("children-placeholder",` + height: var(--n-rail-height); + display: flex; + flex-direction: column; + overflow: hidden; + pointer-events: none; + visibility: hidden; + `),y("rail-placeholder",` + display: flex; + flex-wrap: none; + `),y("button-placeholder",` + width: calc(1.75 * var(--n-rail-height)); + height: var(--n-rail-height); + `),g("base-loading",` + position: absolute; + top: 50%; + left: 50%; + transform: translateX(-50%) translateY(-50%); + font-size: calc(var(--n-button-width) - 4px); + color: var(--n-loading-color); + transition: color .3s var(--n-bezier); + `,[lt({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),y("checked, unchecked",` + transition: color .3s var(--n-bezier); + color: var(--n-text-color); + box-sizing: border-box; + position: absolute; + white-space: nowrap; + top: 0; + bottom: 0; + display: flex; + align-items: center; + line-height: 1; + `),y("checked",` + right: 0; + padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset)); + `),y("unchecked",` + left: 0; + justify-content: flex-end; + padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset)); + `),C("&:focus",[y("rail",` + box-shadow: var(--n-box-shadow-focus); + `)]),P("round",[y("rail","border-radius: calc(var(--n-rail-height) / 2);",[y("button","border-radius: calc(var(--n-button-height) / 2);")])]),je("disabled",[je("icon",[P("rubber-band",[P("pressed",[y("rail",[y("button","max-width: var(--n-button-width-pressed);")])]),y("rail",[C("&:active",[y("button","max-width: var(--n-button-width-pressed);")])]),P("active",[P("pressed",[y("rail",[y("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),y("rail",[C("&:active",[y("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),P("active",[y("rail",[y("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),y("rail",` + overflow: hidden; + height: var(--n-rail-height); + min-width: var(--n-rail-width); + border-radius: var(--n-rail-border-radius); + cursor: pointer; + position: relative; + transition: + opacity .3s var(--n-bezier), + background .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); + background-color: var(--n-rail-color); + `,[y("button-icon",` + color: var(--n-icon-color); + transition: color .3s var(--n-bezier); + font-size: calc(var(--n-button-height) - 4px); + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + display: flex; + justify-content: center; + align-items: center; + line-height: 1; + `,[lt()]),y("button",` + align-items: center; + top: var(--n-offset); + left: var(--n-offset); + height: var(--n-button-height); + width: var(--n-button-width-pressed); + max-width: var(--n-button-width); + border-radius: var(--n-button-border-radius); + background-color: var(--n-button-color); + box-shadow: var(--n-button-box-shadow); + box-sizing: border-box; + cursor: inherit; + content: ""; + position: absolute; + transition: + background-color .3s var(--n-bezier), + left .3s var(--n-bezier), + opacity .3s var(--n-bezier), + max-width .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); + `)]),P("active",[y("rail","background-color: var(--n-rail-color-active);")]),P("loading",[y("rail",` + cursor: wait; + `)]),P("disabled",[y("rail",` + cursor: not-allowed; + opacity: .5; + `)])]),m0=Object.assign(Object.assign({},ne.props),{size:{type:String,default:"medium"},value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},onChange:[Function,Array]});let Xt;const G1=q({name:"Switch",props:m0,setup(e){Xt===void 0&&(typeof CSS<"u"?typeof CSS.supports<"u"?Xt=CSS.supports("width","max(1px)"):Xt=!1:Xt=!0);const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Switch","-switch",g0,wm,e,o),n=rt(e),{mergedSizeRef:l,mergedDisabledRef:a}=n,s=D(e.defaultValue),d=le(e,"value"),c=so(d,s),u=R(()=>c.value===e.checkedValue),f=D(!1),p=D(!1),v=R(()=>{const{railStyle:O}=e;if(O)return O({focused:p.value,checked:u.value})});function h(O){const{"onUpdate:value":k,onChange:$,onUpdateValue:L}=e,{nTriggerFormInput:M,nTriggerFormChange:j}=n;k&&ae(k,O),L&&ae(L,O),$&&ae($,O),s.value=O,M(),j()}function m(){const{nTriggerFormFocus:O}=n;O()}function b(){const{nTriggerFormBlur:O}=n;O()}function x(){e.loading||a.value||(c.value!==e.checkedValue?h(e.checkedValue):h(e.uncheckedValue))}function S(){p.value=!0,m()}function B(){p.value=!1,b(),f.value=!1}function T(O){e.loading||a.value||O.key===" "&&(c.value!==e.checkedValue?h(e.checkedValue):h(e.uncheckedValue),f.value=!1)}function z(O){e.loading||a.value||O.key===" "&&(O.preventDefault(),f.value=!0)}const I=R(()=>{const{value:O}=l,{self:{opacityDisabled:k,railColor:$,railColorActive:L,buttonBoxShadow:M,buttonColor:j,boxShadowFocus:E,loadingColor:U,textColor:_,iconColor:V,[W("buttonHeight",O)]:te,[W("buttonWidth",O)]:N,[W("buttonWidthPressed",O)]:G,[W("railHeight",O)]:Ce,[W("railWidth",O)]:X,[W("railBorderRadius",O)]:ve,[W("buttonBorderRadius",O)]:he},common:{cubicBezierEaseInOut:be}}=r.value;let me,se,Re;return Xt?(me=`calc((${Ce} - ${te}) / 2)`,se=`max(${Ce}, ${te})`,Re=`max(${X}, calc(${X} + ${te} - ${Ce}))`):(me=_o((Mo(Ce)-Mo(te))/2),se=_o(Math.max(Mo(Ce),Mo(te))),Re=Mo(Ce)>Mo(te)?X:_o(Mo(X)+Mo(te)-Mo(Ce))),{"--n-bezier":be,"--n-button-border-radius":he,"--n-button-box-shadow":M,"--n-button-color":j,"--n-button-width":N,"--n-button-width-pressed":G,"--n-button-height":te,"--n-height":se,"--n-offset":me,"--n-opacity-disabled":k,"--n-rail-border-radius":ve,"--n-rail-color":$,"--n-rail-color-active":L,"--n-rail-height":Ce,"--n-rail-width":X,"--n-width":Re,"--n-box-shadow-focus":E,"--n-loading-color":U,"--n-text-color":_,"--n-icon-color":V}}),w=t?Ae("switch",R(()=>l.value[0]),I,e):void 0;return{handleClick:x,handleBlur:B,handleFocus:S,handleKeyup:T,handleKeydown:z,mergedRailStyle:v,pressed:f,mergedClsPrefix:o,mergedValue:c,checked:u,mergedDisabled:a,cssVars:t?void 0:I,themeClass:w==null?void 0:w.themeClass,onRender:w==null?void 0:w.onRender}},render(){const{mergedClsPrefix:e,mergedDisabled:o,checked:t,mergedRailStyle:r,onRender:n,$slots:l}=this;n==null||n();const{checked:a,unchecked:s,icon:d,"checked-icon":c,"unchecked-icon":u}=l,f=!(ht(d)&&ht(c)&&ht(u));return i("div",{role:"switch","aria-checked":t,class:[`${e}-switch`,this.themeClass,f&&`${e}-switch--icon`,t&&`${e}-switch--active`,o&&`${e}-switch--disabled`,this.round&&`${e}-switch--round`,this.loading&&`${e}-switch--loading`,this.pressed&&`${e}-switch--pressed`,this.rubberBand&&`${e}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},i("div",{class:`${e}-switch__rail`,"aria-hidden":"true",style:r},Ee(a,p=>Ee(s,v=>p||v?i("div",{"aria-hidden":!0,class:`${e}-switch__children-placeholder`},i("div",{class:`${e}-switch__rail-placeholder`},i("div",{class:`${e}-switch__button-placeholder`}),p),i("div",{class:`${e}-switch__rail-placeholder`},i("div",{class:`${e}-switch__button-placeholder`}),v)):null)),i("div",{class:`${e}-switch__button`},Ee(d,p=>Ee(c,v=>Ee(u,h=>i(At,null,{default:()=>this.loading?i(Et,{key:"loading",clsPrefix:e,strokeWidth:20}):this.checked&&(v||p)?i("div",{class:`${e}-switch__button-icon`,key:v?"checked-icon":"icon"},v||p):!this.checked&&(h||p)?i("div",{class:`${e}-switch__button-icon`,key:h?"unchecked-icon":"icon"},h||p):null})))),Ee(a,p=>p&&i("div",{key:"checked",class:`${e}-switch__checked`},p)),Ee(s,p=>p&&i("div",{key:"unchecked",class:`${e}-switch__unchecked`},p)))))}}),jn="n-tabs",cs={tab:[String,Number,Object,Function],name:{type:[String,Number],required:!0},disabled:Boolean,displayDirective:{type:String,default:"if"},closable:{type:Boolean,default:void 0},tabProps:Object,label:[String,Number,Object,Function]},q1=q({__TAB_PANE__:!0,name:"TabPane",alias:["TabPanel"],props:cs,setup(e){const o=Se(jn,null);return o||Eo("tab-pane","`n-tab-pane` must be placed inside `n-tabs`."),{style:o.paneStyleRef,class:o.paneClassRef,mergedClsPrefix:o.mergedClsPrefixRef}},render(){return i("div",{class:[`${this.mergedClsPrefix}-tab-pane`,this.class],style:this.style},this.$slots)}}),b0=Object.assign({internalLeftPadded:Boolean,internalAddable:Boolean,internalCreatedByPane:Boolean},_t(cs,["displayDirective"])),un=q({__TAB__:!0,inheritAttrs:!1,name:"Tab",props:b0,setup(e){const{mergedClsPrefixRef:o,valueRef:t,typeRef:r,closableRef:n,tabStyleRef:l,tabChangeIdRef:a,onBeforeLeaveRef:s,triggerRef:d,handleAdd:c,activateTab:u,handleClose:f}=Se(jn);return{trigger:d,mergedClosable:R(()=>{if(e.internalAddable)return!1;const{closable:p}=e;return p===void 0?n.value:p}),style:l,clsPrefix:o,value:t,type:r,handleClose(p){p.stopPropagation(),!e.disabled&&f(e.name)},activateTab(){if(e.disabled)return;if(e.internalAddable){c();return}const{name:p}=e,v=++a.id;if(p!==t.value){const{value:h}=s;h?Promise.resolve(h(e.name,t.value)).then(m=>{m&&a.id===v&&u(p)}):u(p)}}}},render(){const{internalAddable:e,clsPrefix:o,name:t,disabled:r,label:n,tab:l,value:a,mergedClosable:s,style:d,trigger:c,$slots:{default:u}}=this,f=n??l;return i("div",{class:`${o}-tabs-tab-wrapper`},this.internalLeftPadded?i("div",{class:`${o}-tabs-tab-pad`}):null,i("div",Object.assign({key:t,"data-name":t,"data-disabled":r?!0:void 0},ko({class:[`${o}-tabs-tab`,a===t&&`${o}-tabs-tab--active`,r&&`${o}-tabs-tab--disabled`,s&&`${o}-tabs-tab--closable`,e&&`${o}-tabs-tab--addable`],onClick:c==="click"?this.activateTab:void 0,onMouseenter:c==="hover"?this.activateTab:void 0,style:e?void 0:d},this.internalCreatedByPane?this.tabProps||{}:this.$attrs)),i("span",{class:`${o}-tabs-tab__label`},e?i(ao,null,i("div",{class:`${o}-tabs-tab__height-placeholder`}," "),i(De,{clsPrefix:o},{default:()=>i(tr,null)})):u?u():typeof f=="object"?f:qe(f??t)),s&&this.type==="card"?i(St,{clsPrefix:o,class:`${o}-tabs-tab__close`,onClick:this.handleClose,disabled:r}):null))}}),x0=g("tabs",` + box-sizing: border-box; + width: 100%; + display: flex; + flex-direction: column; + transition: + background-color .3s var(--n-bezier), + border-color .3s var(--n-bezier); +`,[P("segment-type",[g("tabs-rail",[C("&.transition-disabled","color: red;",[g("tabs-tab",` + transition: none; + `)])])]),P("top",[g("tab-pane",` + padding: var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left); + `)]),P("left",[g("tab-pane",` + padding: var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left) var(--n-pane-padding-top); + `)]),P("left, right",` + flex-direction: row; + `,[g("tabs-bar",` + width: 2px; + right: 0; + transition: + top .2s var(--n-bezier), + max-height .2s var(--n-bezier), + background-color .3s var(--n-bezier); + `),g("tabs-tab",` + padding: var(--n-tab-padding-vertical); + `)]),P("right",` + flex-direction: row-reverse; + `,[g("tab-pane",` + padding: var(--n-pane-padding-left) var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom); + `),g("tabs-bar",` + left: 0; + `)]),P("bottom",` + flex-direction: column-reverse; + justify-content: flex-end; + `,[g("tab-pane",` + padding: var(--n-pane-padding-bottom) var(--n-pane-padding-right) var(--n-pane-padding-top) var(--n-pane-padding-left); + `),g("tabs-bar",` + top: 0; + `)]),g("tabs-rail",` + padding: 3px; + border-radius: var(--n-tab-border-radius); + width: 100%; + background-color: var(--n-color-segment); + transition: background-color .3s var(--n-bezier); + display: flex; + align-items: center; + `,[g("tabs-tab-wrapper",` + flex-basis: 0; + flex-grow: 1; + display: flex; + align-items: center; + justify-content: center; + `,[g("tabs-tab",` + overflow: hidden; + border-radius: var(--n-tab-border-radius); + width: 100%; + display: flex; + align-items: center; + justify-content: center; + `,[P("active",` + font-weight: var(--n-font-weight-strong); + color: var(--n-tab-text-color-active); + background-color: var(--n-tab-color-segment); + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .08); + `),C("&:hover",` + color: var(--n-tab-text-color-hover); + `)])])]),P("flex",[g("tabs-nav",{width:"100%"},[g("tabs-wrapper",{width:"100%"},[g("tabs-tab",{marginRight:0})])])]),g("tabs-nav",` + box-sizing: border-box; + line-height: 1.5; + display: flex; + transition: border-color .3s var(--n-bezier); + `,[y("prefix, suffix",` + display: flex; + align-items: center; + `),y("prefix","padding-right: 16px;"),y("suffix","padding-left: 16px;")]),P("top, bottom",[g("tabs-nav-scroll-wrapper",[C("&::before",` + top: 0; + bottom: 0; + left: 0; + width: 20px; + `),C("&::after",` + top: 0; + bottom: 0; + right: 0; + width: 20px; + `),P("shadow-start",[C("&::before",` + box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, .12); + `)]),P("shadow-end",[C("&::after",` + box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, .12); + `)])])]),P("left, right",[g("tabs-nav-scroll-wrapper",[C("&::before",` + top: 0; + left: 0; + right: 0; + height: 20px; + `),C("&::after",` + bottom: 0; + left: 0; + right: 0; + height: 20px; + `),P("shadow-start",[C("&::before",` + box-shadow: inset 0 10px 8px -8px rgba(0, 0, 0, .12); + `)]),P("shadow-end",[C("&::after",` + box-shadow: inset 0 -10px 8px -8px rgba(0, 0, 0, .12); + `)])])]),g("tabs-nav-scroll-wrapper",` + flex: 1; + position: relative; + overflow: hidden; + `,[g("tabs-nav-y-scroll",` + height: 100%; + width: 100%; + overflow-y: auto; + scrollbar-width: none; + `,[C("&::-webkit-scrollbar",` + width: 0; + height: 0; + `)]),C("&::before, &::after",` + transition: box-shadow .3s var(--n-bezier); + pointer-events: none; + content: ""; + position: absolute; + z-index: 1; + `)]),g("tabs-nav-scroll-content",` + display: flex; + position: relative; + min-width: 100%; + width: fit-content; + box-sizing: border-box; + `),g("tabs-wrapper",` + display: inline-flex; + flex-wrap: nowrap; + position: relative; + `),g("tabs-tab-wrapper",` + display: flex; + flex-wrap: nowrap; + flex-shrink: 0; + flex-grow: 0; + `),g("tabs-tab",` + cursor: pointer; + white-space: nowrap; + flex-wrap: nowrap; + display: inline-flex; + align-items: center; + color: var(--n-tab-text-color); + font-size: var(--n-tab-font-size); + background-clip: padding-box; + padding: var(--n-tab-padding); + transition: + box-shadow .3s var(--n-bezier), + color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + border-color .3s var(--n-bezier); + `,[P("disabled",{cursor:"not-allowed"}),y("close",` + margin-left: 6px; + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + `),y("label",` + display: flex; + align-items: center; + `)]),g("tabs-bar",` + position: absolute; + bottom: 0; + height: 2px; + border-radius: 1px; + background-color: var(--n-bar-color); + transition: + left .2s var(--n-bezier), + max-width .2s var(--n-bezier), + background-color .3s var(--n-bezier); + `,[C("&.transition-disabled",` + transition: none; + `),P("disabled",` + background-color: var(--n-tab-text-color-disabled) + `)]),g("tabs-pane-wrapper",` + position: relative; + overflow: hidden; + transition: max-height .2s var(--n-bezier); + `),g("tab-pane",` + color: var(--n-pane-text-color); + width: 100%; + transition: + color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + opacity .2s var(--n-bezier); + left: 0; + right: 0; + top: 0; + `,[C("&.next-transition-leave-active, &.prev-transition-leave-active, &.next-transition-enter-active, &.prev-transition-enter-active",` + transition: + color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + transform .2s var(--n-bezier), + opacity .2s var(--n-bezier); + `),C("&.next-transition-leave-active, &.prev-transition-leave-active",` + position: absolute; + `),C("&.next-transition-enter-from, &.prev-transition-leave-to",` + transform: translateX(32px); + opacity: 0; + `),C("&.next-transition-leave-to, &.prev-transition-enter-from",` + transform: translateX(-32px); + opacity: 0; + `),C("&.next-transition-leave-from, &.next-transition-enter-to, &.prev-transition-leave-from, &.prev-transition-enter-to",` + transform: translateX(0); + opacity: 1; + `)]),g("tabs-tab-pad",` + box-sizing: border-box; + width: var(--n-tab-gap); + flex-grow: 0; + flex-shrink: 0; + `),P("line-type, bar-type",[g("tabs-tab",` + font-weight: var(--n-tab-font-weight); + box-sizing: border-box; + vertical-align: bottom; + `,[C("&:hover",{color:"var(--n-tab-text-color-hover)"}),P("active",` + color: var(--n-tab-text-color-active); + font-weight: var(--n-tab-font-weight-active); + `),P("disabled",{color:"var(--n-tab-text-color-disabled)"})])]),g("tabs-nav",[P("line-type",[P("top",[y("prefix, suffix",` + border-bottom: 1px solid var(--n-tab-border-color); + `),g("tabs-nav-scroll-content",` + border-bottom: 1px solid var(--n-tab-border-color); + `),g("tabs-bar",` + bottom: -1px; + `)]),P("left",[y("prefix, suffix",` + border-right: 1px solid var(--n-tab-border-color); + `),g("tabs-nav-scroll-content",` + border-right: 1px solid var(--n-tab-border-color); + `),g("tabs-bar",` + right: -1px; + `)]),P("right",[y("prefix, suffix",` + border-left: 1px solid var(--n-tab-border-color); + `),g("tabs-nav-scroll-content",` + border-left: 1px solid var(--n-tab-border-color); + `),g("tabs-bar",` + left: -1px; + `)]),P("bottom",[y("prefix, suffix",` + border-top: 1px solid var(--n-tab-border-color); + `),g("tabs-nav-scroll-content",` + border-top: 1px solid var(--n-tab-border-color); + `),g("tabs-bar",` + top: -1px; + `)]),y("prefix, suffix",` + transition: border-color .3s var(--n-bezier); + `),g("tabs-nav-scroll-content",` + transition: border-color .3s var(--n-bezier); + `),g("tabs-bar",` + border-radius: 0; + `)]),P("card-type",[y("prefix, suffix",` + transition: border-color .3s var(--n-bezier); + border-bottom: 1px solid var(--n-tab-border-color); + `),g("tabs-pad",` + flex-grow: 1; + transition: border-color .3s var(--n-bezier); + border-bottom: 1px solid var(--n-tab-border-color); + `),g("tabs-tab-pad",` + transition: border-color .3s var(--n-bezier); + `),g("tabs-tab",` + font-weight: var(--n-tab-font-weight); + border: 1px solid var(--n-tab-border-color); + background-color: var(--n-tab-color); + box-sizing: border-box; + position: relative; + vertical-align: bottom; + display: flex; + justify-content: space-between; + font-size: var(--n-tab-font-size); + color: var(--n-tab-text-color); + `,[P("addable",` + padding-left: 8px; + padding-right: 8px; + font-size: 16px; + `,[y("height-placeholder",` + width: 0; + font-size: var(--n-tab-font-size); + `),je("disabled",[C("&:hover",` + color: var(--n-tab-text-color-hover); + `)])]),P("closable","padding-right: 8px;"),P("active",` + background-color: #0000; + font-weight: var(--n-tab-font-weight-active); + color: var(--n-tab-text-color-active); + `),P("disabled","color: var(--n-tab-text-color-disabled);")]),g("tabs-scroll-padding","border-bottom: 1px solid var(--n-tab-border-color);")]),P("left, right",[g("tabs-wrapper",` + flex-direction: column; + `,[g("tabs-tab-wrapper",` + flex-direction: column; + `,[g("tabs-tab-pad",` + height: var(--n-tab-gap-vertical); + width: 100%; + `)])])]),P("top",[P("card-type",[g("tabs-tab",` + border-top-left-radius: var(--n-tab-border-radius); + border-top-right-radius: var(--n-tab-border-radius); + `,[P("active",` + border-bottom: 1px solid #0000; + `)]),g("tabs-tab-pad",` + border-bottom: 1px solid var(--n-tab-border-color); + `)])]),P("left",[P("card-type",[g("tabs-tab",` + border-top-left-radius: var(--n-tab-border-radius); + border-bottom-left-radius: var(--n-tab-border-radius); + `,[P("active",` + border-right: 1px solid #0000; + `)]),g("tabs-tab-pad",` + border-right: 1px solid var(--n-tab-border-color); + `)])]),P("right",[P("card-type",[g("tabs-tab",` + border-top-right-radius: var(--n-tab-border-radius); + border-bottom-right-radius: var(--n-tab-border-radius); + `,[P("active",` + border-left: 1px solid #0000; + `)]),g("tabs-tab-pad",` + border-left: 1px solid var(--n-tab-border-color); + `)])]),P("bottom",[P("card-type",[g("tabs-tab",` + border-bottom-left-radius: var(--n-tab-border-radius); + border-bottom-right-radius: var(--n-tab-border-radius); + `,[P("active",` + border-top: 1px solid #0000; + `)]),g("tabs-tab-pad",` + border-top: 1px solid var(--n-tab-border-color); + `)])])])]),C0=Object.assign(Object.assign({},ne.props),{value:[String,Number],defaultValue:[String,Number],trigger:{type:String,default:"click"},type:{type:String,default:"bar"},closable:Boolean,justifyContent:String,size:{type:String,default:"medium"},placement:{type:String,default:"top"},tabStyle:[String,Object],barWidth:Number,paneClass:String,paneStyle:[String,Object],paneWrapperClass:String,paneWrapperStyle:[String,Object],addable:[Boolean,Object],tabsPadding:{type:Number,default:0},animated:Boolean,onBeforeLeave:Function,onAdd:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClose:[Function,Array],labelSize:String,activeName:[String,Number],onActiveNameChange:[Function,Array]}),Y1=q({name:"Tabs",props:C0,setup(e,{slots:o}){var t,r,n,l;const{mergedClsPrefixRef:a,inlineThemeDisabled:s}=ke(e),d=ne("Tabs","-tabs",x0,Im,e,a),c=D(null),u=D(null),f=D(null),p=D(null),v=D(null),h=D(!0),m=D(!0),b=gt(e,["labelSize","size"]),x=gt(e,["activeName","value"]),S=D((r=(t=x.value)!==null&&t!==void 0?t:e.defaultValue)!==null&&r!==void 0?r:o.default?(l=(n=tt(o.default())[0])===null||n===void 0?void 0:n.props)===null||l===void 0?void 0:l.name:null),B=so(x,S),T={id:0},z=R(()=>{if(!(!e.justifyContent||e.type==="card"))return{display:"flex",justifyContent:e.justifyContent}});Ke(B,()=>{T.id=0,k(),$()});function I(){var Q;const{value:A}=B;return A===null?null:(Q=c.value)===null||Q===void 0?void 0:Q.querySelector(`[data-name="${A}"]`)}function w(Q){if(e.type==="card")return;const{value:A}=u;if(A&&Q){const Z=`${a.value}-tabs-bar--disabled`,{barWidth:re,placement:ue}=e;if(Q.dataset.disabled==="true"?A.classList.add(Z):A.classList.remove(Z),["top","bottom"].includes(ue)){if(O(["top","maxHeight","height"]),typeof re=="number"&&Q.offsetWidth>=re){const Y=Math.floor((Q.offsetWidth-re)/2)+Q.offsetLeft;A.style.left=`${Y}px`,A.style.maxWidth=`${re}px`}else A.style.left=`${Q.offsetLeft}px`,A.style.maxWidth=`${Q.offsetWidth}px`;A.style.width="8192px",A.offsetWidth}else{if(O(["left","maxWidth","width"]),typeof re=="number"&&Q.offsetHeight>=re){const Y=Math.floor((Q.offsetHeight-re)/2)+Q.offsetTop;A.style.top=`${Y}px`,A.style.maxHeight=`${re}px`}else A.style.top=`${Q.offsetTop}px`,A.style.maxHeight=`${Q.offsetHeight}px`;A.style.height="8192px",A.offsetHeight}}}function O(Q){const{value:A}=u;if(A)for(const Z of Q)A.style[Z]=""}function k(){if(e.type==="card")return;const Q=I();Q&&w(Q)}function $(Q){var A;const Z=(A=v.value)===null||A===void 0?void 0:A.$el;if(!Z)return;const re=I();if(!re)return;const{scrollLeft:ue,offsetWidth:Y}=Z,{offsetLeft:ce,offsetWidth:He}=re;ue>ce?Z.scrollTo({top:0,left:ce,behavior:"smooth"}):ce+He>ue+Y&&Z.scrollTo({top:0,left:ce+He-Y,behavior:"smooth"})}const L=D(null);let M=0,j=null;function E(Q){const A=L.value;if(A){M=Q.getBoundingClientRect().height;const Z=`${M}px`,re=()=>{A.style.height=Z,A.style.maxHeight=Z};j?(re(),j(),j=null):j=re}}function U(Q){const A=L.value;if(A){const Z=Q.getBoundingClientRect().height,re=()=>{document.body.offsetHeight,A.style.maxHeight=`${Z}px`,A.style.height=`${Math.max(M,Z)}px`};j?(j(),j=null,re()):j=re}}function _(){const Q=L.value;Q&&(Q.style.maxHeight="",Q.style.height="")}const V={value:[]},te=D("next");function N(Q){const A=B.value;let Z="next";for(const re of V.value){if(re===A)break;if(re===Q){Z="prev";break}}te.value=Z,G(Q)}function G(Q){const{onActiveNameChange:A,onUpdateValue:Z,"onUpdate:value":re}=e;A&&ae(A,Q),Z&&ae(Z,Q),re&&ae(re,Q),S.value=Q}function Ce(Q){const{onClose:A}=e;A&&ae(A,Q)}function X(){const{value:Q}=u;if(!Q)return;const A="transition-disabled";Q.classList.add(A),k(),Q.classList.remove(A)}let ve=0;function he(Q){var A;if(Q.contentRect.width===0&&Q.contentRect.height===0||ve===Q.contentRect.width)return;ve=Q.contentRect.width;const{type:Z}=e;(Z==="line"||Z==="bar")&&X(),Z!=="segment"&&ee((A=v.value)===null||A===void 0?void 0:A.$el)}const be=Ur(he,64);Ke([()=>e.justifyContent,()=>e.size],()=>{io(()=>{const{type:Q}=e;(Q==="line"||Q==="bar")&&X()})});const me=D(!1);function se(Q){var A;const{target:Z,contentRect:{width:re}}=Q,ue=Z.parentElement.offsetWidth;if(!me.value)ueY.$el.offsetWidth&&(me.value=!1)}ee((A=v.value)===null||A===void 0?void 0:A.$el)}const Re=Ur(se,64);function ge(){const{onAdd:Q}=e;Q&&Q(),io(()=>{const A=I(),{value:Z}=v;!A||!Z||Z.scrollTo({left:A.offsetLeft,top:0,behavior:"smooth"})})}function ee(Q){if(!Q)return;const{placement:A}=e;if(A==="top"||A==="bottom"){const{scrollLeft:Z,scrollWidth:re,offsetWidth:ue}=Q;h.value=Z<=0,m.value=Z+ue>=re}else{const{scrollTop:Z,scrollHeight:re,offsetHeight:ue}=Q;h.value=Z<=0,m.value=Z+ue>=re}}const xe=Ur(Q=>{ee(Q.target)},64);Oe(jn,{triggerRef:le(e,"trigger"),tabStyleRef:le(e,"tabStyle"),paneClassRef:le(e,"paneClass"),paneStyleRef:le(e,"paneStyle"),mergedClsPrefixRef:a,typeRef:le(e,"type"),closableRef:le(e,"closable"),valueRef:B,tabChangeIdRef:T,onBeforeLeaveRef:le(e,"onBeforeLeave"),activateTab:N,handleClose:Ce,handleAdd:ge}),dd(()=>{k(),$()}),oo(()=>{const{value:Q}=f;if(!Q)return;const{value:A}=a,Z=`${A}-tabs-nav-scroll-wrapper--shadow-start`,re=`${A}-tabs-nav-scroll-wrapper--shadow-end`;h.value?Q.classList.remove(Z):Q.classList.add(Z),m.value?Q.classList.remove(re):Q.classList.add(re)});const de=D(null);Ke(B,()=>{if(e.type==="segment"){const Q=de.value;Q&&io(()=>{Q.classList.add("transition-disabled"),Q.offsetWidth,Q.classList.remove("transition-disabled")})}});const ye={syncBarPosition:()=>{k()}},pe=R(()=>{const{value:Q}=b,{type:A}=e,Z={card:"Card",bar:"Bar",line:"Line",segment:"Segment"}[A],re=`${Q}${Z}`,{self:{barColor:ue,closeIconColor:Y,closeIconColorHover:ce,closeIconColorPressed:He,tabColor:Ve,tabBorderColor:Ze,paneTextColor:po,tabFontWeight:fo,tabBorderRadius:Bo,tabFontWeightActive:To,colorSegment:xo,fontWeightStrong:Co,tabColorSegment:Ao,closeSize:Fo,closeIconSize:co,closeColorHover:uo,closeColorPressed:F,closeBorderRadius:K,[W("panePadding",Q)]:ie,[W("tabPadding",re)]:ze,[W("tabPaddingVertical",re)]:Pe,[W("tabGap",re)]:Ie,[W("tabGap",`${re}Vertical`)]:Te,[W("tabTextColor",A)]:_e,[W("tabTextColorActive",A)]:Qe,[W("tabTextColorHover",A)]:vo,[W("tabTextColorDisabled",A)]:Wo,[W("tabFontSize",Q)]:No},common:{cubicBezierEaseInOut:st}}=d.value;return{"--n-bezier":st,"--n-color-segment":xo,"--n-bar-color":ue,"--n-tab-font-size":No,"--n-tab-text-color":_e,"--n-tab-text-color-active":Qe,"--n-tab-text-color-disabled":Wo,"--n-tab-text-color-hover":vo,"--n-pane-text-color":po,"--n-tab-border-color":Ze,"--n-tab-border-radius":Bo,"--n-close-size":Fo,"--n-close-icon-size":co,"--n-close-color-hover":uo,"--n-close-color-pressed":F,"--n-close-border-radius":K,"--n-close-icon-color":Y,"--n-close-icon-color-hover":ce,"--n-close-icon-color-pressed":He,"--n-tab-color":Ve,"--n-tab-font-weight":fo,"--n-tab-font-weight-active":To,"--n-tab-padding":ze,"--n-tab-padding-vertical":Pe,"--n-tab-gap":Ie,"--n-tab-gap-vertical":Te,"--n-pane-padding-left":Ko(ie,"left"),"--n-pane-padding-right":Ko(ie,"right"),"--n-pane-padding-top":Ko(ie,"top"),"--n-pane-padding-bottom":Ko(ie,"bottom"),"--n-font-weight-strong":Co,"--n-tab-color-segment":Ao}}),Me=s?Ae("tabs",R(()=>`${b.value[0]}${e.type[0]}`),pe,e):void 0;return Object.assign({mergedClsPrefix:a,mergedValue:B,renderedNames:new Set,tabsRailElRef:de,tabsPaneWrapperRef:L,tabsElRef:c,barElRef:u,addTabInstRef:p,xScrollInstRef:v,scrollWrapperElRef:f,addTabFixed:me,tabWrapperStyle:z,handleNavResize:be,mergedSize:b,handleScroll:xe,handleTabsResize:Re,cssVars:s?void 0:pe,themeClass:Me==null?void 0:Me.themeClass,animationDirection:te,renderNameListRef:V,onAnimationBeforeLeave:E,onAnimationEnter:U,onAnimationAfterEnter:_,onRender:Me==null?void 0:Me.onRender},ye)},render(){const{mergedClsPrefix:e,type:o,placement:t,addTabFixed:r,addable:n,mergedSize:l,renderNameListRef:a,onRender:s,paneWrapperClass:d,paneWrapperStyle:c,$slots:{default:u,prefix:f,suffix:p}}=this;s==null||s();const v=u?tt(u()).filter(z=>z.type.__TAB_PANE__===!0):[],h=u?tt(u()).filter(z=>z.type.__TAB__===!0):[],m=!h.length,b=o==="card",x=o==="segment",S=!b&&!x&&this.justifyContent;a.value=[];const B=()=>{const z=i("div",{style:this.tabWrapperStyle,class:[`${e}-tabs-wrapper`]},S?null:i("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}),m?v.map((I,w)=>(a.value.push(I.props.name),rn(i(un,Object.assign({},I.props,{internalCreatedByPane:!0,internalLeftPadded:w!==0&&(!S||S==="center"||S==="start"||S==="end")}),I.children?{default:I.children.tab}:void 0)))):h.map((I,w)=>(a.value.push(I.props.name),rn(w!==0&&!S?_i(I):I))),!r&&n&&b?Mi(n,(m?v.length:h.length)!==0):null,S?null:i("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}));return i("div",{ref:"tabsElRef",class:`${e}-tabs-nav-scroll-content`},b&&n?i(vt,{onResize:this.handleTabsResize},{default:()=>z}):z,b?i("div",{class:`${e}-tabs-pad`}):null,b?null:i("div",{ref:"barElRef",class:`${e}-tabs-bar`}))},T=x?"top":t;return i("div",{class:[`${e}-tabs`,this.themeClass,`${e}-tabs--${o}-type`,`${e}-tabs--${l}-size`,S&&`${e}-tabs--flex`,`${e}-tabs--${T}`],style:this.cssVars},i("div",{class:[`${e}-tabs-nav--${o}-type`,`${e}-tabs-nav--${T}`,`${e}-tabs-nav`]},Ee(f,z=>z&&i("div",{class:`${e}-tabs-nav__prefix`},z)),x?i("div",{class:`${e}-tabs-rail`,ref:"tabsRailElRef"},m?v.map((z,I)=>(a.value.push(z.props.name),i(un,Object.assign({},z.props,{internalCreatedByPane:!0,internalLeftPadded:I!==0}),z.children?{default:z.children.tab}:void 0))):h.map((z,I)=>(a.value.push(z.props.name),I===0?z:_i(z)))):i(vt,{onResize:this.handleNavResize},{default:()=>i("div",{class:`${e}-tabs-nav-scroll-wrapper`,ref:"scrollWrapperElRef"},["top","bottom"].includes(T)?i(id,{ref:"xScrollInstRef",onScroll:this.handleScroll},{default:B}):i("div",{class:`${e}-tabs-nav-y-scroll`,onScroll:this.handleScroll},B()))}),r&&n&&b?Mi(n,!0):null,Ee(p,z=>z&&i("div",{class:`${e}-tabs-nav__suffix`},z))),m&&(this.animated&&(T==="top"||T==="bottom")?i("div",{ref:"tabsPaneWrapperRef",style:c,class:[`${e}-tabs-pane-wrapper`,d]},Oi(v,this.mergedValue,this.renderedNames,this.onAnimationBeforeLeave,this.onAnimationEnter,this.onAnimationAfterEnter,this.animationDirection)):Oi(v,this.mergedValue,this.renderedNames)))}});function Oi(e,o,t,r,n,l,a){const s=[];return e.forEach(d=>{const{name:c,displayDirective:u,"display-directive":f}=d.props,p=h=>u===h||f===h,v=o===c;if(d.key!==void 0&&(d.key=c),v||p("show")||p("show:lazy")&&t.has(c)){t.has(c)||t.add(c);const h=!p("if");s.push(h?Lo(d,[[Go,v]]):d)}}),a?i(fn,{name:`${a}-transition`,onBeforeLeave:r,onEnter:n,onAfterEnter:l},{default:()=>s}):s}function Mi(e,o){return i(un,{ref:"addTabInstRef",key:"__addable",name:"__addable",internalCreatedByPane:!0,internalAddable:!0,internalLeftPadded:o,disabled:typeof e=="object"&&e.disabled})}function _i(e){const o=Jt(e);return o.props?o.props.internalLeftPadded=!0:o.props={internalLeftPadded:!0},o}function rn(e){return Array.isArray(e.dynamicProps)?e.dynamicProps.includes("internalLeftPadded")||e.dynamicProps.push("internalLeftPadded"):e.dynamicProps=["internalLeftPadded"],e}const y0=g("thing",` + display: flex; + transition: color .3s var(--n-bezier); + font-size: var(--n-font-size); + color: var(--n-text-color); +`,[g("thing-avatar",` + margin-right: 12px; + margin-top: 2px; + `),g("thing-avatar-header-wrapper",` + display: flex; + flex-wrap: nowrap; + `,[g("thing-header-wrapper",` + flex: 1; + `)]),g("thing-main",` + flex-grow: 1; + `,[g("thing-header",` + display: flex; + margin-bottom: 4px; + justify-content: space-between; + align-items: center; + `,[y("title",` + font-size: 16px; + font-weight: var(--n-title-font-weight); + transition: color .3s var(--n-bezier); + color: var(--n-title-text-color); + `)]),y("description",[C("&:not(:last-child)",` + margin-bottom: 4px; + `)]),y("content",[C("&:not(:first-child)",` + margin-top: 12px; + `)]),y("footer",[C("&:not(:first-child)",` + margin-top: 12px; + `)]),y("action",[C("&:not(:first-child)",` + margin-top: 12px; + `)])])]),w0=Object.assign(Object.assign({},ne.props),{title:String,titleExtra:String,description:String,descriptionStyle:[String,Object],content:String,contentStyle:[String,Object],contentIndented:Boolean}),X1=q({name:"Thing",props:w0,setup(e,{slots:o}){const{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=ke(e),l=ne("Thing","-thing",y0,Om,e,t),a=to("Thing",n,t),s=R(()=>{const{self:{titleTextColor:c,textColor:u,titleFontWeight:f,fontSize:p},common:{cubicBezierEaseInOut:v}}=l.value;return{"--n-bezier":v,"--n-font-size":p,"--n-text-color":u,"--n-title-font-weight":f,"--n-title-text-color":c}}),d=r?Ae("thing",void 0,s,e):void 0;return()=>{var c;const{value:u}=t,f=a?a.value:!1;return(c=d==null?void 0:d.onRender)===null||c===void 0||c.call(d),i("div",{class:[`${u}-thing`,d==null?void 0:d.themeClass,f&&`${u}-thing--rtl`],style:r?void 0:s.value},o.avatar&&e.contentIndented?i("div",{class:`${u}-thing-avatar`},o.avatar()):null,i("div",{class:`${u}-thing-main`},!e.contentIndented&&(o.header||e.title||o["header-extra"]||e.titleExtra||o.avatar)?i("div",{class:`${u}-thing-avatar-header-wrapper`},o.avatar?i("div",{class:`${u}-thing-avatar`},o.avatar()):null,o.header||e.title||o["header-extra"]||e.titleExtra?i("div",{class:`${u}-thing-header-wrapper`},i("div",{class:`${u}-thing-header`},o.header||e.title?i("div",{class:`${u}-thing-header__title`},o.header?o.header():e.title):null,o["header-extra"]||e.titleExtra?i("div",{class:`${u}-thing-header__extra`},o["header-extra"]?o["header-extra"]():e.titleExtra):null),o.description||e.description?i("div",{class:`${u}-thing-main__description`,style:e.descriptionStyle},o.description?o.description():e.description):null):null):i(ao,null,o.header||e.title||o["header-extra"]||e.titleExtra?i("div",{class:`${u}-thing-header`},o.header||e.title?i("div",{class:`${u}-thing-header__title`},o.header?o.header():e.title):null,o["header-extra"]||e.titleExtra?i("div",{class:`${u}-thing-header__extra`},o["header-extra"]?o["header-extra"]():e.titleExtra):null):null,o.description||e.description?i("div",{class:`${u}-thing-main__description`,style:e.descriptionStyle},o.description?o.description():e.description):null),o.default||e.content?i("div",{class:`${u}-thing-main__content`,style:e.contentStyle},o.default?o.default():e.content):null,o.footer?i("div",{class:`${u}-thing-main__footer`},o.footer()):null,o.action?i("div",{class:`${u}-thing-main__action`},o.action()):null))}}}),S0=g("h",` + font-size: var(--n-font-size); + font-weight: var(--n-font-weight); + margin: var(--n-margin); + transition: color .3s var(--n-bezier); + color: var(--n-text-color); +`,[C("&:first-child",{marginTop:0}),P("prefix-bar",{position:"relative",paddingLeft:"var(--n-prefix-width)"},[P("align-text",{paddingLeft:0},[C("&::before",{left:"calc(-1 * var(--n-prefix-width))"})]),C("&::before",` + content: ""; + width: var(--n-bar-width); + border-radius: calc(var(--n-bar-width) / 2); + transition: background-color .3s var(--n-bezier); + left: 0; + top: 0; + bottom: 0; + position: absolute; + `),C("&::before",{backgroundColor:"var(--n-bar-color)"})])]),z0=Object.assign(Object.assign({},ne.props),{type:{type:String,default:"default"},prefix:String,alignText:Boolean}),Vt=e=>q({name:`H${e}`,props:z0,setup(o){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=ke(o),n=ne("Typography","-h",S0,Ya,o,t),l=R(()=>{const{type:s}=o,{common:{cubicBezierEaseInOut:d},self:{headerFontWeight:c,headerTextColor:u,[W("headerPrefixWidth",e)]:f,[W("headerFontSize",e)]:p,[W("headerMargin",e)]:v,[W("headerBarWidth",e)]:h,[W("headerBarColor",s)]:m}}=n.value;return{"--n-bezier":d,"--n-font-size":p,"--n-margin":v,"--n-bar-color":m,"--n-bar-width":h,"--n-font-weight":c,"--n-text-color":u,"--n-prefix-width":f}}),a=r?Ae(`h${e}`,R(()=>o.type[0]),l,o):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:l,themeClass:a==null?void 0:a.themeClass,onRender:a==null?void 0:a.onRender}},render(){var o;const{prefix:t,alignText:r,mergedClsPrefix:n,cssVars:l,$slots:a}=this;return(o=this.onRender)===null||o===void 0||o.call(this),i(`h${e}`,{class:[`${n}-h`,`${n}-h${e}`,this.themeClass,{[`${n}-h--prefix-bar`]:t,[`${n}-h--align-text`]:r}],style:l},a)}});Vt("1");Vt("2");const Z1=Vt("3");Vt("4");Vt("5");Vt("6");const $0=g("text",` + transition: color .3s var(--n-bezier); + color: var(--n-text-color); +`,[P("strong",` + font-weight: var(--n-font-weight-strong); + `),P("italic",{fontStyle:"italic"}),P("underline",{textDecoration:"underline"}),P("code",` + line-height: 1.4; + display: inline-block; + font-family: var(--n-font-famliy-mono); + transition: + color .3s var(--n-bezier), + border-color .3s var(--n-bezier), + background-color .3s var(--n-bezier); + box-sizing: border-box; + padding: .05em .35em 0 .35em; + border-radius: var(--n-code-border-radius); + font-size: .9em; + color: var(--n-code-text-color); + background-color: var(--n-code-color); + border: var(--n-code-border); + `)]),R0=Object.assign(Object.assign({},ne.props),{code:Boolean,type:{type:String,default:"default"},delete:Boolean,strong:Boolean,italic:Boolean,underline:Boolean,depth:[String,Number],tag:String,as:{type:String,validator:()=>!0,default:void 0}}),Q1=q({name:"Text",props:R0,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Typography","-text",$0,Ya,e,o),n=R(()=>{const{depth:a,type:s}=e,d=s==="default"?a===void 0?"textColor":`textColor${a}Depth`:W("textColor",s),{common:{fontWeightStrong:c,fontFamilyMono:u,cubicBezierEaseInOut:f},self:{codeTextColor:p,codeBorderRadius:v,codeColor:h,codeBorder:m,[d]:b}}=r.value;return{"--n-bezier":f,"--n-text-color":b,"--n-font-weight-strong":c,"--n-font-famliy-mono":u,"--n-code-border-radius":v,"--n-code-text-color":p,"--n-code-color":h,"--n-code-border":m}}),l=t?Ae("text",R(()=>`${e.type[0]}${e.depth||""}`),n,e):void 0;return{mergedClsPrefix:o,compitableTag:gt(e,["as","tag"]),cssVars:t?void 0:n,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e,o,t;const{mergedClsPrefix:r}=this;(e=this.onRender)===null||e===void 0||e.call(this);const n=[`${r}-text`,this.themeClass,{[`${r}-text--code`]:this.code,[`${r}-text--delete`]:this.delete,[`${r}-text--strong`]:this.strong,[`${r}-text--italic`]:this.italic,[`${r}-text--underline`]:this.underline}],l=(t=(o=this.$slots).default)===null||t===void 0?void 0:t.call(o);return this.code?i("code",{class:n,style:this.cssVars},this.delete?i("del",null,l):l):this.delete?i("del",{class:n,style:this.cssVars},l):i(this.compitableTag||"span",{class:n,style:this.cssVars},l)}}),Ut="n-upload",us="__UPLOAD_DRAGGER__",P0=q({name:"UploadDragger",[us]:!0,setup(e,{slots:o}){const t=Se(Ut,null);return t||Eo("upload-dragger","`n-upload-dragger` must be placed inside `n-upload`."),()=>{const{mergedClsPrefixRef:{value:r},mergedDisabledRef:{value:n},maxReachedRef:{value:l}}=t;return i("div",{class:[`${r}-upload-dragger`,(n||l)&&`${r}-upload-dragger--disabled`]},o)}}});var fs=globalThis&&globalThis.__awaiter||function(e,o,t,r){function n(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function d(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?l(u.value):n(u.value).then(s,d)}c((r=r.apply(e,o||[])).next())})};const hs=e=>e.includes("image/"),Di=(e="")=>{const o=e.split("/"),r=o[o.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},Li=/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i,ps=e=>{if(e.type)return hs(e.type);const o=Di(e.name||"");if(Li.test(o))return!0;const t=e.thumbnailUrl||e.url||"",r=Di(t);return!!(/^data:image\//.test(t)||Li.test(r))};function k0(e){return fs(this,void 0,void 0,function*(){return yield new Promise(o=>{if(!e.type||!hs(e.type)){o("");return}o(window.URL.createObjectURL(e))})})}const I0=jo&&window.FileReader&&window.File;function B0(e){return e.isDirectory}function T0(e){return e.isFile}function F0(e,o){return fs(this,void 0,void 0,function*(){const t=[];let r,n=0;function l(){n++}function a(){n--,n||r(t)}function s(d){d.forEach(c=>{if(c){if(l(),o&&B0(c)){const u=c.createReader();l(),u.readEntries(f=>{s(f),a()},()=>{a()})}else T0(c)&&(l(),c.file(u=>{t.push({file:u,entry:c,source:"dnd"}),a()},()=>{a()}));a()}})}return yield new Promise(d=>{r=d,s(e)}),t})}function nr(e){const{id:o,name:t,percentage:r,status:n,url:l,file:a,thumbnailUrl:s,type:d,fullPath:c,batchId:u}=e;return{id:o,name:t,percentage:r??null,status:n,url:l??null,file:a??null,thumbnailUrl:s??null,type:d??null,fullPath:c??null,batchId:u??null}}function O0(e,o,t){return e=e.toLowerCase(),o=o.toLocaleLowerCase(),t=t.toLocaleLowerCase(),t.split(",").map(n=>n.trim()).filter(Boolean).some(n=>{if(n.startsWith(".")){if(e.endsWith(n))return!0}else if(n.includes("/")){const[l,a]=o.split("/"),[s,d]=n.split("/");if((s==="*"||l&&s&&s===l)&&(d==="*"||a&&d&&d===a))return!0}else return!0;return!1})}const M0=(e,o)=>{if(!e)return;const t=document.createElement("a");t.href=e,o!==void 0&&(t.download=o),document.body.appendChild(t),t.click(),document.body.removeChild(t)},vs=q({name:"UploadTrigger",props:{abstract:Boolean},setup(e,{slots:o}){const t=Se(Ut,null);t||Eo("upload-trigger","`n-upload-trigger` must be placed inside `n-upload`.");const{mergedClsPrefixRef:r,mergedDisabledRef:n,maxReachedRef:l,listTypeRef:a,dragOverRef:s,openOpenFileDialog:d,draggerInsideRef:c,handleFileAddition:u,mergedDirectoryDndRef:f,triggerStyleRef:p}=t,v=R(()=>a.value==="image-card");function h(){n.value||l.value||d()}function m(B){B.preventDefault(),s.value=!0}function b(B){B.preventDefault(),s.value=!0}function x(B){B.preventDefault(),s.value=!1}function S(B){var T;if(B.preventDefault(),!c.value||n.value||l.value){s.value=!1;return}const z=(T=B.dataTransfer)===null||T===void 0?void 0:T.items;z!=null&&z.length?F0(Array.from(z).map(I=>I.webkitGetAsEntry()),f.value).then(I=>{u(I)}).finally(()=>{s.value=!1}):s.value=!1}return()=>{var B;const{value:T}=r;return e.abstract?(B=o.default)===null||B===void 0?void 0:B.call(o,{handleClick:h,handleDrop:S,handleDragOver:m,handleDragEnter:b,handleDragLeave:x}):i("div",{class:[`${T}-upload-trigger`,(n.value||l.value)&&`${T}-upload-trigger--disabled`,v.value&&`${T}-upload-trigger--image-card`],style:p.value,onClick:h,onDrop:S,onDragover:m,onDragenter:b,onDragleave:x},v.value?i(P0,null,{default:()=>lo(o.default,()=>[i(De,{clsPrefix:T},{default:()=>i(tr,null)})])}):o)}}}),_0=q({name:"UploadProgress",props:{show:Boolean,percentage:{type:Number,required:!0},status:{type:String,required:!0}},setup(){return{mergedTheme:Se(Ut).mergedThemeRef}},render(){return i(wt,null,{default:()=>this.show?i(Qb,{type:"line",showIndicator:!1,percentage:this.percentage,status:this.status,height:2,theme:this.mergedTheme.peers.Progress,themeOverrides:this.mergedTheme.peerOverrides.Progress}):null})}}),D0=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"},i("g",{fill:"none"},i("path",{d:"M21.75 3A3.25 3.25 0 0 1 25 6.25v15.5A3.25 3.25 0 0 1 21.75 25H6.25A3.25 3.25 0 0 1 3 21.75V6.25A3.25 3.25 0 0 1 6.25 3h15.5zm.583 20.4l-7.807-7.68a.75.75 0 0 0-.968-.07l-.084.07l-7.808 7.68c.183.065.38.1.584.1h15.5c.204 0 .4-.035.583-.1l-7.807-7.68l7.807 7.68zM21.75 4.5H6.25A1.75 1.75 0 0 0 4.5 6.25v15.5c0 .208.036.408.103.593l7.82-7.692a2.25 2.25 0 0 1 3.026-.117l.129.117l7.82 7.692c.066-.185.102-.385.102-.593V6.25a1.75 1.75 0 0 0-1.75-1.75zm-3.25 3a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5zm0 1.5a1 1 0 1 0 0 2a1 1 0 0 0 0-2z",fill:"currentColor"}))),L0=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"},i("g",{fill:"none"},i("path",{d:"M6.4 2A2.4 2.4 0 0 0 4 4.4v19.2A2.4 2.4 0 0 0 6.4 26h15.2a2.4 2.4 0 0 0 2.4-2.4V11.578c0-.729-.29-1.428-.805-1.944l-6.931-6.931A2.4 2.4 0 0 0 14.567 2H6.4zm-.9 2.4a.9.9 0 0 1 .9-.9H14V10a2 2 0 0 0 2 2h6.5v11.6a.9.9 0 0 1-.9.9H6.4a.9.9 0 0 1-.9-.9V4.4zm16.44 6.1H16a.5.5 0 0 1-.5-.5V4.06l6.44 6.44z",fill:"currentColor"})));var H0=globalThis&&globalThis.__awaiter||function(e,o,t,r){function n(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function d(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?l(u.value):n(u.value).then(s,d)}c((r=r.apply(e,o||[])).next())})};const wr={paddingMedium:"0 3px",heightMedium:"24px",iconSizeMedium:"18px"},A0=q({name:"UploadFile",props:{clsPrefix:{type:String,required:!0},file:{type:Object,required:!0},listType:{type:String,required:!0}},setup(e){const o=Se(Ut),t=D(null),r=D(""),n=R(()=>{const{file:z}=e;return z.status==="finished"?"success":z.status==="error"?"error":"info"}),l=R(()=>{const{file:z}=e;if(z.status==="error")return"error"}),a=R(()=>{const{file:z}=e;return z.status==="uploading"}),s=R(()=>{if(!o.showCancelButtonRef.value)return!1;const{file:z}=e;return["uploading","pending","error"].includes(z.status)}),d=R(()=>{if(!o.showRemoveButtonRef.value)return!1;const{file:z}=e;return["finished"].includes(z.status)}),c=R(()=>{if(!o.showDownloadButtonRef.value)return!1;const{file:z}=e;return["finished"].includes(z.status)}),u=R(()=>{if(!o.showRetryButtonRef.value)return!1;const{file:z}=e;return["error"].includes(z.status)}),f=We(()=>r.value||e.file.thumbnailUrl||e.file.url),p=R(()=>{if(!o.showPreviewButtonRef.value)return!1;const{file:{status:z},listType:I}=e;return["finished"].includes(z)&&f.value&&I==="image-card"});function v(){o.submit(e.file.id)}function h(z){z.preventDefault();const{file:I}=e;["finished","pending","error"].includes(I.status)?b(I):["uploading"].includes(I.status)?S(I):qo("upload","The button clicked type is unknown.")}function m(z){z.preventDefault(),x(e.file)}function b(z){const{xhrMap:I,doChange:w,onRemoveRef:{value:O},mergedFileListRef:{value:k}}=o;Promise.resolve(O?O({file:Object.assign({},z),fileList:k}):!0).then($=>{if($===!1)return;const L=Object.assign({},z,{status:"removed"});I.delete(z.id),w(L,void 0,{remove:!0})})}function x(z){const{onDownloadRef:{value:I}}=o;Promise.resolve(I?I(Object.assign({},z)):!0).then(w=>{w!==!1&&M0(z.url,z.name)})}function S(z){const{xhrMap:I}=o,w=I.get(z.id);w==null||w.abort(),b(Object.assign({},z))}function B(){const{onPreviewRef:{value:z}}=o;if(z)z(e.file);else if(e.listType==="image-card"){const{value:I}=t;if(!I)return;I.click()}}const T=()=>H0(this,void 0,void 0,function*(){const{listType:z}=e;z!=="image"&&z!=="image-card"||o.shouldUseThumbnailUrlRef.value(e.file)&&(r.value=yield o.getFileThumbnailUrlResolver(e.file))});return oo(()=>{T()}),{mergedTheme:o.mergedThemeRef,progressStatus:n,buttonType:l,showProgress:a,disabled:o.mergedDisabledRef,showCancelButton:s,showRemoveButton:d,showDownloadButton:c,showRetryButton:u,showPreviewButton:p,mergedThumbnailUrl:f,shouldUseThumbnailUrl:o.shouldUseThumbnailUrlRef,renderIcon:o.renderIconRef,imageRef:t,handleRemoveOrCancelClick:h,handleDownloadClick:m,handleRetryClick:v,handlePreviewClick:B}},render(){const{clsPrefix:e,mergedTheme:o,listType:t,file:r,renderIcon:n}=this;let l;const a=t==="image";a||t==="image-card"?l=!this.shouldUseThumbnailUrl(r)||!this.mergedThumbnailUrl?i("span",{class:`${e}-upload-file-info__thumbnail`},n?n(r):ps(r)?i(De,{clsPrefix:e},{default:()=>D0}):i(De,{clsPrefix:e},{default:()=>L0})):i("a",{rel:"noopener noreferer",target:"_blank",href:r.url||void 0,class:`${e}-upload-file-info__thumbnail`,onClick:this.handlePreviewClick},t==="image-card"?i(fb,{src:this.mergedThumbnailUrl||void 0,previewSrc:r.url||void 0,alt:r.name,ref:"imageRef"}):i("img",{src:this.mergedThumbnailUrl||void 0,alt:r.name})):l=i("span",{class:`${e}-upload-file-info__thumbnail`},n?n(r):i(De,{clsPrefix:e},{default:()=>i(jd,null)}));const d=i(_0,{show:this.showProgress,percentage:r.percentage||0,status:this.progressStatus}),c=t==="text"||t==="image";return i("div",{class:[`${e}-upload-file`,`${e}-upload-file--${this.progressStatus}-status`,r.url&&r.status!=="error"&&t!=="image-card"&&`${e}-upload-file--with-url`,`${e}-upload-file--${t}-type`]},i("div",{class:`${e}-upload-file-info`},l,i("div",{class:`${e}-upload-file-info__name`},c&&(r.url&&r.status!=="error"?i("a",{rel:"noopener noreferer",target:"_blank",href:r.url||void 0,onClick:this.handlePreviewClick},r.name):i("span",{onClick:this.handlePreviewClick},r.name)),a&&d),i("div",{class:[`${e}-upload-file-info__action`,`${e}-upload-file-info__action--${t}-type`]},this.showPreviewButton?i(Po,{key:"preview",quaternary:!0,type:this.buttonType,onClick:this.handlePreviewClick,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,builtinThemeOverrides:wr},{icon:()=>i(De,{clsPrefix:e},{default:()=>i(dl,null)})}):null,(this.showRemoveButton||this.showCancelButton)&&!this.disabled&&i(Po,{key:"cancelOrTrash",theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,quaternary:!0,builtinThemeOverrides:wr,type:this.buttonType,onClick:this.handleRemoveOrCancelClick},{icon:()=>i(At,null,{default:()=>this.showRemoveButton?i(De,{clsPrefix:e,key:"trash"},{default:()=>i(Kd,null)}):i(De,{clsPrefix:e,key:"cancel"},{default:()=>i(Yd,null)})})}),this.showRetryButton&&!this.disabled&&i(Po,{key:"retry",quaternary:!0,type:this.buttonType,onClick:this.handleRetryClick,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,builtinThemeOverrides:wr},{icon:()=>i(De,{clsPrefix:e},{default:()=>i(Jd,null)})}),this.showDownloadButton?i(Po,{key:"download",quaternary:!0,type:this.buttonType,onClick:this.handleDownloadClick,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,builtinThemeOverrides:wr},{icon:()=>i(De,{clsPrefix:e},{default:()=>i(Gd,null)})}):null)),!a&&d)}}),E0=q({name:"UploadFileList",setup(e,{slots:o}){const t=Se(Ut,null);t||Eo("upload-file-list","`n-upload-file-list` must be placed inside `n-upload`.");const{abstractRef:r,mergedClsPrefixRef:n,listTypeRef:l,mergedFileListRef:a,fileListStyleRef:s,cssVarsRef:d,themeClassRef:c,maxReachedRef:u,showTriggerRef:f,imageGroupPropsRef:p}=t,v=R(()=>l.value==="image-card"),h=()=>a.value.map(b=>i(A0,{clsPrefix:n.value,key:b.id,file:b,listType:l.value})),m=()=>v.value?i(cb,Object.assign({},p.value),{default:h}):i(wt,{group:!0},{default:h});return()=>{const{value:b}=n,{value:x}=r;return i("div",{class:[`${b}-upload-file-list`,v.value&&`${b}-upload-file-list--grid`,x?c==null?void 0:c.value:void 0],style:[x&&d?d.value:"",s.value]},m(),f.value&&!u.value&&v.value&&i(vs,null,o))}}}),j0=C([g("upload","width: 100%;",[P("dragger-inside",[g("upload-trigger",` + display: block; + `)]),P("drag-over",[g("upload-dragger",` + border: var(--n-dragger-border-hover); + `)])]),g("upload-dragger",` + cursor: pointer; + box-sizing: border-box; + width: 100%; + text-align: center; + border-radius: var(--n-border-radius); + padding: 24px; + opacity: 1; + transition: + opacity .3s var(--n-bezier), + border-color .3s var(--n-bezier), + background-color .3s var(--n-bezier); + background-color: var(--n-dragger-color); + border: var(--n-dragger-border); + `,[C("&:hover",` + border: var(--n-dragger-border-hover); + `),P("disabled",` + cursor: not-allowed; + `)]),g("upload-trigger",` + display: inline-block; + box-sizing: border-box; + opacity: 1; + transition: opacity .3s var(--n-bezier); + `,[C("+",[g("upload-file-list","margin-top: 8px;")]),P("disabled",` + opacity: var(--n-item-disabled-opacity); + cursor: not-allowed; + `),P("image-card",` + width: 96px; + height: 96px; + `,[g("base-icon",` + font-size: 24px; + `),g("upload-dragger",` + padding: 0; + height: 100%; + width: 100%; + display: flex; + align-items: center; + justify-content: center; + `)])]),g("upload-file-list",` + line-height: var(--n-line-height); + opacity: 1; + transition: opacity .3s var(--n-bezier); + `,[C("a, img","outline: none;"),P("disabled",` + opacity: var(--n-item-disabled-opacity); + cursor: not-allowed; + `,[g("upload-file","cursor: not-allowed;")]),P("grid",` + display: grid; + grid-template-columns: repeat(auto-fill, 96px); + grid-gap: 8px; + margin-top: 0; + `),g("upload-file",` + display: block; + box-sizing: border-box; + cursor: default; + padding: 0px 12px 0 6px; + transition: background-color .3s var(--n-bezier); + border-radius: var(--n-border-radius); + `,[rr(),g("progress",[rr({foldPadding:!0})]),C("&:hover",` + background-color: var(--n-item-color-hover); + `,[g("upload-file-info",[y("action",` + opacity: 1; + `)])]),P("image-type",` + border-radius: var(--n-border-radius); + text-decoration: underline; + text-decoration-color: #0000; + `,[g("upload-file-info",` + padding-top: 0px; + padding-bottom: 0px; + width: 100%; + height: 100%; + display: flex; + justify-content: space-between; + align-items: center; + padding: 6px 0; + `,[g("progress",` + padding: 2px 0; + margin-bottom: 0; + `),y("name",` + padding: 0 8px; + `),y("thumbnail",` + width: 32px; + height: 32px; + font-size: 28px; + display: flex; + justify-content: center; + align-items: center; + `,[C("img",` + width: 100%; + `)])])]),P("text-type",[g("progress",` + box-sizing: border-box; + padding-bottom: 6px; + margin-bottom: 6px; + `)]),P("image-card-type",` + position: relative; + width: 96px; + height: 96px; + border: var(--n-item-border-image-card); + border-radius: var(--n-border-radius); + padding: 0; + display: flex; + align-items: center; + justify-content: center; + transition: border-color .3s var(--n-bezier), background-color .3s var(--n-bezier); + border-radius: var(--n-border-radius); + overflow: hidden; + `,[g("progress",` + position: absolute; + left: 8px; + bottom: 8px; + right: 8px; + width: unset; + `),g("upload-file-info",` + padding: 0; + width: 100%; + height: 100%; + `,[y("thumbnail",` + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: 36px; + `,[C("img",` + width: 100%; + `)])]),C("&::before",` + position: absolute; + z-index: 1; + left: 0; + right: 0; + top: 0; + bottom: 0; + border-radius: inherit; + opacity: 0; + transition: opacity .2s var(--n-bezier); + content: ""; + `),C("&:hover",[C("&::before","opacity: 1;"),g("upload-file-info",[y("thumbnail","opacity: .12;")])])]),P("error-status",[C("&:hover",` + background-color: var(--n-item-color-hover-error); + `),g("upload-file-info",[y("name","color: var(--n-item-text-color-error);"),y("thumbnail","color: var(--n-item-text-color-error);")]),P("image-card-type",` + border: var(--n-item-border-image-card-error); + `)]),P("with-url",` + cursor: pointer; + `,[g("upload-file-info",[y("name",` + color: var(--n-item-text-color-success); + text-decoration-color: var(--n-item-text-color-success); + `,[C("a",` + text-decoration: underline; + `)])])]),g("upload-file-info",` + position: relative; + padding-top: 6px; + padding-bottom: 6px; + display: flex; + flex-wrap: nowrap; + `,[y("thumbnail",` + font-size: 18px; + opacity: 1; + transition: opacity .2s var(--n-bezier); + color: var(--n-item-icon-color); + `,[g("base-icon",` + margin-right: 2px; + vertical-align: middle; + transition: color .3s var(--n-bezier); + `)]),y("action",` + padding-top: inherit; + padding-bottom: inherit; + position: absolute; + right: 0; + top: 0; + bottom: 0; + width: 80px; + display: flex; + align-items: center; + transition: opacity .2s var(--n-bezier); + justify-content: flex-end; + opacity: 0; + `,[g("button",[C("&:not(:last-child)",{marginRight:"4px"}),g("base-icon",[C("svg",[lt()])])]),P("image-type",` + position: relative; + max-width: 80px; + width: auto; + `),P("image-card-type",` + z-index: 2; + position: absolute; + width: 100%; + height: 100%; + left: 0; + right: 0; + bottom: 0; + top: 0; + display: flex; + justify-content: center; + align-items: center; + `)]),y("name",` + color: var(--n-item-text-color); + flex: 1; + display: flex; + justify-content: center; + text-overflow: ellipsis; + overflow: hidden; + flex-direction: column; + text-decoration-color: #0000; + font-size: var(--n-font-size); + transition: + color .3s var(--n-bezier), + text-decoration-color .3s var(--n-bezier); + `,[C("a",` + color: inherit; + text-decoration: underline; + `)])])])]),g("upload-file-input",` + display: block; + width: 0; + height: 0; + opacity: 0; + `)]);var Hi=globalThis&&globalThis.__awaiter||function(e,o,t,r){function n(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function d(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?l(u.value):n(u.value).then(s,d)}c((r=r.apply(e,o||[])).next())})};function W0(e,o,t){const{doChange:r,xhrMap:n}=e;let l=0;function a(d){var c;let u=Object.assign({},o,{status:"error",percentage:l});n.delete(o.id),u=nr(((c=e.onError)===null||c===void 0?void 0:c.call(e,{file:u,event:d}))||u),r(u,d)}function s(d){var c;if(e.isErrorState){if(e.isErrorState(t)){a(d);return}}else if(t.status<200||t.status>=300){a(d);return}let u=Object.assign({},o,{status:"finished",percentage:l});n.delete(o.id),u=nr(((c=e.onFinish)===null||c===void 0?void 0:c.call(e,{file:u,event:d}))||u),r(u,d)}return{handleXHRLoad:s,handleXHRError:a,handleXHRAbort(d){const c=Object.assign({},o,{status:"removed",file:null,percentage:l});n.delete(o.id),r(c,d)},handleXHRProgress(d){const c=Object.assign({},o,{status:"uploading"});if(d.lengthComputable){const u=Math.ceil(d.loaded/d.total*100);c.percentage=u,l=u}r(c,d)}}}function N0(e){const{inst:o,file:t,data:r,headers:n,withCredentials:l,action:a,customRequest:s}=e,{doChange:d}=e.inst;let c=0;s({file:t,data:r,headers:n,withCredentials:l,action:a,onProgress(u){const f=Object.assign({},t,{status:"uploading"}),p=u.percent;f.percentage=p,c=p,d(f)},onFinish(){var u;let f=Object.assign({},t,{status:"finished",percentage:c});f=nr(((u=o.onFinish)===null||u===void 0?void 0:u.call(o,{file:f}))||f),d(f)},onError(){var u;let f=Object.assign({},t,{status:"error",percentage:c});f=nr(((u=o.onError)===null||u===void 0?void 0:u.call(o,{file:f}))||f),d(f)}})}function V0(e,o,t){const r=W0(e,o,t);t.onabort=r.handleXHRAbort,t.onerror=r.handleXHRError,t.onload=r.handleXHRLoad,t.upload&&(t.upload.onprogress=r.handleXHRProgress)}function gs(e,o){return typeof e=="function"?e({file:o}):e||{}}function U0(e,o,t){const r=gs(o,t);r&&Object.keys(r).forEach(n=>{e.setRequestHeader(n,r[n])})}function K0(e,o,t){const r=gs(o,t);r&&Object.keys(r).forEach(n=>{e.append(n,r[n])})}function G0(e,o,t,{method:r,action:n,withCredentials:l,responseType:a,headers:s,data:d}){const c=new XMLHttpRequest;c.responseType=a,e.xhrMap.set(t.id,c),c.withCredentials=l;const u=new FormData;if(K0(u,d,t),u.append(o,t.file),V0(e,t,c),n!==void 0){c.open(r.toUpperCase(),n),U0(c,s,t),c.send(u);const f=Object.assign({},t,{status:"uploading"});e.doChange(f)}}const q0=Object.assign(Object.assign({},ne.props),{name:{type:String,default:"file"},accept:String,action:String,customRequest:Function,directory:Boolean,directoryDnd:{type:Boolean,default:void 0},method:{type:String,default:"POST"},multiple:Boolean,showFileList:{type:Boolean,default:!0},data:[Object,Function],headers:[Object,Function],withCredentials:Boolean,responseType:{type:String,default:""},disabled:{type:Boolean,default:void 0},onChange:Function,onRemove:Function,onFinish:Function,onError:Function,onBeforeUpload:Function,isErrorState:Function,onDownload:Function,defaultUpload:{type:Boolean,default:!0},fileList:Array,"onUpdate:fileList":[Function,Array],onUpdateFileList:[Function,Array],fileListStyle:[String,Object],defaultFileList:{type:Array,default:()=>[]},showCancelButton:{type:Boolean,default:!0},showRemoveButton:{type:Boolean,default:!0},showDownloadButton:Boolean,showRetryButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},listType:{type:String,default:"text"},onPreview:Function,shouldUseThumbnailUrl:{type:Function,default:e=>I0?ps(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerStyle:[String,Object],renderIcon:Object}),J1=q({name:"Upload",props:q0,setup(e){e.abstract&&e.listType==="image-card"&&Eo("upload","when the list-type is image-card, abstract is not supported.");const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=ke(e),r=ne("Upload","-upload",j0,Zm,e,o),n=rt(e),l=R(()=>{const{max:k}=e;return k!==void 0?v.value.length>=k:!1}),a=D(e.defaultFileList),s=le(e,"fileList"),d=D(null),c={value:!1},u=D(!1),f=new Map,p=so(s,a),v=R(()=>p.value.map(nr));function h(){var k;(k=d.value)===null||k===void 0||k.click()}function m(k){const $=k.target;S($.files?Array.from($.files).map(L=>({file:L,entry:null,source:"input"})):null,k),$.value=""}function b(k){const{"onUpdate:fileList":$,onUpdateFileList:L}=e;$&&ae($,k),L&&ae(L,k),a.value=k}const x=R(()=>e.multiple||e.directory);function S(k,$){if(!k||k.length===0)return;const{onBeforeUpload:L}=e;k=x.value?k:[k[0]];const{max:M,accept:j}=e;k=k.filter(({file:U,source:_})=>_==="dnd"&&(j!=null&&j.trim())?O0(U.name,U.type,j):!0),M&&(k=k.slice(0,M-v.value.length));const E=it();Promise.all(k.map(({file:U,entry:_})=>Hi(this,void 0,void 0,function*(){var V;const te={id:it(),batchId:E,name:U.name,status:"pending",percentage:0,file:U,url:null,type:U.type,thumbnailUrl:null,fullPath:(V=_==null?void 0:_.fullPath)!==null&&V!==void 0?V:`/${U.webkitRelativePath||U.name}`};return!L||(yield L({file:te,fileList:v.value}))!==!1?te:null}))).then(U=>Hi(this,void 0,void 0,function*(){let _=Promise.resolve();U.forEach(V=>{_=_.then(io).then(()=>{V&&T(V,$,{append:!0})})}),yield _})).then(()=>{e.defaultUpload&&B()})}function B(k){const{method:$,action:L,withCredentials:M,headers:j,data:E,name:U}=e,_=k!==void 0?v.value.filter(te=>te.id===k):v.value,V=k!==void 0;_.forEach(te=>{const{status:N}=te;(N==="pending"||N==="error"&&V)&&(e.customRequest?N0({inst:{doChange:T,xhrMap:f,onFinish:e.onFinish,onError:e.onError},file:te,action:L,withCredentials:M,headers:j,data:E,customRequest:e.customRequest}):G0({doChange:T,xhrMap:f,onFinish:e.onFinish,onError:e.onError,isErrorState:e.isErrorState},U,te,{method:$,action:L,withCredentials:M,responseType:e.responseType,headers:j,data:E}))})}const T=(k,$,L={append:!1,remove:!1})=>{const{append:M,remove:j}=L,E=Array.from(v.value),U=E.findIndex(_=>_.id===k.id);if(M||j||~U){M?E.push(k):j?E.splice(U,1):E.splice(U,1,k);const{onChange:_}=e;_&&_({file:k,fileList:E,event:$}),b(E)}};function z(k){var $;if(k.thumbnailUrl)return k.thumbnailUrl;const{createThumbnailUrl:L}=e;return L?($=L(k.file,k))!==null&&$!==void 0?$:k.url||"":k.url?k.url:k.file?k0(k.file):""}const I=R(()=>{const{common:{cubicBezierEaseInOut:k},self:{draggerColor:$,draggerBorder:L,draggerBorderHover:M,itemColorHover:j,itemColorHoverError:E,itemTextColorError:U,itemTextColorSuccess:_,itemTextColor:V,itemIconColor:te,itemDisabledOpacity:N,lineHeight:G,borderRadius:Ce,fontSize:X,itemBorderImageCardError:ve,itemBorderImageCard:he}}=r.value;return{"--n-bezier":k,"--n-border-radius":Ce,"--n-dragger-border":L,"--n-dragger-border-hover":M,"--n-dragger-color":$,"--n-font-size":X,"--n-item-color-hover":j,"--n-item-color-hover-error":E,"--n-item-disabled-opacity":N,"--n-item-icon-color":te,"--n-item-text-color":V,"--n-item-text-color-error":U,"--n-item-text-color-success":_,"--n-line-height":G,"--n-item-border-image-card-error":ve,"--n-item-border-image-card":he}}),w=t?Ae("upload",void 0,I,e):void 0;Oe(Ut,{mergedClsPrefixRef:o,mergedThemeRef:r,showCancelButtonRef:le(e,"showCancelButton"),showDownloadButtonRef:le(e,"showDownloadButton"),showRemoveButtonRef:le(e,"showRemoveButton"),showRetryButtonRef:le(e,"showRetryButton"),onRemoveRef:le(e,"onRemove"),onDownloadRef:le(e,"onDownload"),mergedFileListRef:v,triggerStyleRef:le(e,"triggerStyle"),shouldUseThumbnailUrlRef:le(e,"shouldUseThumbnailUrl"),renderIconRef:le(e,"renderIcon"),xhrMap:f,submit:B,doChange:T,showPreviewButtonRef:le(e,"showPreviewButton"),onPreviewRef:le(e,"onPreview"),getFileThumbnailUrlResolver:z,listTypeRef:le(e,"listType"),dragOverRef:u,openOpenFileDialog:h,draggerInsideRef:c,handleFileAddition:S,mergedDisabledRef:n.mergedDisabledRef,maxReachedRef:l,fileListStyleRef:le(e,"fileListStyle"),abstractRef:le(e,"abstract"),acceptRef:le(e,"accept"),cssVarsRef:t?void 0:I,themeClassRef:w==null?void 0:w.themeClass,onRender:w==null?void 0:w.onRender,showTriggerRef:le(e,"showTrigger"),imageGroupPropsRef:le(e,"imageGroupProps"),mergedDirectoryDndRef:R(()=>{var k;return(k=e.directoryDnd)!==null&&k!==void 0?k:e.directory})});const O={clear:()=>{a.value=[]},submit:B,openOpenFileDialog:h};return Object.assign({mergedClsPrefix:o,draggerInsideRef:c,inputElRef:d,mergedTheme:r,dragOver:u,mergedMultiple:x,cssVars:t?void 0:I,themeClass:w==null?void 0:w.themeClass,onRender:w==null?void 0:w.onRender,handleFileInputChange:m},O)},render(){var e,o;const{draggerInsideRef:t,mergedClsPrefix:r,$slots:n,directory:l,onRender:a}=this;if(n.default&&!this.abstract){const d=n.default()[0];!((e=d==null?void 0:d.type)===null||e===void 0)&&e[us]&&(t.value=!0)}const s=i("input",Object.assign({},this.inputProps,{ref:"inputElRef",type:"file",class:`${r}-upload-file-input`,accept:this.accept,multiple:this.mergedMultiple,onChange:this.handleFileInputChange,webkitdirectory:l||void 0,directory:l||void 0}));return this.abstract?i(ao,null,(o=n.default)===null||o===void 0?void 0:o.call(n),i(Ni,{to:"body"},s)):(a==null||a(),i("div",{class:[`${r}-upload`,t.value&&`${r}-upload--dragger-inside`,this.dragOver&&`${r}-upload--drag-over`,this.themeClass],style:this.cssVars},s,this.showTrigger&&this.listType!=="image-card"&&i(vs,null,n),this.showFileList&&i(E0,null,n)))}}),Y0=()=>({}),X0={name:"Equation",common:fe,self:Y0},Z0=X0,ex={name:"dark",common:fe,Alert:lu,Anchor:mu,AutoComplete:Ou,Avatar:Ll,AvatarGroup:Nu,BackTop:Ku,Badge:qu,Breadcrumb:rf,Button:$o,ButtonGroup:pg,Calendar:gf,Card:Vl,Carousel:If,Cascader:_f,Checkbox:Nt,Code:Ul,Collapse:Af,CollapseTransition:Wf,ColorPicker:xf,DataTable:Ph,DatePicker:lp,Descriptions:cp,Dialog:va,Divider:Fp,Drawer:Hp,Dropdown:Rn,DynamicInput:tv,DynamicTags:mv,Element:xv,Empty:zt,Ellipsis:ea,Equation:Z0,Form:Sv,GradientText:Uv,Icon:Eh,IconWrapper:og,Image:nb,Input:Ho,InputNumber:gg,LegacyTransfer:Cb,Layout:yg,List:$g,LoadingBar:Pg,Log:Ig,Menu:Ag,Mention:Tg,Message:fg,Modal:Cp,Notification:ag,PageHeader:Wg,Pagination:Ql,Popconfirm:Gg,Popover:$t,Popselect:Kl,Progress:Ea,Radio:ta,Rate:Zg,Result:tm,Row:rb,Scrollbar:zo,Select:Xl,Skeleton:l0,Slider:im,Space:$a,Spin:dm,Statistic:hm,Steps:mm,Switch:xm,Table:Rm,Tabs:Tm,Tag:Sl,Thing:_m,TimePicker:fa,Timeline:Hm,Tooltip:Dr,Transfer:jm,Tree:Ga,TreeSelect:Um,Typography:Ym,Upload:Jm,Watermark:ob};export{Ov as $,_1 as A,J1 as B,C1 as C,y1 as D,P1 as E,D1 as F,b1 as G,L1 as H,Sc as I,W1 as J,x1 as K,h1 as L,X1 as M,Z1 as N,qr as O,Jh as P,z1 as Q,O1 as R,f1 as S,S1 as T,V1 as U,B1 as V,M1 as W,cb as X,m1 as Y,K1 as Z,Q1 as _,k1 as a,Ev as a0,Hv as a1,N1 as a2,R1 as a3,$1 as a4,G1 as a5,xt as b,T1 as c,I1 as d,Po as e,q1 as f,Y1 as g,Rf as h,$p as i,Nh as j,U1 as k,v1 as l,fb as m,H1 as n,p1 as o,g1 as p,ex as q,w1 as r,E1 as s,F1 as t,j1 as u,A1 as v,vs as w,Qb as x,Pn as y,E0 as z}; diff --git a/web/dist/assets/paopao-video-player-aa5e8b3f.js b/web/dist/assets/paopao-video-player-aa5e8b3f.js new file mode 100644 index 00000000..de7528ef --- /dev/null +++ b/web/dist/assets/paopao-video-player-aa5e8b3f.js @@ -0,0 +1,836 @@ +import{d as h,o as s,c as l,a as t,L as p,M as m,z as d,v as y,J as u,N as f,O as c,P as g,Q as P,R as B}from"./@vue-e0e89260.js";var T="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg t='1687171769163' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='3910' xmlns:xlink='http://www.w3.org/1999/xlink' width='500' height='500'%3e%3cpath d='M327.68 184.32a81.92 81.92 0 0 1 81.92 81.92v491.52a81.92 81.92 0 1 1-163.84 0V266.24a81.92 81.92 0 0 1 81.92-81.92z m368.64 0a81.92 81.92 0 0 1 81.92 81.92v491.52a81.92 81.92 0 1 1-163.84 0V266.24a81.92 81.92 0 0 1 81.92-81.92z' p-id='3911' fill='white'%3e%3c/path%3e%3c/svg%3e",w=T,V="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg t='1687171715945' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='2813' width='500' height='500' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath d='M817.088 484.96l-512-323.744C295.232 154.976 282.752 154.592 272.576 160.224 262.336 165.856 256 176.608 256 188.256l0 647.328c0 11.648 6.336 22.4 16.576 28.032 4.8 2.656 10.112 3.968 15.424 3.968 5.952 0 11.904-1.664 17.088-4.928l512-323.616C826.368 533.184 832 522.976 832 512 832 501.024 826.368 490.816 817.088 484.96z' fill='white' p-id='2814'%3e%3c/path%3e%3c/svg%3e",b=V,M="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg t='1687172017162' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='7048' xmlns:xlink='http://www.w3.org/1999/xlink' width='500' height='500'%3e%3cpath d='M462.06 142.1L284.12 320H80c-26.52 0-48 21.48-48 48v288c0 26.5 21.48 48 48 48h204.12l177.94 177.9c30.06 30.06 81.94 8.94 81.94-33.94V176.04c0-42.92-51.92-63.96-81.94-33.94zM992 512c0-127.06-64.12-243.88-171.54-312.48-22.38-14.28-52.06-7.64-66.24 14.92s-7.56 52.42 14.82 66.72C848.54 331.94 896 418.22 896 512s-47.46 180.06-126.96 230.84c-22.38 14.28-29 44.14-14.82 66.72 13.02 20.72 42.24 30.28 66.24 14.92C927.88 755.88 992 639.06 992 512z m-283.54-153.74c-23.16-12.66-52.38-4.32-65.22 18.9-12.78 23.22-4.32 52.4 18.9 65.22C687.96 456.56 704 483.26 704 512c0 28.76-16.04 55.44-41.84 69.62-23.22 12.82-31.68 42-18.9 65.22 12.86 23.32 42.1 31.6 65.22 18.9 56.46-31.1 91.54-90 91.54-153.76s-35.08-122.64-91.56-153.72z' p-id='7049' fill='white'%3e%3c/path%3e%3c/svg%3e",k=M,j="data:image/svg+xml,%3c%3fxml version='1.0' standalone='no'%3f%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg t='1687171887277' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5997' xmlns:xlink='http://www.w3.org/1999/xlink' width='500' height='500'%3e%3cpath d='M810.666667 938.666667h-128c-25.6 0-42.666667-17.066667-42.666667-42.666667s17.066667-42.666667 42.666667-42.666667h128c25.6 0 42.666667-17.066667 42.666666-42.666666v-128c0-25.6 17.066667-42.666667 42.666667-42.666667s42.666667 17.066667 42.666667 42.666667v128c0 72.533333-55.466667 128-128 128zM341.333333 938.666667H213.333333c-72.533333 0-128-55.466667-128-128v-128c0-25.6 17.066667-42.666667 42.666667-42.666667s42.666667 17.066667 42.666667 42.666667v128c0 25.6 17.066667 42.666667 42.666666 42.666666h128c25.6 0 42.666667 17.066667 42.666667 42.666667s-17.066667 42.666667-42.666667 42.666667zM896 384c-25.6 0-42.666667-17.066667-42.666667-42.666667V213.333333c0-25.6-17.066667-42.666667-42.666666-42.666666h-128c-25.6 0-42.666667-17.066667-42.666667-42.666667s17.066667-42.666667 42.666667-42.666667h128c72.533333 0 128 55.466667 128 128v128c0 25.6-17.066667 42.666667-42.666667 42.666667zM128 384c-25.6 0-42.666667-17.066667-42.666667-42.666667V213.333333c0-72.533333 55.466667-128 128-128h128c25.6 0 42.666667 17.066667 42.666667 42.666667s-17.066667 42.666667-42.666667 42.666667H213.333333c-25.6 0-42.666667 17.066667-42.666666 42.666666v128c0 25.6-17.066667 42.666667-42.666667 42.666667z' p-id='5998' fill='white'%3e%3c/path%3e%3c/svg%3e",$=j,C=h({name:"BasicTheme",props:{uuid:{type:String,required:!0},src:{type:String,required:!0},autoplay:{type:Boolean,required:!0},loop:{type:Boolean,required:!0},controls:{type:Boolean,required:!0},hoverable:{type:Boolean,required:!0},mask:{type:Boolean,required:!0},colors:{type:[String,Array],required:!0},time:{type:Object,required:!0},playing:{type:Boolean,default:!1},duration:{type:[String,Number],required:!0}},data(){return{hovered:!1,volume:!1,amount:1,Pause:w,Play:b,Volume:k,Maximize:$}},computed:{colorFrom(){var e;return typeof this.colors=="string"?this.colors?this.colors:"#fbbf24":(e=this.colors)!=null&&e[0]?this.colors[0]:"#fbbf24"},colorTo(){var e;return typeof this.colors=="string"?this.colors?this.colors:"#fbbf24":(e=this.colors)!=null&&e[1]?this.colors[1]:"#ec4899"}},mounted(){this.$emit("setPlayer",this.$refs[this.uuid])},methods:{setVolume(){this.$refs[this.uuid].volume=this.amount},stopVolume(){return this.amount>0?this.amount=0:this.amount=1}}});const I={class:"relative"},D=["loop","autoplay","muted"],F=["src"],q={class:"flex items-center justify-start w-full"},E={class:"font-sans text-white text-xs w-24"},N={class:"mr-3 ml-2"},R=["src"],A=["src"],U={class:"relative"},G={class:"px-3 py-2 rounded-lg flex items-center transform translate-x-2",style:{"background-color":"rgba(0, 0, 0, .8)"}},O=["src"],L=["src"],Y=["src"];function H(e,n,a,r,i,v){return s(),l("div",{class:"shadow-xl rounded-xl overflow-hidden relative",onMouseenter:n[14]||(n[14]=o=>e.hovered=!0),onMouseleave:n[15]||(n[15]=o=>e.hovered=!1),onKeydown:n[16]||(n[16]=g(o=>e.$emit("play"),["left"]))},[t("div",I,[t("video",{ref:e.uuid,class:"w-full",loop:e.loop,autoplay:e.autoplay,muted:e.autoplay,onTimeupdate:n[0]||(n[0]=o=>e.$emit("timeupdate",o.target)),onPause:n[1]||(n[1]=o=>e.$emit("isPlaying",!1)),onPlay:n[2]||(n[2]=o=>e.$emit("isPlaying",!0)),onClick:n[3]||(n[3]=o=>e.$emit("play"))},[t("source",{src:e.src,type:"video/mp4"},null,8,F)],40,D),e.controls?(s(),l("div",{key:0,class:p([{"opacity-0 translate-y-full":!e.hoverable&&e.hovered,"opacity-0 translate-y-full":e.hoverable&&!e.hovered},"transition duration-300 transform absolute w-full bottom-0 left-0 flex items-center justify-between overlay px-5 pt-3 pb-5"])},[t("div",q,[t("p",E,m(e.time.display)+"/"+m(e.duration),1),t("div",N,[d(t("img",{src:e.Pause,alt:"Icon pause video",class:"w-5 cursor-pointer",onClick:n[4]||(n[4]=o=>e.$emit("play"))},null,8,R),[[y,e.playing]]),d(t("img",{src:e.Play,alt:"Icon play video",class:"w-5 cursor-pointer",onClick:n[5]||(n[5]=o=>e.$emit("play"))},null,8,A),[[y,!e.playing]])]),t("div",{class:"w-full h-1 bg-white bg-opacity-60 rounded-sm cursor-pointer",onClick:n[6]||(n[6]=o=>e.$emit("position",o))},[t("div",{class:"relative h-full pointer-events-none",style:u(`width: ${e.time.progress}%; transition: width .2s ease-in-out;`)},[t("div",{class:"w-full rounded-sm h-full gradient-variable bg-gradient-to-r pointer-events-none absolute top-0 left-0",style:u(`--tw-gradient-from: ${e.colorFrom};--tw-gradient-to: ${e.colorTo};transition: width .2s ease-in-out`)},null,4),t("div",{class:"w-full rounded-sm filter blur-sm h-full gradient-variable bg-gradient-to-r pointer-events-none absolute top-0 left-0",style:u(`--tw-gradient-from: ${e.colorFrom};--tw-gradient-to: ${e.colorTo};transition: width .2s ease-in-out`)},null,4)],4)])]),t("div",{class:"ml-5 flex items-center justify-end",onMouseleave:n[12]||(n[12]=o=>e.volume=!1)},[t("div",U,[t("div",{class:p(`w-128 origin-left translate-x-2 -rotate-90 w-128 transition duration-200 absolute transform top-0 py-2 ${e.volume?"-translate-y-4":"opacity-0 -translate-y-1 pointer-events-none"}`)},[t("div",G,[d(t("input",{"onUpdate:modelValue":n[7]||(n[7]=o=>e.amount=o),type:"range",step:"0.05",min:"0",max:"1",class:"rounded-lg overflow-hidden appearance-none bg-white bg-opacity-30 h-1 w-128 vertical-range",onInput:n[8]||(n[8]=function(){return e.setVolume&&e.setVolume(...arguments)})},null,544),[[f,e.amount]])])],2),t("img",{src:e.Volume,alt:"High volume video",class:"w-5 cursor-pointer relative",style:{"z-index":"2"},onClick:n[9]||(n[9]=function(){return e.stopVolume&&e.stopVolume(...arguments)}),onMouseenter:n[10]||(n[10]=o=>e.volume=!0)},null,40,O)]),t("img",{src:e.Maximize,alt:"Fullscreen",class:"w-3 ml-4 cursor-pointer",onClick:n[11]||(n[11]=o=>e.$emit("fullScreen"))},null,8,L)],32)],2)):c("",!0),!e.autoplay&&e.mask&&e.time.current===0?(s(),l("div",{key:1,class:p(`transition transform duration-300 absolute top-0 left-0 w-full h-full bg-black bg-opacity-50 backdrop-filter z-10 flex items-center justify-center ${e.playing?"opacity-0 pointer-events-none":""}`)},[t("div",{class:"w-20 h-20 rounded-full bg-white bg-opacity-20 transition duration-200 hover:bg-opacity-40 flex items-center justify-center cursor-pointer",onClick:n[13]||(n[13]=o=>e.$emit("play"))},[t("img",{src:e.Play,alt:"Icon play video",class:"transform translate-x-0.5 w-12"},null,8,Y)])],2)):c("",!0)])],32)}C.render=H;var S=h({name:"BasicTheme",props:{uuid:{type:String,required:!0},src:{type:String,required:!0},autoplay:{type:Boolean,required:!0},loop:{type:Boolean,required:!0},controls:{type:Boolean,required:!0},hoverable:{type:Boolean,required:!0},mask:{type:Boolean,required:!0},colors:{type:[String,Array],required:!0},time:{type:Object,required:!0},playing:{type:Boolean,default:!1},duration:{type:[String,Number],required:!0}},data(){return{hovered:!1,volume:!1,amount:1,Pause:w,Play:b,Volume:k,Maximize:$}},computed:{color(){var e;return typeof this.colors=="string"?this.colors?this.colors:"#8B5CF6":(e=this.colors)!=null&&e[0]?this.colors[0]:"#8B5CF6"}},mounted(){this.$emit("setPlayer",this.$refs[this.uuid])},methods:{setVolume(){this.$refs[this.uuid].volume=this.amount},stopVolume(){return this.amount>0?this.amount=0:this.amount=1}}});const W={class:"relative"},X=["loop","autoplay","muted"],K=["src"],J={class:"mr-5"},Q=["src"],Z=["src"],_={class:"relative mr-6"},ee={class:"px-3 py-3 rounded-xl flex items-center transform translate-x-9 bg-black bg-opacity-30"},ne=["src"],te=["src"],oe=["src"];function re(e,n,a,r,i,v){return s(),l("div",{class:"shadow-xl rounded-3xl overflow-hidden relative",onMouseenter:n[13]||(n[13]=o=>e.hovered=!0),onMouseleave:n[14]||(n[14]=o=>e.hovered=!1),onKeydown:n[15]||(n[15]=g(o=>e.$emit("play"),["left"]))},[t("div",W,[t("video",{ref:e.uuid,class:"w-full",loop:e.loop,autoplay:e.autoplay,muted:e.autoplay,onTimeupdate:n[0]||(n[0]=o=>e.$emit("timeupdate",o.target)),onPause:n[1]||(n[1]=o=>e.$emit("isPlaying",!1)),onPlay:n[2]||(n[2]=o=>e.$emit("isPlaying",!0)),onClick:n[3]||(n[3]=o=>e.$emit("play"))},[t("source",{src:e.src,type:"video/mp4"},null,8,K)],40,X),e.controls?(s(),l("div",{key:0,class:p([{"opacity-0 translate-y-full":!e.hoverable&&e.hovered,"opacity-0 translate-y-full":e.hoverable&&!e.hovered},"absolute px-5 pb-5 bottom-0 left-0 w-full transition duration-300 transform"])},[t("div",{class:"w-full bg-black bg-opacity-30 px-5 py-4 rounded-xl flex items-center justify-between",onMouseleave:n[11]||(n[11]=o=>e.volume=!1)},[t("div",{class:"font-sans py-1 px-2 text-white rounded-md text-xs mr-5 whitespace-nowrap font-medium w-32 text-center",style:u(`font-size: 11px; background-color: ${e.color}`)},m(e.time.display)+" / "+m(e.duration),5),t("div",J,[d(t("img",{src:e.Pause,alt:"Icon pause video",class:"w-4 cursor-pointer filter-white transition duration-300",onClick:n[4]||(n[4]=o=>e.$emit("play"))},null,8,Q),[[y,e.playing]]),d(t("img",{src:e.Play,alt:"Icon play video",class:"w-4 cursor-pointer filter-white transition duration-300",onClick:n[5]||(n[5]=o=>e.$emit("play"))},null,8,Z),[[y,!e.playing]])]),t("div",{class:"w-full h-1 bg-white bg-opacity-40 rounded-sm cursor-pointer mr-6",onClick:n[6]||(n[6]=o=>e.$emit("position",o))},[t("div",{class:"w-full rounded-sm h-full bg-white pointer-events-none",style:u(`width: ${e.time.progress}%; transition: width .2s ease-in-out;`)},null,4)]),t("div",_,[t("div",{class:p(`w-128 origin-left translate-x-2 -rotate-90 w-128 transition duration-200 absolute transform top-0 py-2 ${e.volume?"-translate-y-4":"opacity-0 -translate-y-1 pointer-events-none"}`)},[t("div",ee,[d(t("input",{"onUpdate:modelValue":n[7]||(n[7]=o=>e.amount=o),type:"range",step:"0.05",min:"0",max:"1",class:"rounded-lg overflow-hidden appearance-none bg-white bg-opacity-30 h-1.5 w-128 vertical-range"},null,512),[[f,e.amount]])])],2),t("img",{src:e.Volume,alt:"High volume video",class:"w-5 cursor-pointer filter-white transition duration-300 relative",style:{"z-index":"2"},onClick:n[8]||(n[8]=function(){return e.stopVolume&&e.stopVolume(...arguments)}),onMouseenter:n[9]||(n[9]=o=>e.volume=!0)},null,40,ne)]),t("img",{src:e.Maximize,alt:"Fullscreen",class:"w-4 cursor-pointer filter-white transition duration-300",onClick:n[10]||(n[10]=o=>e.$emit("fullScreen"))},null,8,te)],32)],2)):c("",!0),!e.autoplay&&e.mask&&e.time.current===0?(s(),l("div",{key:1,class:p(`transition transform duration-300 absolute top-0 left-0 w-full h-full bg-black bg-opacity-50 backdrop-filter z-10 flex items-center justify-center ${e.playing?"opacity-0 pointer-events-none":""}`)},[t("div",{class:"w-20 h-20 rounded-full bg-white bg-opacity-20 transition duration-200 hover:bg-opacity-40 flex items-center justify-center cursor-pointer",onClick:n[12]||(n[12]=o=>e.$emit("play"))},[t("img",{src:e.Play,alt:"Icon play video",class:"transform translate-x-0.5 w-12"},null,8,oe)])],2)):c("",!0)])],32)}S.render=re;var z=h({name:"PaoPaoVideoPlayer",components:{basic:S,gradient:C},props:{src:{type:String,required:!0},autoplay:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},controls:{type:Boolean,default:!0},mask:{type:Boolean,default:!0},colors:{type:[String,Array],default(){return["#8B5CF6","#ec4899"]}},hoverable:{type:Boolean,default:!1},theme:{type:String,default:"basic"}},data(){return{uuid:Math.random().toString(36).substr(2,18),player:null,duration:0,playing:!1,time:{progress:0,display:0,current:0}}},watch:{"time.current"(e){this.time.display=this.format(Number(e)),this.time.progress=e*100/this.player.duration}},methods:{isPlaying(e){this.playing=e},play(){return this.playing?this.player.pause():this.player.play()},setPlayer(e){this.player=e,this.player.addEventListener("loadeddata",()=>{this.player.readyState>=3&&(this.duration=this.format(Number(this.player.duration)),this.time.display=this.format(0))})},stop(){this.player.pause(),this.player.currentTime=0},fullScreen(){this.player.webkitEnterFullscreen()},position(e){this.player.pause();const n=e.target.getBoundingClientRect(),r=(e.clientX-n.left)*100/e.target.offsetWidth;this.player.currentTime=r*this.player.duration/100,this.player.play()},format(e){const n=Math.floor(e/3600),a=Math.floor(e%3600/60),r=Math.round(e%60);return[n,a>9?a:n?"0"+a:a||"00",r>9?r:"0"+r].filter(Boolean).join(":")}}});const ae={class:"paopao-video-player"};function ie(e,n,a,r,i,v){return s(),l("div",ae,[(s(),P(B(e.theme),{uuid:e.uuid,src:e.src,autoplay:e.autoplay,loop:e.loop,controls:e.controls,mask:e.mask,colors:e.colors,time:e.time,playing:e.playing,duration:e.duration,hoverable:e.hoverable,onPlay:e.play,onStop:e.stop,onTimeupdate:n[0]||(n[0]=o=>{let{currentTime:x}=o;return e.time.current=x}),onPosition:e.position,onFullScreen:e.fullScreen,onSetPlayer:e.setPlayer,onIsPlaying:e.isPlaying},null,40,["uuid","src","autoplay","loop","controls","mask","colors","time","playing","duration","hoverable","onPlay","onStop","onPosition","onFullScreen","onSetPlayer","onIsPlaying"]))])}function se(e,n){n===void 0&&(n={});var a=n.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",a==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var le=`/*! tailwindcss v2.2.17 | MIT License | https://tailwindcss.com */ + +/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */ + +/* +Document +======== +*/ + +/** +Use a better box model (opinionated). +*/ + +*, +::before, +::after { + box-sizing: border-box; +} + +/** +Use a more readable tab size (opinionated). +*/ + +/** +1. Correct the line height in all browsers. +2. Prevent adjustments of font size after orientation changes in iOS. +*/ + +/* +Sections +======== +*/ + +/** +Remove the margin in all browsers. +*/ + +/** +Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3) +*/ + +/* +Grouping content +================ +*/ + +/** +1. Add the correct height in Firefox. +2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) +*/ + +/* +Text-level semantics +==================== +*/ + +/** +Add the correct text decoration in Chrome, Edge, and Safari. +*/ + +/** +Add the correct font weight in Edge and Safari. +*/ + +/** +1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3) +2. Correct the odd 'em' font sizing in all browsers. +*/ + +/** +Add the correct font size in all browsers. +*/ + +/** +Prevent 'sub' and 'sup' elements from affecting the line height in all browsers. +*/ + +/* +Tabular data +============ +*/ + +/** +1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) +2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) +*/ + +/* +Forms +===== +*/ + +/** +1. Change the font styles in all browsers. +2. Remove the margin in Firefox and Safari. +*/ + + +input { + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ +} + +/** +Remove the inheritance of text transform in Edge and Firefox. +1. Remove the inheritance of text transform in Firefox. +*/ + +/** +Correct the inability to style clickable types in iOS and Safari. +*/ + + +[type='button'], +[type='reset'], +[type='submit'] { + -webkit-appearance: button; +} + +/** +Remove the inner border and padding in Firefox. +*/ + +::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** +Restore the focus styles unset by the previous rule. +*/ + +:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** +Remove the additional ':invalid' styles in Firefox. +See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737 +*/ + +:-moz-ui-invalid { + box-shadow: none; +} + +/** +Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers. +*/ + +/** +Add the correct vertical alignment in Chrome and Firefox. +*/ + +progress { + vertical-align: baseline; +} + +/** +Correct the cursor style of increment and decrement buttons in Safari. +*/ + +::-webkit-inner-spin-button, +::-webkit-outer-spin-button { + height: auto; +} + +/** +1. Correct the odd appearance in Chrome and Safari. +2. Correct the outline style in Safari. +*/ + +[type='search'] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/** +Remove the inner padding in Chrome and Safari on macOS. +*/ + +::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** +1. Correct the inability to style clickable types in iOS and Safari. +2. Change font properties to 'inherit' in Safari. +*/ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} + +/* +Interactive +=========== +*/ + +/* +Add the correct display in Chrome and Safari. +*/ + +/** + * Manually forked from SUIT CSS Base: https://github.com/suitcss/base + * A thin layer on top of normalize.css that provides a starting point more + * suitable for web applications. + */ + +/** + * Removes the default spacing and border for appropriate elements. + */ + + +p { + margin: 0; +} + +/** + * Tailwind custom reset styles + */ + +/** + * 1. Use the user's configured \`sans\` font-family (with Tailwind's default + * sans-serif font stack as a fallback) as a sane default. + * 2. Use Tailwind's default "normal" line-height so the user isn't forced + * to override it to ensure consistency even when using the default theme. + */ + +/** + * Inherit font-family and line-height from \`html\` so users can set them as + * a class directly on the \`html\` element. + */ + +/** + * 1. Prevent padding and border from affecting element width. + * + * We used to set this in the html element and inherit from + * the parent element for everything else. This caused issues + * in shadow-dom-enhanced elements like
where the content + * is wrapped by a div with box-sizing set to \`content-box\`. + * + * https://github.com/mozdevs/cssremedy/issues/4 + * + * + * 2. Allow adding a border to an element by just adding a border-width. + * + * By default, the way the browser specifies that an element should have no + * border is by setting it's border-style to \`none\` in the user-agent + * stylesheet. + * + * In order to easily add borders to elements by just setting the \`border-width\` + * property, we change the default border-style for all elements to \`solid\`, and + * use border-width to hide them instead. This way our \`border\` utilities only + * need to set the \`border-width\` property instead of the entire \`border\` + * shorthand, making our border utilities much more straightforward to compose. + * + * https://github.com/tailwindcss/tailwindcss/pull/116 + */ + +*, +::before, +::after { + box-sizing: border-box; /* 1 */ + border-width: 0; /* 2 */ + border-style: solid; /* 2 */ + border-color: currentColor; /* 2 */ +} + +/* + * Ensure horizontal rules are visible by default + */ + +/** + * Undo the \`border-style: none\` reset that Normalize applies to images so that + * our \`border-{width}\` utilities have the expected effect. + * + * The Normalize reset is unnecessary for us since we default the border-width + * to 0 on all elements. + * + * https://github.com/tailwindcss/tailwindcss/issues/362 + */ + +img { + border-style: solid; +} + +input:-ms-input-placeholder { + opacity: 1; + color: #9ca3af; +} + +input::placeholder { + opacity: 1; + color: #9ca3af; +} + + +[role="button"] { + cursor: pointer; +} + +/** + * Override legacy focus reset from Normalize with modern Firefox focus styles. + * + * This is actually an improvement over the new defaults in Firefox in our testing, + * as it triggers the better focus styles even for links, which still use a dotted + * outline in Firefox by default. + */ + +:-moz-focusring { + outline: auto; +} + +/** + * Reset links to optimize for opt-in styling instead of + * opt-out. + */ + +/** + * Reset form element properties that are easy to forget to + * style explicitly so you don't inadvertently introduce + * styles that deviate from your design system. These styles + * supplement a partial reset that is already applied by + * normalize.css. + */ + + +input { + padding: 0; + line-height: inherit; + color: inherit; +} + +/** + * Use the configured 'mono' font family for elements that + * are expected to be rendered with a monospace font, falling + * back to the system monospace stack if there is no configured + * 'mono' font family. + */ + +/** + * 1. Make replaced elements \`display: block\` by default as that's + * the behavior you want almost all of the time. Inspired by + * CSS Remedy, with \`svg\` added as well. + * + * https://github.com/mozdevs/cssremedy/issues/14 + * + * 2. Add \`vertical-align: middle\` to align replaced elements more + * sensibly by default when overriding \`display\` by adding a + * utility like \`inline\`. + * + * This can trigger a poorly considered linting error in some + * tools but is included by design. + * + * https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210 + */ + +img, +svg, +video { + display: block; /* 1 */ + vertical-align: middle; /* 2 */ +} + +/** + * Constrain images and videos to the parent width and preserve + * their intrinsic aspect ratio. + * + * https://github.com/mozdevs/cssremedy/issues/14 + */ + +img, +video { + max-width: 100%; + height: auto; +} + +/** + * Ensure the default browser behavior of the \`hidden\` attribute. + */ + +[hidden] { + display: none; +} + +*, ::before, ::after{ + --tw-border-opacity: 1; + border-color: rgba(229, 231, 235, var(--tw-border-opacity)); +} + +.paopao-video-player .pointer-events-none{ + pointer-events: none; +} + +.paopao-video-player .absolute{ + position: absolute; +} + +.paopao-video-player .relative{ + position: relative; +} + +.paopao-video-player .top-0{ + top: 0px; +} + +.paopao-video-player .bottom-0{ + bottom: 0px; +} + +.paopao-video-player .left-0{ + left: 0px; +} + +.paopao-video-player .z-10{ + z-index: 10; +} + +.paopao-video-player .mr-3{ + margin-right: 0.75rem; +} + +.paopao-video-player .mr-5{ + margin-right: 1.25rem; +} + +.paopao-video-player .mr-6{ + margin-right: 1.5rem; +} + +.paopao-video-player .ml-2{ + margin-left: 0.5rem; +} + +.paopao-video-player .ml-4{ + margin-left: 1rem; +} + +.paopao-video-player .ml-5{ + margin-left: 1.25rem; +} + +.paopao-video-player .flex{ + display: flex; +} + +.paopao-video-player .h-1{ + height: 0.25rem; +} + +.paopao-video-player .h-20{ + height: 5rem; +} + +.paopao-video-player .h-full{ + height: 100%; +} + +.paopao-video-player .w-3{ + width: 0.75rem; +} + +.paopao-video-player .w-4{ + width: 1rem; +} + +.paopao-video-player .w-5{ + width: 1.25rem; +} + +.paopao-video-player .w-12{ + width: 3rem; +} + +.paopao-video-player .w-20{ + width: 5rem; +} + +.paopao-video-player .w-24{ + width: 6rem; +} + +.paopao-video-player .w-32{ + width: 8rem; +} + +.paopao-video-player .w-full{ + width: 100%; +} + +.paopao-video-player .origin-left{ + transform-origin: left; +} + +.paopao-video-player .transform{ + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + transform: translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.paopao-video-player .translate-x-0{ + --tw-translate-x: 0px; +} + +.paopao-video-player .translate-x-2{ + --tw-translate-x: 0.5rem; +} + +.paopao-video-player .translate-x-9{ + --tw-translate-x: 2.25rem; +} + +.paopao-video-player .-translate-y-1{ + --tw-translate-y: -0.25rem; +} + +.paopao-video-player .-translate-y-4{ + --tw-translate-y: -1rem; +} + +.paopao-video-player .translate-y-full{ + --tw-translate-y: 100%; +} + +.paopao-video-player .-rotate-90{ + --tw-rotate: -90deg; +} + +@keyframes spin{ + to{ + transform: rotate(360deg); + } +} + +@keyframes ping{ + 75%, 100%{ + transform: scale(2); + opacity: 0; + } +} + +@keyframes pulse{ + 50%{ + opacity: .5; + } +} + +@keyframes bounce{ + 0%, 100%{ + transform: translateY(-25%); + animation-timing-function: cubic-bezier(0.8,0,1,1); + } + + 50%{ + transform: none; + animation-timing-function: cubic-bezier(0,0,0.2,1); + } +} + +.paopao-video-player .cursor-pointer{ + cursor: pointer; +} + +.paopao-video-player .appearance-none{ + appearance: none; +} + +.paopao-video-player .items-center{ + align-items: center; +} + +.paopao-video-player .justify-start{ + justify-content: flex-start; +} + +.paopao-video-player .justify-end{ + justify-content: flex-end; +} + +.paopao-video-player .justify-center{ + justify-content: center; +} + +.paopao-video-player .justify-between{ + justify-content: space-between; +} + +.paopao-video-player .overflow-hidden{ + overflow: hidden; +} + +.paopao-video-player .whitespace-nowrap{ + white-space: nowrap; +} + +.paopao-video-player .rounded-sm{ + border-radius: 0.125rem; +} + +.paopao-video-player .rounded-md{ + border-radius: 0.375rem; +} + +.paopao-video-player .rounded-lg{ + border-radius: 0.5rem; +} + +.paopao-video-player .rounded-xl{ + border-radius: 0.75rem; +} + +.paopao-video-player .rounded-3xl{ + border-radius: 1.5rem; +} + +.paopao-video-player .rounded-full{ + border-radius: 9999px; +} + +.paopao-video-player .bg-black{ + --tw-bg-opacity: 1; + background-color: rgba(0, 0, 0, var(--tw-bg-opacity)); +} + +.paopao-video-player .bg-white{ + --tw-bg-opacity: 1; + background-color: rgba(255, 255, 255, var(--tw-bg-opacity)); +} + +.paopao-video-player .bg-opacity-20{ + --tw-bg-opacity: 0.2; +} + +.paopao-video-player .bg-opacity-30{ + --tw-bg-opacity: 0.3; +} + +.paopao-video-player .bg-opacity-40{ + --tw-bg-opacity: 0.4; +} + +.paopao-video-player .bg-opacity-50{ + --tw-bg-opacity: 0.5; +} + +.paopao-video-player .bg-opacity-60{ + --tw-bg-opacity: 0.6; +} + +.paopao-video-player .hover\\:bg-opacity-40:hover{ + --tw-bg-opacity: 0.4; +} + +.paopao-video-player .bg-gradient-to-r{ + background-image: linear-gradient(to right, var(--tw-gradient-stops)); +} + +.paopao-video-player .px-2{ + padding-left: 0.5rem; + padding-right: 0.5rem; +} + +.paopao-video-player .px-3{ + padding-left: 0.75rem; + padding-right: 0.75rem; +} + +.paopao-video-player .px-5{ + padding-left: 1.25rem; + padding-right: 1.25rem; +} + +.paopao-video-player .py-1{ + padding-top: 0.25rem; + padding-bottom: 0.25rem; +} + +.paopao-video-player .py-2{ + padding-top: 0.5rem; + padding-bottom: 0.5rem; +} + +.paopao-video-player .py-3{ + padding-top: 0.75rem; + padding-bottom: 0.75rem; +} + +.paopao-video-player .py-4{ + padding-top: 1rem; + padding-bottom: 1rem; +} + +.paopao-video-player .pt-3{ + padding-top: 0.75rem; +} + +.paopao-video-player .pb-5{ + padding-bottom: 1.25rem; +} + +.paopao-video-player .text-center{ + text-align: center; +} + +.paopao-video-player .font-sans{ + font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; +} + +.paopao-video-player .text-xs{ + font-size: 0.75rem; + line-height: 1rem; +} + +.paopao-video-player .font-medium{ + font-weight: 500; +} + +.paopao-video-player .text-white{ + --tw-text-opacity: 1; + color: rgba(255, 255, 255, var(--tw-text-opacity)); +} + +.paopao-video-player .opacity-0{ + opacity: 0; +} + +*, ::before, ::after{ + --tw-shadow: 0 0 #0000; +} + +.paopao-video-player .shadow-xl{ + --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +*, ::before, ::after{ + --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/); + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgba(59, 130, 246, 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; +} + +.paopao-video-player .filter{ + --tw-blur: var(--tw-empty,/*!*/ /*!*/); + --tw-brightness: var(--tw-empty,/*!*/ /*!*/); + --tw-contrast: var(--tw-empty,/*!*/ /*!*/); + --tw-grayscale: var(--tw-empty,/*!*/ /*!*/); + --tw-hue-rotate: var(--tw-empty,/*!*/ /*!*/); + --tw-invert: var(--tw-empty,/*!*/ /*!*/); + --tw-saturate: var(--tw-empty,/*!*/ /*!*/); + --tw-sepia: var(--tw-empty,/*!*/ /*!*/); + --tw-drop-shadow: var(--tw-empty,/*!*/ /*!*/); + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} + +.paopao-video-player .blur-sm{ + --tw-blur: blur(4px); +} + +.paopao-video-player .blur{ + --tw-blur: blur(8px); +} + +.paopao-video-player .backdrop-filter{ + --tw-backdrop-blur: var(--tw-empty,/*!*/ /*!*/); + --tw-backdrop-brightness: var(--tw-empty,/*!*/ /*!*/); + --tw-backdrop-contrast: var(--tw-empty,/*!*/ /*!*/); + --tw-backdrop-grayscale: var(--tw-empty,/*!*/ /*!*/); + --tw-backdrop-hue-rotate: var(--tw-empty,/*!*/ /*!*/); + --tw-backdrop-invert: var(--tw-empty,/*!*/ /*!*/); + --tw-backdrop-opacity: var(--tw-empty,/*!*/ /*!*/); + --tw-backdrop-saturate: var(--tw-empty,/*!*/ /*!*/); + --tw-backdrop-sepia: var(--tw-empty,/*!*/ /*!*/); + -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); + backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia); +} + +.paopao-video-player .transition{ + transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter; + transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; + transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} + +.paopao-video-player .duration-200{ + transition-duration: 200ms; +} + +.paopao-video-player .duration-300{ + transition-duration: 300ms; +} + +.paopao-video-player .ease-in-out{ + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); +} + +.overlay { + background: linear-gradient(0deg, rgba(0,0,0,0.41961), transparent) +} + +.vertical-range::-webkit-slider-thumb { + width: 6px; + appearance: none; + height: 6px; + background-color: white; + cursor: ns-resize; + box-shadow: -405px 0 0 400px rgba(255, 255, 255, .6); + border-radius: 50%; +} + +.backdrop-filter { + -webkit-backdrop-filter: blur(15px) !important; + backdrop-filter: blur(15px) !important; +} + +.filter-white:hover { + filter: brightness(2); +} + +.gradient-variable { + --tw-gradient-from: #fbbf24; + --tw-gradient-to: #ec4899; + --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(251, 191, 36, 0)) +} +`;se(le);z.render=ie;var de=(()=>{const e=z;return e.install=n=>{n.component("PaoPaoVideoPlayer",e)},e})();export{de as e}; diff --git a/web/dist/assets/post-item-593ff254.css b/web/dist/assets/post-item-593ff254.css new file mode 100644 index 00000000..a4e275ef --- /dev/null +++ b/web/dist/assets/post-item-593ff254.css @@ -0,0 +1 @@ +.post-item .timestamp-mobile{margin-top:2px;opacity:.75;font-size:11px}.post-item{width:100%;padding:16px;box-sizing:border-box}.post-item .nickname-wrap{font-size:14px}.post-item .username-wrap{font-size:14px;opacity:.75}.post-item .top-tag{transform:scale(.75)}.post-item .item-header-extra{display:flex;align-items:center;opacity:.75}.post-item .item-header-extra .timestamp{font-size:12px}.post-item .post-text{text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.post-item .opt-item{display:flex;align-items:center;opacity:.7}.post-item .opt-item .opt-item-icon{margin-right:10px}.post-item:hover{background:#f7f9f9;cursor:pointer}.post-item .n-thing-avatar{margin-top:0}.post-item .n-thing-header{line-height:16px;margin-bottom:8px!important}.dark .post-item{background-color:#101014bf}.dark .post-item:hover{background:#18181c} diff --git a/web/dist/assets/post-item.11c28084.js b/web/dist/assets/post-item.11c28084.js deleted file mode 100644 index b8737242..00000000 --- a/web/dist/assets/post-item.11c28084.js +++ /dev/null @@ -1 +0,0 @@ -import{p as O,H as V,C as j,B as D,_ as E,a as F,b as L,c as M}from"./content.ed80294a.js";import{d as R,aj as S,al as I,$ as P,y as W,am as Y,W as o,Y as f,a4 as i,an as Z,a3 as t,a5 as n,ab as A,ac as G,a8 as v,Z as u,a9 as _,aa as p,a6 as r,a7 as c,ae as J,ao as K,af as Q,ah as U}from"./index.d4f5aad2.js";import{f as X}from"./formatTime.e07969bb.js";import{_ as tt}from"./Thing.d394adea.js";const et={class:"nickname-wrap"},st={class:"username-wrap"},at={class:"timestamp"},nt=["innerHTML"],ot={class:"opt-item"},it={class:"opt-item"},rt={class:"opt-item"},ut=R({__name:"post-item",props:{post:null},setup(x){const C=x;S();const m=I(),B=P(),e=W(()=>{let a=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},C.post);return a.contents.map(s=>{(+s.type==1||+s.type==2)&&a.texts.push(s),+s.type==3&&a.imgs.push(s),+s.type==4&&a.videos.push(s),+s.type==6&&a.links.push(s),+s.type==7&&a.attachments.push(s),+s.type==8&&a.charge_attachments.push(s)}),a}),k=a=>{m.push({name:"post",query:{id:a}})},b=(a,s)=>{if(a.target.dataset.detail){const l=a.target.dataset.detail.split(":");if(l.length===2){B.commit("refresh"),l[0]==="tag"?m.push({name:"home",query:{q:l[1],t:"tag"}}):m.push({name:"user",query:{username:l[1]}});return}}k(s)};return(a,s)=>{const l=J,z=Y("router-link"),d=K,y=E,w=F,T=L,q=M,h=Q,N=U,$=tt;return o(),f("div",{class:"post-item",onClick:s[2]||(s[2]=g=>k(t(e).id))},[i($,{"content-indented":""},Z({avatar:n(()=>[i(l,{round:"",size:30,src:t(e).user.avatar},null,8,["src"])]),header:n(()=>[u("span",et,[i(z,{onClick:s[0]||(s[0]=v(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t(e).user.username}}},{default:n(()=>[_(p(t(e).user.nickname),1)]),_:1},8,["to"])]),u("span",st," @"+p(t(e).user.username),1),t(e).is_top?(o(),r(d,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:n(()=>[_(" \u7F6E\u9876 ")]),_:1})):c("",!0),t(e).visibility==1?(o(),r(d,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:n(()=>[_(" \u79C1\u5BC6 ")]),_:1})):c("",!0),t(e).visibility==2?(o(),r(d,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:n(()=>[_(" \u597D\u53CB\u53EF\u89C1 ")]),_:1})):c("",!0)]),"header-extra":n(()=>[u("span",at,p(t(e).ip_loc?t(e).ip_loc+" \xB7 ":t(e).ip_loc)+" "+p(t(X)(t(e).created_on)),1)]),footer:n(()=>[t(e).attachments.length>0?(o(),r(y,{key:0,attachments:t(e).attachments},null,8,["attachments"])):c("",!0),t(e).charge_attachments.length>0?(o(),r(y,{key:1,attachments:t(e).charge_attachments,price:t(e).attachment_price},null,8,["attachments","price"])):c("",!0),t(e).imgs.length>0?(o(),r(w,{key:2,imgs:t(e).imgs},null,8,["imgs"])):c("",!0),t(e).videos.length>0?(o(),r(T,{key:3,videos:t(e).videos},null,8,["videos"])):c("",!0),t(e).links.length>0?(o(),r(q,{key:4,links:t(e).links},null,8,["links"])):c("",!0)]),action:n(()=>[i(N,{justify:"space-between"},{default:n(()=>[u("div",ot,[i(h,{size:"18",class:"opt-item-icon"},{default:n(()=>[i(t(V))]),_:1}),_(" "+p(t(e).upvote_count),1)]),u("div",it,[i(h,{size:"18",class:"opt-item-icon"},{default:n(()=>[i(t(j))]),_:1}),_(" "+p(t(e).comment_count),1)]),u("div",rt,[i(h,{size:"18",class:"opt-item-icon"},{default:n(()=>[i(t(D))]),_:1}),_(" "+p(t(e).collection_count),1)])]),_:1})]),_:2},[t(e).texts.length>0?{name:"description",fn:n(()=>[(o(!0),f(A,null,G(t(e).texts,g=>(o(),f("span",{key:g.id,class:"post-text",onClick:s[1]||(s[1]=v(H=>b(H,t(e).id),["stop"])),innerHTML:t(O)(g.content).content},null,8,nt))),128))]),key:"0"}:void 0]),1024)])}}});export{ut as _}; diff --git a/web/dist/assets/post-item.766f3250.css b/web/dist/assets/post-item.766f3250.css deleted file mode 100644 index 227cd0fe..00000000 --- a/web/dist/assets/post-item.766f3250.css +++ /dev/null @@ -1 +0,0 @@ -.post-item{width:100%;padding:16px;box-sizing:border-box}.post-item .nickname-wrap{font-size:14px}.post-item .username-wrap{font-size:14px;opacity:.75}.post-item .top-tag{transform:scale(.75)}.post-item .timestamp{opacity:.75;font-size:12px}.post-item .post-text{text-align:justify;overflow:hidden;white-space:pre-wrap;word-break:break-all}.post-item .opt-item{display:flex;align-items:center;opacity:.7}.post-item .opt-item .opt-item-icon{margin-right:10px}.post-item:hover{background:#f7f9f9;cursor:pointer}.post-item .n-thing-avatar{margin-top:0}.post-item .n-thing-header{line-height:16px;margin-bottom:8px!important}.dark .post-item:hover{background:#18181c} diff --git a/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-e2c8dabf.js b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-e2c8dabf.js new file mode 100644 index 00000000..548571b5 --- /dev/null +++ b/web/dist/assets/post-item.vue_vue_type_style_index_0_lang-e2c8dabf.js @@ -0,0 +1 @@ +import{p as B,a as N,_ as V,b as D,c as I}from"./content-72d615e5.js";import{d as F,n as P,a3 as A,o as i,c as k,V as o,a7 as E,a1 as s,a as u,F as Q,a4 as R,a2 as f,_ as p,e as _,M as m,Q as r,O as c,s as S}from"./@vue-e0e89260.js";import{u as G}from"./vuex-473b3783.js";import{u as J}from"./vue-router-b8e3382f.js";import{b as K}from"./formatTime-cdf4e6f1.js";import{a as oe}from"./copy-to-clipboard-1dd3075d.js";import{i as ie,j as U,l as W,m as X,o as le}from"./@vicons-8f91201d.js";import{j as y,o as Y,O as Z,e as ue,P as re,a as ee,M as te}from"./naive-ui-62663ad7.js";const ce={class:"post-item"},pe={class:"nickname-wrap"},_e={class:"username-wrap"},me={class:"timestamp-mobile"},de={class:"item-header-extra"},ve=["innerHTML"],he={class:"opt-item"},ge={class:"opt-item"},He=F({__name:"mobile-post-item",props:{post:{}},setup(C){const q=C,h=J(),T=G(),t=l=>()=>S(y,null,{default:()=>S(l)}),x=P(()=>[{label:"复制链接",key:"copyTweetLink",icon:t(le)}]),O=async l=>{switch(l){case"copyTweetLink":oe(`${window.location.origin}/#/post?id=${e.value.id}`),window.$message.success("链接已复制到剪贴板");break}},e=P(()=>{let l=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},q.post);return l.contents.map(n=>{(+n.type==1||+n.type==2)&&l.texts.push(n),+n.type==3&&l.imgs.push(n),+n.type==4&&l.videos.push(n),+n.type==6&&l.links.push(n),+n.type==7&&l.attachments.push(n),+n.type==8&&l.charge_attachments.push(n)}),l}),a=l=>{h.push({name:"post",query:{id:l}})},v=(l,n)=>{if(l.target.dataset.detail){const d=l.target.dataset.detail.split(":");if(d.length===2){T.commit("refresh"),d[0]==="tag"?h.push({name:"home",query:{q:d[1],t:"tag"}}):h.push({name:"user",query:{username:d[1]}});return}}a(n)};return(l,n)=>{const d=Y,M=A("router-link"),w=Z,L=ue,$=re,b=N,j=V,g=D,H=I,se=ee,ae=te;return i(),k("div",ce,[o(ae,{"content-indented":""},E({avatar:s(()=>[o(d,{round:"",size:30,src:e.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",pe,[o(M,{onClick:n[0]||(n[0]=f(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:e.value.user.username}}},{default:s(()=>[_(m(e.value.user.nickname),1)]),_:1},8,["to"])]),u("span",_e," @"+m(e.value.user.username),1),e.value.is_top?(i(),r(w,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[_(" 置顶 ")]),_:1})):c("",!0),e.value.visibility==1?(i(),r(w,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[_(" 私密 ")]),_:1})):c("",!0),e.value.visibility==2?(i(),r(w,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[_(" 好友可见 ")]),_:1})):c("",!0),u("div",null,[u("span",me,m(p(K)(e.value.created_on))+" "+m(e.value.ip_loc),1)])]),"header-extra":s(()=>[u("div",de,[o($,{placement:"bottom-end",trigger:"click",size:"small",options:x.value,onSelect:O},{default:s(()=>[o(L,{quaternary:"",circle:""},{icon:s(()=>[o(p(y),null,{default:s(()=>[o(p(ie))]),_:1})]),_:1})]),_:1},8,["options"])])]),footer:s(()=>[e.value.attachments.length>0?(i(),r(b,{key:0,attachments:e.value.attachments},null,8,["attachments"])):c("",!0),e.value.charge_attachments.length>0?(i(),r(b,{key:1,attachments:e.value.charge_attachments,price:e.value.attachment_price},null,8,["attachments","price"])):c("",!0),e.value.imgs.length>0?(i(),r(j,{key:2,imgs:e.value.imgs},null,8,["imgs"])):c("",!0),e.value.videos.length>0?(i(),r(g,{key:3,videos:e.value.videos},null,8,["videos"])):c("",!0),e.value.links.length>0?(i(),r(H,{key:4,links:e.value.links},null,8,["links"])):c("",!0)]),action:s(()=>[o(se,{justify:"space-between"},{default:s(()=>[u("div",he,[o(p(y),{size:"18",class:"opt-item-icon"},{default:s(()=>[o(p(U))]),_:1}),_(" "+m(e.value.upvote_count),1)]),u("div",{class:"opt-item",onClick:n[3]||(n[3]=f(z=>a(e.value.id),["stop"]))},[o(p(y),{size:"18",class:"opt-item-icon"},{default:s(()=>[o(p(W))]),_:1}),_(" "+m(e.value.comment_count),1)]),u("div",ge,[o(p(y),{size:"18",class:"opt-item-icon"},{default:s(()=>[o(p(X))]),_:1}),_(" "+m(e.value.collection_count),1)])]),_:1})]),_:2},[e.value.texts.length>0?{name:"description",fn:s(()=>[u("div",{onClick:n[2]||(n[2]=z=>a(e.value.id))},[(i(!0),k(Q,null,R(e.value.texts,z=>(i(),k("span",{key:z.id,class:"post-text",onClick:n[1]||(n[1]=f(ne=>v(ne,e.value.id),["stop"])),innerHTML:p(B)(z.content).content},null,8,ve))),128))])]),key:"0"}:void 0]),1024)])}}});const ye={class:"nickname-wrap"},ke={class:"username-wrap"},fe={class:"item-header-extra"},xe={class:"timestamp"},we=["innerHTML"],$e={class:"opt-item"},be={class:"opt-item"},Pe=F({__name:"post-item",props:{post:{}},setup(C){const q=C,h=J(),T=G(),t=P(()=>{let e=Object.assign({texts:[],imgs:[],videos:[],links:[],attachments:[],charge_attachments:[]},q.post);return e.contents.map(a=>{(+a.type==1||+a.type==2)&&e.texts.push(a),+a.type==3&&e.imgs.push(a),+a.type==4&&e.videos.push(a),+a.type==6&&e.links.push(a),+a.type==7&&e.attachments.push(a),+a.type==8&&e.charge_attachments.push(a)}),e}),x=e=>{h.push({name:"post",query:{id:e}})},O=(e,a)=>{if(e.target.dataset.detail){const v=e.target.dataset.detail.split(":");if(v.length===2){T.commit("refresh"),v[0]==="tag"?h.push({name:"home",query:{q:v[1],t:"tag"}}):h.push({name:"user",query:{username:v[1]}});return}}x(a)};return(e,a)=>{const v=Y,l=A("router-link"),n=Z,d=N,M=V,w=D,L=I,$=y,b=ee,j=te;return i(),k("div",{class:"post-item",onClick:a[3]||(a[3]=g=>x(t.value.id))},[o(j,{"content-indented":""},E({avatar:s(()=>[o(v,{round:"",size:30,src:t.value.user.avatar},null,8,["src"])]),header:s(()=>[u("span",ye,[o(l,{onClick:a[0]||(a[0]=f(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{username:t.value.user.username}}},{default:s(()=>[_(m(t.value.user.nickname),1)]),_:1},8,["to"])]),u("span",ke," @"+m(t.value.user.username),1),t.value.is_top?(i(),r(n,{key:0,class:"top-tag",type:"warning",size:"small",round:""},{default:s(()=>[_(" 置顶 ")]),_:1})):c("",!0),t.value.visibility==1?(i(),r(n,{key:1,class:"top-tag",type:"error",size:"small",round:""},{default:s(()=>[_(" 私密 ")]),_:1})):c("",!0),t.value.visibility==2?(i(),r(n,{key:2,class:"top-tag",type:"info",size:"small",round:""},{default:s(()=>[_(" 好友可见 ")]),_:1})):c("",!0)]),"header-extra":s(()=>[u("div",fe,[u("span",xe,m(t.value.ip_loc?t.value.ip_loc+" · ":t.value.ip_loc)+" "+m(p(K)(t.value.created_on)),1)])]),footer:s(()=>[t.value.attachments.length>0?(i(),r(d,{key:0,attachments:t.value.attachments},null,8,["attachments"])):c("",!0),t.value.charge_attachments.length>0?(i(),r(d,{key:1,attachments:t.value.charge_attachments,price:t.value.attachment_price},null,8,["attachments","price"])):c("",!0),t.value.imgs.length>0?(i(),r(M,{key:2,imgs:t.value.imgs},null,8,["imgs"])):c("",!0),t.value.videos.length>0?(i(),r(w,{key:3,videos:t.value.videos},null,8,["videos"])):c("",!0),t.value.links.length>0?(i(),r(L,{key:4,links:t.value.links},null,8,["links"])):c("",!0)]),action:s(()=>[o(b,{justify:"space-between"},{default:s(()=>[u("div",$e,[o($,{size:"18",class:"opt-item-icon"},{default:s(()=>[o(p(U))]),_:1}),_(" "+m(t.value.upvote_count),1)]),u("div",{class:"opt-item",onClick:a[2]||(a[2]=f(g=>x(t.value.id),["stop"]))},[o($,{size:"18",class:"opt-item-icon"},{default:s(()=>[o(p(W))]),_:1}),_(" "+m(t.value.comment_count),1)]),u("div",be,[o($,{size:"18",class:"opt-item-icon"},{default:s(()=>[o(p(X))]),_:1}),_(" "+m(t.value.collection_count),1)])]),_:1})]),_:2},[t.value.texts.length>0?{name:"description",fn:s(()=>[(i(!0),k(Q,null,R(t.value.texts,g=>(i(),k("span",{key:g.id,class:"post-text",onClick:a[1]||(a[1]=f(H=>O(H,t.value.id),["stop"])),innerHTML:p(B)(g.content).content},null,8,we))),128))]),key:"0"}:void 0]),1024)])}}});export{Pe as _,He as a}; diff --git a/web/dist/assets/post-skeleton-f1900002.css b/web/dist/assets/post-skeleton-f1900002.css new file mode 100644 index 00000000..2b10b03e --- /dev/null +++ b/web/dist/assets/post-skeleton-f1900002.css @@ -0,0 +1 @@ +.skeleton-item[data-v-ab0015b4]{padding:12px;display:flex}.skeleton-item .user[data-v-ab0015b4]{width:42px}.skeleton-item .content[data-v-ab0015b4]{width:calc(100% - 42px)}.dark .skeleton-item[data-v-ab0015b4]{background-color:#101014bf} diff --git a/web/dist/assets/post-skeleton-ffa76165.js b/web/dist/assets/post-skeleton-ffa76165.js new file mode 100644 index 00000000..db8930ff --- /dev/null +++ b/web/dist/assets/post-skeleton-ffa76165.js @@ -0,0 +1 @@ +import{U as r}from"./naive-ui-62663ad7.js";import{d as c,o as s,c as n,a4 as p,a as o,V as t,F as l}from"./@vue-e0e89260.js";import{_ as i}from"./index-347d1d96.js";const m={class:"user"},d={class:"content"},u=c({__name:"post-skeleton",props:{num:{default:1}},setup(f){return(_,k)=>{const e=r;return s(!0),n(l,null,p(new Array(_.num),a=>(s(),n("div",{class:"skeleton-item",key:a},[o("div",m,[t(e,{circle:"",size:"small"})]),o("div",d,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});const b=i(u,[["__scopeId","data-v-ab0015b4"]]);export{b as _}; diff --git a/web/dist/assets/post-skeleton.328dfb67.css b/web/dist/assets/post-skeleton.328dfb67.css deleted file mode 100644 index 1311e96a..00000000 --- a/web/dist/assets/post-skeleton.328dfb67.css +++ /dev/null @@ -1 +0,0 @@ -.skeleton-item[data-v-a6d56894]{padding:12px;display:flex}.skeleton-item .user[data-v-a6d56894]{width:42px}.skeleton-item .content[data-v-a6d56894]{width:calc(100% - 42px)} diff --git a/web/dist/assets/post-skeleton.38f0f247.js b/web/dist/assets/post-skeleton.38f0f247.js deleted file mode 100644 index 3bfcacf8..00000000 --- a/web/dist/assets/post-skeleton.38f0f247.js +++ /dev/null @@ -1 +0,0 @@ -import{ai as r,d as c,W as s,Y as n,ac as l,Z as a,a4 as t,ab as p}from"./index.d4f5aad2.js";import{b as i}from"./Skeleton.e1c16fcb.js";const d={class:"user"},u={class:"content"},m=c({__name:"post-skeleton",props:{num:{default:1}},setup(o){return(v,k)=>{const e=i;return s(!0),n(p,null,l(new Array(o.num),_=>(s(),n("div",{class:"skeleton-item",key:_},[a("div",d,[t(e,{circle:"",size:"small"})]),a("div",u,[t(e,{text:"",repeat:3}),t(e,{text:"",style:{width:"60%"}})])]))),128)}}});var y=r(m,[["__scopeId","data-v-a6d56894"]]);export{y as _}; diff --git a/web/dist/assets/qrcode-9719fc56.js b/web/dist/assets/qrcode-9719fc56.js new file mode 100644 index 00000000..7c593bbd --- /dev/null +++ b/web/dist/assets/qrcode-9719fc56.js @@ -0,0 +1,8 @@ +import{e as bt}from"./encode-utf8-f813de00.js";import{d as Pt}from"./dijkstrajs-f906a09e.js";var O={},Rt=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},dt={},N={};let it;const Lt=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];N.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};N.getSymbolTotalCodewords=function(t){return Lt[t]};N.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};N.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');it=t};N.isKanjiModeEnabled=function(){return typeof it<"u"};N.toSJIS=function(t){return it(t)};var G={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+i)}}e.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},e.from=function(o,n){if(e.isValid(o))return o;try{return t(o)}catch{return n}}})(G);function ht(){this.buffer=[],this.length=0}ht.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let i=0;i>>t-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Ut=ht;function K(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}K.prototype.set=function(e,t,i,o){const n=e*this.size+t;this.data[n]=i,o&&(this.reservedBit[n]=!0)};K.prototype.get=function(e,t){return this.data[e*this.size+t]};K.prototype.xor=function(e,t,i){this.data[e*this.size+t]^=i};K.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Dt=K,wt={};(function(e){const t=N.getSymbolSize;e.getRowColCoords=function(o){if(o===1)return[];const n=Math.floor(o/7)+2,r=t(o),s=r===145?26:Math.ceil((r-13)/(2*n-2))*2,c=[r-7];for(let u=1;u=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const r=n.size;let s=0,c=0,u=0,l=null,a=null;for(let A=0;A=5&&(s+=t.N1+(c-5)),l=g,c=1),g=n.get(w,A),g===a?u++:(u>=5&&(s+=t.N1+(u-5)),a=g,u=1)}c>=5&&(s+=t.N1+(c-5)),u>=5&&(s+=t.N1+(u-5))}return s},e.getPenaltyN2=function(n){const r=n.size;let s=0;for(let c=0;c=10&&(c===1488||c===93)&&s++,u=u<<1&2047|n.get(a,l),a>=10&&(u===1488||u===93)&&s++}return s*t.N3},e.getPenaltyN4=function(n){let r=0;const s=n.data.length;for(let u=0;u=0;){const s=r[0];for(let u=0;u0){const r=new Uint8Array(this.degree);return r.set(o,n),r}return o};var kt=st,Bt={},L={},ut={};ut.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var S={};const At="[0-9]+",zt="[A-Z $%*+\\-./:]+";let H="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";H=H.replace(/u/g,"\\u");const Vt="(?:(?![A-Z0-9 $%*+\\-./:]|"+H+`)(?:.|[\r +]))+`;S.KANJI=new RegExp(H,"g");S.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");S.BYTE=new RegExp(Vt,"g");S.NUMERIC=new RegExp(At,"g");S.ALPHANUMERIC=new RegExp(zt,"g");const Ht=new RegExp("^"+H+"$"),Kt=new RegExp("^"+At+"$"),Jt=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");S.testKanji=function(t){return Ht.test(t)};S.testNumeric=function(t){return Kt.test(t)};S.testAlphanumeric=function(t){return Jt.test(t)};(function(e){const t=ut,i=S;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(r,s){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?r.ccBits[0]:s<27?r.ccBits[1]:r.ccBits[2]},e.getBestModeForData=function(r){return i.testNumeric(r)?e.NUMERIC:i.testAlphanumeric(r)?e.ALPHANUMERIC:i.testKanji(r)?e.KANJI:e.BYTE},e.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},e.isValid=function(r){return r&&r.bit&&r.ccBits};function o(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+n)}}e.from=function(r,s){if(e.isValid(r))return r;try{return o(r)}catch{return s}}})(L);(function(e){const t=N,i=j,o=G,n=L,r=ut,s=7973,c=t.getBCHDigit(s);function u(w,g,E){for(let C=1;C<=40;C++)if(g<=e.getCapacity(C,E,w))return C}function l(w,g){return n.getCharCountIndicator(w,g)+4}function a(w,g){let E=0;return w.forEach(function(C){const p=l(C.mode,g);E+=p+C.getBitsLength()}),E}function A(w,g){for(let E=1;E<=40;E++)if(a(w,E)<=e.getCapacity(E,g,n.MIXED))return E}e.from=function(g,E){return r.isValid(g)?parseInt(g,10):E},e.getCapacity=function(g,E,C){if(!r.isValid(g))throw new Error("Invalid QR Code version");typeof C>"u"&&(C=n.BYTE);const p=t.getSymbolTotalCodewords(g),h=i.getTotalCodewordsCount(g,E),m=(p-h)*8;if(C===n.MIXED)return m;const d=m-l(C,g);switch(C){case n.NUMERIC:return Math.floor(d/10*3);case n.ALPHANUMERIC:return Math.floor(d/11*2);case n.KANJI:return Math.floor(d/13);case n.BYTE:default:return Math.floor(d/8)}},e.getBestVersionForData=function(g,E){let C;const p=o.from(E,o.M);if(Array.isArray(g)){if(g.length>1)return A(g,p);if(g.length===0)return 1;C=g[0]}else C=g;return u(C.mode,C.getLength(),p)},e.getEncodedBits=function(g){if(!r.isValid(g)||g<7)throw new Error("Invalid QR Code version");let E=g<<12;for(;t.getBCHDigit(E)-c>=0;)E^=s<=0;)n^=pt<0&&(o=this.data.substr(i),n=parseInt(o,10),t.put(n,r*3+1))};var _t=U;const Ot=L,W=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function D(e){this.mode=Ot.ALPHANUMERIC,this.data=e}D.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};D.prototype.getLength=function(){return this.data.length};D.prototype.getBitsLength=function(){return D.getBitsLength(this.data.length)};D.prototype.write=function(t){let i;for(i=0;i+2<=this.data.length;i+=2){let o=W.indexOf(this.data[i])*45;o+=W.indexOf(this.data[i+1]),t.put(o,11)}this.data.length%2&&t.put(W.indexOf(this.data[i]),6)};var Gt=D;const jt=bt,vt=L;function F(e){this.mode=vt.BYTE,typeof e=="string"&&(e=jt(e)),this.data=new Uint8Array(e)}F.getBitsLength=function(t){return t*8};F.prototype.getLength=function(){return this.data.length};F.prototype.getBitsLength=function(){return F.getBitsLength(this.data.length)};F.prototype.write=function(e){for(let t=0,i=this.data.length;t=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` +Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),e.put(i,13)}};var Zt=k;(function(e){const t=L,i=_t,o=Gt,n=Qt,r=Zt,s=S,c=N,u=Pt;function l(h){return unescape(encodeURIComponent(h)).length}function a(h,m,d){const f=[];let y;for(;(y=h.exec(d))!==null;)f.push({data:y[0],index:y.index,mode:m,length:y[0].length});return f}function A(h){const m=a(s.NUMERIC,t.NUMERIC,h),d=a(s.ALPHANUMERIC,t.ALPHANUMERIC,h);let f,y;return c.isKanjiModeEnabled()?(f=a(s.BYTE,t.BYTE,h),y=a(s.KANJI,t.KANJI,h)):(f=a(s.BYTE_KANJI,t.BYTE,h),y=[]),m.concat(d,f,y).sort(function(I,T){return I.index-T.index}).map(function(I){return{data:I.data,mode:I.mode,length:I.length}})}function w(h,m){switch(m){case t.NUMERIC:return i.getBitsLength(h);case t.ALPHANUMERIC:return o.getBitsLength(h);case t.KANJI:return r.getBitsLength(h);case t.BYTE:return n.getBitsLength(h)}}function g(h){return h.reduce(function(m,d){const f=m.length-1>=0?m[m.length-1]:null;return f&&f.mode===d.mode?(m[m.length-1].data+=d.data,m):(m.push(d),m)},[])}function E(h){const m=[];for(let d=0;d=0&&c<=6&&(u===0||u===6)||u>=0&&u<=6&&(c===0||c===6)||c>=2&&c<=4&&u>=2&&u<=4?e.set(r+c,s+u,!0,!0):e.set(r+c,s+u,!1,!0))}}function se(e){const t=e.size;for(let i=8;i>c&1)===1,e.set(n,r,s,!0),e.set(r,n,s,!0)}function x(e,t,i){const o=e.size,n=oe.getEncodedBits(t,i);let r,s;for(r=0;r<15;r++)s=(n>>r&1)===1,r<6?e.set(r,8,s,!0):r<8?e.set(r+1,8,s,!0):e.set(o-15+r,8,s,!0),r<8?e.set(8,o-r-1,s,!0):r<9?e.set(8,15-r-1+1,s,!0):e.set(8,15-r-1,s,!0);e.set(o-8,8,1,!0)}function le(e,t){const i=e.size;let o=-1,n=i-1,r=7,s=0;for(let c=i-1;c>0;c-=2)for(c===6&&c--;;){for(let u=0;u<2;u++)if(!e.isReserved(n,c-u)){let l=!1;s>>r&1)===1),e.set(n,c-u,l),r--,r===-1&&(s++,r=7)}if(n+=o,n<0||i<=n){n-=o,o=-o;break}}}function ae(e,t,i){const o=new Xt;i.forEach(function(u){o.put(u.mode.bit,4),o.put(u.getLength(),re.getCharCountIndicator(u.mode,e)),u.write(o)});const n=Q.getSymbolTotalCodewords(e),r=ot.getTotalCodewordsCount(e,t),s=(n-r)*8;for(o.getLengthInBits()+4<=s&&o.put(0,4);o.getLengthInBits()%8!==0;)o.putBit(0);const c=(s-o.getLengthInBits())/8;for(let u=0;u=7&&ce(u,t),le(u,s),isNaN(o)&&(o=nt.getBestMask(u,x.bind(null,u,i))),nt.applyMask(o,u),x(u,i,o),{modules:u,version:t,errorCorrectionLevel:i,maskPattern:o,segments:n}}dt.create=function(t,i){if(typeof t>"u"||t==="")throw new Error("No input text");let o=Z.M,n,r;return typeof i<"u"&&(o=Z.from(i.errorCorrectionLevel,Z.M),n=_.from(i.version),r=nt.from(i.maskPattern),i.toSJISFunc&&Q.setToSJISFunction(i.toSJISFunc)),ge(t,n,o,r)};var Tt={},ct={};(function(e){function t(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let o=i.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+i);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(r){return[r,r]}))),o.length===6&&o.push("F","F");const n=parseInt(o.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+o.slice(0,6).join("")}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const n=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,r=o.width&&o.width>=21?o.width:void 0,s=o.scale||4;return{width:r,scale:r?4:s,margin:n,color:{dark:t(o.color.dark||"#000000ff"),light:t(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(o,n){return n.width&&n.width>=o+n.margin*2?n.width/(o+n.margin*2):n.scale},e.getImageWidth=function(o,n){const r=e.getScale(o,n);return Math.floor((o+n.margin*2)*r)},e.qrToImageData=function(o,n,r){const s=n.modules.size,c=n.modules.data,u=e.getScale(s,r),l=Math.floor((s+r.margin*2)*u),a=r.margin*u,A=[r.color.light,r.color.dark];for(let w=0;w=a&&g>=a&&w"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(l=o()),u=t.getOptions(u);const a=t.getImageWidth(r.modules.size,u),A=l.getContext("2d"),w=A.createImageData(a,a);return t.qrToImageData(w.data,r,u),i(A,l,a),A.putImageData(w,0,0),l},e.renderToDataURL=function(r,s,c){let u=c;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const l=e.render(r,s,u),a=u.type||"image/png",A=u.rendererOpts||{};return l.toDataURL(a,A.quality)}})(Tt);var Mt={};const de=ct;function gt(e,t){const i=e.a/255,o=t+'="'+e.hex+'"';return i<1?o+" "+t+'-opacity="'+i.toFixed(2).slice(1)+'"':o}function tt(e,t,i){let o=e+t;return typeof i<"u"&&(o+=" "+i),o}function he(e,t,i){let o="",n=0,r=!1,s=0;for(let c=0;c0&&u>0&&e[c-1]||(o+=r?tt("M",u+i,.5+l+i):tt("m",n,0),n=0,r=!1),u+1':"",l="',a='viewBox="0 0 '+c+" "+c+'"',w=''+u+l+` +`;return typeof o=="function"&&o(null,w),w};const we=Rt,rt=dt,St=Tt,me=Mt;function lt(e,t,i,o,n){const r=[].slice.call(arguments,1),s=r.length,c=typeof r[s-1]=="function";if(!c&&!we())throw new Error("Callback required as last argument");if(c){if(s<2)throw new Error("Too few arguments provided");s===2?(n=i,i=t,t=o=void 0):s===3&&(t.getContext&&typeof n>"u"?(n=o,o=void 0):(n=o,o=i,i=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(i=t,t=o=void 0):s===2&&!t.getContext&&(o=i,i=t,t=void 0),new Promise(function(u,l){try{const a=rt.create(i,o);u(e(a,t,o))}catch(a){l(a)}})}try{const u=rt.create(i,o);n(null,e(u,t,o))}catch(u){n(u)}}O.create=rt.create;O.toCanvas=lt.bind(null,St.render);O.toDataURL=lt.bind(null,St.renderToDataURL);O.toString=lt.bind(null,function(e,t,i){return me.render(e,i)});export{O as b}; diff --git a/web/dist/assets/seemly-76b7b838.js b/web/dist/assets/seemly-76b7b838.js new file mode 100644 index 00000000..0642f701 --- /dev/null +++ b/web/dist/assets/seemly-76b7b838.js @@ -0,0 +1 @@ +let d=[];const A=new WeakMap;function F(){d.forEach(n=>n(...A.get(n))),d=[]}function G(n,...e){A.set(n,e),!d.includes(n)&&d.push(n)===1&&requestAnimationFrame(F)}function H(n,e){let{target:t}=n;for(;t;){if(t.dataset&&t.dataset[e]!==void 0)return!0;t=t.parentElement}return!1}function W(n){return n.composedPath()[0]||null}function R(n){if(typeof n=="number")return{"":n.toString()};const e={};return n.split(/ +/).forEach(t=>{if(t==="")return;const[r,s]=t.split(":");s===void 0?e[""]=r:e[r]=s}),e}function q(n,e){var t;if(n==null)return;const r=R(n);if(e===void 0)return r[""];if(typeof e=="string")return(t=r[e])!==null&&t!==void 0?t:r[""];if(Array.isArray(e)){for(let s=e.length-1;s>=0;--s){const u=e[s];if(u in r)return r[u]}return r[""]}else{let s,u=-1;return Object.keys(r).forEach(l=>{const g=Number(l);!Number.isNaN(g)&&e>=g&&g>=u&&(u=g,s=r[l])}),s}}function T(n){return typeof n=="string"?n.endsWith("px")?Number(n.slice(0,n.length-2)):Number(n):n}function _(n){if(n!=null)return typeof n=="number"?`${n}px`:n.endsWith("px")?n:`${n}px`}function B(n,e){const t=n.trim().split(/\s+/g),r={top:t[0]};switch(t.length){case 1:r.right=t[0],r.bottom=t[0],r.left=t[0];break;case 2:r.right=t[1],r.left=t[1],r.bottom=t[0];break;case 3:r.right=t[1],r.bottom=t[2],r.left=t[1];break;case 4:r.right=t[1],r.bottom=t[2],r.left=t[3];break;default:throw new Error("[seemly/getMargin]:"+n+" is not a valid value.")}return e===void 0?r:r[e]}function D(n,e){const[t,r]=n.split(" ");return e?e==="row"?t:r:{row:t,col:r||t}}const w={black:"#000",silver:"#C0C0C0",gray:"#808080",white:"#FFF",maroon:"#800000",red:"#F00",purple:"#800080",fuchsia:"#F0F",green:"#008000",lime:"#0F0",olive:"#808000",yellow:"#FF0",navy:"#000080",blue:"#00F",teal:"#008080",aqua:"#0FF",transparent:"#0000"},$="^\\s*",p="\\s*$",a="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",o="([0-9A-Fa-f])",c="([0-9A-Fa-f]{2})",y=new RegExp(`${$}rgb\\s*\\(${a},${a},${a}\\)${p}`),E=new RegExp(`${$}rgba\\s*\\(${a},${a},${a},${a}\\)${p}`),N=new RegExp(`${$}#${o}${o}${o}${p}`),C=new RegExp(`${$}#${c}${c}${c}${p}`),M=new RegExp(`${$}#${o}${o}${o}${o}${p}`),I=new RegExp(`${$}#${c}${c}${c}${c}${p}`);function f(n){return parseInt(n,16)}function x(n){try{let e;if(e=C.exec(n))return[f(e[1]),f(e[2]),f(e[3]),1];if(e=y.exec(n))return[i(e[1]),i(e[5]),i(e[9]),1];if(e=E.exec(n))return[i(e[1]),i(e[5]),i(e[9]),h(e[13])];if(e=N.exec(n))return[f(e[1]+e[1]),f(e[2]+e[2]),f(e[3]+e[3]),1];if(e=I.exec(n))return[f(e[1]),f(e[2]),f(e[3]),h(f(e[4])/255)];if(e=M.exec(n))return[f(e[1]+e[1]),f(e[2]+e[2]),f(e[3]+e[3]),h(f(e[4]+e[4])/255)];if(n in w)return x(w[n]);throw new Error(`[seemly/rgba]: Invalid color value ${n}.`)}catch(e){throw e}}function j(n){return n>1?1:n<0?0:n}function b(n,e,t,r){return`rgba(${i(n)}, ${i(e)}, ${i(t)}, ${j(r)})`}function m(n,e,t,r,s){return i((n*e*(1-r)+t*r)/s)}function J(n,e){Array.isArray(n)||(n=x(n)),Array.isArray(e)||(e=x(e));const t=n[3],r=e[3],s=h(t+r-t*r);return b(m(n[0],t,e[0],r,s),m(n[1],t,e[1],r,s),m(n[2],t,e[2],r,s),s)}function P(n,e){const[t,r,s,u=1]=Array.isArray(n)?n:x(n);return e.alpha?b(t,r,s,e.alpha):b(t,r,s,u)}function Q(n,e){const[t,r,s,u=1]=Array.isArray(n)?n:x(n),{lightness:l=1,alpha:g=1}=e;return k([t*l,r*l,s*l,u*g])}function h(n){const e=Math.round(Number(n)*100)/100;return e>1?1:e<0?0:e}function i(n){const e=Math.round(Number(n));return e>255?255:e<0?0:e}function k(n){const[e,t,r]=n;return 3 in n?`rgba(${i(e)}, ${i(t)}, ${i(r)}, ${h(n[3])})`:`rgba(${i(e)}, ${i(t)}, ${i(r)}, 1)`}function U(n=8){return Math.random().toString(16).slice(2,2+n)}export{B as a,P as b,J as c,T as d,U as e,D as f,W as g,H as h,q as i,G as j,_ as p,x as r,Q as s}; diff --git a/web/dist/assets/toggle-selection-93f4ad84.js b/web/dist/assets/toggle-selection-93f4ad84.js new file mode 100644 index 00000000..dd73d0b8 --- /dev/null +++ b/web/dist/assets/toggle-selection-93f4ad84.js @@ -0,0 +1 @@ +var o=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,a=[],n=0;nM(r,n))}function F(e,n={}){const{preserveGroup:t=!1}=n,r=[],s=t?i=>{i.isLeaf||(r.push(i.key),o(i.children))}:i=>{i.isLeaf||(i.isGroup||r.push(i.key),o(i.children))};function o(i){i.forEach(s)}return o(e),r}function R(e,n){const{isLeaf:t}=e;return t!==void 0?t:!n(e)}function j(e){return e.children}function U(e){return e.key}function q(){return!1}function V(e,n){const{isLeaf:t}=e;return!(t===!1&&!Array.isArray(n(e)))}function W(e){return e.disabled===!0}function Z(e,n){return e.isLeaf===!1&&!Array.isArray(n(e))}function P(e){var n;return e==null?[]:Array.isArray(e)?e:(n=e.checkedKeys)!==null&&n!==void 0?n:[]}function x(e){var n;return e==null||Array.isArray(e)?[]:(n=e.indeterminateKeys)!==null&&n!==void 0?n:[]}function z(e,n){const t=new Set(e);return n.forEach(r=>{t.has(r)||t.add(r)}),Array.from(t)}function B(e,n){const t=new Set(e);return n.forEach(r=>{t.has(r)&&t.delete(r)}),Array.from(t)}function H(e){return(e==null?void 0:e.type)==="group"}function le(e){const n=new Map;return e.forEach((t,r)=>{n.set(t.key,r)}),t=>{var r;return(r=n.get(t))!==null&&r!==void 0?r:null}}class J extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function Q(e,n,t,r){return w(n.concat(e),t,r,!1)}function X(e,n){const t=new Set;return e.forEach(r=>{const s=n.treeNodeMap.get(r);if(s!==void 0){let o=s.parent;for(;o!==null&&!(o.disabled||t.has(o.key));)t.add(o.key),o=o.parent}}),t}function Y(e,n,t,r){const s=w(n,t,r,!1),o=w(e,t,r,!0),i=X(e,t),d=[];return s.forEach(f=>{(o.has(f)||i.has(f))&&d.push(f)}),d.forEach(f=>s.delete(f)),s}function E(e,n){const{checkedKeys:t,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:i,leafOnly:d,checkStrategy:f,allowNotLoaded:u}=e;if(!i)return r!==void 0?{checkedKeys:z(t,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:B(t,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(t),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=n;let c;s!==void 0?c=Y(s,t,n,u):r!==void 0?c=Q(r,t,n,u):c=w(t,n,u,!1);const v=f==="parent",N=f==="child"||d,g=c,A=new Set,C=Math.max.apply(null,Array.from(h.keys()));for(let b=C;b>=0;b-=1){const L=b===0,S=h.get(b);for(const a of S){if(a.isLeaf)continue;const{key:l,shallowLoaded:p}=a;if(N&&p&&a.children.forEach(y=>{!y.disabled&&!y.isLeaf&&y.shallowLoaded&&g.has(y.key)&&g.delete(y.key)}),a.disabled||!p)continue;let m=!0,k=!1,K=!0;for(const y of a.children){const O=y.key;if(!y.disabled){if(K&&(K=!1),g.has(O))k=!0;else if(A.has(O)){k=!0,m=!1;break}else if(m=!1,k)break}}m&&!K?(v&&a.children.forEach(y=>{!y.disabled&&g.has(y.key)&&g.delete(y.key)}),g.add(l)):k&&A.add(l),L&&N&&g.has(l)&&g.delete(l)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(A)}}function w(e,n,t,r){const{treeNodeMap:s,getChildren:o}=n,i=new Set,d=new Set(e);return e.forEach(f=>{const u=s.get(f);u!==void 0&&M(u,h=>{if(h.disabled)return G.STOP;const{key:c}=h;if(!i.has(c)&&(i.add(c),d.add(c),Z(h.rawNode,o))){if(r)return G.STOP;if(!t)throw new J}})}),d}function $(e,{includeGroup:n=!1,includeSelf:t=!0},r){var s;const o=r.treeNodeMap;let i=e==null?null:(s=o.get(e))!==null&&s!==void 0?s:null;const d={keyPath:[],treeNodePath:[],treeNode:i};if(i!=null&&i.ignored)return d.treeNode=null,d;for(;i;)!i.ignored&&(n||!i.isGroup)&&d.treeNodePath.push(i),i=i.parent;return d.treeNodePath.reverse(),t||d.treeNodePath.pop(),d.keyPath=d.treeNodePath.map(f=>f.key),d}function ee(e){if(e.length===0)return null;const n=e[0];return n.isGroup||n.ignored||n.disabled?n.getNext():n}function te(e,n){const t=e.siblings,r=t.length,{index:s}=e;return n?t[(s+1)%r]:s===t.length-1?null:t[s+1]}function _(e,n,{loop:t=!1,includeDisabled:r=!1}={}){const s=n==="prev"?ne:te,o={reverse:n==="prev"};let i=!1,d=null;function f(u){if(u!==null){if(u===e){if(!i)i=!0;else if(!e.disabled&&!e.isGroup){d=e;return}}else if((!u.disabled||r)&&!u.ignored&&!u.isGroup){d=u;return}if(u.isGroup){const h=T(u,o);h!==null?d=h:f(s(u,t))}else{const h=s(u,!1);if(h!==null)f(h);else{const c=re(u);c!=null&&c.isGroup?f(s(c,t)):t&&f(s(u,!0))}}}}return f(e),d}function ne(e,n){const t=e.siblings,r=t.length,{index:s}=e;return n?t[(s-1+r)%r]:s===0?null:t[s-1]}function re(e){return e.parent}function T(e,n={}){const{reverse:t=!1}=n,{children:r}=e;if(r){const{length:s}=r,o=t?s-1:0,i=t?-1:s,d=t?-1:1;for(let f=o;f!==i;f+=d){const u=r[f];if(!u.disabled&&!u.ignored)if(u.isGroup){const h=T(u,n);if(h!==null)return h}else return u}}return null}const ie={getChild(){return this.ignored?null:T(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return _(this,"next",e)},getPrev(e={}){return _(this,"prev",e)}};function se(e,n){const t=n?new Set(n):void 0,r=[];function s(o){o.forEach(i=>{r.push(i),!(i.isLeaf||!i.children||i.ignored)&&(i.isGroup||t===void 0||t.has(i.key))&&s(i.children)})}return s(e),r}function ae(e,n){const t=e.key;for(;n;){if(n.key===t)return!0;n=n.parent}return!1}function D(e,n,t,r,s,o=null,i=0){const d=[];return e.forEach((f,u)=>{var h;const c=Object.create(r);if(c.rawNode=f,c.siblings=d,c.level=i,c.index=u,c.isFirstChild=u===0,c.isLastChild=u+1===e.length,c.parent=o,!c.ignored){const v=s(f);Array.isArray(v)&&(c.children=D(v,n,t,r,s,c,i+1))}d.push(c),n.set(c.key,c),t.has(i)||t.set(i,[]),(h=t.get(i))===null||h===void 0||h.push(c)}),d}function ue(e,n={}){var t;const r=new Map,s=new Map,{getDisabled:o=W,getIgnored:i=q,getIsGroup:d=H,getKey:f=U}=n,u=(t=n.getChildren)!==null&&t!==void 0?t:j,h=n.ignoreEmptyChildren?a=>{const l=u(a);return Array.isArray(l)?l.length?l:null:l}:u,c=Object.assign({get key(){return f(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return d(this.rawNode)},get isLeaf(){return R(this.rawNode,h)},get shallowLoaded(){return V(this.rawNode,h)},get ignored(){return i(this.rawNode)},contains(a){return ae(this,a)}},ie),v=D(e,r,s,c,h);function N(a){if(a==null)return null;const l=r.get(a);return l&&!l.isGroup&&!l.ignored?l:null}function g(a){if(a==null)return null;const l=r.get(a);return l&&!l.ignored?l:null}function A(a,l){const p=g(a);return p?p.getPrev(l):null}function C(a,l){const p=g(a);return p?p.getNext(l):null}function b(a){const l=g(a);return l?l.getParent():null}function L(a){const l=g(a);return l?l.getChild():null}const S={treeNodes:v,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(a){return se(v,a)},getNode:N,getPrev:A,getNext:C,getParent:b,getChild:L,getFirstAvailableNode(){return ee(v)},getPath(a,l={}){return $(a,l,S)},getCheckedKeys(a,l={}){const{cascade:p=!0,leafOnly:m=!1,checkStrategy:k="all",allowNotLoaded:K=!1}=l;return E({checkedKeys:P(a),indeterminateKeys:x(a),cascade:p,leafOnly:m,checkStrategy:k,allowNotLoaded:K},S)},check(a,l,p={}){const{cascade:m=!0,leafOnly:k=!1,checkStrategy:K="all",allowNotLoaded:y=!1}=p;return E({checkedKeys:P(l),indeterminateKeys:x(l),keysToCheck:a==null?[]:I(a),cascade:m,leafOnly:k,checkStrategy:K,allowNotLoaded:y},S)},uncheck(a,l,p={}){const{cascade:m=!0,leafOnly:k=!1,checkStrategy:K="all",allowNotLoaded:y=!1}=p;return E({checkedKeys:P(l),indeterminateKeys:x(l),keysToUncheck:a==null?[]:I(a),cascade:m,leafOnly:k,checkStrategy:K,allowNotLoaded:y},S)},getNonLeafKeys(a={}){return F(v,a)}};return S}export{ue as a,le as c}; diff --git a/web/dist/assets/v3-infinite-loading-1ff9ffe7.css b/web/dist/assets/v3-infinite-loading-1ff9ffe7.css new file mode 100644 index 00000000..4cc91e4b --- /dev/null +++ b/web/dist/assets/v3-infinite-loading-1ff9ffe7.css @@ -0,0 +1 @@ +.container[data-v-d3e37633]{box-sizing:initial;display:inline-block;text-align:center;border-radius:50%;overflow:hidden}.spinner[data-v-d3e37633]{box-sizing:initial;border:2px solid #a1a1a1;border-right-color:transparent;width:23px;height:23px;border-radius:50%;animation:spin-d3e37633 .9s linear infinite}@keyframes spin-d3e37633{to{transform:rotate(360deg)}}.state-error[data-v-a7077831]{display:flex;flex-direction:column;align-items:center}.retry[data-v-a7077831]{margin-top:8px;padding:2px 6px 4px;width:60px;color:inherit;font-size:14px;font-family:inherit;background:transparent;border:2px solid currentColor;border-radius:5px;outline:none;cursor:pointer}.retry[data-v-a7077831]:hover{opacity:.8} diff --git a/web/dist/assets/v3-infinite-loading-e5c2e8bf.js b/web/dist/assets/v3-infinite-loading-e5c2e8bf.js new file mode 100644 index 00000000..ac22fc6d --- /dev/null +++ b/web/dist/assets/v3-infinite-loading-e5c2e8bf.js @@ -0,0 +1 @@ +import{d as L,r as v,S as C,w as $,j as H,I as M,o as x,c as h,z as N,v as O,a as i,U as u,V,M as g,O as y,y as E,W as D,X as R}from"./@vue-e0e89260.js";function T(t,o){const n=t.getBoundingClientRect();if(!o)return n.top>=0&&n.bottom<=window.innerHeight;const e=o.getBoundingClientRect();return n.top>=e.top&&n.bottom<=e.bottom}async function U(t){return await E(),t.value instanceof HTMLElement?t.value:t.value?document.querySelector(t.value):null}function w(t){let o=`0px 0px ${t.distance}px 0px`;t.top&&(o=`${t.distance}px 0px 0px 0px`);const n=new IntersectionObserver(e=>{e[0].isIntersecting&&(t.firstload&&t.emit(),t.firstload=!0)},{root:t.parentEl,rootMargin:o});return n.observe(t.infiniteLoading.value),n}const I=(t,o)=>{const n=t.__vccOpts||t;for(const[e,c]of o)n[e]=c;return n},j={},q=t=>(D("data-v-d3e37633"),t=t(),R(),t),z={class:"container"},W=q(()=>i("div",{class:"spinner"},null,-1)),A=[W];function F(t,o){return x(),h("div",z,A)}const G=I(j,[["render",F],["__scopeId","data-v-d3e37633"]]),J={class:"state-error"},K=L({__name:"InfiniteLoading",props:{top:{type:Boolean,default:!1},target:{},distance:{default:0},identifier:{},firstload:{type:Boolean,default:!0},slots:{}},emits:["infinite"],setup(t,{emit:o}){const n=t;let e=null,c=0;const d=v(null),s=v(""),{top:p,firstload:k,distance:S}=n,{identifier:_,target:B}=C(n),a={infiniteLoading:d,top:p,firstload:k,distance:S,parentEl:null,emit(){c=(a.parentEl||document.documentElement).scrollHeight,m.loading(),o("infinite",m)}},m={loading(){s.value="loading"},async loaded(){s.value="loaded";const r=a.parentEl||document.documentElement;await E(),p&&(r.scrollTop=r.scrollHeight-c),T(d.value,a.parentEl)&&a.emit()},complete(){s.value="complete",e==null||e.disconnect()},error(){s.value="error"}};return $(_,()=>{e==null||e.disconnect(),e=w(a)}),H(async()=>{a.parentEl=await U(B),e=w(a)}),M(()=>{e==null||e.disconnect()}),(r,f)=>(x(),h("div",{ref_key:"infiniteLoading",ref:d,style:{"min-height":"1px"}},[N(i("div",null,[u(r.$slots,"spinner",{},()=>[V(G)],!0)],512),[[O,s.value=="loading"]]),s.value=="complete"?u(r.$slots,"complete",{key:0},()=>{var l;return[i("span",null,g(((l=r.slots)==null?void 0:l.complete)||"No more results!"),1)]},!0):y("",!0),s.value=="error"?u(r.$slots,"error",{key:1,retry:a.emit},()=>{var l;return[i("span",J,[i("span",null,g(((l=r.slots)==null?void 0:l.error)||"Oops something went wrong!"),1),i("button",{class:"retry",onClick:f[0]||(f[0]=(...b)=>a.emit&&a.emit(...b))},"retry")])]},!0):y("",!0)],512))}}),X=I(K,[["__scopeId","data-v-a7077831"]]);export{X as W}; diff --git a/web/dist/assets/vdirs-b0483831.js b/web/dist/assets/vdirs-b0483831.js new file mode 100644 index 00000000..02dd9f6e --- /dev/null +++ b/web/dist/assets/vdirs-b0483831.js @@ -0,0 +1 @@ +import{o as c,a as u}from"./evtd-b614532e.js";const i="@@mmoContext",x={mounted(n,{value:e}){n[i]={handler:void 0},typeof e=="function"&&(n[i].handler=e,c("mousemoveoutside",n,e))},updated(n,{value:e}){const t=n[i];typeof e=="function"?t.handler?t.handler!==e&&(u("mousemoveoutside",n,t.handler),t.handler=e,c("mousemoveoutside",n,e)):(n[i].handler=e,c("mousemoveoutside",n,e)):t.handler&&(u("mousemoveoutside",n,t.handler),t.handler=void 0)},unmounted(n){const{handler:e}=n[i];e&&u("mousemoveoutside",n,e),n[i].handler=void 0}},Z=x,o="@@coContext",f={mounted(n,{value:e,modifiers:t}){n[o]={handler:void 0},typeof e=="function"&&(n[o].handler=e,c("clickoutside",n,e,{capture:t.capture}))},updated(n,{value:e,modifiers:t}){const d=n[o];typeof e=="function"?d.handler?d.handler!==e&&(u("clickoutside",n,d.handler,{capture:t.capture}),d.handler=e,c("clickoutside",n,e,{capture:t.capture})):(n[o].handler=e,c("clickoutside",n,e,{capture:t.capture})):d.handler&&(u("clickoutside",n,d.handler,{capture:t.capture}),d.handler=void 0)},unmounted(n,{modifiers:e}){const{handler:t}=n[o];t&&u("clickoutside",n,t,{capture:e.capture}),n[o].handler=void 0}},z=f;function m(n,e){console.error(`[vdirs/${n}]: ${e}`)}class l{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,t){const{elementZIndex:d}=this;if(t!==void 0){e.style.zIndex=`${t}`,d.delete(e);return}const{nextZIndex:s}=this;d.has(e)&&d.get(e)+1===this.nextZIndex||(e.style.zIndex=`${s}`,d.set(e,s),this.nextZIndex=s+1,this.squashState())}unregister(e,t){const{elementZIndex:d}=this;d.has(e)?d.delete(e):t===void 0&&m("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((t,d)=>t[1]-d[1]),this.nextZIndex=2e3,e.forEach(t=>{const d=t[0],s=this.nextZIndex++;`${s}`!==d.style.zIndex&&(d.style.zIndex=`${s}`)})}}const a=new l,r="@@ziContext",I={mounted(n,e){const{value:t={}}=e,{zIndex:d,enabled:s}=t;n[r]={enabled:!!s,initialized:!1},s&&(a.ensureZIndex(n,d),n[r].initialized=!0)},updated(n,e){const{value:t={}}=e,{zIndex:d,enabled:s}=t,h=n[r].enabled;s&&!h&&(a.ensureZIndex(n,d),n[r].initialized=!0),n[r].enabled=!!s},unmounted(n,e){if(!n[r].initialized)return;const{value:t={}}=e,{zIndex:d}=t;a.unregister(n,d)}},g=I;export{z as c,Z as m,g as z}; diff --git a/web/dist/assets/vfonts-7afd136d.css b/web/dist/assets/vfonts-7afd136d.css new file mode 100644 index 00000000..afcedec3 --- /dev/null +++ b/web/dist/assets/vfonts-7afd136d.css @@ -0,0 +1 @@ +@font-face{font-family:v-sans;font-weight:400;src:url(/assets/LatoLatin-Regular-ddd4ef7f.woff2)}@font-face{font-family:v-sans;font-weight:600;src:url(/assets/LatoLatin-Semibold-267eef30.woff2)}@font-face{font-family:v-mono;font-weight:400;src:url(/assets/FiraCode-Regular-f13d1ece.woff2)} diff --git a/web/dist/assets/vooks-a50491fd.js b/web/dist/assets/vooks-a50491fd.js new file mode 100644 index 00000000..adef0668 --- /dev/null +++ b/web/dist/assets/vooks-a50491fd.js @@ -0,0 +1 @@ +import{r as f,Y as c,w as q,n as k,g as U,j as Y,h as g,k as B,E as V}from"./@vue-e0e89260.js";import{o as h,a as v}from"./evtd-b614532e.js";function N(e){const n=f(!!e.value);if(n.value)return c(n);const t=q(e,o=>{o&&(n.value=!0,t())});return c(n)}function ee(e){const n=k(e),t=f(n.value);return q(n,o=>{t.value=o}),typeof e=="function"?t:{__v_isRef:!0,get value(){return t.value},set value(o){e.set(o)}}}function I(){return U()!==null}const $=typeof window<"u";let y,E;const X=()=>{var e,n;y=$?(n=(e=document)===null||e===void 0?void 0:e.fonts)===null||n===void 0?void 0:n.ready:void 0,E=!1,y!==void 0?y.then(()=>{E=!0}):E=!0};X();function ne(e){if(E)return;let n=!1;Y(()=>{E||y==null||y.then(()=>{n||e()})}),g(()=>{n=!0})}const M=f(null);function D(e){if(e.clientX>0||e.clientY>0)M.value={x:e.clientX,y:e.clientY};else{const{target:n}=e;if(n instanceof Element){const{left:t,top:o,width:u,height:i}=n.getBoundingClientRect();t>0||o>0?M.value={x:t+u/2,y:o+i/2}:M.value={x:0,y:0}}else M.value=null}}let L=0,H=!0;function te(){if(!$)return c(f(null));L===0&&h("click",document,D,!0);const e=()=>{L+=1};return H&&(H=I())?(B(e),g(()=>{L-=1,L===0&&v("click",document,D,!0)})):e(),c(M)}const K=f(void 0);let C=0;function S(){K.value=Date.now()}let F=!0;function ie(e){if(!$)return c(f(!1));const n=f(!1);let t=null;function o(){t!==null&&window.clearTimeout(t)}function u(){o(),n.value=!0,t=window.setTimeout(()=>{n.value=!1},e)}C===0&&h("click",window,S,!0);const i=()=>{C+=1,h("click",window,u,!0)};return F&&(F=I())?(B(i),g(()=>{C-=1,C===0&&v("click",window,S,!0),v("click",window,u,!0),o()})):i(),c(n)}let T=0;const O=typeof window<"u"&&window.matchMedia!==void 0,p=f(null);let r,w;function x(e){e.matches&&(p.value="dark")}function P(e){e.matches&&(p.value="light")}function Q(){r=window.matchMedia("(prefers-color-scheme: dark)"),w=window.matchMedia("(prefers-color-scheme: light)"),r.matches?p.value="dark":w.matches?p.value="light":p.value=null,r.addEventListener?(r.addEventListener("change",x),w.addEventListener("change",P)):r.addListener&&(r.addListener(x),w.addListener(P))}function z(){"removeEventListener"in r?(r.removeEventListener("change",x),w.removeEventListener("change",P)):"removeListener"in r&&(r.removeListener(x),w.removeListener(P)),r=void 0,w=void 0}let R=!0;function ae(){return O?(T===0&&Q(),R&&(R=I())&&(B(()=>{T+=1}),g(()=>{T-=1,T===0&&z()})),c(p)):c(p)}function oe(e,n){return q(e,t=>{t!==void 0&&(n.value=t)}),k(()=>e.value===void 0?n.value:e.value)}function ue(){const e=f(!1);return Y(()=>{e.value=!0}),c(e)}function se(e,n){return k(()=>{for(const t of n)if(e[t]!==void 0)return e[t];return e[n[n.length-1]]})}const A=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function re(){return A}const G={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};function J(e){return`(min-width: ${e}px)`}const b={};function le(e=G){if(!$)return k(()=>[]);if(typeof window.matchMedia!="function")return k(()=>[]);const n=f({}),t=Object.keys(e),o=(u,i)=>{u.matches?n.value[i]=!0:n.value[i]=!1};return t.forEach(u=>{const i=e[u];let s,l;b[i]===void 0?(s=window.matchMedia(J(i)),s.addEventListener?s.addEventListener("change",a=>{l.forEach(d=>{d(a,u)})}):s.addListener&&s.addListener(a=>{l.forEach(d=>{d(a,u)})}),l=new Set,b[i]={mql:s,cbs:l}):(s=b[i].mql,l=b[i].cbs),l.add(o),s.matches&&l.forEach(a=>{a(s,u)})}),g(()=>{t.forEach(u=>{const{cbs:i}=b[e[u]];i.has(o)&&i.delete(o)})}),k(()=>{const{value:u}=n;return t.filter(i=>u[i])})}function fe(e={},n){const t=V({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:o,keyup:u}=e,i=a=>{switch(a.key){case"Control":t.ctrl=!0;break;case"Meta":t.command=!0,t.win=!0;break;case"Shift":t.shift=!0;break;case"Tab":t.tab=!0;break}o!==void 0&&Object.keys(o).forEach(d=>{if(d!==a.key)return;const m=o[d];if(typeof m=="function")m(a);else{const{stop:j=!1,prevent:_=!1}=m;j&&a.stopPropagation(),_&&a.preventDefault(),m.handler(a)}})},s=a=>{switch(a.key){case"Control":t.ctrl=!1;break;case"Meta":t.command=!1,t.win=!1;break;case"Shift":t.shift=!1;break;case"Tab":t.tab=!1;break}u!==void 0&&Object.keys(u).forEach(d=>{if(d!==a.key)return;const m=u[d];if(typeof m=="function")m(a);else{const{stop:j=!1,prevent:_=!1}=m;j&&a.stopPropagation(),_&&a.preventDefault(),m.handler(a)}})},l=()=>{(n===void 0||n.value)&&(h("keydown",document,i),h("keyup",document,s)),n!==void 0&&q(n,a=>{a?(h("keydown",document,i),h("keyup",document,s)):(v("keydown",document,i),v("keyup",document,s))})};return I()?(B(l),g(()=>{(n===void 0||n.value)&&(v("keydown",document,i),v("keyup",document,s))})):l(),c(t)}export{re as a,oe as b,se as c,fe as d,ie as e,te as f,le as g,N as h,ue as i,ae as j,ne as o,ee as u}; diff --git a/web/dist/assets/vue-4ed993c7.js b/web/dist/assets/vue-4ed993c7.js new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/web/dist/assets/vue-4ed993c7.js @@ -0,0 +1 @@ + diff --git a/web/dist/assets/vue-router-b8e3382f.js b/web/dist/assets/vue-router-b8e3382f.js new file mode 100644 index 00000000..616f6884 --- /dev/null +++ b/web/dist/assets/vue-router-b8e3382f.js @@ -0,0 +1,5 @@ +import{Z as tt,_ as F,n as N,E as Be,y as nt,i as B,d as qe,s as ze,p as ae,r as rt,w as st}from"./@vue-e0e89260.js";/*! + * vue-router v4.1.6 + * (c) 2022 Eduardo San Martin Morote + * @license MIT + */const z=typeof window<"u";function ot(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const S=Object.assign;function le(e,t){const n={};for(const r in t){const s=t[r];n[r]=I(s)?s.map(e):e(s)}return n}const W=()=>{},I=Array.isArray,ct=/\/$/,it=e=>e.replace(ct,"");function ue(e,t,n="/"){let r,s={},l="",d="";const g=t.indexOf("#");let i=t.indexOf("?");return g=0&&(i=-1),i>-1&&(r=t.slice(0,i),l=t.slice(i+1,g>-1?g:t.length),s=e(l)),g>-1&&(r=r||t.slice(0,g),d=t.slice(g,t.length)),r=ft(r??t,n),{fullPath:r+(l&&"?")+l+d,path:r,query:s,hash:d}}function at(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Se(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function lt(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&G(t.matched[r],n.matched[s])&&Ge(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function G(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Ge(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!ut(e[n],t[n]))return!1;return!0}function ut(e,t){return I(e)?ke(e,t):I(t)?ke(t,e):e===t}function ke(e,t){return I(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function ft(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let s=n.length-1,l,d;for(l=0;l1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(l-(l===r.length?1:0)).join("/")}var X;(function(e){e.pop="pop",e.push="push"})(X||(X={}));var Y;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Y||(Y={}));function ht(e){if(!e)if(z){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),it(e)}const dt=/^[^#]+#/;function pt(e,t){return e.replace(dt,"#")+t}function mt(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const ee=()=>({left:window.pageXOffset,top:window.pageYOffset});function gt(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=mt(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function Ce(e,t){return(history.state?history.state.position-t:-1)+e}const he=new Map;function vt(e,t){he.set(e,t)}function yt(e){const t=he.get(e);return he.delete(e),t}let Rt=()=>location.protocol+"//"+location.host;function Ke(e,t){const{pathname:n,search:r,hash:s}=t,l=e.indexOf("#");if(l>-1){let g=s.includes(e.slice(l))?e.slice(l).length:1,i=s.slice(g);return i[0]!=="/"&&(i="/"+i),Se(i,"")}return Se(n,e)+r+s}function Et(e,t,n,r){let s=[],l=[],d=null;const g=({state:u})=>{const m=Ke(e,location),R=n.value,b=t.value;let C=0;if(u){if(n.value=m,t.value=u,d&&d===R){d=null;return}C=b?u.position-b.position:0}else r(m);s.forEach(E=>{E(n.value,R,{delta:C,type:X.pop,direction:C?C>0?Y.forward:Y.back:Y.unknown})})};function i(){d=n.value}function f(u){s.push(u);const m=()=>{const R=s.indexOf(u);R>-1&&s.splice(R,1)};return l.push(m),m}function o(){const{history:u}=window;u.state&&u.replaceState(S({},u.state,{scroll:ee()}),"")}function a(){for(const u of l)u();l=[],window.removeEventListener("popstate",g),window.removeEventListener("beforeunload",o)}return window.addEventListener("popstate",g),window.addEventListener("beforeunload",o),{pauseListeners:i,listen:f,destroy:a}}function be(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ee():null}}function Pt(e){const{history:t,location:n}=window,r={value:Ke(e,n)},s={value:t.state};s.value||l(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function l(i,f,o){const a=e.indexOf("#"),u=a>-1?(n.host&&document.querySelector("base")?e:e.slice(a))+i:Rt()+e+i;try{t[o?"replaceState":"pushState"](f,"",u),s.value=f}catch(m){console.error(m),n[o?"replace":"assign"](u)}}function d(i,f){const o=S({},t.state,be(s.value.back,i,s.value.forward,!0),f,{position:s.value.position});l(i,o,!0),r.value=i}function g(i,f){const o=S({},s.value,t.state,{forward:i,scroll:ee()});l(o.current,o,!0);const a=S({},be(r.value,i,null),{position:o.position+1},f);l(i,a,!1),r.value=i}return{location:r,state:s,push:g,replace:d}}function wt(e){e=ht(e);const t=Pt(e),n=Et(e,t.state,t.location,t.replace);function r(l,d=!0){d||n.pauseListeners(),history.go(l)}const s=S({location:"",base:e,go:r,createHref:pt.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function ln(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),wt(e)}function St(e){return typeof e=="string"||e&&typeof e=="object"}function Ve(e){return typeof e=="string"||typeof e=="symbol"}const H={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Ue=Symbol("");var Ae;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Ae||(Ae={}));function K(e,t){return S(new Error,{type:e,[Ue]:!0},t)}function $(e,t){return e instanceof Error&&Ue in e&&(t==null||!!(e.type&t))}const _e="[^/]+?",kt={sensitive:!1,strict:!1,start:!0,end:!0},Ct=/[.+*?^${}()[\]/\\]/g;function bt(e,t){const n=S({},kt,t),r=[];let s=n.start?"^":"";const l=[];for(const f of e){const o=f.length?[]:[90];n.strict&&!f.length&&(s+="/");for(let a=0;at.length?t.length===1&&t[0]===40+40?1:-1:0}function _t(e,t){let n=0;const r=e.score,s=t.score;for(;n0&&t[t.length-1]<0}const Ot={type:0,value:""},xt=/[a-zA-Z0-9_]/;function Mt(e){if(!e)return[[]];if(e==="/")return[[Ot]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${n})/"${f}": ${m}`)}let n=0,r=n;const s=[];let l;function d(){l&&s.push(l),l=[]}let g=0,i,f="",o="";function a(){f&&(n===0?l.push({type:0,value:f}):n===1||n===2||n===3?(l.length>1&&(i==="*"||i==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),l.push({type:1,value:f,regexp:o,repeatable:i==="*"||i==="+",optional:i==="*"||i==="?"})):t("Invalid state to consume buffer"),f="")}function u(){f+=i}for(;g{d(w)}:W}function d(o){if(Ve(o)){const a=r.get(o);a&&(r.delete(o),n.splice(n.indexOf(a),1),a.children.forEach(d),a.alias.forEach(d))}else{const a=n.indexOf(o);a>-1&&(n.splice(a,1),o.record.name&&r.delete(o.record.name),o.children.forEach(d),o.alias.forEach(d))}}function g(){return n}function i(o){let a=0;for(;a=0&&(o.record.path!==n[a].record.path||!De(o,n[a]));)a++;n.splice(a,0,o),o.record.name&&!Me(o)&&r.set(o.record.name,o)}function f(o,a){let u,m={},R,b;if("name"in o&&o.name){if(u=r.get(o.name),!u)throw K(1,{location:o});b=u.record.name,m=S(xe(a.params,u.keys.filter(w=>!w.optional).map(w=>w.name)),o.params&&xe(o.params,u.keys.map(w=>w.name))),R=u.stringify(m)}else if("path"in o)R=o.path,u=n.find(w=>w.re.test(R)),u&&(m=u.parse(R),b=u.record.name);else{if(u=a.name?r.get(a.name):n.find(w=>w.re.test(a.path)),!u)throw K(1,{location:o,currentLocation:a});b=u.record.name,m=S({},a.params,o.params),R=u.stringify(m)}const C=[];let E=u;for(;E;)C.unshift(E.record),E=E.parent;return{name:b,path:R,params:m,matched:C,meta:Ht(C)}}return e.forEach(o=>l(o)),{addRoute:l,resolve:f,removeRoute:d,getRoutes:g,getRecordMatcher:s}}function xe(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Lt(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:$t(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function $t(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="boolean"?n:n[r];return t}function Me(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ht(e){return e.reduce((t,n)=>S(t,n.meta),{})}function Ne(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function De(e,t){return t.children.some(n=>n===e||De(e,n))}const Qe=/#/g,Tt=/&/g,jt=/\//g,Bt=/=/g,qt=/\?/g,Fe=/\+/g,zt=/%5B/g,Gt=/%5D/g,We=/%5E/g,Kt=/%60/g,Ye=/%7B/g,Vt=/%7C/g,Xe=/%7D/g,Ut=/%20/g;function me(e){return encodeURI(""+e).replace(Vt,"|").replace(zt,"[").replace(Gt,"]")}function Dt(e){return me(e).replace(Ye,"{").replace(Xe,"}").replace(We,"^")}function de(e){return me(e).replace(Fe,"%2B").replace(Ut,"+").replace(Qe,"%23").replace(Tt,"%26").replace(Kt,"`").replace(Ye,"{").replace(Xe,"}").replace(We,"^")}function Qt(e){return de(e).replace(Bt,"%3D")}function Ft(e){return me(e).replace(Qe,"%23").replace(qt,"%3F")}function Wt(e){return e==null?"":Ft(e).replace(jt,"%2F")}function J(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function Yt(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;sl&&de(l)):[r&&de(r)]).forEach(l=>{l!==void 0&&(t+=(t.length?"&":"")+n,l!=null&&(t+="="+l))})}return t}function Xt(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=I(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const Zt=Symbol(""),Le=Symbol(""),te=Symbol(""),ge=Symbol(""),pe=Symbol("");function Q(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e,reset:n}}function T(e,t,n,r,s){const l=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((d,g)=>{const i=a=>{a===!1?g(K(4,{from:n,to:t})):a instanceof Error?g(a):St(a)?g(K(2,{from:t,to:a})):(l&&r.enterCallbacks[s]===l&&typeof a=="function"&&l.push(a),d())},f=e.call(r&&r.instances[s],t,n,i);let o=Promise.resolve(f);e.length<3&&(o=o.then(i)),o.catch(a=>g(a))})}function fe(e,t,n,r){const s=[];for(const l of e)for(const d in l.components){let g=l.components[d];if(!(t!=="beforeRouteEnter"&&!l.instances[d]))if(Jt(g)){const f=(g.__vccOpts||g)[t];f&&s.push(T(f,n,r,l,d))}else{let i=g();s.push(()=>i.then(f=>{if(!f)return Promise.reject(new Error(`Couldn't resolve component "${d}" at "${l.path}"`));const o=ot(f)?f.default:f;l.components[d]=o;const u=(o.__vccOpts||o)[t];return u&&T(u,n,r,l,d)()}))}}return s}function Jt(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function $e(e){const t=B(te),n=B(ge),r=N(()=>t.resolve(F(e.to))),s=N(()=>{const{matched:i}=r.value,{length:f}=i,o=i[f-1],a=n.matched;if(!o||!a.length)return-1;const u=a.findIndex(G.bind(null,o));if(u>-1)return u;const m=He(i[f-2]);return f>1&&He(o)===m&&a[a.length-1].path!==m?a.findIndex(G.bind(null,i[f-2])):u}),l=N(()=>s.value>-1&&rn(n.params,r.value.params)),d=N(()=>s.value>-1&&s.value===n.matched.length-1&&Ge(n.params,r.value.params));function g(i={}){return nn(i)?t[F(e.replace)?"replace":"push"](F(e.to)).catch(W):Promise.resolve()}return{route:r,href:N(()=>r.value.href),isActive:l,isExactActive:d,navigate:g}}const en=qe({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:$e,setup(e,{slots:t}){const n=Be($e(e)),{options:r}=B(te),s=N(()=>({[Te(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Te(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const l=t.default&&t.default(n);return e.custom?l:ze("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},l)}}}),tn=en;function nn(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function rn(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!I(s)||s.length!==r.length||r.some((l,d)=>l!==s[d]))return!1}return!0}function He(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Te=(e,t,n)=>e??t??n,sn=qe({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=B(pe),s=N(()=>e.route||r.value),l=B(Le,0),d=N(()=>{let f=F(l);const{matched:o}=s.value;let a;for(;(a=o[f])&&!a.components;)f++;return f}),g=N(()=>s.value.matched[d.value]);ae(Le,N(()=>d.value+1)),ae(Zt,g),ae(pe,s);const i=rt();return st(()=>[i.value,g.value,e.name],([f,o,a],[u,m,R])=>{o&&(o.instances[a]=f,m&&m!==o&&f&&f===u&&(o.leaveGuards.size||(o.leaveGuards=m.leaveGuards),o.updateGuards.size||(o.updateGuards=m.updateGuards))),f&&o&&(!m||!G(o,m)||!u)&&(o.enterCallbacks[a]||[]).forEach(b=>b(f))},{flush:"post"}),()=>{const f=s.value,o=e.name,a=g.value,u=a&&a.components[o];if(!u)return je(n.default,{Component:u,route:f});const m=a.props[o],R=m?m===!0?f.params:typeof m=="function"?m(f):m:null,C=ze(u,S({},R,t,{onVnodeUnmounted:E=>{E.component.isUnmounted&&(a.instances[o]=null)},ref:i}));return je(n.default,{Component:C,route:f})||C}}});function je(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const on=sn;function un(e){const t=It(e.routes,e),n=e.parseQuery||Yt,r=e.stringifyQuery||Ie,s=e.history,l=Q(),d=Q(),g=Q(),i=tt(H);let f=H;z&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const o=le.bind(null,c=>""+c),a=le.bind(null,Wt),u=le.bind(null,J);function m(c,p){let h,v;return Ve(c)?(h=t.getRecordMatcher(c),v=p):v=c,t.addRoute(v,h)}function R(c){const p=t.getRecordMatcher(c);p&&t.removeRoute(p)}function b(){return t.getRoutes().map(c=>c.record)}function C(c){return!!t.getRecordMatcher(c)}function E(c,p){if(p=S({},p||i.value),typeof c=="string"){const y=ue(n,c,p.path),_=t.resolve({path:y.path},p),D=s.createHref(y.fullPath);return S(y,_,{params:u(_.params),hash:J(y.hash),redirectedFrom:void 0,href:D})}let h;if("path"in c)h=S({},c,{path:ue(n,c.path,p.path).path});else{const y=S({},c.params);for(const _ in y)y[_]==null&&delete y[_];h=S({},c,{params:a(c.params)}),p.params=a(p.params)}const v=t.resolve(h,p),k=c.hash||"";v.params=o(u(v.params));const A=at(r,S({},c,{hash:Dt(k),path:v.path})),P=s.createHref(A);return S({fullPath:A,hash:k,query:r===Ie?Xt(c.query):c.query||{}},v,{redirectedFrom:void 0,href:P})}function w(c){return typeof c=="string"?ue(n,c,i.value.path):S({},c)}function O(c,p){if(f!==c)return K(8,{from:p,to:c})}function M(c){return V(c)}function j(c){return M(S(w(c),{replace:!0}))}function L(c){const p=c.matched[c.matched.length-1];if(p&&p.redirect){const{redirect:h}=p;let v=typeof h=="function"?h(c):h;return typeof v=="string"&&(v=v.includes("?")||v.includes("#")?v=w(v):{path:v},v.params={}),S({query:c.query,hash:c.hash,params:"path"in v?{}:c.params},v)}}function V(c,p){const h=f=E(c),v=i.value,k=c.state,A=c.force,P=c.replace===!0,y=L(h);if(y)return V(S(w(y),{state:typeof y=="object"?S({},k,y.state):k,force:A,replace:P}),p||h);const _=h;_.redirectedFrom=p;let D;return!A&<(r,v,h)&&(D=K(16,{to:_,from:v}),Pe(v,v,!0,!1)),(D?Promise.resolve(D):ve(_,v)).catch(x=>$(x)?$(x,2)?x:se(x):re(x,_,v)).then(x=>{if(x){if($(x,2))return V(S({replace:P},w(x.to),{state:typeof x.to=="object"?S({},k,x.to.state):k,force:A}),p||_)}else x=Re(_,v,!0,P,k);return ye(_,v,x),x})}function Ze(c,p){const h=O(c,p);return h?Promise.reject(h):Promise.resolve()}function ve(c,p){let h;const[v,k,A]=cn(c,p);h=fe(v.reverse(),"beforeRouteLeave",c,p);for(const y of v)y.leaveGuards.forEach(_=>{h.push(T(_,c,p))});const P=Ze.bind(null,c,p);return h.push(P),q(h).then(()=>{h=[];for(const y of l.list())h.push(T(y,c,p));return h.push(P),q(h)}).then(()=>{h=fe(k,"beforeRouteUpdate",c,p);for(const y of k)y.updateGuards.forEach(_=>{h.push(T(_,c,p))});return h.push(P),q(h)}).then(()=>{h=[];for(const y of c.matched)if(y.beforeEnter&&!p.matched.includes(y))if(I(y.beforeEnter))for(const _ of y.beforeEnter)h.push(T(_,c,p));else h.push(T(y.beforeEnter,c,p));return h.push(P),q(h)}).then(()=>(c.matched.forEach(y=>y.enterCallbacks={}),h=fe(A,"beforeRouteEnter",c,p),h.push(P),q(h))).then(()=>{h=[];for(const y of d.list())h.push(T(y,c,p));return h.push(P),q(h)}).catch(y=>$(y,8)?y:Promise.reject(y))}function ye(c,p,h){for(const v of g.list())v(c,p,h)}function Re(c,p,h,v,k){const A=O(c,p);if(A)return A;const P=p===H,y=z?history.state:{};h&&(v||P?s.replace(c.fullPath,S({scroll:P&&y&&y.scroll},k)):s.push(c.fullPath,k)),i.value=c,Pe(c,p,h,P),se()}let U;function Je(){U||(U=s.listen((c,p,h)=>{if(!we.listening)return;const v=E(c),k=L(v);if(k){V(S(k,{replace:!0}),v).catch(W);return}f=v;const A=i.value;z&&vt(Ce(A.fullPath,h.delta),ee()),ve(v,A).catch(P=>$(P,12)?P:$(P,2)?(V(P.to,v).then(y=>{$(y,20)&&!h.delta&&h.type===X.pop&&s.go(-1,!1)}).catch(W),Promise.reject()):(h.delta&&s.go(-h.delta,!1),re(P,v,A))).then(P=>{P=P||Re(v,A,!1),P&&(h.delta&&!$(P,8)?s.go(-h.delta,!1):h.type===X.pop&&$(P,20)&&s.go(-1,!1)),ye(v,A,P)}).catch(W)}))}let ne=Q(),Ee=Q(),Z;function re(c,p,h){se(c);const v=Ee.list();return v.length?v.forEach(k=>k(c,p,h)):console.error(c),Promise.reject(c)}function et(){return Z&&i.value!==H?Promise.resolve():new Promise((c,p)=>{ne.add([c,p])})}function se(c){return Z||(Z=!c,Je(),ne.list().forEach(([p,h])=>c?h(c):p()),ne.reset()),c}function Pe(c,p,h,v){const{scrollBehavior:k}=e;if(!z||!k)return Promise.resolve();const A=!h&&yt(Ce(c.fullPath,0))||(v||!h)&&history.state&&history.state.scroll||null;return nt().then(()=>k(c,p,A)).then(P=>P&>(P)).catch(P=>re(P,c,p))}const oe=c=>s.go(c);let ce;const ie=new Set,we={currentRoute:i,listening:!0,addRoute:m,removeRoute:R,hasRoute:C,getRoutes:b,resolve:E,options:e,push:M,replace:j,go:oe,back:()=>oe(-1),forward:()=>oe(1),beforeEach:l.add,beforeResolve:d.add,afterEach:g.add,onError:Ee.add,isReady:et,install(c){const p=this;c.component("RouterLink",tn),c.component("RouterView",on),c.config.globalProperties.$router=p,Object.defineProperty(c.config.globalProperties,"$route",{enumerable:!0,get:()=>F(i)}),z&&!ce&&i.value===H&&(ce=!0,M(s.location).catch(k=>{}));const h={};for(const k in H)h[k]=N(()=>i.value[k]);c.provide(te,p),c.provide(ge,Be(h)),c.provide(pe,i);const v=c.unmount;ie.add(c),c.unmount=function(){ie.delete(c),ie.size<1&&(f=H,U&&U(),U=null,i.value=H,ce=!1,Z=!1),v()}}};return we}function q(e){return e.reduce((t,n)=>t.then(()=>n()),Promise.resolve())}function cn(e,t){const n=[],r=[],s=[],l=Math.max(t.matched.length,e.matched.length);for(let d=0;dG(f,g))?r.push(g):n.push(g));const i=e.matched[d];i&&(t.matched.find(f=>G(f,i))||s.push(i))}return[n,r,s]}function fn(){return B(te)}function hn(){return B(ge)}export{ln as a,hn as b,un as c,fn as u}; diff --git a/web/dist/assets/vueuc-59ca65c3.js b/web/dist/assets/vueuc-59ca65c3.js new file mode 100644 index 00000000..b9a4cfa7 --- /dev/null +++ b/web/dist/assets/vueuc-59ca65c3.js @@ -0,0 +1 @@ +import{a as K,o as se}from"./evtd-b614532e.js";import{j as Me,d as ce,p as G,e as Ce,g as Le}from"./seemly-76b7b838.js";import{e as He,F as Se,C as Ve,d as k,p as Ye,g as Te,i as fe,r as F,h as R,z as ze,u as Z,n as D,s as E,K as Xe,j as q,w as U,y as Ee,U as Ae,l as De,m as Ne,x as _e}from"./@vue-e0e89260.js";import{u as ee}from"./@css-render-580d83ec.js";import{h as je,u as ue,o as Pe,i as Ue}from"./vooks-a50491fd.js";import{z as Ke}from"./vdirs-b0483831.js";import{R as qe}from"./@juggle-41516555.js";import{C as Ge}from"./css-render-6a5c5852.js";function ae(n,e,t="default"){const r=e[t];if(r===void 0)throw new Error(`[vueuc/${n}]: slot[${t}] is empty.`);return r()}function de(n,e=!0,t=[]){return n.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&t.push(He(String(r)));return}if(Array.isArray(r)){de(r,e,t);return}if(r.type===Se){if(r.children===null)return;Array.isArray(r.children)&&de(r.children,e,t)}else r.type!==Ve&&t.push(r)}}),t}function he(n,e,t="default"){const r=e[t];if(r===void 0)throw new Error(`[vueuc/${n}]: slot[${t}] is empty.`);const o=de(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${n}]: slot[${t}] should have exactly one child.`)}let H=null;function Fe(){if(H===null&&(H=document.getElementById("v-binder-view-measurer"),H===null)){H=document.createElement("div"),H.id="v-binder-view-measurer";const{style:n}=H;n.position="fixed",n.left="0",n.right="0",n.top="0",n.bottom="0",n.pointerEvents="none",n.visibility="hidden",document.body.appendChild(H)}return H.getBoundingClientRect()}function Je(n,e){const t=Fe();return{top:e,left:n,height:0,width:0,right:t.width-n,bottom:t.height-e}}function oe(n){const e=n.getBoundingClientRect(),t=Fe();return{left:e.left-t.left,top:e.top-t.top,bottom:t.height+t.top-e.bottom,right:t.width+t.left-e.right,width:e.width,height:e.height}}function Qe(n){return n.nodeType===9?null:n.parentNode}function Be(n){if(n===null)return null;const e=Qe(n);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:t,overflowX:r,overflowY:o}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(t+o+r))return e}return Be(e)}const Ze=k({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(n){var e;Ye("VBinder",(e=Te())===null||e===void 0?void 0:e.proxy);const t=fe("VBinder",null),r=F(null),o=i=>{r.value=i,t&&n.syncTargetWithParent&&t.setTargetRef(i)};let l=[];const p=()=>{let i=r.value;for(;i=Be(i),i!==null;)l.push(i);for(const b of l)se("scroll",b,x,!0)},g=()=>{for(const i of l)K("scroll",i,x,!0);l=[]},a=new Set,m=i=>{a.size===0&&p(),a.has(i)||a.add(i)},y=i=>{a.has(i)&&a.delete(i),a.size===0&&g()},x=()=>{Me(d)},d=()=>{a.forEach(i=>i())},c=new Set,v=i=>{c.size===0&&se("resize",window,u),c.has(i)||c.add(i)},h=i=>{c.has(i)&&c.delete(i),c.size===0&&K("resize",window,u)},u=()=>{c.forEach(i=>i())};return R(()=>{K("resize",window,u),g()}),{targetRef:r,setTargetRef:o,addScrollListener:m,removeScrollListener:y,addResizeListener:v,removeResizeListener:h}},render(){return ae("binder",this.$slots)}}),$t=Ze,Mt=k({name:"Target",setup(){const{setTargetRef:n,syncTarget:e}=fe("VBinder");return{syncTarget:e,setTargetDirective:{mounted:n,updated:n}}},render(){const{syncTarget:n,setTargetDirective:e}=this;return n?ze(he("follower",this.$slots),[[e]]):he("follower",this.$slots)}});function pe(n,e){console.error(`[vueuc/${n}]: ${e}`)}const{c:W}=Ge(),te="vueuc-style";function me(n){return n&-n}class Re{constructor(e,t){this.l=e,this.min=t;const r=new Array(e+1);for(let o=0;oo)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let l=e*r;for(;e>0;)l+=t[e],e-=me(e);return l}getBound(e){let t=0,r=this.l;for(;r>t;){const o=Math.floor((t+r)/2),l=this.sum(o);if(l>e){r=o;continue}else if(l{const{to:e}=n;return e??"body"})}},render(){return this.showTeleport?this.disabled?ae("lazy-teleport",this.$slots):E(Xe,{disabled:this.disabled,to:this.mergedTo},ae("lazy-teleport",this.$slots)):null}}),J={top:"bottom",bottom:"top",left:"right",right:"left"},be={start:"end",center:"center",end:"start"},ie={top:"height",bottom:"height",left:"width",right:"width"},tt={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},nt={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},rt={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},ge={top:!0,bottom:!1,left:!0,right:!1},we={top:"end",bottom:"start",left:"end",right:"start"};function ot(n,e,t,r,o,l){if(!o||l)return{placement:n,top:0,left:0};const[p,g]=n.split("-");let a=g??"center",m={top:0,left:0};const y=(c,v,h)=>{let u=0,i=0;const b=t[c]-e[v]-e[c];return b>0&&r&&(h?i=ge[v]?b:-b:u=ge[v]?b:-b),{left:u,top:i}},x=p==="left"||p==="right";if(a!=="center"){const c=rt[n],v=J[c],h=ie[c];if(t[h]>e[h]){if(e[c]+e[h]e[v]&&(a=be[g])}else{const c=p==="bottom"||p==="top"?"left":"top",v=J[c],h=ie[c],u=(t[h]-e[h])/2;(e[c]e[v]?(a=we[c],m=y(h,c,x)):(a=we[v],m=y(h,v,x)))}let d=p;return e[p] *",{pointerEvents:"all"})])]),St=k({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(n){const e=fe("VBinder"),t=ue(()=>n.enabled!==void 0?n.enabled:n.show),r=F(null),o=F(null),l=()=>{const{syncTrigger:d}=n;d.includes("scroll")&&e.addScrollListener(a),d.includes("resize")&&e.addResizeListener(a)},p=()=>{e.removeScrollListener(a),e.removeResizeListener(a)};q(()=>{t.value&&(a(),l())});const g=ee();st.mount({id:"vueuc/binder",head:!0,anchorMetaName:te,ssr:g}),R(()=>{p()}),Pe(()=>{t.value&&a()});const a=()=>{if(!t.value)return;const d=r.value;if(d===null)return;const c=e.targetRef,{x:v,y:h,overlap:u}=n,i=v!==void 0&&h!==void 0?Je(v,h):oe(c);d.style.setProperty("--v-target-width",`${Math.round(i.width)}px`),d.style.setProperty("--v-target-height",`${Math.round(i.height)}px`);const{width:b,minWidth:z,placement:I,internalShift:C,flip:O}=n;d.setAttribute("v-placement",I),u?d.setAttribute("v-overlap",""):d.removeAttribute("v-overlap");const{style:B}=d;b==="target"?B.width=`${i.width}px`:b!==void 0?B.width=b:B.width="",z==="target"?B.minWidth=`${i.width}px`:z!==void 0?B.minWidth=z:B.minWidth="";const X=oe(d),N=oe(o.value),{left:_,top:s,placement:f}=ot(I,i,X,C,O,u),w=it(f,u),{left:$,top:M,transform:T}=lt(f,N,i,s,_,u);d.setAttribute("v-placement",f),d.style.setProperty("--v-offset-left",`${Math.round(_)}px`),d.style.setProperty("--v-offset-top",`${Math.round(s)}px`),d.style.transform=`translateX(${$}) translateY(${M}) ${T}`,d.style.setProperty("--v-transform-origin",w),d.style.transformOrigin=w};U(t,d=>{d?(l(),m()):p()});const m=()=>{Ee().then(a).catch(d=>console.error(d))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(d=>{U(Z(n,d),a)}),["teleportDisabled"].forEach(d=>{U(Z(n,d),m)}),U(Z(n,"syncTrigger"),d=>{d.includes("resize")?e.addResizeListener(a):e.removeResizeListener(a),d.includes("scroll")?e.addScrollListener(a):e.removeScrollListener(a)});const y=Ue(),x=ue(()=>{const{to:d}=n;if(d!==void 0)return d;y.value});return{VBinder:e,mergedEnabled:t,offsetContainerRef:o,followerRef:r,mergedTo:x,syncPosition:a}},render(){return E(et,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var n,e;const t=E("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[E("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n))]);return this.zindexable?ze(t,[[Ke,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):t}})}});class ut{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||qe)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const t of e){const r=this.elHandlersMap.get(t.target);r!==void 0&&r(t)}}registerHandler(e,t){this.elHandlersMap.set(e,t),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const ye=new ut,xe=k({name:"ResizeObserver",props:{onResize:Function},setup(n){let e=!1;const t=Te().proxy;function r(o){const{onResize:l}=n;l!==void 0&&l(o)}q(()=>{const o=t.$el;if(o===void 0){pe("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){pe("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(ye.registerHandler(o.nextElementSibling,r),e=!0)}),R(()=>{e&&ye.unregisterHandler(t.$el.nextElementSibling)})},render(){return Ae(this.$slots,"default")}});let Q;function at(){return Q===void 0&&("matchMedia"in window?Q=window.matchMedia("(pointer:coarse)").matches:Q=!1),Q}let le;function $e(){return le===void 0&&(le="chrome"in window?window.devicePixelRatio:1),le}const dt=W(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[W("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[W("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Tt=k({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(n){const e=ee();dt.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:te,ssr:e}),q(()=>{const{defaultScrollIndex:s,defaultScrollKey:f}=n;s!=null?v({index:s}):f!=null&&v({key:f})});let t=!1,r=!1;De(()=>{if(t=!1,!r){r=!0;return}v({top:x.value,left:y})}),Ne(()=>{t=!0,r||(r=!0)});const o=D(()=>{const s=new Map,{keyField:f}=n;return n.items.forEach((w,$)=>{s.set(w[f],$)}),s}),l=F(null),p=F(void 0),g=new Map,a=D(()=>{const{items:s,itemSize:f,keyField:w}=n,$=new Re(s.length,f);return s.forEach((M,T)=>{const S=M[w],A=g.get(S);A!==void 0&&$.add(T,A)}),$}),m=F(0);let y=0;const x=F(0),d=ue(()=>Math.max(a.value.getBound(x.value-ce(n.paddingTop))-1,0)),c=D(()=>{const{value:s}=p;if(s===void 0)return[];const{items:f,itemSize:w}=n,$=d.value,M=Math.min($+Math.ceil(s/w+1),f.length-1),T=[];for(let S=$;S<=M;++S)T.push(f[S]);return T}),v=(s,f)=>{if(typeof s=="number"){b(s,f,"auto");return}const{left:w,top:$,index:M,key:T,position:S,behavior:A,debounce:L=!0}=s;if(w!==void 0||$!==void 0)b(w,$,A);else if(M!==void 0)i(M,A,L);else if(T!==void 0){const ne=o.value.get(T);ne!==void 0&&i(ne,A,L)}else S==="bottom"?b(0,Number.MAX_SAFE_INTEGER,A):S==="top"&&b(0,0,A)};let h,u=null;function i(s,f,w){const{value:$}=a,M=$.sum(s)+ce(n.paddingTop);if(!w)l.value.scrollTo({left:0,top:M,behavior:f});else{h=s,u!==null&&window.clearTimeout(u),u=window.setTimeout(()=>{h=void 0,u=null},16);const{scrollTop:T,offsetHeight:S}=l.value;if(M>T){const A=$.get(s);M+A<=T+S||l.value.scrollTo({left:0,top:M+A-S,behavior:f})}else l.value.scrollTo({left:0,top:M,behavior:f})}}function b(s,f,w){l.value.scrollTo({left:s,top:f,behavior:w})}function z(s,f){var w,$,M;if(t||n.ignoreItemResize||_(f.target))return;const{value:T}=a,S=o.value.get(s),A=T.get(S),L=(M=($=(w=f.borderBoxSize)===null||w===void 0?void 0:w[0])===null||$===void 0?void 0:$.blockSize)!==null&&M!==void 0?M:f.contentRect.height;if(L===A)return;L-n.itemSize===0?g.delete(s):g.set(s,L-n.itemSize);const j=L-A;if(j===0)return;T.add(S,j);const V=l.value;if(V!=null){if(h===void 0){const re=T.sum(S);V.scrollTop>re&&V.scrollBy(0,j)}else if(SV.scrollTop+V.offsetHeight&&V.scrollBy(0,j)}N()}m.value++}const I=!at();let C=!1;function O(s){var f;(f=n.onScroll)===null||f===void 0||f.call(n,s),(!I||!C)&&N()}function B(s){var f;if((f=n.onWheel)===null||f===void 0||f.call(n,s),I){const w=l.value;if(w!=null){if(s.deltaX===0&&(w.scrollTop===0&&s.deltaY<=0||w.scrollTop+w.offsetHeight>=w.scrollHeight&&s.deltaY>=0))return;s.preventDefault(),w.scrollTop+=s.deltaY/$e(),w.scrollLeft+=s.deltaX/$e(),N(),C=!0,Me(()=>{C=!1})}}}function X(s){if(t||_(s.target)||s.contentRect.height===p.value)return;p.value=s.contentRect.height;const{onResize:f}=n;f!==void 0&&f(s)}function N(){const{value:s}=l;s!=null&&(x.value=s.scrollTop,y=s.scrollLeft)}function _(s){let f=s;for(;f!==null;){if(f.style.display==="none")return!0;f=f.parentElement}return!1}return{listHeight:p,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:D(()=>{const{itemResizable:s}=n,f=G(a.value.sum());return m.value,[n.itemsStyle,{boxSizing:"content-box",height:s?"":f,minHeight:s?f:"",paddingTop:G(n.paddingTop),paddingBottom:G(n.paddingBottom)}]}),visibleItemsStyle:D(()=>(m.value,{transform:`translateY(${G(a.value.sum(d.value))})`})),viewportItems:c,listElRef:l,itemsElRef:F(null),scrollTo:v,handleListResize:X,handleListScroll:O,handleListWheel:B,handleItemResize:z}},render(){const{itemResizable:n,keyField:e,keyToIndex:t,visibleItemsTag:r}=this;return E(xe,{onResize:this.handleListResize},{default:()=>{var o,l;return E("div",_e(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?E("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[E(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>this.viewportItems.map(p=>{const g=p[e],a=t.get(g),m=this.$slots.default({item:p,index:a})[0];return n?E(xe,{key:g,onResize:y=>this.handleItemResize(g,y)},{default:()=>m}):(m.key=g,m)})})]):(l=(o=this.$slots).empty)===null||l===void 0?void 0:l.call(o)])}})}}),ft=W(".v-x-scroll",{overflow:"auto",scrollbarWidth:"none"},[W("&::-webkit-scrollbar",{width:0,height:0})]),zt=k({name:"XScroll",props:{disabled:Boolean,onScroll:Function},setup(){const n=F(null);function e(o){!(o.currentTarget.offsetWidthx){const{updateCounter:C}=n;for(let O=b;O>=0;--O){const B=u-1-O;C!==void 0?C(B):m.textContent=`${B}`;const X=m.offsetWidth;if(v-=d[O],v+X<=x||O===0){h=!0,b=O-1,c&&(b===-1?(c.style.maxWidth=`${x-X}px`,c.style.boxSizing="border-box"):c.style.maxWidth="");break}}}}const{onUpdateOverflow:i}=n;h?i!==void 0&&i(!0):(i!==void 0&&i(!1),m.setAttribute(Y,""))}const l=ee();return ct.mount({id:"vueuc/overflow",head:!0,anchorMetaName:te,ssr:l}),q(o),{selfRef:t,counterRef:r,sync:o}},render(){const{$slots:n}=this;return Ee(this.sync),E("div",{class:"v-overflow",ref:"selfRef"},[Ae(n,"default"),n.counter?n.counter():E("span",{style:{display:"inline-block"},ref:"counterRef"}),n.tail?n.tail():null])}});function Ie(n){return n instanceof HTMLElement}function Oe(n){for(let e=0;e=0;e--){const t=n.childNodes[e];if(Ie(t)&&(ke(t)||We(t)))return!0}return!1}function ke(n){if(!ht(n))return!1;try{n.focus({preventScroll:!0})}catch{}return document.activeElement===n}function ht(n){if(n.tabIndex>0||n.tabIndex===0&&n.getAttribute("tabIndex")!==null)return!0;if(n.getAttribute("disabled"))return!1;switch(n.nodeName){case"A":return!!n.href&&n.rel!=="ignore";case"INPUT":return n.type!=="hidden"&&n.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let P=[];const At=k({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(n){const e=Ce(),t=F(null),r=F(null);let o=!1,l=!1;const p=typeof document>"u"?null:document.activeElement;function g(){return P[P.length-1]===e}function a(u){var i;u.code==="Escape"&&g()&&((i=n.onEsc)===null||i===void 0||i.call(n,u))}q(()=>{U(()=>n.active,u=>{u?(x(),se("keydown",document,a)):(K("keydown",document,a),o&&d())},{immediate:!0})}),R(()=>{K("keydown",document,a),o&&d()});function m(u){if(!l&&g()){const i=y();if(i===null||i.contains(Le(u)))return;c("first")}}function y(){const u=t.value;if(u===null)return null;let i=u;for(;i=i.nextSibling,!(i===null||i instanceof Element&&i.tagName==="DIV"););return i}function x(){var u;if(!n.disabled){if(P.push(e),n.autoFocus){const{initialFocusTo:i}=n;i===void 0?c("first"):(u=ve(i))===null||u===void 0||u.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",m,!0)}}function d(){var u;if(n.disabled||(document.removeEventListener("focus",m,!0),P=P.filter(b=>b!==e),g()))return;const{finalFocusTo:i}=n;i!==void 0?(u=ve(i))===null||u===void 0||u.focus({preventScroll:!0}):n.returnFocusOnDeactivated&&p instanceof HTMLElement&&(l=!0,p.focus({preventScroll:!0}),l=!1)}function c(u){if(g()&&n.active){const i=t.value,b=r.value;if(i!==null&&b!==null){const z=y();if(z==null||z===b){l=!0,i.focus({preventScroll:!0}),l=!1;return}l=!0;const I=u==="first"?Oe(z):We(z);l=!1,I||(l=!0,i.focus({preventScroll:!0}),l=!1)}}}function v(u){if(l)return;const i=y();i!==null&&(u.relatedTarget!==null&&i.contains(u.relatedTarget)?c("last"):c("first"))}function h(u){l||(u.relatedTarget!==null&&u.relatedTarget===t.value?c("last"):c("first"))}return{focusableStartRef:t,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:v,handleEndFocus:h}},render(){const{default:n}=this.$slots;if(n===void 0)return null;if(this.disabled)return n();const{active:e,focusableStyle:t}=this;return E(Se,null,[E("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:t,onFocus:this.handleStartFocus}),n(),E("div",{"aria-hidden":"true",style:t,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});export{At as F,et as L,xe as V,Tt as a,St as b,$t as c,Mt as d,Et as e,zt as f,ye as r}; diff --git a/web/dist/assets/vuex-473b3783.js b/web/dist/assets/vuex-473b3783.js new file mode 100644 index 00000000..708e2a87 --- /dev/null +++ b/web/dist/assets/vuex-473b3783.js @@ -0,0 +1,5 @@ +import{w as M,$ as V,E as H,a0 as U,i as k,n as B}from"./@vue-e0e89260.js";/*! + * vuex v4.1.0 + * (c) 2022 Evan You + * @license MIT + */var x="store";function st(e){return e===void 0&&(e=null),k(e!==null?e:x)}function g(e,t){Object.keys(e).forEach(function(i){return t(e[i],i)})}function K(e){return e!==null&&typeof e=="object"}function W(e){return e&&typeof e.then=="function"}function Y(e,t){return function(){return e(t)}}function T(e,t,i){return t.indexOf(e)<0&&(i&&i.prepend?t.unshift(e):t.push(e)),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}function A(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var i=e.state;y(e,i,[],e._modules.root,!0),S(e,i,t)}function S(e,t,i){var r=e._state,n=e._scope;e.getters={},e._makeLocalGettersCache=Object.create(null);var o=e._wrappedGetters,a={},s={},u=V(!0);u.run(function(){g(o,function(l,c){a[c]=Y(l,e),s[c]=B(function(){return a[c]()}),Object.defineProperty(e.getters,c,{get:function(){return s[c].value},enumerable:!0})})}),e._state=H({data:t}),e._scope=u,e.strict&&Q(e),r&&i&&e._withCommit(function(){r.data=null}),n&&n.stop()}function y(e,t,i,r,n){var o=!i.length,a=e._modules.getNamespace(i);if(r.namespaced&&(e._modulesNamespaceMap[a],e._modulesNamespaceMap[a]=r),!o&&!n){var s=E(t,i.slice(0,-1)),u=i[i.length-1];e._withCommit(function(){s[u]=r.state})}var l=r.context=X(e,a,i);r.forEachMutation(function(c,f){var h=a+f;q(e,h,c,l)}),r.forEachAction(function(c,f){var h=c.root?f:a+f,d=c.handler||c;z(e,h,d,l)}),r.forEachGetter(function(c,f){var h=a+f;J(e,h,c,l)}),r.forEachChild(function(c,f){y(e,t,i.concat(f),c,n)})}function X(e,t,i){var r=t==="",n={dispatch:r?e.dispatch:function(o,a,s){var u=b(o,a,s),l=u.payload,c=u.options,f=u.type;return(!c||!c.root)&&(f=t+f),e.dispatch(f,l)},commit:r?e.commit:function(o,a,s){var u=b(o,a,s),l=u.payload,c=u.options,f=u.type;(!c||!c.root)&&(f=t+f),e.commit(f,l,c)}};return Object.defineProperties(n,{getters:{get:r?function(){return e.getters}:function(){return G(e,t)}},state:{get:function(){return E(e.state,i)}}}),n}function G(e,t){if(!e._makeLocalGettersCache[t]){var i={},r=t.length;Object.keys(e.getters).forEach(function(n){if(n.slice(0,r)===t){var o=n.slice(r);Object.defineProperty(i,o,{get:function(){return e.getters[n]},enumerable:!0})}}),e._makeLocalGettersCache[t]=i}return e._makeLocalGettersCache[t]}function q(e,t,i,r){var n=e._mutations[t]||(e._mutations[t]=[]);n.push(function(a){i.call(e,r.state,a)})}function z(e,t,i,r){var n=e._actions[t]||(e._actions[t]=[]);n.push(function(a){var s=i.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},a);return W(s)||(s=Promise.resolve(s)),e._devtoolHook?s.catch(function(u){throw e._devtoolHook.emit("vuex:error",u),u}):s})}function J(e,t,i,r){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(o){return i(r.state,r.getters,o.state,o.getters)})}function Q(e){M(function(){return e._state.data},function(){},{deep:!0,flush:"sync"})}function E(e,t){return t.reduce(function(i,r){return i[r]},e)}function b(e,t,i){return K(e)&&e.type&&(i=t,t=e,e=e.type),{type:e,payload:t,options:i}}var Z="vuex bindings",j="vuex:mutations",C="vuex:actions",_="vuex",tt=0;function et(e,t){U({id:"org.vuejs.vuex",app:e,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[Z]},function(i){i.addTimelineLayer({id:j,label:"Vuex Mutations",color:I}),i.addTimelineLayer({id:C,label:"Vuex Actions",color:I}),i.addInspector({id:_,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),i.on.getInspectorTree(function(r){if(r.app===e&&r.inspectorId===_)if(r.filter){var n=[];D(n,t._modules.root,r.filter,""),r.rootNodes=n}else r.rootNodes=[N(t._modules.root,"")]}),i.on.getInspectorState(function(r){if(r.app===e&&r.inspectorId===_){var n=r.nodeId;G(t,n),r.state=nt(at(t._modules,n),n==="root"?t.getters:t._makeLocalGettersCache,n)}}),i.on.editInspectorState(function(r){if(r.app===e&&r.inspectorId===_){var n=r.nodeId,o=r.path;n!=="root"&&(o=n.split("/").filter(Boolean).concat(o)),t._withCommit(function(){r.set(t._state.data,o,r.state.value)})}}),t.subscribe(function(r,n){var o={};r.payload&&(o.payload=r.payload),o.state=n,i.notifyComponentUpdate(),i.sendInspectorTree(_),i.sendInspectorState(_),i.addTimelineEvent({layerId:j,event:{time:Date.now(),title:r.type,data:o}})}),t.subscribeAction({before:function(r,n){var o={};r.payload&&(o.payload=r.payload),r._id=tt++,r._time=Date.now(),o.state=n,i.addTimelineEvent({layerId:C,event:{time:r._time,title:r.type,groupId:r._id,subtitle:"start",data:o}})},after:function(r,n){var o={},a=Date.now()-r._time;o.duration={_custom:{type:"duration",display:a+"ms",tooltip:"Action duration",value:a}},r.payload&&(o.payload=r.payload),o.state=n,i.addTimelineEvent({layerId:C,event:{time:Date.now(),title:r.type,groupId:r._id,subtitle:"end",data:o}})}})})}var I=8702998,rt=6710886,it=16777215,$={label:"namespaced",textColor:it,backgroundColor:rt};function L(e){return e&&e!=="root"?e.split("/").slice(-2,-1)[0]:"Root"}function N(e,t){return{id:t||"root",label:L(t),tags:e.namespaced?[$]:[],children:Object.keys(e._children).map(function(i){return N(e._children[i],t+i+"/")})}}function D(e,t,i,r){r.includes(i)&&e.push({id:r||"root",label:r.endsWith("/")?r.slice(0,r.length-1):r||"Root",tags:t.namespaced?[$]:[]}),Object.keys(t._children).forEach(function(n){D(e,t._children[n],i,r+n+"/")})}function nt(e,t,i){t=i==="root"?t:t[i];var r=Object.keys(t),n={state:Object.keys(e.state).map(function(a){return{key:a,editable:!0,value:e.state[a]}})};if(r.length){var o=ot(t);n.getters=Object.keys(o).map(function(a){return{key:a.endsWith("/")?L(a):a,editable:!1,value:O(function(){return o[a]})}})}return n}function ot(e){var t={};return Object.keys(e).forEach(function(i){var r=i.split("/");if(r.length>1){var n=t,o=r.pop();r.forEach(function(a){n[a]||(n[a]={_custom:{value:{},display:a,tooltip:"Module",abstract:!0}}),n=n[a]._custom.value}),n[o]=O(function(){return e[i]})}else t[i]=O(function(){return e[i]})}),t}function at(e,t){var i=t.split("/").filter(function(r){return r});return i.reduce(function(r,n,o){var a=r[n];if(!a)throw new Error('Missing module "'+n+'" for path "'+t+'".');return o===i.length-1?a:a._children},t==="root"?e:e.root._children)}function O(e){try{return e()}catch(t){return t}}var v=function(t,i){this.runtime=i,this._children=Object.create(null),this._rawModule=t;var r=t.state;this.state=(typeof r=="function"?r():r)||{}},R={namespaced:{configurable:!0}};R.namespaced.get=function(){return!!this._rawModule.namespaced};v.prototype.addChild=function(t,i){this._children[t]=i};v.prototype.removeChild=function(t){delete this._children[t]};v.prototype.getChild=function(t){return this._children[t]};v.prototype.hasChild=function(t){return t in this._children};v.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)};v.prototype.forEachChild=function(t){g(this._children,t)};v.prototype.forEachGetter=function(t){this._rawModule.getters&&g(this._rawModule.getters,t)};v.prototype.forEachAction=function(t){this._rawModule.actions&&g(this._rawModule.actions,t)};v.prototype.forEachMutation=function(t){this._rawModule.mutations&&g(this._rawModule.mutations,t)};Object.defineProperties(v.prototype,R);var m=function(t){this.register([],t,!1)};m.prototype.get=function(t){return t.reduce(function(i,r){return i.getChild(r)},this.root)};m.prototype.getNamespace=function(t){var i=this.root;return t.reduce(function(r,n){return i=i.getChild(n),r+(i.namespaced?n+"/":"")},"")};m.prototype.update=function(t){P([],this.root,t)};m.prototype.register=function(t,i,r){var n=this;r===void 0&&(r=!0);var o=new v(i,r);if(t.length===0)this.root=o;else{var a=this.get(t.slice(0,-1));a.addChild(t[t.length-1],o)}i.modules&&g(i.modules,function(s,u){n.register(t.concat(u),s,r)})};m.prototype.unregister=function(t){var i=this.get(t.slice(0,-1)),r=t[t.length-1],n=i.getChild(r);n&&n.runtime&&i.removeChild(r)};m.prototype.isRegistered=function(t){var i=this.get(t.slice(0,-1)),r=t[t.length-1];return i?i.hasChild(r):!1};function P(e,t,i){if(t.update(i),i.modules)for(var r in i.modules){if(!t.getChild(r))return;P(e.concat(r),t.getChild(r),i.modules[r])}}function ut(e){return new p(e)}var p=function(t){var i=this;t===void 0&&(t={});var r=t.plugins;r===void 0&&(r=[]);var n=t.strict;n===void 0&&(n=!1);var o=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new m(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=o;var a=this,s=this,u=s.dispatch,l=s.commit;this.dispatch=function(h,d){return u.call(a,h,d)},this.commit=function(h,d,F){return l.call(a,h,d,F)},this.strict=n;var c=this._modules.root.state;y(this,c,[],this._modules.root),S(this,c),r.forEach(function(f){return f(i)})},w={state:{configurable:!0}};p.prototype.install=function(t,i){t.provide(i||x,this),t.config.globalProperties.$store=this;var r=this._devtools!==void 0?this._devtools:!1;r&&et(t,this)};w.state.get=function(){return this._state.data};w.state.set=function(e){};p.prototype.commit=function(t,i,r){var n=this,o=b(t,i,r),a=o.type,s=o.payload,u={type:a,payload:s},l=this._mutations[a];l&&(this._withCommit(function(){l.forEach(function(f){f(s)})}),this._subscribers.slice().forEach(function(c){return c(u,n.state)}))};p.prototype.dispatch=function(t,i){var r=this,n=b(t,i),o=n.type,a=n.payload,s={type:o,payload:a},u=this._actions[o];if(u){try{this._actionSubscribers.slice().filter(function(c){return c.before}).forEach(function(c){return c.before(s,r.state)})}catch{}var l=u.length>1?Promise.all(u.map(function(c){return c(a)})):u[0](a);return new Promise(function(c,f){l.then(function(h){try{r._actionSubscribers.filter(function(d){return d.after}).forEach(function(d){return d.after(s,r.state)})}catch{}c(h)},function(h){try{r._actionSubscribers.filter(function(d){return d.error}).forEach(function(d){return d.error(s,r.state,h)})}catch{}f(h)})})}};p.prototype.subscribe=function(t,i){return T(t,this._subscribers,i)};p.prototype.subscribeAction=function(t,i){var r=typeof t=="function"?{before:t}:t;return T(r,this._actionSubscribers,i)};p.prototype.watch=function(t,i,r){var n=this;return M(function(){return t(n.state,n.getters)},i,Object.assign({},r))};p.prototype.replaceState=function(t){var i=this;this._withCommit(function(){i._state.data=t})};p.prototype.registerModule=function(t,i,r){r===void 0&&(r={}),typeof t=="string"&&(t=[t]),this._modules.register(t,i),y(this,this.state,t,this._modules.get(t),r.preserveState),S(this,this.state)};p.prototype.unregisterModule=function(t){var i=this;typeof t=="string"&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var r=E(i.state,t.slice(0,-1));delete r[t[t.length-1]]}),A(this)};p.prototype.hasModule=function(t){return typeof t=="string"&&(t=[t]),this._modules.isRegistered(t)};p.prototype.hotUpdate=function(t){this._modules.update(t),A(this,!0)};p.prototype._withCommit=function(t){var i=this._committing;this._committing=!0,t(),this._committing=i};Object.defineProperties(p.prototype,w);export{ut as c,st as u}; diff --git a/web/dist/index.html b/web/dist/index.html index 8a86016c..13f11cb0 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -3,16 +3,46 @@ - + + + 泡泡 - - + + + + + + + + + + + + + + + + + + + + + +
+ \ No newline at end of file diff --git a/web/dist/logo.png b/web/dist/logo.png new file mode 100644 index 00000000..7054b5bd Binary files /dev/null and b/web/dist/logo.png differ diff --git a/web/dist/manifest.json b/web/dist/manifest.json new file mode 100644 index 00000000..14c5616b --- /dev/null +++ b/web/dist/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "泡泡", + "name": "泡泡", + "description": "一个清新文艺的微社区", + "icons": [ + { + "src": "/logo.png", + "type": "image/png", + "sizes": "600x600" + } + ], + "start_url": "/", + "scope": "/", + "display": "standalone" +} diff --git a/web/dist/sw.js b/web/dist/sw.js new file mode 100644 index 00000000..aeee59a0 --- /dev/null +++ b/web/dist/sw.js @@ -0,0 +1,10 @@ +self.addEventListener("install", (event) => { + event.waitUntil((async () => {})()); + }); + + self.addEventListener("activate", (event) => { + event.waitUntil((async () => {})()); + }); + + self.addEventListener("fetch", (event) => {}); + \ No newline at end of file diff --git a/web/index.html b/web/index.html index ce4d1a56..98bfa4b0 100644 --- a/web/index.html +++ b/web/index.html @@ -3,14 +3,24 @@ - + + + 泡泡
+ \ No newline at end of file diff --git a/web/package.json b/web/package.json index 99785fb4..3d5444cd 100644 --- a/web/package.json +++ b/web/package.json @@ -14,28 +14,30 @@ "@vicons/ionicons5": "^0.12.0", "@vicons/material": "^0.12.0", "@vicons/tabler": "^0.12.0", - "axios": "^0.26.1", - "less": "^4.1.2", + "axios": "^1.4.0", + "copy-to-clipboard": "^3.3.3", + "less": "^4.1.3", "lodash": "^4.17.21", - "moment": "^2.29.3", - "naive-ui": "^2.28.0", - "nonesir-video": "^1.0.3", + "moment": "^2.29.4", + "naive-ui": "^2.34.4", + "paopao-video-player": "^1.0.0", "qrcanvas-vue": "^3.0.0", - "qrcode": "^1.5.0", - "unplugin-vue-components": "^0.19.3", + "qrcode": "^1.5.3", + "unplugin-vue-components": "^0.25.1", + "v3-infinite-loading": "^1.3.1", "vfonts": "^0.0.3", - "vue": "^3.2.25", + "vue": "^3.3.4", "vue-router": "4", - "vue3-player-video": "^1.2.5", - "vuex": "^4.0.2" + "vuex": "^4.1.0" }, "devDependencies": { - "@tauri-apps/cli": "^1.2.0", - "@types/node": "^17.0.35", - "@types/qrcode": "^1.4.2", - "@vitejs/plugin-vue": "^2.3.3", - "@vue/compiler-sfc": "^3.2.36", - "typescript": "^4.7.2", - "vite": "^2.9.2" + "@tauri-apps/cli": "^1.4.0", + "@types/node": "^18.16.0", + "@types/qrcode": "^1.5.1", + "@vitejs/plugin-vue": "^4.2.3", + "@vue/compiler-sfc": "^3.3.4", + "rollup-plugin-visualizer": "^5.9.2", + "typescript": "^5.1.6", + "vite": "^4.4.6" } } diff --git a/web/public/logo.png b/web/public/logo.png new file mode 100644 index 00000000..7054b5bd Binary files /dev/null and b/web/public/logo.png differ diff --git a/web/public/manifest.json b/web/public/manifest.json new file mode 100644 index 00000000..14c5616b --- /dev/null +++ b/web/public/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "泡泡", + "name": "泡泡", + "description": "一个清新文艺的微社区", + "icons": [ + { + "src": "/logo.png", + "type": "image/png", + "sizes": "600x600" + } + ], + "start_url": "/", + "scope": "/", + "display": "standalone" +} diff --git a/web/public/sw.js b/web/public/sw.js new file mode 100644 index 00000000..aeee59a0 --- /dev/null +++ b/web/public/sw.js @@ -0,0 +1,10 @@ +self.addEventListener("install", (event) => { + event.waitUntil((async () => {})()); + }); + + self.addEventListener("activate", (event) => { + event.waitUntil((async () => {})()); + }); + + self.addEventListener("fetch", (event) => {}); + \ No newline at end of file diff --git a/web/src-tauri/Cargo.lock b/web/src-tauri/Cargo.lock index 7edc858d..7eb74689 100644 --- a/web/src-tauri/Cargo.lock +++ b/web/src-tauri/Cargo.lock @@ -23,6 +23,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + [[package]] name = "alloc-no-stdlib" version = "2.0.3" @@ -38,6 +47,15 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "ansi_term" version = "0.12.1" @@ -53,6 +71,99 @@ version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" +[[package]] +name = "async-broadcast" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d26004fe83b2d1cd3a97609b21e39f9a31535822210fe83205d2ce48866ea61" +dependencies = [ + "event-listener", + "futures-core", + "parking_lot", +] + +[[package]] +name = "async-channel" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "once_cell", + "slab", +] + +[[package]] +name = "async-io" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8121296a9f05be7f34aa4196b1747243b3b62e048bb7906f644f3fbfc490cf7" +dependencies = [ + "async-lock", + "autocfg", + "concurrent-queue", + "futures-lite", + "libc", + "log", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "winapi", +] + +[[package]] +name = "async-lock" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-recursion" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.96", +] + +[[package]] +name = "async-task" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + [[package]] name = "atk" version = "0.15.1" @@ -77,22 +188,6 @@ dependencies = [ "system-deps 6.0.2", ] -[[package]] -name = "attohttpc" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fcf00bc6d5abb29b5f97e3c61a90b6d3caa12f3faf897d4a3e3607c050a35a7" -dependencies = [ - "flate2", - "http", - "log", - "native-tls", - "serde", - "serde_json", - "serde_urlencoded", - "url", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -105,6 +200,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + [[package]] name = "bitflags" version = "1.3.2" @@ -179,6 +280,15 @@ name = "bytes" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +dependencies = [ + "serde", +] + +[[package]] +name = "cache-padded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" [[package]] name = "cairo-rs" @@ -206,12 +316,12 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.13.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa0e3586af56b3bfa51fca452bd56e8dbbbd5d8d81cbf0b7e4e35b695b537eb8" +checksum = "7f83bc2e401ed041b7057345ebc488c005efa0341d5541ce7004d30458d0090b" dependencies = [ "serde", - "toml", + "toml 0.7.3", ] [[package]] @@ -228,12 +338,13 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfb" -version = "0.6.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f89d248799e3f15f91b70917f65381062a01bb8e222700ea0e5a7ff9785f9c" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" dependencies = [ "byteorder", - "uuid 0.8.2", + "fnv", + "uuid", ] [[package]] @@ -260,6 +371,19 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +dependencies = [ + "iana-time-zone", + "num-integer", + "num-traits", + "serde", + "winapi", +] + [[package]] name = "cocoa" version = "0.24.0" @@ -291,6 +415,16 @@ dependencies = [ "objc", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "color_quant" version = "1.1.0" @@ -307,6 +441,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "concurrent-queue" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" +dependencies = [ + "cache-padded", +] + [[package]] name = "convert_case" version = "0.4.0" @@ -416,7 +559,7 @@ dependencies = [ "proc-macro2", "quote", "smallvec", - "syn", + "syn 1.0.96", ] [[package]] @@ -426,7 +569,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e" dependencies = [ "quote", - "syn", + "syn 1.0.96", ] [[package]] @@ -436,7 +579,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" dependencies = [ "quote", - "syn", + "syn 1.0.96", ] [[package]] @@ -445,11 +588,55 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" +[[package]] +name = "cxx" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn 2.0.15", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + [[package]] name = "darling" -version = "0.13.4" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" dependencies = [ "darling_core", "darling_macro", @@ -457,57 +644,47 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.13.4" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.15", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" dependencies = [ "darling_core", "quote", - "syn", -] - -[[package]] -name = "dbus" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0a745c25b32caa56b82a3950f5fec7893a960f4c10ca3b02060b0c38d8c2ce" -dependencies = [ - "libc", - "libdbus-sys", - "winapi", + "syn 2.0.15", ] [[package]] name = "deflate" -version = "0.7.20" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" +checksum = "c86f7e25f518f4b81808a2cf1c50996a61f5c2eb394b2393bd87f2a4780a432f" dependencies = [ "adler32", - "byteorder", ] [[package]] -name = "deflate" -version = "1.0.0" +name = "derivative" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c86f7e25f518f4b81808a2cf1c50996a61f5c2eb394b2393bd87f2a4780a432f" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "adler32", + "proc-macro2", + "quote", + "syn 1.0.96", ] [[package]] @@ -520,7 +697,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn", + "syn 1.0.96", ] [[package]] @@ -533,6 +710,15 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + [[package]] name = "dirs-next" version = "2.0.0" @@ -543,6 +729,17 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -581,6 +778,19 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c" +[[package]] +name = "embed-resource" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80663502655af01a2902dff3f06869330782267924bf1788410b74edcd93770a" +dependencies = [ + "cc", + "rustc_version 0.4.0", + "toml 0.7.3", + "vswhom", + "winreg 0.11.0", +] + [[package]] name = "embed_plist" version = "1.2.2" @@ -596,6 +806,33 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enumflags2" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + [[package]] name = "fastrand" version = "1.7.0" @@ -709,6 +946,21 @@ version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-macro" version = "0.3.21" @@ -717,9 +969,15 @@ checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.96", ] +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + [[package]] name = "futures-task" version = "0.3.21" @@ -733,8 +991,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ "futures-core", + "futures-io", "futures-macro", + "futures-sink", "futures-task", + "memchr", "pin-project-lite", "pin-utils", "slab", @@ -928,7 +1189,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.96", ] [[package]] @@ -953,7 +1214,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" dependencies = [ - "aho-corasick", + "aho-corasick 0.7.18", "bstr", "fnv", "log", @@ -1023,7 +1284,26 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.96", +] + +[[package]] +name = "h2" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", ] [[package]] @@ -1056,6 +1336,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "html5ever" version = "0.25.2" @@ -1067,7 +1353,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn", + "syn 1.0.96", ] [[package]] @@ -1081,6 +1367,17 @@ dependencies = [ "itoa 1.0.2", ] +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + [[package]] name = "http-range" version = "0.1.5" @@ -1088,33 +1385,106 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" [[package]] -name = "ico" -version = "0.1.0" +name = "httparse" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a4b3331534254a9b64095ae60d3dc2a8225a7a70229cd5888be127cdc1f6804" -dependencies = [ - "byteorder", - "png 0.11.0", -] +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] -name = "ident_case" -version = "1.0.1" +name = "httpdate" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] -name = "idna" -version = "0.3.0" +name = "hyper" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "ignore" + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa 1.0.2", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows 0.48.0", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] +name = "ico" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3804960be0bb5e4edb1e1ad67afd321a9ecfd875c3e65c099468fd2717d7cae" +dependencies = [ + "byteorder", + "png", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "ignore" version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" @@ -1153,26 +1523,18 @@ checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", "hashbrown", + "serde", ] [[package]] name = "infer" -version = "0.7.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20b2b533137b9cad970793453d4f921c2e91312a6d88b1085c07bc15fc51bb3b" +checksum = "a898e4b7951673fce96614ce5751d13c40fc5674bc2d759288e46c3ab62598b3" dependencies = [ "cfb", ] -[[package]] -name = "inflate" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f9f47468e9a76a6452271efadc88fe865a82be91fe75e6c0c57b87ccea59d4" -dependencies = [ - "adler32", -] - [[package]] name = "instant" version = "0.1.12" @@ -1182,6 +1544,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + [[package]] name = "itoa" version = "0.4.8" @@ -1248,12 +1616,13 @@ dependencies = [ [[package]] name = "json-patch" -version = "0.2.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f995a3c8f2bc3dd52a18a583e90f9ec109c047fa1603a853e46bcda14d2e279d" +checksum = "1f54898088ccb91df1b492cc80029a6fdf1c48ca0db7c6822a8babad69c94658" dependencies = [ "serde", "serde_json", + "thiserror", "treediff", ] @@ -1277,26 +1646,26 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" [[package]] -name = "libdbus-sys" -version = "0.2.2" +name = "line-wrap" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c185b5b7ad900923ef3a8ff594083d4d9b5aea80bb4f32b8342363138c0d456b" +checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" dependencies = [ - "pkg-config", + "safemem", ] [[package]] -name = "line-wrap" -version = "0.1.1" +name = "link-cplusplus" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" dependencies = [ - "safemem", + "cc", ] [[package]] @@ -1405,6 +1774,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + [[package]] name = "miniz_oxide" version = "0.5.3" @@ -1414,6 +1789,17 @@ dependencies = [ "adler", ] +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + [[package]] name = "native-tls" version = "0.2.10" @@ -1466,6 +1852,19 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +[[package]] +name = "nix" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" +dependencies = [ + "bitflags", + "cc", + "cfg-if", + "libc", + "memoffset", +] + [[package]] name = "nodrop" version = "0.1.14" @@ -1478,9 +1877,12 @@ version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a995a3d2834cefa389218e7a35156e8ce544bc95f836900da01ee0b26a07e9d4" dependencies = [ - "dbus", "mac-notification-sys", + "serde", "winrt-notification", + "zbus", + "zvariant", + "zvariant_derive", ] [[package]] @@ -1552,7 +1954,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.96", ] [[package]] @@ -1611,12 +2013,12 @@ checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "open" -version = "3.0.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360bcc8316bf6363aa3954c3ccc4de8add167b087e0259190a043c9514f910fe" +checksum = "2078c0039e6a54a0c42c28faa984e115fb4c2d5bf2208f77d1961002df8576f8" dependencies = [ "pathdiff", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1642,7 +2044,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.96", ] [[package]] @@ -1664,6 +2066,16 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "ordered-stream" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44630c059eacfd6e08bdaa51b1db2ce33119caa4ddc1235e923109aa5f25ccb1" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "os_info" version = "3.5.1" @@ -1718,6 +2130,12 @@ dependencies = [ "tauri-build", ] +[[package]] +name = "parking" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" + [[package]] name = "parking_lot" version = "0.12.1" @@ -1738,15 +2156,9 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.36.1", ] -[[package]] -name = "paste" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" - [[package]] name = "pathdiff" version = "0.2.1" @@ -1831,7 +2243,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.96", ] [[package]] @@ -1845,7 +2257,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.96", ] [[package]] @@ -1890,7 +2302,7 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" dependencies = [ - "base64", + "base64 0.13.0", "indexmap", "line-wrap", "serde", @@ -1900,26 +2312,28 @@ dependencies = [ [[package]] name = "png" -version = "0.11.0" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b0cabbbd20c2d7f06dbf015e06aad59b6ca3d9ed14848783e98af9aaf19925" +checksum = "dc38c0ad57efb786dd57b9864e5b18bae478c00c824dc55a38bbc9da95dde3ba" dependencies = [ "bitflags", - "deflate 0.7.20", - "inflate", - "num-iter", + "crc32fast", + "deflate", + "miniz_oxide", ] [[package]] -name = "png" -version = "0.17.5" +name = "polling" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc38c0ad57efb786dd57b9864e5b18bae478c00c824dc55a38bbc9da95dde3ba" +checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6" dependencies = [ - "bitflags", - "crc32fast", - "deflate 1.0.0", - "miniz_oxide", + "autocfg", + "cfg-if", + "libc", + "log", + "wepoll-ffi", + "windows-sys 0.42.0", ] [[package]] @@ -1941,7 +2355,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ "thiserror", - "toml", + "toml 0.5.9", ] [[package]] @@ -1953,7 +2367,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.96", "version_check", ] @@ -1976,18 +2390,18 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.39" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.18" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -2104,13 +2518,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" dependencies = [ - "aho-corasick", + "aho-corasick 1.0.1", "memchr", - "regex-syntax", + "regex-syntax 0.7.1", ] [[package]] @@ -2119,7 +2533,7 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.28", ] [[package]] @@ -2128,6 +2542,12 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +[[package]] +name = "regex-syntax" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" + [[package]] name = "remove_dir_all" version = "0.5.3" @@ -2137,6 +2557,45 @@ dependencies = [ "winapi", ] +[[package]] +name = "reqwest" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +dependencies = [ + "base64 0.21.0", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "winreg 0.10.1", +] + [[package]] name = "rfd" version = "0.10.0" @@ -2213,7 +2672,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -2228,6 +2687,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scratch" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" + [[package]] name = "security-framework" version = "2.6.1" @@ -2300,29 +2765,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.147" +version = "1.0.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "71b2f6e1ab5c2b98c05f0f35b236b22e8df7ead6ffbf51d7808da7f8817e7ab6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.147" +version = "1.0.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] name = "serde_json" -version = "1.0.81" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa 1.0.2", "ryu", @@ -2337,7 +2802,16 @@ checksum = "a2ad84e47328a31223de7fed7a4f5087f2d6ddfe586cf3ca25b7a165bc0a5aed" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.96", +] + +[[package]] +name = "serde_spanned" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +dependencies = [ + "serde", ] [[package]] @@ -2354,24 +2828,30 @@ dependencies = [ [[package]] name = "serde_with" -version = "1.14.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +checksum = "21e47d95bc83ed33b2ecf84f4187ad1ab9685d18ff28db000c99deac8ce180e3" dependencies = [ + "base64 0.21.0", + "chrono", + "hex", + "indexmap", "serde", + "serde_json", "serde_with_macros", + "time", ] [[package]] name = "serde_with_macros" -version = "1.5.2" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +checksum = "ea3cee93715c2e266b9338b7544da68a9f24e227722ba482bd1c024367c77c65" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -2393,7 +2873,7 @@ checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.96", ] [[package]] @@ -2406,6 +2886,21 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "sha1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + [[package]] name = "sha2" version = "0.10.2" @@ -2454,6 +2949,16 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "soup2" version = "0.2.1" @@ -2497,6 +3002,12 @@ dependencies = [ "loom", ] +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "string_cache" version = "0.8.4" @@ -2547,7 +3058,7 @@ dependencies = [ "heck 0.3.3", "proc-macro2", "quote", - "syn", + "syn 1.0.96", ] [[package]] @@ -2561,6 +3072,30 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sys-locale" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a11bd9c338fdba09f7881ab41551932ad42e405f61d01e8406baea71c07aee" +dependencies = [ + "js-sys", + "libc", + "wasm-bindgen", + "web-sys", + "windows-sys 0.45.0", +] + [[package]] name = "system-deps" version = "5.0.0" @@ -2570,7 +3105,7 @@ dependencies = [ "cfg-expr 0.9.1", "heck 0.3.3", "pkg-config", - "toml", + "toml 0.5.9", "version-compare 0.0.11", ] @@ -2583,15 +3118,15 @@ dependencies = [ "cfg-expr 0.10.3", "heck 0.4.0", "pkg-config", - "toml", + "toml 0.5.9", "version-compare 0.1.0", ] [[package]] name = "tao" -version = "0.15.4" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0382fcc02b87420a0d024ff6ec2dbfccdccafb46de8c03fb07dbf2f36810a42" +checksum = "704522803dda895767f69198af8351b0a3f4fe2e293c3ca54cce0ecba05a97f2" dependencies = [ "bitflags", "cairo-rs", @@ -2621,18 +3156,29 @@ dependencies = [ "objc", "once_cell", "parking_lot", - "paste", - "png 0.17.5", + "png", "raw-window-handle", "scopeguard", "serde", + "tao-macros", "unicode-segmentation", - "uuid 1.2.2", + "uuid", "windows 0.39.0", "windows-implement", "x11-dl", ] +[[package]] +name = "tao-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b27a4bcc5eb524658234589bdffc7e7bfb996dbae6ce9393bfd39cb4159b445" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.96", +] + [[package]] name = "tar" version = "0.4.38" @@ -2646,12 +3192,12 @@ dependencies = [ [[package]] name = "tauri" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac135e45c2923bd91edbb95a0d656f8d025389697e34d6d79166952bfa79c61c" +checksum = "7fbe522898e35407a8e60dc3870f7579fea2fc262a6a6072eccdd37ae1e1d91e" dependencies = [ "anyhow", - "attohttpc", + "bytes", "cocoa", "dirs-next", "embed_plist", @@ -2674,6 +3220,7 @@ dependencies = [ "rand 0.8.5", "raw-window-handle", "regex", + "reqwest", "rfd", "semver 1.0.10", "serde", @@ -2682,6 +3229,7 @@ dependencies = [ "serialize-to-javascript", "shared_child", "state", + "sys-locale", "tar", "tauri-macros", "tauri-runtime", @@ -2691,7 +3239,7 @@ dependencies = [ "thiserror", "tokio", "url", - "uuid 1.2.2", + "uuid", "webkit2gtk", "webview2-com", "windows 0.39.0", @@ -2699,32 +3247,33 @@ dependencies = [ [[package]] name = "tauri-build" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef796f49abc98e6de0abe1b655120addc9d82363d8fc2304e71a4177c25e783c" +checksum = "7d2edd6a259b5591c8efdeb9d5702cb53515b82a6affebd55c7fd6d3a27b7d1b" dependencies = [ "anyhow", "cargo_toml", "heck 0.4.0", "json-patch", "semver 1.0.10", + "serde", "serde_json", "tauri-utils", - "winres", + "tauri-winres", ] [[package]] name = "tauri-codegen" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb77cf7bfe3d8f886e73a7fa6157587d015c599671180b76595c1aef175ba8" +checksum = "54ad2d49fdeab4a08717f5b49a163bdc72efc3b1950b6758245fcde79b645e1a" dependencies = [ - "base64", + "base64 0.21.0", "brotli", "ico", "json-patch", "plist", - "png 0.17.5", + "png", "proc-macro2", "quote", "regex", @@ -2735,29 +3284,29 @@ dependencies = [ "tauri-utils", "thiserror", "time", - "uuid 1.2.2", + "uuid", "walkdir", ] [[package]] name = "tauri-macros" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f24f481b0b2acfc288ac78755f00ebea53992c7365a165af64cb5ae00806edea" +checksum = "8eb12a2454e747896929338d93b0642144bb51e0dddbb36e579035731f0d76b7" dependencies = [ "heck 0.4.0", "proc-macro2", "quote", - "syn", + "syn 1.0.96", "tauri-codegen", "tauri-utils", ] [[package]] name = "tauri-runtime" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc5d54c476defa5436e70e0d0a06e3cb0f49b6f863895995d5e3769411769cf" +checksum = "108683199cb18f96d2d4134187bb789964143c845d2d154848dda209191fd769" dependencies = [ "gtk", "http", @@ -2768,16 +3317,17 @@ dependencies = [ "serde_json", "tauri-utils", "thiserror", - "uuid 1.2.2", + "url", + "uuid", "webview2-com", "windows 0.39.0", ] [[package]] name = "tauri-runtime-wry" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78c55091701426c2519c7e9f1dc2dd33e533af4e75eae89cedc6995409351a2" +checksum = "0b7aa256a1407a3a091b5d843eccc1a5042289baf0a43d1179d9f0fcfea37c1b" dependencies = [ "cocoa", "gtk", @@ -2786,7 +3336,7 @@ dependencies = [ "raw-window-handle", "tauri-runtime", "tauri-utils", - "uuid 1.2.2", + "uuid", "webkit2gtk", "webview2-com", "windows 0.39.0", @@ -2795,12 +3345,13 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d64c9a09ba1538b8e67ae8c78c10904f36ce38d364bf7f089ec807032a826b02" +checksum = "03fc02bb6072bb397e1d473c6f76c953cda48b4a2d0cce605df284aa74a12e84" dependencies = [ "brotli", "ctor", + "dunce", "glob", "heck 0.4.0", "html5ever", @@ -2821,6 +3372,16 @@ dependencies = [ "windows 0.39.0", ] +[[package]] +name = "tauri-winres" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5993dc129e544393574288923d1ec447c857f3f644187f4fbf7d9a875fbfc4fb" +dependencies = [ + "embed-resource", + "toml 0.7.3", +] + [[package]] name = "tempfile" version = "3.3.0" @@ -2847,29 +3408,38 @@ dependencies = [ ] [[package]] -name = "thin-slice" -version = "0.1.1" +name = "termcolor" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thin-slice" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -2883,13 +3453,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.9" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" +checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" dependencies = [ "itoa 1.0.2", "libc", "num_threads", + "serde", ] [[package]] @@ -2909,15 +3480,42 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.19.2" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ + "autocfg", "bytes", - "memchr", + "libc", + "mio", "num_cpus", - "once_cell", "pin-project-lite", + "socket2", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", ] [[package]] @@ -2929,6 +3527,46 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + [[package]] name = "tracing" version = "0.1.35" @@ -2949,7 +3587,7 @@ checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.96", ] [[package]] @@ -2993,13 +3631,19 @@ dependencies = [ [[package]] name = "treediff" -version = "3.0.2" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "761e8d5ad7ce14bb82b7e61ccc0ca961005a275a060b9644a2431aa11553c2ff" +checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" dependencies = [ "serde_json", ] +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + [[package]] name = "typenum" version = "1.15.0" @@ -3012,6 +3656,16 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +[[package]] +name = "uds_windows" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" +dependencies = [ + "tempfile", + "winapi", +] + [[package]] name = "unicode-bidi" version = "0.3.8" @@ -3039,6 +3693,12 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + [[package]] name = "url" version = "2.3.1" @@ -3057,12 +3717,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" - [[package]] name = "uuid" version = "1.2.2" @@ -3102,6 +3756,32 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b17ae1f6c8a2b28506cd96d412eebf83b4a0ff2cbefeeb952f2f9dfa44ba18" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + [[package]] name = "walkdir" version = "2.3.2" @@ -3113,6 +3793,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -3146,7 +3835,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 1.0.96", "wasm-bindgen-shared", ] @@ -3180,7 +3869,7 @@ checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3191,6 +3880,19 @@ version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" +[[package]] +name = "wasm-streams" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "web-sys" version = "0.3.58" @@ -3268,7 +3970,7 @@ checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.96", ] [[package]] @@ -3286,6 +3988,15 @@ dependencies = [ "windows-metadata", ] +[[package]] +name = "wepoll-ffi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] + [[package]] name = "winapi" version = "0.3.9" @@ -3356,6 +4067,15 @@ dependencies = [ "windows_x86_64_msvc 0.39.0", ] +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.0", +] + [[package]] name = "windows-bindgen" version = "0.39.0" @@ -3372,7 +4092,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba01f98f509cb5dc05f4e5fc95e535f78260f15fea8fe1a8abdd08f774f1cee7" dependencies = [ - "syn", + "syn 1.0.96", "windows-tokens", ] @@ -3395,12 +4115,87 @@ dependencies = [ "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + [[package]] name = "windows-tokens" version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" @@ -3419,6 +4214,18 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + [[package]] name = "windows_i686_gnu" version = "0.24.0" @@ -3443,6 +4250,18 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + [[package]] name = "windows_i686_msvc" version = "0.24.0" @@ -3467,6 +4286,18 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + [[package]] name = "windows_x86_64_gnu" version = "0.24.0" @@ -3491,6 +4322,30 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + [[package]] name = "windows_x86_64_msvc" version = "0.24.0" @@ -3516,12 +4371,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" [[package]] -name = "winres" -version = "0.1.12" +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winnow" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "winreg" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a1a57ff50e9b408431e8f97d5456f2807f8eb2a2cd79b06068fc87f8ecf189" dependencies = [ - "toml", + "cfg-if", + "winapi", ] [[package]] @@ -3537,11 +4423,11 @@ dependencies = [ [[package]] name = "wry" -version = "0.22.1" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0fd80bb2bd8e8eae26d59c5164e70233f29f7593cb886a958024a4fd8b5cd21" +checksum = "1c846dc4dda988e959869dd0802cd27417c9696e584593e49178aeee28890d25" dependencies = [ - "base64", + "base64 0.13.0", "block", "cocoa", "core-graphics", @@ -3608,3 +4494,93 @@ name = "xml-rs" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" + +[[package]] +name = "zbus" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d8f1a037b2c4a67d9654dc7bdfa8ff2e80555bbefdd3c1833c1d1b27c963a6b" +dependencies = [ + "async-broadcast", + "async-channel", + "async-executor", + "async-io", + "async-lock", + "async-recursion", + "async-task", + "async-trait", + "byteorder", + "derivative", + "dirs", + "enumflags2", + "event-listener", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "lazy_static", + "nix", + "once_cell", + "ordered-stream", + "rand 0.8.5", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tracing", + "uds_windows", + "winapi", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8fb5186d1c87ae88cf234974c240671238b4a679158ad3b94ec465237349a6" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "syn 1.0.96", +] + +[[package]] +name = "zbus_names" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a408fd8a352695690f53906dc7fd036be924ec51ea5e05666ff42685ed0af5" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + +[[package]] +name = "zvariant" +version = "3.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794fb7f59af4105697b0449ba31731ee5dbb3e773a17dbdf3d36206ea1b1644" +dependencies = [ + "byteorder", + "enumflags2", + "libc", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "3.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd58d4b6c8e26d3dd2149c8c40c6613ef6451b9885ff1296d1ac86c388351a54" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.96", +] diff --git a/web/src-tauri/Cargo.toml b/web/src-tauri/Cargo.toml index ca987b44..80d56f50 100644 --- a/web/src-tauri/Cargo.toml +++ b/web/src-tauri/Cargo.toml @@ -6,13 +6,13 @@ authors = ["Rocboss"] license = "MIT License" repository = "https://github.com/rocboss/paopao-ce" edition = "2021" -rust-version = "1.57" +rust-version = "1.60" [build-dependencies] -tauri-build = { version = "1.2", features = [] } +tauri-build = { version = "1.4", features = [] } [dependencies] -tauri = { version = "1.2", features = ["api-all", "macos-private-api"] } +tauri = { version = "1.4", features = ["api-all", "macos-private-api"] } [features] # by default Tauri runs in production mode diff --git a/web/src-tauri/tauri.conf.json b/web/src-tauri/tauri.conf.json index e61a48c8..39bc1a8e 100644 --- a/web/src-tauri/tauri.conf.json +++ b/web/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "package": { "productName": "Paopao", - "version": "0.1.0" + "version": "0.2.0" }, "build": { "distDir": "../dist", @@ -62,14 +62,14 @@ "windows": [ { "title": "泡泡 | 一个清新文艺的微社区", - "width": 1024, - "height": 800, + "width": 1080, + "height": 860, "resizable": false, "fullscreen": false, "transparent": true, "decorations": true, - "titleBarStyle": "Overlay", - "hiddenTitle": true, + "titleBarStyle": "Visible", + "hiddenTitle": false, "acceptFirstMouse": false } ], diff --git a/web/src/App.vue b/web/src/App.vue index 3e28ac86..c19e49d1 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -4,11 +4,13 @@
-
+
- +
+ +
=> { - return request({ - method: 'get', - url: '/v1/posts', - params - }); +export const getPosts = ( + params: NetParams.PostGetPosts +): Promise => { + return request({ + method: "get", + url: "/v1/posts", + params, + }); }; /** 获取标签列表 */ -export const getTags = (params: NetParams.PostGetTags): Promise => { - return request({ - method: 'get', - url: '/v1/tags', - params - }); +export const getTags = ( + params: NetParams.PostGetTags +): Promise => { + return request({ + method: "get", + url: "/v1/tags", + params, + }); }; /** 获取动态详情 */ -export const getPost = (params: NetParams.PostGetPost): Promise => { - return request({ - method: 'get', - url: '/v1/post', - params - }); +export const getPost = ( + params: NetParams.PostGetPost +): Promise => { + return request({ + method: "get", + url: "/v1/post", + params, + }); }; /** 获取动态点赞状态 */ -export const getPostStar = (params: NetParams.PostPostStar): Promise => { - return request({ - method: 'get', - url: '/v1/post/star', - params - }); +export const getPostStar = ( + params: NetParams.PostPostStar +): Promise => { + return request({ + method: "get", + url: "/v1/post/star", + params, + }); }; /** 动态点赞 */ -export const postStar = (data: NetParams.PostPostStar): Promise => { - return request({ - method: 'post', - url: '/v1/post/star', - data - }); +export const postStar = ( + data: NetParams.PostPostStar +): Promise => { + return request({ + method: "post", + url: "/v1/post/star", + data, + }); }; /** 获取动态收藏状态 */ -export const getPostCollection = (params: NetParams.PostGetPostCollection): Promise => { - return request({ - method: 'get', - url: '/v1/post/collection', - params - }); +export const getPostCollection = ( + params: NetParams.PostGetPostCollection +): Promise => { + return request({ + method: "get", + url: "/v1/post/collection", + params, + }); }; /** 动态收藏 */ -export const postCollection = (data: NetParams.PostPostCollection): Promise => { - return request({ - method: 'post', - url: '/v1/post/collection', - data - }); +export const postCollection = ( + data: NetParams.PostPostCollection +): Promise => { + return request({ + method: "post", + url: "/v1/post/collection", + data, + }); }; /** 获取动态评论列表 */ -export const getPostComments = (params: NetParams.PostGetPostComments): Promise => { - return request({ - method: 'get', - url: '/v1/post/comments', - params - }); +export const getPostComments = ( + params: NetParams.PostGetPostComments +): Promise => { + return request({ + method: "get", + url: "/v1/post/comments", + params, + }); }; /** 获取联系人列表 */ -export const getContacts = (params: NetParams.GetContacts): Promise => { - return request({ - method: 'get', - url: '/v1/user/contacts', - params - }); +export const getContacts = ( + params: NetParams.GetContacts +): Promise => { + return request({ + method: "get", + url: "/v1/user/contacts", + params, + }); }; /** 发布动态 */ -export const createPost = (data: NetParams.PostCreatePost): Promise => { - return request({ - method: 'post', - url: '/v1/post', - data - }); +export const createPost = ( + data: NetParams.PostCreatePost +): Promise => { + return request({ + method: "post", + url: "/v1/post", + data, + }); }; /** 删除动态 */ -export const deletePost = (data: NetParams.PostDeletePost): Promise => { - return request({ - method: 'delete', - url: '/v1/post', - data - }); +export const deletePost = ( + data: NetParams.PostDeletePost +): Promise => { + return request({ + method: "delete", + url: "/v1/post", + data, + }); }; /** 锁定/解锁动态 */ -export const lockPost = (data: NetParams.PostLockPost): Promise => { - return request({ - method: 'post', - url: '/v1/post/lock', - data - }); +export const lockPost = ( + data: NetParams.PostLockPost +): Promise => { + return request({ + method: "post", + url: "/v1/post/lock", + data, + }); }; /** 置顶/取消置顶动态 */ -export const stickPost = (data: NetParams.PostStickPost): Promise => { - return request({ - method: 'post', - url: '/v1/post/stick', - data - }); +export const stickPost = ( + data: NetParams.PostStickPost +): Promise => { + return request({ + method: "post", + url: "/v1/post/stick", + data, + }); +}; + +/** 设为亮点/取消亮点动态 */ +export const highlightPost = ( + data: NetParams.PostHighlightPost +): Promise => { + return request({ + method: "post", + url: "/v1/post/highlight", + data, + }); }; /** 置顶/取消置顶动态 */ -export const visibilityPost = (data: NetParams.PostVisibilityPost): Promise => { - return request({ - method: 'post', - url: '/v1/post/visibility', - data - }); +export const visibilityPost = ( + data: NetParams.PostVisibilityPost +): Promise => { + return request({ + method: "post", + url: "/v1/post/visibility", + data, + }); +}; + +/** 点赞评论 */ +export const thumbsUpTweetComment = ( + data: NetParams.PostTweetCommentThumbs +): Promise => { + return request({ + method: "post", + url: "/v1/tweet/comment/thumbsup", + data, + }); +}; + +/** 点踩评论 */ +export const thumbsDownTweetComment = ( + data: NetParams.PostTweetCommentThumbs +): Promise => { + return request({ + method: "post", + url: "/v1/tweet/comment/thumbsdown", + data, + }); +}; + +/** 点赞评论回复 */ +export const thumbsUpTweetReply = ( + data: NetParams.PostTweetReplyThumbs +): Promise => { + return request({ + method: "post", + url: "/v1/tweet/reply/thumbsup", + data, + }); +}; + +/** 点踩评论回复 */ +export const thumbsDownTweetReply = ( + data: NetParams.PostTweetReplyThumbs +): Promise => { + return request({ + method: "post", + url: "/v1/tweet/reply/thumbsdown", + data, + }); }; /** 发布动态评论 */ -export const createComment = (data: NetParams.PostCreateComment): Promise => { - return request({ - method: 'post', - url: '/v1/post/comment', - data - }); +export const createComment = ( + data: NetParams.PostCreateComment +): Promise => { + return request({ + method: "post", + url: "/v1/post/comment", + data, + }); }; /** 删除评论 */ -export const deleteComment = (data: NetParams.PostDeleteComment): Promise => { - return request({ - method: 'delete', - url: '/v1/post/comment', - data - }); +export const deleteComment = ( + data: NetParams.PostDeleteComment +): Promise => { + return request({ + method: "delete", + url: "/v1/post/comment", + data, + }); }; /** 发布评论回复 */ -export const createCommentReply = (data: NetParams.PostCreateCommentReply): Promise => { - return request({ - method: 'post', - url: '/v1/post/comment/reply', - data - }); +export const createCommentReply = ( + data: NetParams.PostCreateCommentReply +): Promise => { + return request({ + method: "post", + url: "/v1/post/comment/reply", + data, + }); }; /** 删除评论回复 */ -export const deleteCommentReply = (data: NetParams.PostDeleteCommentReply): Promise => { - return request({ - method: 'delete', - url: '/v1/post/comment/reply', - data - }); +export const deleteCommentReply = ( + data: NetParams.PostDeleteCommentReply +): Promise => { + return request({ + method: "delete", + url: "/v1/post/comment/reply", + data, + }); +}; + +/** 置顶/取消置顶话题 */ +export const stickTopic = ( + data: NetParams.PostStickTopic +): Promise => { + return request({ + method: "post", + url: "/v1/topic/stick", + data, + }); +}; + +/** 关注话题 */ +export const followTopic = ( + data: NetParams.PostFollowTopic +): Promise => { + return request({ + method: "post", + url: "/v1/topic/follow", + data, + }); +}; + +/** 取消关注话题 */ +export const unfollowTopic = ( + data: NetParams.PostUnfollowTopic +): Promise => { + return request({ + method: "post", + url: "/v1/topic/unfollow", + data, + }); }; diff --git a/web/src/api/user.ts b/web/src/api/user.ts index e37a785b..8c7c587f 100644 --- a/web/src/api/user.ts +++ b/web/src/api/user.ts @@ -1,12 +1,14 @@ -import { request } from '@/utils/request'; +import { request } from "@/utils/request"; /** 获取验证码 */ -export const getCaptcha = (params: NetParams.UserGetCaptcha = {}): Promise => { - return request({ - method: 'get', - url: '/v1/captcha', - params - }); +export const getCaptcha = ( + params: NetParams.UserGetCaptcha = {} +): Promise => { + return request({ + method: "get", + url: "/v1/captcha", + params, + }); }; /** @@ -15,11 +17,11 @@ export const getCaptcha = (params: NetParams.UserGetCaptcha = {}): Promise { - return request({ - method: 'post', - url: '/v1/captcha', - data - }); + return request({ + method: "post", + url: "/v1/captcha", + data, + }); }; /** @@ -27,12 +29,14 @@ export const sendCaptcha = (data: any) => { * @param {Object} data * @returns Promise */ -export const sendUserWhisper = (data: NetParams.UserWhisper): Promise => { - return request({ - method: 'post', - url: '/v1/user/whisper', - data - }); +export const sendUserWhisper = ( + data: NetParams.UserWhisper +): Promise => { + return request({ + method: "post", + url: "/v1/user/whisper", + data, + }); }; /** @@ -40,12 +44,14 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise => { - return request({ - method: 'post', - url: '/v1/friend/requesting', - data - }); +export const requestingFriend = ( + data: NetParams.RequestingFriend +): Promise => { + return request({ + method: "post", + url: "/v1/friend/requesting", + data, + }); }; /** @@ -53,12 +59,14 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise => { - return request({ - method: 'post', - url: '/v1/friend/add', - data - }); +export const addFriend = ( + data: NetParams.AddFriend +): Promise => { + return request({ + method: "post", + url: "/v1/friend/add", + data, + }); }; /** @@ -66,12 +74,14 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise => { - return request({ - method: 'post', - url: '/v1/friend/reject', - data - }); +export const rejectFriend = ( + data: NetParams.RejectFriend +): Promise => { + return request({ + method: "post", + url: "/v1/friend/reject", + data, + }); }; /** @@ -79,12 +89,14 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise => { - return request({ - method: 'post', - url: '/v1/friend/delete', - data - }); +export const deleteFriend = ( + data: NetParams.DeleteFriend +): Promise => { + return request({ + method: "post", + url: "/v1/friend/delete", + data, + }); }; /** @@ -92,12 +104,14 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise => { - return request({ - method: 'post', - url: '/v1/user/contacts', - data - }); +export const getContacts = ( + data: NetParams.GetContacts +): Promise => { + return request({ + method: "post", + url: "/v1/user/contacts", + data, + }); }; /** @@ -105,12 +119,14 @@ export const sendUserWhisper = (data: NetParams.UserWhisper): Promise => { - return request({ - method: 'post', - url: '/v1/user/phone', - data - }); +export const bindUserPhone = ( + data: NetParams.UserBindUserPhone +): Promise => { + return request({ + method: "post", + url: "/v1/user/phone", + data, + }); }; /** @@ -118,30 +134,36 @@ export const bindUserPhone = (data: NetParams.UserBindUserPhone): Promise => { - return request({ - method: 'post', - url: '/v1/user/activate', - data - }); +export const activateUser = ( + data: NetParams.UserActivation +): Promise => { + return request({ + method: "post", + url: "/v1/user/activate", + data, + }); }; /** 更改密码 */ -export const changePassword = (data: NetParams.UserChangePassword): Promise => { - return request({ - method: 'post', - url: '/v1/user/password', - data - }); +export const changePassword = ( + data: NetParams.UserChangePassword +): Promise => { + return request({ + method: "post", + url: "/v1/user/password", + data, + }); }; /** 更改昵称 */ -export const changeNickname = (data: NetParams.UserChangeNickname): Promise => { - return request({ - method: 'post', - url: '/v1/user/nickname', - data - }); +export const changeNickname = ( + data: NetParams.UserChangeNickname +): Promise => { + return request({ + method: "post", + url: "/v1/user/nickname", + data, + }); }; /** @@ -150,29 +172,33 @@ export const changeNickname = (data: NetParams.UserChangeNickname): Promise { - return request({ - method: 'post', - url: '/v1/user/avatar', - data - }); + return request({ + method: "post", + url: "/v1/user/avatar", + data, + }); }; /** 获取未读消息数 */ -export const getUnreadMsgCount = (params: NetParams.UserGetUnreadMsgCount = {}): Promise => { - return request({ - method: 'get', - url: '/v1/user/msgcount/unread', - params - }); +export const getUnreadMsgCount = ( + params: NetParams.UserGetUnreadMsgCount = {} +): Promise => { + return request({ + method: "get", + url: "/v1/user/msgcount/unread", + params, + }); }; /** 获取消息列表 */ -export const getMessages = (params: NetParams.UserGetMessages): Promise => { - return request({ - method: 'get', - url: '/v1/user/messages', - params - }); +export const getMessages = ( + params: NetParams.UserGetMessages +): Promise => { + return request({ + method: "get", + url: "/v1/user/messages", + params, + }); }; /** @@ -181,47 +207,55 @@ export const getMessages = (params: NetParams.UserGetMessages): Promise { - return request({ - method: 'post', - url: '/v1/user/message/read', - data - }); + return request({ + method: "post", + url: "/v1/user/message/read", + data, + }); }; /** 获取收藏列表 */ -export const getCollections = (params: NetParams.UserGetCollections): Promise => { - return request({ - method: 'get', - url: '/v1/user/collections', - params - }); +export const getCollections = ( + params: NetParams.UserGetCollections +): Promise => { + return request({ + method: "get", + url: "/v1/user/collections", + params, + }); }; /** 获取用户基础信息 */ -export const getUserProfile = (params: NetParams.UserGetUserProfile): Promise => { - return request({ - method: 'get', - url: '/v1/user/profile', - params - }); +export const getUserProfile = ( + params: NetParams.UserGetUserProfile +): Promise => { + return request({ + method: "get", + url: "/v1/user/profile", + params, + }); }; /** 获取用户帖子列表 */ -export const getUserPosts = (params: NetParams.UserGetUserPosts): Promise => { - return request({ - method: 'get', - url: '/v1/user/posts', - params - }); +export const getUserPosts = ( + params: NetParams.UserGetUserPosts +): Promise => { + return request({ + method: "get", + url: "/v1/user/posts", + params, + }); }; /** 获取账单列表 */ -export const getBills = (params: NetParams.UserGetBills): Promise => { - return request({ - method: 'get', - url: '/v1/user/wallet/bills', - params - }); +export const getBills = ( + params: NetParams.UserGetBills +): Promise => { + return request({ + method: "get", + url: "/v1/user/wallet/bills", + params, + }); }; /** @@ -229,12 +263,14 @@ export const getBills = (params: NetParams.UserGetBills): Promise => { - return request({ - method: 'post', - url: '/v1/user/recharge', - data - }); +export const reqRecharge = ( + data: NetParams.UserReqRecharge +): Promise => { + return request({ + method: "post", + url: "/v1/user/recharge", + data, + }); }; /** @@ -242,12 +278,14 @@ export const reqRecharge = (data: NetParams.UserReqRecharge): Promise => { - return request({ - method: 'get', - url: '/v1/user/recharge', - params - }); +export const getRecharge = ( + params: NetParams.UserGetRecharge +): Promise => { + return request({ + method: "get", + url: "/v1/user/recharge", + params, + }); }; /** @@ -255,12 +293,14 @@ export const getRecharge = (params: NetParams.UserGetRecharge): Promise => { - return request({ - method: 'get', - url: '/v1/suggest/users', - params - }); +export const getSuggestUsers = (params: { + k: string; +}): Promise => { + return request({ + method: "get", + url: "/v1/suggest/users", + params, + }); }; /** @@ -268,12 +308,14 @@ export const getSuggestUsers = (params: { k: string }): Promise => { - return request({ - method: 'get', - url: '/v1/suggest/tags', - params - }); +export const getSuggestTags = (params: { + k: string; +}): Promise => { + return request({ + method: "get", + url: "/v1/suggest/tags", + params, + }); }; /** @@ -281,12 +323,14 @@ export const getSuggestTags = (params: { k: string }): Promise => { - return request({ - method: 'get', - url: '/v1/attachment/precheck', - params - }); +export const precheckAttachment = ( + params: NetParams.UserPrecheckAttachment +): Promise => { + return request({ + method: "get", + url: "/v1/attachment/precheck", + params, + }); }; /** @@ -294,12 +338,14 @@ export const precheckAttachment = (params: NetParams.UserPrecheckAttachment): Pr * @param {Object} params * @returns Promise */ -export const getAttachment = (params: NetParams.UserGetAttachment): Promise => { - return request({ - method: 'get', - url: '/v1/attachment', - params - }); +export const getAttachment = ( + params: NetParams.UserGetAttachment +): Promise => { + return request({ + method: "get", + url: "/v1/attachment", + params, + }); }; /** @@ -307,10 +353,12 @@ export const getAttachment = (params: NetParams.UserGetAttachment): Promise => { - return request({ - method: 'post', - url: '/v1/admin/user/status', - data - }); +export const changeUserStatus = ( + data: NetParams.UserStatusReq +): Promise => { + return request({ + method: "post", + url: "/v1/admin/user/status", + data, + }); }; diff --git a/web/src/assets/css/main.less b/web/src/assets/css/main.less index b33e6dac..5cde672f 100644 --- a/web/src/assets/css/main.less +++ b/web/src/assets/css/main.less @@ -1,6 +1,6 @@ :root { // 如果要变更中间栏的大小,修改此处即可 - --content-main: 500px; + --content-main: 600px; } .app-container { @@ -93,8 +93,6 @@ @media screen and (max-width: 821px) { .content-wrap { top: 0; - left: 60px; position: absolute !important; - width: calc(100% - 60px) !important; } } \ No newline at end of file diff --git a/web/src/components/auth.vue b/web/src/components/auth.vue index 0e7d50c8..4ea830fa 100644 --- a/web/src/components/auth.vue +++ b/web/src/components/auth.vue @@ -12,7 +12,52 @@ >
+
+ 账号登录 + + + + + + + + + + 登录 + +
{ store.commit('updateUserinfo', res); store.commit('triggerAuth', false); + store.commit('refresh') loginForm.username = ''; loginForm.password = ''; }) @@ -253,4 +300,9 @@ onMounted(() => { .auth-wrap { margin-top: -30px; } +.dark { + .auth-wrap { + background-color: rgba(16, 16, 20, 0.75); + } +} \ No newline at end of file diff --git a/web/src/components/comment-item.vue b/web/src/components/comment-item.vue index 7c2ad228..10c218f4 100644 --- a/web/src/components/comment-item.vue +++ b/web/src/components/comment-item.vue @@ -24,12 +24,7 @@
@@ -103,7 +97,6 @@ import { ref, computed } from 'vue'; import { useStore } from 'vuex'; import { useRouter } from 'vue-router'; -import { formatRelativeTime } from '@/utils/formatTime'; import { parsePostTag } from '@/utils/content'; import { Trash } from '@vicons/tabler'; import { deleteComment } from '@/api/post'; @@ -247,5 +240,8 @@ const execDelAction = () => { .reply-wrap { background: #18181c; } + .comment-item { + background-color: rgba(16, 16, 20, 0.75); + } } \ No newline at end of file diff --git a/web/src/components/compose-comment.vue b/web/src/components/compose-comment.vue index 226adaf1..d611fbaa 100644 --- a/web/src/components/compose-comment.vue +++ b/web/src/components/compose-comment.vue @@ -44,6 +44,7 @@ :data="{ type: uploadType, }" + :file-list="fileQueue" @before-upload="beforeUpload" @finish="finishUpload" @error="failUpload" @@ -88,10 +89,10 @@ :show-indicator="false" status="success" :stroke-width="10" - :percentage="(content.length / 200) * 100" + :percentage="(content.length / defaultCommentMaxLength) * 100" /> - {{ content.length }} / 200 + {{ content.length }} / {{ defaultCommentMaxLength }}
@@ -129,7 +130,18 @@ - @@ -195,17 +219,28 @@ \ No newline at end of file + diff --git a/web/src/components/reply-item.vue b/web/src/components/reply-item.vue index 5f75a038..3e2fd176 100644 --- a/web/src/components/reply-item.vue +++ b/web/src/components/reply-item.vue @@ -2,46 +2,29 @@
- + {{ props.reply.user.username }} {{ props.reply.at_user_id > 0 ? '回复' : ':' }} - + {{ props.reply.at_user.username }}
- {{ - props.reply.ip_loc - ? props.reply.ip_loc + ' · ' - : props.reply.ip_loc - }} - {{ formatRelativeTime(props.reply.created_on) }} - + {{ props.reply.ip_loc }} + \ No newline at end of file diff --git a/web/src/views/Setting.vue b/web/src/views/Setting.vue index 041c6816..32925440 100644 --- a/web/src/views/Setting.vue +++ b/web/src/views/Setting.vue @@ -772,4 +772,9 @@ onMounted(() => { } } } +.dark { + .setting-card { + background-color: rgba(16, 16, 20, 0.75); + } +} \ No newline at end of file diff --git a/web/src/views/Topic.vue b/web/src/views/Topic.vue index dd91b9b5..474907ca 100644 --- a/web/src/views/Topic.vue +++ b/web/src/views/Topic.vue @@ -6,33 +6,23 @@ + + - - - #{{ tag.tag }} - - ({{ tag.quote_num }}) - - + @@ -40,13 +30,35 @@