diff --git a/.codeclimate.yml b/.codeclimate.yml index a3b960126ff8c9d340f14e6ce4906527f4fad133..1a58b3ee0697e764ca8e089cab3f94f2161f59fe 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,12 +1,6 @@ --- version: "2" plugins: - govet: - enabled: true - sonar-php: - enabled: true - sonar-python: - enabled: true csslint: enabled: true coffeelint: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f68dd78a35e02d4e91a14e078d0a4847788d6463..21cbb611ab11de6a31a21a15932249bdfaf82041 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,29 +4,16 @@ workflow: - if: $CI_COMMIT_TAG - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH -stages: [test, qa, release] +stages: [test, release] include: - - local: 'ci/.gitlab-ci-golang.yml' - - local: 'ci/.gitlab-ci-node.yml' - - local: 'ci/.gitlab-ci-python.yml' - - local: 'ci/.gitlab-ci-php.yml' - - local: 'ci/.gitlab-ci-ruby.yml' - component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/code-quality@$CI_COMMIT_SHA inputs: - stage: qa - debug: "1" + stage: test -# We customize the `code_quality` job to enable verbose logs (for debugging), and to also save the -# code quality report so it can be inspected by other jobs to verify it works correctly. code_quality: - artifacts: - paths: - - gl-code-quality-report.json rules: - if: $CI_MERGE_REQUEST_ID || $CI_COMMIT_TAG || $CI_COMMIT_BRANCH - tags: - - saas-linux-medium-amd64 ensure-job-added: stage: test diff --git a/ci/.gitlab-ci-golang.yml b/ci/.gitlab-ci-golang.yml deleted file mode 100644 index 57f91f61aa2119a568a48e8b520c7e9a43686408..0000000000000000000000000000000000000000 --- a/ci/.gitlab-ci-golang.yml +++ /dev/null @@ -1,30 +0,0 @@ -run-golang-test: - image: golang:latest - stage: test - variables: - GO_ENV: test - before_script: - - go version # Print out golang version for debugging - - apt-get update - - apt-get install sqlite3 - - mkdir -p $GOPATH/src/gitlab.com/test-code-quality-ci-component/sample-golang-echo-app - - mv $CI_PROJECT_DIR/src/sample-golang-echo-app/* $GOPATH/src/gitlab.com/test-code-quality-ci-component/sample-golang-echo-app - - cd $GOPATH/src/gitlab.com/test-code-quality-ci-component/sample-golang-echo-app - - go install github.com/ybkuroki/go-webapp-sample@latest - - go mod download - - export PATH="$PATH:$GOPATH/bin" - script: - - go test -v ./... - -verify-golang-findings: - image: badouralix/curl-jq - stage: qa - needs: - - code_quality - script: - - echo "Expect code_quality job will have at least 1 govet offense" - - | - count=`jq 'map(select(.engine_name=="govet")) | length' gl-code-quality-report.json` - if [ "$count" == "0" ]; then - exit 1 - fi diff --git a/ci/.gitlab-ci-node.yml b/ci/.gitlab-ci-node.yml deleted file mode 100644 index 1d440856d674238e03451dfcd5e1cfb7bc53e06c..0000000000000000000000000000000000000000 --- a/ci/.gitlab-ci-node.yml +++ /dev/null @@ -1,27 +0,0 @@ -run-node-test: - image: node:latest - stage: test - cache: - paths: - - node_modules/ - before_script: - - node -v # Print out node version for debugging - - cd src/sample-node-remix-app - - npm install - script: - - npm run test - -verify-node-findings: - image: badouralix/curl-jq - stage: qa - needs: - - code_quality - script: - - echo "Expect code_quality job will have at least 1 eslint, 1 structure and 1 duplication findings" - - | - eslint_count=`jq 'map(select(.engine_name=="eslint")) | length' gl-code-quality-report.json` - structure_count=`jq 'map(select(.engine_name=="structure")) | length' gl-code-quality-report.json` - duplication_count=`jq 'map(select(.engine_name=="duplication")) | length' gl-code-quality-report.json` - if [ "$eslint_count" == "0" ] || [ "$structure_count" == "0" ] || [ "$duplication_count" == "0" ]; then - exit 1 - fi diff --git a/ci/.gitlab-ci-php.yml b/ci/.gitlab-ci-php.yml deleted file mode 100644 index 0cc46cf08a4c6d1704694eeac33d696826a4a456..0000000000000000000000000000000000000000 --- a/ci/.gitlab-ci-php.yml +++ /dev/null @@ -1,41 +0,0 @@ -run-php-laravel-test: - image: php:8.2-cli - stage: test - services: - - mysql:latest - variables: - MYSQL_DATABASE: php_laravel_app - MYSQL_ROOT_PASSWORD: secret - DB_HOST: mysql - DB_USERNAME: root - cache: - paths: - - vendor/ - before_script: - - php -v # Print out php version for debugging - - cd src/sample-php-laravel-app - - cp .env.example .env - - apt-get update - - apt-get install -qq git curl libmcrypt-dev libjpeg-dev libpng-dev libfreetype6-dev libbz2-dev libzip-dev - - apt-get clean - - docker-php-ext-install pdo_mysql zip - - curl --silent --show-error "https://getcomposer.org/installer" | php -- --install-dir=/usr/local/bin --filename=composer - - composer install - - php artisan key:generate - - php artisan migrate - script: - - vendor/bin/phpunit - -verify-php-findings: - image: badouralix/curl-jq - stage: qa - needs: - - code_quality - script: - - echo "Expect code_quality job will have at least 1 sonar-php offense" - - | - count=`jq 'map(select(.engine_name=="sonar-php")) | length' gl-code-quality-report.json` - if [ "$count" == "0" ]; then - exit 1 - fi - diff --git a/ci/.gitlab-ci-python.yml b/ci/.gitlab-ci-python.yml deleted file mode 100644 index f71a5bacf505bc3e0d76d0266c1bd8bd828ef201..0000000000000000000000000000000000000000 --- a/ci/.gitlab-ci-python.yml +++ /dev/null @@ -1,41 +0,0 @@ -run-python-test: - image: ubuntu:20.04 - stage: test - services: - - mysql:latest - variables: - MYSQL_DATABASE: python_django_app - MYSQL_ROOT_PASSWORD: secret - cache: - paths: - - ~/.cache/pip/ - before_script: - - cd src/sample-python-django-app - - apt -y update - - apt -y install apt-utils - - DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata - - apt -y install net-tools python3.8 python3-pip python3-venv mysql-client libmysqlclient-dev pkg-config - - apt -y upgrade - - python3 -m venv env - - source env/bin/activate - - env/bin/python -V # Print out python version for debugging - - env/bin/pip install Django mysqlclient - - env/bin/pip freeze > requirements.txt - - env/bin/pip install -r requirements.txt - script: - # The MYSQL user only gets permissions for MYSQL_DB, so Django can't create a test database. - - echo "GRANT ALL on *.* to 'root';"| mysql -u root --password="secret" -h mysql - - env/bin/python manage.py test - -verify-python-findings: - image: badouralix/curl-jq - stage: qa - needs: - - code_quality - script: - - echo "Expect code_quality job will have at least 1 sonar-python finding" - - | - count=`jq 'map(select(.engine_name=="sonar-python")) | length' gl-code-quality-report.json` - if [ "$count" == "0" ]; then - exit 1 - fi diff --git a/ci/.gitlab-ci-ruby.yml b/ci/.gitlab-ci-ruby.yml deleted file mode 100644 index 1f52e20bc78768097e6f1e023bbac6ee29b7b2e3..0000000000000000000000000000000000000000 --- a/ci/.gitlab-ci-ruby.yml +++ /dev/null @@ -1,55 +0,0 @@ -run-ruby-rails-test: - image: ruby:3.2.2 - stage: test - cache: - paths: - - vendor/ruby - before_script: - - ruby -v # Print out ruby version for debugging - - apt-get update -q && apt-get install nodejs -yqq - - cd src/sample-ruby-rails-app - - bundle lock --add-platform aarch64-linux - - bundle config set --local deployment true - - bundle install -j $(nproc) - script: - - bin/rails test - -run-ruby-gem-test: - image: ruby:latest - stage: test - cache: - paths: - - vendor/ruby - before_script: - - ruby -v # Print out ruby version for debugging - - apt-get update -q && apt-get install nodejs -yqq - - cd src/sample-ruby-gem - - bin/setup - script: - - rake spec - -verify-ruby-rails-findings: - image: badouralix/curl-jq - stage: qa - needs: - - code_quality - script: - - echo "Expect code_quality job will have at least 1 rubocop offense" - - | - count=`jq 'map(select(.engine_name=="rubocop")) | length' gl-code-quality-report.json` - if [ "$count" == "0" ]; then - exit 1 - fi - -verify-ruby-gem-findings: - image: badouralix/curl-jq - stage: qa - needs: - - code_quality - script: - - echo "Expect code_quality job will have at least 1 fixme offense" - - | - count=`jq 'map(select(.engine_name=="fixme")) | length' gl-code-quality-report.json` - if [ "$count" == "0" ]; then - exit 1 - fi diff --git a/src/sample-golang-echo-app/.github/.golangci.yml b/src/sample-golang-echo-app/.github/.golangci.yml deleted file mode 100644 index 1801df17a56c40168a995a83ade291cc02401cec..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/.github/.golangci.yml +++ /dev/null @@ -1,112 +0,0 @@ -# ref: https://github.com/golangci/golangci-lint/blob/master/.golangci.yml -# all available settings of specific linters -run: - concurrency: 4 - timeout: 3m - -linters-settings: - dupl: - threshold: 150 - funlen: - lines: 100 - statements: 50 - goconst: - min-len: 3 - min-occurrences: 2 - gocyclo: - min-complexity: 15 - gomnd: - # don't include the "operation" and "assign" - checks: - - argument - - case - - condition - - return - gofmt: - simplify: true - govet: - check-shadowing: true - settings: - printf: - funcs: - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf - lll: - line-length: 120 - misspell: - locale: US - nakedret: - max-func-lines: 20 - revive: - ignore-generated-header: true - severity: warning - confidence: 0.8 - errorCode: 0 - warningCode: 0 - rules: - - name: blank-imports - - name: context-as-argument - - name: context-keys-type - - name: dot-imports - - name: error-return - - name: error-strings - - name: error-naming - - name: exported - - name: if-return - - name: increment-decrement - - name: var-naming - - name: var-declaration - - name: package-comments - - name: range - - name: receiver-naming - - name: time-naming - - name: unexported-return - - name: indent-error-flow - - name: errorf - - name: empty-block - - name: superfluous-else - - name: unused-parameter - - name: unreachable-code - - name: redefines-builtin-id - -linters: - disable-all: true - enable: - # default - # ref: https://golangci-lint.run/usage/linters/ - #- deadcode - #- errcheck - #- gosimple - #- govet - #- ineffassign - #- staticcheck - #- structcheck - #- typecheck - #- unused - #- varcheck - # add - - dupl - - errcheck - - funlen - - goconst - - gocyclo - - gofmt - - goimports - - gomnd - - govet - - lll - - misspell - - nakedret - - staticcheck - - stylecheck - - typecheck - - unconvert - - unparam - - revive - -# https://github.com/golangci/golangci/wiki/Configuration -# latest version: https://github.com/golangci/golangci-lint -service: - golangci-lint-version: 1.51.2 diff --git a/src/sample-golang-echo-app/.github/ISSUE_TEMPLATE/bug_report.md b/src/sample-golang-echo-app/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 69fdb0114fb2486202c35747fc44933a9d8c8097..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "[BUG]" -labels: bug -assignees: '' - ---- - -## Summary -> Write the actual behavior and the purpose to modify. - -## Cause -> Why such a problem happened? - -### To reproduce -Perform the follwing steps to reproduce the problem. - -1. … -1. … - -## Expected behavior -Expected the follwing behavior. - -## How to deal with this issue -> How do you fix it? - -## Notes diff --git a/src/sample-golang-echo-app/.github/ISSUE_TEMPLATE/feature_request.md b/src/sample-golang-echo-app/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 792495bd321d790c0e51d3db5910b880ace2820e..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: "[NEW]" -labels: enhancement -assignees: '' - ---- - -## Purpose -> What is it necessary for? - -## Expected behavior -Expected the follwing behavior. - -## How to deal with this issue -> How do you fix it? - -## Notes diff --git a/src/sample-golang-echo-app/.github/dependabot.yml b/src/sample-golang-echo-app/.github/dependabot.yml deleted file mode 100644 index 459b7f171be80c94fca88316cce224f4c29bee90..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/.github/dependabot.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: 2 -updates: - - package-ecosystem: gomod - directory: "/" - schedule: - interval: daily - - package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily \ No newline at end of file diff --git a/src/sample-golang-echo-app/.github/pull_request_template.md b/src/sample-golang-echo-app/.github/pull_request_template.md deleted file mode 100644 index 151065d3cbd33b63160c50a23313162c64b289dc..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/.github/pull_request_template.md +++ /dev/null @@ -1,9 +0,0 @@ -### Fixes #[ISSUE NUMBER]. - -Changes proposed in this pull request: - -- ... -- ... -- ... - -by [YOUR NAME] diff --git a/src/sample-golang-echo-app/.github/workflows/check.yml b/src/sample-golang-echo-app/.github/workflows/check.yml deleted file mode 100644 index e279b3bc2ece13efe65bb346a6b606e52960fd25..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/.github/workflows/check.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: check - -on: - pull_request: - branches: [ master ] - -jobs: - check: - name: check - runs-on: ubuntu-latest - steps: - # Set up GOPATH - - name: set up - uses: actions/setup-go@v4 - with: - go-version: '1.20' - id: go - # Check out this repository - - name: checkout - uses: actions/checkout@v3 - # Store cache - - name: cache - uses: actions/cache@v3.3.1 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - # Run golangci-lint using reviewdog - - name: golangci-lint - uses: reviewdog/action-golangci-lint@v2 - with: - github_token: ${{ secrets.github_token }} - level: warning - golangci_lint_flags: "--config=.github/.golangci.yml" - reporter: github-pr-review - # Run test - - name: test - run: go test -cover ./... diff --git a/src/sample-golang-echo-app/.github/workflows/release.yml b/src/sample-golang-echo-app/.github/workflows/release.yml deleted file mode 100644 index 926252c68a5d111700e9a429bc6eb99f2ed7fbff..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/.github/workflows/release.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: release -on: - push: - tags: - - "v[0-9]+.[0-9]+.[0-9]+" -jobs: - goreleaser: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4.2.0 - with: - version: latest - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/sample-golang-echo-app/.gitignore b/src/sample-golang-echo-app/.gitignore deleted file mode 100644 index b851cf98aa22b7c816fc82f6891d9b3d6f2342a2..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib -*.db - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -#vendor/ - -# Output file of the swaggo/swag -swagger.json -swagger.yaml - -# Debug folder -.vscode diff --git a/src/sample-golang-echo-app/.goreleaser.yml b/src/sample-golang-echo-app/.goreleaser.yml deleted file mode 100644 index 5269a1a9f993b78f88800069590d9e6d5699ce15..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/.goreleaser.yml +++ /dev/null @@ -1,52 +0,0 @@ -# This is an example .goreleaser.yml file with some sensible defaults. -# Make sure to check the documentation at https://goreleaser.com -project_name: go-webapp-sample -env: - - GO111MODULE=on -before: - hooks: - # You may remove this if you don't use go modules. - - go mod tidy -builds: - - main: . - binary: go-webapp-sample - ldflags: - - -s -w - - -X main.Version={{.Version}} - - -X main.Revision={{.ShortCommit}} - env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin - -archives: - - format: tar.gz - # this name template makes the OS and Arch compatible with the results of uname. - name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - {{- if .Arm }}v{{ .Arm }}{{ end }} - # use zip for windows archives - format_overrides: - - goos: windows - format: zip -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ incpatch .Version }}-next" -changelog: - filters: - exclude: - - polish - - bump - - typo - -# The lines beneath this are called `modelines`. See `:help modeline` -# Feel free to remove those if you don't want/use them. -# yaml-language-server: $schema=https://goreleaser.com/static/schema.json -# vim: set ts=2 sw=2 tw=0 fo=cnqoj diff --git a/src/sample-golang-echo-app/CONTRIBUTING.md b/src/sample-golang-echo-app/CONTRIBUTING.md deleted file mode 100644 index 88ab1cc1baab39cdb4ac598ac651c4cd6b05ee49..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/CONTRIBUTING.md +++ /dev/null @@ -1,31 +0,0 @@ -# Contribution -## Preface -Thank you for considering to contribute to this sample application. -I have created this sample application to be helpful as possible whenever you choose to develop a web application using golang. - -## How to report a bug -Please create an issue which highlights the following points when you report a bug: - -1. Version of golang you are using. -1. Operating system you are using. -1. Reproduce the bug. -1. Expected behavior (if any). - -Also, please write about it when you know the causes and how to fix the bug. - -1. Cause -1. How to fix - -## How to suggest a feature or enhancement -Please create an issue which highlights the purpose (feature or enhancement) and expected behavior, and also the functions which you would like to implement as a sample. - -1. Purpose. -1. Expected behavoir (if any), What kind of function do you propose? -1. How to develop - -## How to create a pull request -You can feel free to fork this repository, fix the source code and create a pull request when you are certain that you can resolve an issue. -And after that, please check passed the check workflow of GitHub Action. - -I will check your pull request, and I may suggest some improvements or alternatives. -If there was no problem, I will merge your changes. diff --git a/src/sample-golang-echo-app/LICENSE b/src/sample-golang-echo-app/LICENSE deleted file mode 100644 index 5b3af9864081c3a41ce6cbf8553cff2495e92660..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Yuta Kuroki - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/sample-golang-echo-app/README.md b/src/sample-golang-echo-app/README.md deleted file mode 100644 index 68b95b1e8f36f4357f941ab3a4f109e4e969b636..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/README.md +++ /dev/null @@ -1,182 +0,0 @@ -# go-webapp-sample - -[![license](https://img.shields.io/github/license/ybkuroki/go-webapp-sample?style=for-the-badge)](https://github.com/ybkuroki/go-webapp-sample/blob/master/LICENSE) -[![report](https://goreportcard.com/badge/github.com/ybkuroki/go-webapp-sample?style=for-the-badge)](https://goreportcard.com/report/github.com/ybkuroki/go-webapp-sample) -[![workflow](https://img.shields.io/github/actions/workflow/status/ybkuroki/go-webapp-sample/check.yml?label=check&logo=github&style=for-the-badge)](https://github.com/ybkuroki/go-webapp-sample/actions?query=workflow%3Acheck) -[![release](https://img.shields.io/github/release/ybkuroki/go-webapp-sample?style=for-the-badge&logo=github)](https://github.com/ybkuroki/go-webapp-sample/releases) - -## Preface -This repository is the sample of web application using golang. -This sample uses [Echo](https://echo.labstack.com/) as web application framework, [Gorm](https://gorm.io/) as OR mapper and [Zap logger](https://pkg.go.dev/go.uber.org/zap) as logger. -This sample application provides only several functions as Web APIs. -Please refer to the 'Service' section about the detail of those functions. - -Also, this application contains the static contents such as html file, css file and javascript file which built [vuejs-webapp-sample](https://github.com/ybkuroki/vuejs-webapp-sample) project to easily check the behavior of those functions. -So, you can check this application without starting a web server for front end. -Please refer to the 'Starting Server' section about checking the behavior of this application. - -If you would like to develop a web application using golang, please feel free to use this sample. - -## Install -Perform the following steps: -1. Download(`x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z`) and install [MinGW(gcc)](https://sourceforge.net/projects/mingw-w64/files/?source=navbar). -1. Download and install [Visual Studio Code(VS Code)](https://code.visualstudio.com/). -1. Download and install [Golang](https://golang.org/). -1. Get the source code of this repository by the following command. - ```bash - go install github.com/ybkuroki/go-webapp-sample@latest - ``` - -## Starting Server -There are 2 methods for starting server. - -### Without Web Server -1. Starting this web application by the following command. - ```bash - go run main.go - ``` -1. When startup is complete, the console shows the following message: - ``` - http server started on [::]:8080 - ``` -1. Access [http://localhost:8080](http://localhost:8080) in your browser. -1. Login with the following username and password. - - username : ``test`` - - password : ``test`` - -### With Web Server -#### Starting Application Server -1. Starting this web application by the following command. - ```bash - go run main.go - ``` -1. When startup is complete, the console shows the following message: - ``` - http server started on [::]:8080 - ``` -1. Access [http://localhost:8080/api/health](http://localhost:8080/api/health) in your browser and confirm that this application has started. - ``` - healthy - ``` -#### Starting Web Server -1. Clone [vuejs-webapp-sample](https://github.com/ybkuroki/vuejs-webapp-sample) project and install some tools. -1. Start by the following command. - ```bash - npm run serve - ``` -1. When startup is complete, the console shows the following message: - ``` - DONE Compiled successfully in *****ms - - App running at: - - Local: http://localhost:3000/ - - Network: http://192.168.***.***:3000/ - - Note that the development build is not optimized. - To create a production build, run npm run build. - ``` -1. Access [http://localhost:3000](http://localhost:3000) in your browser. -1. Login with the following username and password. - - username : ``test`` - - password : ``test`` - -## Using Swagger -In this sample, Swagger is enabled only when executed this application on the development environment. -Swagger isn't enabled on the another environments in default. - -### Accessing to Swagger -1. Start this application according to the 'Starting Application Server' section. -2. Access [http://localhost:8080/swagger/index.html](http://localhost:8080/swagger/index.html) in your browser. - -### Updating the existing Swagger document -1. Update some comments of some controllers. -2. Download Swag library. (Only first time) - ```bash - go install github.com/swaggo/swag/cmd/swag@latest - ``` -3. Update ``docs/docs.go``. - ```bash - swag init - ``` - -## Build executable file -Build this source code by the following command. -```bash -go build main.go -``` - -## Project Map -The following figure is the map of this sample project. - -``` -- go-webapp-sample - + config … Define configurations of this system. - + logger … Provide loggers. - + middleware … Define custom middleware. - + migration … Provide database migration service for development. - + router … Define routing. - + controller … Define controllers. - + model … Define models. - + repository … Provide a service of database access. - + service … Provide a service of book management. - + session … Provide session management. - + test … for unit test - - main.go … Entry Point. -``` - -## Services -This sample provides 3 services: book management, account management, and master management. -Regarding the detail of the API specification, please refer to the 'Using Swagger' section. - -### Book Management -There are the following services in the book management. - -|Service Name|HTTP Method|URL|Parameter|Summary| -|:---|:---:|:---|:---|:---| -|Get Service|GET|``/api/books/[BOOK_ID]``|Book ID|Get a book data.| -|List/Search Service|GET|``/api/books?query=[KEYWORD]&page=[PAGE_NUMBER]&size=[PAGE_SIZE]``|Page, Keyword(Optional)|Get a list of books.| -|Regist Service|POST|``/api/books``|Book|Regist a book data.| -|Edit Service|PUT|``/api/books``|Book|Edit a book data.| -|Delete Service|DELETE|``/api/books``|Book|Delete a book data.| - -### Account Management -There are the following services in the Account management. - -|Service Name|HTTP Method|URL|Parameter|Summary| -|:---|:---:|:---|:---|:---| -|Login Service|POST|``/api/auth/login``|Session ID, User Name, Password|Session authentication with username and password.| -|Logout Service|POST|``/api/auth/logout``|Session ID|Logout a user.| -|Login Status Check Service|GET|``/api/auth/loginStatus``|Session ID|Check if the user is logged in.| -|Login Username Service|GET|``/api/auth/loginAccount``|Session ID|Get the login user's username.| - -### Master Management -There are the following services in the Master management. - -|Service Name|HTTP Method|URL|Parameter|Summary| -|:---|:---:|:---|:---|:---| -|Category List Service|GET|``/api/categories``|Nothing|Get a list of categories.| -|Format List Service|GET|``/api/formats``|Nothing|Get a list of formats.| - -## Tests -Create the unit tests only for the packages such as controller, service, model/dto and util. The test cases is included the regular cases and irregular cases. Please refer to the source code in each packages for more detail. - -The command for testing is the following: -```bash -go test ./... -v -``` - -## Libraries -This sample uses the following libraries. - -|Library Name|Version| -|:---|:---:| -|echo|4.10.2| -|gorm|1.24.6| -|go-playground/validator.v9|9.31.0| -|zap|1.24.0| - -## Contribution -Please read [CONTRIBUTING.md](https://github.com/ybkuroki/go-webapp-sample/blob/master/CONTRIBUTING.md) for proposing new functions, reporting bugs and submitting pull requests before contributing to this repository. - -## License -The License of this sample is *MIT License*. diff --git a/src/sample-golang-echo-app/config/config.go b/src/sample-golang-echo-app/config/config.go deleted file mode 100644 index afee25ef6a4cc628ae7b5284bfeccf9c094165f9..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/config/config.go +++ /dev/null @@ -1,95 +0,0 @@ -package config - -import ( - "embed" - "flag" - "fmt" - "os" - - "github.com/ybkuroki/go-webapp-sample/util" - "gopkg.in/yaml.v3" -) - -// Config represents the composition of yml settings. -type Config struct { - Database struct { - Dialect string `default:"sqlite3"` - Host string `default:"book.db"` - Port string - Dbname string - Username string - Password string - Migration bool `default:"false"` - } - Redis struct { - Enabled bool `default:"false"` - ConnectionPoolSize int `yaml:"connection_pool_size" default:"10"` - Host string - Port string - } - Extension struct { - MasterGenerator bool `yaml:"master_generator" default:"false"` - CorsEnabled bool `yaml:"cors_enabled" default:"false"` - SecurityEnabled bool `yaml:"security_enabled" default:"false"` - } - Log struct { - RequestLogFormat string `yaml:"request_log_format" default:"${remote_ip} ${account_name} ${uri} ${method} ${status}"` - } - StaticContents struct { - Enabled bool `default:"false"` - } - Swagger struct { - Enabled bool `default:"false"` - Path string - } - Security struct { - AuthPath []string `yaml:"auth_path"` - ExculdePath []string `yaml:"exclude_path"` - UserPath []string `yaml:"user_path"` - AdminPath []string `yaml:"admin_path"` - } -} - -const ( - // DEV represents development environment - DEV = "develop" - // PRD represents production environment - PRD = "production" - // DOC represents docker container - DOC = "docker" -) - -// LoadAppConfig reads the settings written to the yml file -func LoadAppConfig(yamlFile embed.FS) (*Config, string) { - var env *string - if value := os.Getenv("WEB_APP_ENV"); value != "" { - env = &value - } else { - env = flag.String("env", "develop", "To switch configurations.") - flag.Parse() - } - - file, err := yamlFile.ReadFile(fmt.Sprintf(AppConfigPath, *env)) - if err != nil { - fmt.Printf("Failed to read application.%s.yml: %s", *env, err) - os.Exit(ErrExitStatus) - } - - config := &Config{} - if err := yaml.Unmarshal(file, config); err != nil { - fmt.Printf("Failed to read application.%s.yml: %s", *env, err) - os.Exit(ErrExitStatus) - } - - return config, *env -} - -// LoadMessagesConfig loads the messages.properties. -func LoadMessagesConfig(propsFile embed.FS) map[string]string { - messages := util.ReadPropertiesFile(propsFile, MessagesConfigPath) - if messages == nil { - fmt.Printf("Failed to load the messages.properties.") - os.Exit(ErrExitStatus) - } - return messages -} diff --git a/src/sample-golang-echo-app/config/const.go b/src/sample-golang-echo-app/config/const.go deleted file mode 100644 index f4c1ef26311c018071ae8ce7c84fb5f21819dc1a..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/config/const.go +++ /dev/null @@ -1,47 +0,0 @@ -package config - -// ErrExitStatus represents the error status in this application. -const ErrExitStatus int = 2 - -const ( - // AppConfigPath is the path of application.yml. - AppConfigPath = "resources/config/application.%s.yml" - // MessagesConfigPath is the path of messages.properties. - MessagesConfigPath = "resources/config/messages.properties" - // LoggerConfigPath is the path of zaplogger.yml. - LoggerConfigPath = "resources/config/zaplogger.%s.yml" -) - -// PasswordHashCost is hash cost for a password. -const PasswordHashCost int = 10 - -const ( - // API represents the group of API. - API = "/api" - // APIBooks represents the group of book management API. - APIBooks = API + "/books" - // APIBooksID represents the API to get book data using id. - APIBooksID = APIBooks + "/:id" - // APICategories represents the group of category management API. - APICategories = API + "/categories" - // APIFormats represents the group of format management API. - APIFormats = API + "/formats" -) - -const ( - // APIAccount represents the group of auth management API. - APIAccount = API + "/auth" - // APIAccountLoginStatus represents the API to get the status of logged in account. - APIAccountLoginStatus = APIAccount + "/loginStatus" - // APIAccountLoginAccount represents the API to get the logged in account. - APIAccountLoginAccount = APIAccount + "/loginAccount" - // APIAccountLogin represents the API to login by session authentication. - APIAccountLogin = APIAccount + "/login" - // APIAccountLogout represents the API to logout. - APIAccountLogout = APIAccount + "/logout" -) - -const ( - // APIHealth represents the API to get the status of this application. - APIHealth = API + "/health" -) diff --git a/src/sample-golang-echo-app/container/container.go b/src/sample-golang-echo-app/container/container.go deleted file mode 100644 index e7a12d824b5205428c9deb918d50cfa109fa7bae..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/container/container.go +++ /dev/null @@ -1,65 +0,0 @@ -package container - -import ( - "github.com/ybkuroki/go-webapp-sample/config" - "github.com/ybkuroki/go-webapp-sample/logger" - "github.com/ybkuroki/go-webapp-sample/repository" - "github.com/ybkuroki/go-webapp-sample/session" -) - -// Container represents a interface for accessing the data which sharing in overall application. -type Container interface { - GetRepository() repository.Repository - GetSession() session.Session - GetConfig() *config.Config - GetMessages() map[string]string - GetLogger() logger.Logger - GetEnv() string -} - -// container struct is for sharing data which such as database setting, the setting of application and logger in overall this application. -type container struct { - rep repository.Repository - session session.Session - config *config.Config - messages map[string]string - logger logger.Logger - env string -} - -// NewContainer is constructor. -func NewContainer(rep repository.Repository, s session.Session, config *config.Config, - messages map[string]string, logger logger.Logger, env string) Container { - return &container{rep: rep, session: s, config: config, - messages: messages, logger: logger, env: env} -} - -// GetRepository returns the object of repository. -func (c *container) GetRepository() repository.Repository { - return c.rep -} - -// GetSession returns the object of session. -func (c *container) GetSession() session.Session { - return c.session -} - -// GetConfig returns the object of configuration. -func (c *container) GetConfig() *config.Config { - return c.config -} - -// GetMessages returns the map has key and message. -func (c *container) GetMessages() map[string]string { - return c.messages -} - -// GetLogger returns the object of logger. -func (c *container) GetLogger() logger.Logger { - return c.logger -} - -// GetEnv returns the running environment. -func (c *container) GetEnv() string { - return c.env -} diff --git a/src/sample-golang-echo-app/controller/account.go b/src/sample-golang-echo-app/controller/account.go deleted file mode 100644 index a1db16c035307cb90e99e431ada22d844dfdd30e..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/account.go +++ /dev/null @@ -1,108 +0,0 @@ -package controller - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/model" - "github.com/ybkuroki/go-webapp-sample/model/dto" - "github.com/ybkuroki/go-webapp-sample/service" -) - -// AccountController is a controller for managing user account. -type AccountController interface { - GetLoginStatus(c echo.Context) error - GetLoginAccount(c echo.Context) error - Login(c echo.Context) error - Logout(c echo.Context) error -} - -type accountController struct { - context container.Container - service service.AccountService - dummyAccount *model.Account -} - -// NewAccountController is constructor. -func NewAccountController(container container.Container) AccountController { - return &accountController{ - context: container, - service: service.NewAccountService(container), - dummyAccount: model.NewAccountWithPlainPassword("test", "test", 1), - } -} - -// GetLoginStatus returns the status of login. -// @Summary Get the login status. -// @Description Get the login status of current logged-in user. -// @Tags Auth -// @Accept json -// @Produce json -// @Success 200 {boolean} bool "The current user have already logged-in. Returns true." -// @Failure 401 {boolean} bool "The current user haven't logged-in yet. Returns false." -// @Router /auth/loginStatus [get] -func (controller *accountController) GetLoginStatus(c echo.Context) error { - return c.JSON(http.StatusOK, true) -} - -// GetLoginAccount returns the account data of logged in user. -// @Summary Get the account data of logged-in user. -// @Description Get the account data of logged-in user. -// @Tags Auth -// @Accept json -// @Produce json -// @Success 200 {object} model.Account "Success to fetch the account data. If the security function is disable, it returns the dummy data." -// @Failure 401 {boolean} bool "The current user haven't logged-in yet. Returns false." -// @Router /auth/loginAccount [get] -func (controller *accountController) GetLoginAccount(c echo.Context) error { - if !controller.context.GetConfig().Extension.SecurityEnabled { - return c.JSON(http.StatusOK, controller.dummyAccount) - } - return c.JSON(http.StatusOK, controller.context.GetSession().GetAccount()) -} - -// Login is the method to login using username and password by http post. -// @Summary Login using username and password. -// @Description Login using username and password. -// @Tags Auth -// @Accept json -// @Produce json -// @Param data body dto.LoginDto true "User name and Password for logged-in." -// @Success 200 {object} model.Account "Success to the authentication." -// @Failure 401 {boolean} bool "Failed to the authentication." -// @Router /auth/login [post] -func (controller *accountController) Login(c echo.Context) error { - dto := dto.NewLoginDto() - if err := c.Bind(dto); err != nil { - return c.JSON(http.StatusBadRequest, dto) - } - - sess := controller.context.GetSession() - if account := sess.GetAccount(); account != nil { - return c.JSON(http.StatusOK, account) - } - - authenticate, a := controller.service.AuthenticateByUsernameAndPassword(dto.UserName, dto.Password) - if authenticate { - _ = sess.SetAccount(a) - _ = sess.Save() - return c.JSON(http.StatusOK, a) - } - return c.NoContent(http.StatusUnauthorized) -} - -// Logout is the method to logout by http post. -// @Summary Logout. -// @Description Logout. -// @Tags Auth -// @Accept json -// @Produce json -// @Success 200 -// @Router /auth/logout [post] -func (controller *accountController) Logout(c echo.Context) error { - sess := controller.context.GetSession() - _ = sess.SetAccount(nil) - _ = sess.Delete() - return c.NoContent(http.StatusOK) -} diff --git a/src/sample-golang-echo-app/controller/account_test.go b/src/sample-golang-echo-app/controller/account_test.go deleted file mode 100644 index 2aab8359f636458e88377596298c1bf01cf3f030..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/account_test.go +++ /dev/null @@ -1,106 +0,0 @@ -package controller - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/labstack/echo/v4" - "github.com/stretchr/testify/assert" - "github.com/ybkuroki/go-webapp-sample/config" - "github.com/ybkuroki/go-webapp-sample/model" - "github.com/ybkuroki/go-webapp-sample/model/dto" - "github.com/ybkuroki/go-webapp-sample/test" -) - -func TestGetLoginStatus_Success(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - account := NewAccountController(container) - router.GET(config.APIAccountLoginStatus, func(c echo.Context) error { return account.GetLoginStatus(c) }) - - req := httptest.NewRequest("GET", config.APIAccountLoginStatus, nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - assert.Equal(t, http.StatusOK, rec.Code) - assert.JSONEq(t, "true", rec.Body.String()) -} - -func TestGetLoginAccount_Success(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - account := NewAccountController(container) - router.GET(config.APIAccountLoginAccount, func(c echo.Context) error { return account.GetLoginAccount(c) }) - - req := httptest.NewRequest("GET", config.APIAccountLoginAccount, nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - entity := model.NewAccountWithPlainPassword("test", "test", 1) - assert.Equal(t, http.StatusOK, rec.Code) - assert.JSONEq(t, test.ConvertToString(entity), rec.Body.String()) -} - -func TestLogin_Success(t *testing.T) { - router, container := test.PrepareForControllerTest(true) - - account := NewAccountController(container) - router.POST(config.APIAccountLogin, func(c echo.Context) error { return account.Login(c) }) - - param := createLoginSuccessAccount() - req := test.NewJSONRequest("POST", config.APIAccountLogin, param) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - assert.Equal(t, http.StatusOK, rec.Code) - assert.NotEmpty(t, test.GetCookie(rec, "GSESSION")) -} - -func TestLogin_AuthenticationFailure(t *testing.T) { - router, container := test.PrepareForControllerTest(true) - - account := NewAccountController(container) - router.POST(config.APIAccountLogin, func(c echo.Context) error { return account.Login(c) }) - - param := createLoginFailureAccount() - req := test.NewJSONRequest("POST", config.APIAccountLogin, param) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - assert.Equal(t, http.StatusUnauthorized, rec.Code) - assert.Empty(t, test.GetCookie(rec, "GSESSION")) -} - -func TestLogout_Success(t *testing.T) { - router, container := test.PrepareForControllerTest(true) - - account := NewAccountController(container) - router.POST(config.APIAccountLogout, func(c echo.Context) error { return account.Logout(c) }) - - req := test.NewJSONRequest("POST", config.APIAccountLogout, nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - assert.Equal(t, http.StatusOK, rec.Code) - assert.NotEmpty(t, test.GetCookie(rec, "GSESSION")) -} - -func createLoginSuccessAccount() *dto.LoginDto { - return &dto.LoginDto{ - UserName: "test", - Password: "test", - } -} - -func createLoginFailureAccount() *dto.LoginDto { - return &dto.LoginDto{ - UserName: "test", - Password: "abcde", - } -} diff --git a/src/sample-golang-echo-app/controller/book.go b/src/sample-golang-echo-app/controller/book.go deleted file mode 100644 index 2b6de4e1bfa7ea912a3a11be253a0aefb8173af1..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/book.go +++ /dev/null @@ -1,135 +0,0 @@ -package controller - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/model/dto" - "github.com/ybkuroki/go-webapp-sample/service" -) - -// BookController is a controller for managing books. -type BookController interface { - GetBook(c echo.Context) error - GetBookList(c echo.Context) error - CreateBook(c echo.Context) error - UpdateBook(c echo.Context) error - DeleteBook(c echo.Context) error -} - -type bookController struct { - container container.Container - service service.BookService -} - -// NewBookController is constructor. -func NewBookController(container container.Container) BookController { - return &bookController{container: container, service: service.NewBookService(container)} -} - -// GetBook returns one record matched book's id. -// @Summary Get a book -// @Description Get a book -// @Tags Books -// @Accept json -// @Produce json -// @Param book_id path int true "Book ID" -// @Success 200 {object} model.Book "Success to fetch data." -// @Failure 400 {string} message "Failed to fetch data." -// @Failure 401 {boolean} bool "Failed to the authentication. Returns false." -// @Router /books/{book_id} [get] -func (controller *bookController) GetBook(c echo.Context) error { - book, err := controller.service.FindByID(c.Param("id")) - if err != nil { - return c.JSON(http.StatusBadRequest, err.Error()) - } - return c.JSON(http.StatusOK, book) -} - -// GetBookList returns the list of matched books by searching. -// @Summary Get a book list -// @Description Get the list of matched books by searching -// @Tags Books -// @Accept json -// @Produce json -// @Param query query string false "Keyword" -// @Param page query int false "Page number" -// @Param size query int false "Item size per page" -// @Success 200 {object} model.Page "Success to fetch a book list." -// @Failure 400 {string} message "Failed to fetch data." -// @Failure 401 {boolean} bool "Failed to the authentication. Returns false." -// @Router /books [get] -func (controller *bookController) GetBookList(c echo.Context) error { - book, err := controller.service.FindBooksByTitle(c.QueryParam("query"), c.QueryParam("page"), c.QueryParam("size")) - if err != nil { - return c.JSON(http.StatusBadRequest, err.Error()) - } - return c.JSON(http.StatusOK, book) -} - -// CreateBook create a new book by http post. -// @Summary Create a new book -// @Description Create a new book -// @Tags Books -// @Accept json -// @Produce json -// @Param data body dto.BookDto true "a new book data for creating" -// @Success 200 {object} model.Book "Success to create a new book." -// @Failure 400 {string} message "Failed to the registration." -// @Failure 401 {boolean} bool "Failed to the authentication. Returns false." -// @Router /books [post] -func (controller *bookController) CreateBook(c echo.Context) error { - dto := dto.NewBookDto(controller.container.GetMessages()) - if err := c.Bind(dto); err != nil { - return c.JSON(http.StatusBadRequest, dto) - } - book, result := controller.service.CreateBook(dto) - if result != nil { - return c.JSON(http.StatusBadRequest, result) - } - return c.JSON(http.StatusOK, book) -} - -// UpdateBook update the existing book by http put. -// @Summary Update the existing book -// @Description Update the existing book -// @Tags Books -// @Accept json -// @Produce json -// @Param book_id path int true "Book ID" -// @Param data body dto.BookDto true "the book data for updating" -// @Success 200 {object} model.Book "Success to update the existing book." -// @Failure 400 {string} message "Failed to the update." -// @Failure 401 {boolean} bool "Failed to the authentication. Returns false." -// @Router /books/{book_id} [put] -func (controller *bookController) UpdateBook(c echo.Context) error { - dto := dto.NewBookDto(controller.container.GetMessages()) - if err := c.Bind(dto); err != nil { - return c.JSON(http.StatusBadRequest, dto) - } - book, result := controller.service.UpdateBook(dto, c.Param("id")) - if result != nil { - return c.JSON(http.StatusBadRequest, result) - } - return c.JSON(http.StatusOK, book) -} - -// DeleteBook deletes the existing book by http delete. -// @Summary Delete the existing book -// @Description Delete the existing book -// @Tags Books -// @Accept json -// @Produce json -// @Param book_id path int true "Book ID" -// @Success 200 {object} model.Book "Success to delete the existing book." -// @Failure 400 {string} message "Failed to the delete." -// @Failure 401 {boolean} bool "Failed to the authentication. Returns false." -// @Router /books/{book_id} [delete] -func (controller *bookController) DeleteBook(c echo.Context) error { - book, result := controller.service.DeleteBook(c.Param("id")) - if result != nil { - return c.JSON(http.StatusBadRequest, result) - } - return c.JSON(http.StatusOK, book) -} diff --git a/src/sample-golang-echo-app/controller/book_test.go b/src/sample-golang-echo-app/controller/book_test.go deleted file mode 100644 index 0f65e867f90b0d59356ea7dd816f82d809a64358..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/book_test.go +++ /dev/null @@ -1,310 +0,0 @@ -package controller - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/labstack/echo/v4" - "github.com/stretchr/testify/assert" - "github.com/ybkuroki/go-webapp-sample/config" - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/model" - "github.com/ybkuroki/go-webapp-sample/model/dto" - "github.com/ybkuroki/go-webapp-sample/test" - "github.com/ybkuroki/go-webapp-sample/util" -) - -type BookDtoForBindError struct { - Title string - Isbn string - CategoryID string - FormatID string -} - -const ( - ValidationErrMessageBookTitle string = "Please enter the title with 3 to 50 characters." - ValidationErrMessageBookISBN string = "Please enter the ISBN with 10 to 20 characters." -) - -func TestGetBook_Success(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - book := NewBookController(container) - router.GET(config.APIBooksID, func(c echo.Context) error { return book.GetBook(c) }) - - setUpTestData(container) - - uri := util.NewRequestBuilder().URL(config.APIBooks).PathParams("1").Build().GetRequestURL() - req := httptest.NewRequest("GET", uri, nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - entity := &model.Book{} - opt := entity.FindByID(container.GetRepository(), 1) - data, _ := opt.Take() - - assert.Equal(t, http.StatusOK, rec.Code) - assert.JSONEq(t, test.ConvertToString(data), rec.Body.String()) -} - -func TestGetBook_Failure(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - book := NewBookController(container) - router.GET(config.APIBooksID, func(c echo.Context) error { return book.GetBook(c) }) - - setUpTestData(container) - - uri := util.NewRequestBuilder().URL(config.APIBooks).PathParams("9999").Build().GetRequestURL() - req := httptest.NewRequest("GET", uri, nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - assert.Equal(t, http.StatusBadRequest, rec.Code) - assert.Equal(t, "\"none value taken\"\n", rec.Body.String()) -} - -func TestGetBookList_Success(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - book := NewBookController(container) - router.GET(config.APIBooks, func(c echo.Context) error { return book.GetBookList(c) }) - - setUpTestData(container) - - uri := util.NewRequestBuilder().URL(config.APIBooks). - RequestParams("query", "Test").RequestParams("page", "0").RequestParams("size", "5"). - Build().GetRequestURL() - req := httptest.NewRequest("GET", uri, nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - entity := &model.Book{} - data, _ := entity.FindByTitle(container.GetRepository(), "Test", "0", "5") - - assert.Equal(t, http.StatusOK, rec.Code) - assert.JSONEq(t, test.ConvertToString(data), rec.Body.String()) -} - -func TestCreateBook_Success(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - book := NewBookController(container) - router.POST(config.APIBooks, func(c echo.Context) error { return book.CreateBook(c) }) - - param := createBookForCreate() - req := test.NewJSONRequest("POST", config.APIBooks, param) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - entity := &model.Book{} - opt := entity.FindByID(container.GetRepository(), 1) - data, _ := opt.Take() - - assert.Equal(t, http.StatusOK, rec.Code) - assert.JSONEq(t, test.ConvertToString(data), rec.Body.String()) -} - -func TestCreateBook_BindError(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - book := NewBookController(container) - router.POST(config.APIBooks, func(c echo.Context) error { return book.CreateBook(c) }) - - param := createBookForBindError() - req := test.NewJSONRequest("POST", config.APIBooks, param) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - result := createResultForBindError() - assert.Equal(t, http.StatusBadRequest, rec.Code) - assert.JSONEq(t, test.ConvertToString(result), rec.Body.String()) -} - -func TestCreateBook_ValidationError(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - book := NewBookController(container) - router.POST(config.APIBooks, func(c echo.Context) error { return book.CreateBook(c) }) - - param := createBookForValidationError() - req := test.NewJSONRequest("POST", config.APIBooks, param) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - result := createResultForValidationError() - assert.Equal(t, http.StatusBadRequest, rec.Code) - assert.JSONEq(t, test.ConvertToString(result), rec.Body.String()) -} - -func TestUpdateBook_Success(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - book := NewBookController(container) - router.PUT(config.APIBooksID, func(c echo.Context) error { return book.UpdateBook(c) }) - - setUpTestData(container) - - param := createBookForUpdate() - uri := util.NewRequestBuilder().URL(config.APIBooks).PathParams("1").Build().GetRequestURL() - req := test.NewJSONRequest("PUT", uri, param) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - entity := &model.Book{} - opt := entity.FindByID(container.GetRepository(), 1) - data, _ := opt.Take() - - assert.Equal(t, http.StatusOK, rec.Code) - assert.JSONEq(t, test.ConvertToString(data), rec.Body.String()) -} - -func TestUpdateBook_BindError(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - book := NewBookController(container) - router.PUT(config.APIBooksID, func(c echo.Context) error { return book.UpdateBook(c) }) - - setUpTestData(container) - - param := createBookForBindError() - uri := util.NewRequestBuilder().URL(config.APIBooks).PathParams("1").Build().GetRequestURL() - req := test.NewJSONRequest("PUT", uri, param) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - result := createResultForBindError() - assert.Equal(t, http.StatusBadRequest, rec.Code) - assert.JSONEq(t, test.ConvertToString(result), rec.Body.String()) -} - -func TestUpdateBook_ValidationError(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - book := NewBookController(container) - router.PUT(config.APIBooksID, func(c echo.Context) error { return book.UpdateBook(c) }) - - setUpTestData(container) - - param := createBookForValidationError() - uri := util.NewRequestBuilder().URL(config.APIBooks).PathParams("1").Build().GetRequestURL() - req := test.NewJSONRequest("PUT", uri, param) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - result := createResultForValidationError() - assert.Equal(t, http.StatusBadRequest, rec.Code) - assert.JSONEq(t, test.ConvertToString(result), rec.Body.String()) -} - -func TestDeleteBook_Success(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - book := NewBookController(container) - router.DELETE(config.APIBooksID, func(c echo.Context) error { return book.DeleteBook(c) }) - - setUpTestData(container) - - entity := &model.Book{} - opt := entity.FindByID(container.GetRepository(), 1) - data, _ := opt.Take() - - uri := util.NewRequestBuilder().URL(config.APIBooks).PathParams("1").Build().GetRequestURL() - req := test.NewJSONRequest("DELETE", uri, nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - assert.Equal(t, http.StatusOK, rec.Code) - assert.JSONEq(t, test.ConvertToString(data), rec.Body.String()) -} - -func TestDeleteBook_Failure(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - book := NewBookController(container) - router.DELETE(config.APIBooksID, func(c echo.Context) error { return book.DeleteBook(c) }) - - setUpTestData(container) - - uri := util.NewRequestBuilder().URL(config.APIBooks).PathParams("9999").Build().GetRequestURL() - req := test.NewJSONRequest("DELETE", uri, nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - assert.Equal(t, http.StatusBadRequest, rec.Code) - assert.JSONEq(t, test.ConvertToString(createResultForDeleteError()), rec.Body.String()) -} - -func setUpTestData(container container.Container) { - model := model.NewBook("Test1", "123-123-123-1", 1, 1) - repo := container.GetRepository() - _, _ = model.Create(repo) -} - -func createBookForCreate() *dto.BookDto { - return &dto.BookDto{ - Title: "Test1", - Isbn: "123-123-123-1", - CategoryID: 1, - FormatID: 1, - } -} - -func createBookForValidationError() *dto.BookDto { - return &dto.BookDto{ - Title: "T", - Isbn: "123", - CategoryID: 1, - FormatID: 1, - } -} - -func createBookForBindError() *BookDtoForBindError { - return &BookDtoForBindError{ - Title: "Test1", - Isbn: "123-123-123-1", - CategoryID: "Test", - FormatID: "Test", - } -} - -func createResultForBindError() *dto.BookDto { - return &dto.BookDto{ - Title: "Test1", - Isbn: "123-123-123-1", - CategoryID: 0, - FormatID: 0, - } -} - -func createResultForValidationError() map[string]string { - return map[string]string{ - "isbn": ValidationErrMessageBookISBN, - "title": ValidationErrMessageBookTitle, - } -} - -func createResultForDeleteError() map[string]string { - return map[string]string{"error": "Failed to the delete"} -} - -func createBookForUpdate() *dto.BookDto { - return &dto.BookDto{ - Title: "Test2", - Isbn: "123-123-123-2", - CategoryID: 2, - FormatID: 2, - } -} diff --git a/src/sample-golang-echo-app/controller/category.go b/src/sample-golang-echo-app/controller/category.go deleted file mode 100644 index 9f39850e8c799ac3bc556eeab1abbdc25c6889a8..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/category.go +++ /dev/null @@ -1,37 +0,0 @@ -package controller - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/service" -) - -// CategoryController is a controller for managing category data. -type CategoryController interface { - GetCategoryList(c echo.Context) error -} - -type categoryController struct { - container container.Container - service service.CategoryService -} - -// NewCategoryController is constructor. -func NewCategoryController(container container.Container) CategoryController { - return &categoryController{container: container, service: service.NewCategoryService(container)} -} - -// GetCategoryList returns the list of all categories. -// @Summary Get a category list -// @Description Get a category list -// @Tags Categories -// @Accept json -// @Produce json -// @Success 200 {array} model.Category "Success to fetch a category list." -// @Failure 401 {string} false "Failed to the authentication." -// @Router /categories [get] -func (controller *categoryController) GetCategoryList(c echo.Context) error { - return c.JSON(http.StatusOK, controller.service.FindAllCategories()) -} diff --git a/src/sample-golang-echo-app/controller/category_test.go b/src/sample-golang-echo-app/controller/category_test.go deleted file mode 100644 index a764fecc63df2535fbd94fb4f77fa9152d08d55e..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/category_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package controller - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/labstack/echo/v4" - "github.com/stretchr/testify/assert" - "github.com/ybkuroki/go-webapp-sample/config" - "github.com/ybkuroki/go-webapp-sample/model" - "github.com/ybkuroki/go-webapp-sample/test" -) - -func TestGetCategoryList(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - category := NewCategoryController(container) - router.GET(config.APICategories, func(c echo.Context) error { return category.GetCategoryList(c) }) - - req := httptest.NewRequest("GET", config.APICategories, nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - data := [...]*model.Category{ - {ID: 1, Name: "Technical Book"}, - {ID: 2, Name: "Magazine"}, - {ID: 3, Name: "Novel"}, - } - - assert.Equal(t, http.StatusOK, rec.Code) - assert.JSONEq(t, test.ConvertToString(data), rec.Body.String()) -} diff --git a/src/sample-golang-echo-app/controller/error.go b/src/sample-golang-echo-app/controller/error.go deleted file mode 100644 index 0b0e90d9b7cce2ea192674f23019ff730369ce21..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/error.go +++ /dev/null @@ -1,51 +0,0 @@ -package controller - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "github.com/ybkuroki/go-webapp-sample/container" -) - -// APIError has a error code and a message. -type APIError struct { - Code int - Message string -} - -// ErrorController is a controller for handling errors. -type ErrorController interface { - JSONError(err error, c echo.Context) -} - -type errorController struct { - container container.Container -} - -// NewErrorController is constructor. -func NewErrorController(container container.Container) ErrorController { - return &errorController{container: container} -} - -// JSONError is cumstomize error handler -func (controller *errorController) JSONError(err error, c echo.Context) { - logger := controller.container.GetLogger() - code := http.StatusInternalServerError - msg := http.StatusText(code) - - if he, ok := err.(*echo.HTTPError); ok { - code = he.Code - msg = he.Message.(string) - } - - var apierr APIError - apierr.Code = code - apierr.Message = msg - - if !c.Response().Committed { - if reserr := c.JSON(code, apierr); reserr != nil { - logger.GetZapLogger().Errorf(reserr.Error()) - } - } - logger.GetZapLogger().Debugf(err.Error()) -} diff --git a/src/sample-golang-echo-app/controller/error_test.go b/src/sample-golang-echo-app/controller/error_test.go deleted file mode 100644 index 1fa2f5af7d2782755d84f4a593df856b0fe7d861..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/error_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package controller - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/ybkuroki/go-webapp-sample/test" -) - -func TestJSONError(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - errorHandler := NewErrorController(container) - router.HTTPErrorHandler = errorHandler.JSONError - - req := httptest.NewRequest("GET", "/api/movies/1", nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - assert.Equal(t, http.StatusNotFound, rec.Code) - assert.JSONEq(t, `{"Code":404,"Message":"Not Found"}`, rec.Body.String()) -} diff --git a/src/sample-golang-echo-app/controller/format.go b/src/sample-golang-echo-app/controller/format.go deleted file mode 100644 index dd5d3dd8cfce10e65b122720e8b0b6da27d98c1e..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/format.go +++ /dev/null @@ -1,37 +0,0 @@ -package controller - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/service" -) - -// FormatController is a controller for managing format data. -type FormatController interface { - GetFormatList(c echo.Context) error -} - -type formatController struct { - container container.Container - service service.FormatService -} - -// NewFormatController is constructor. -func NewFormatController(container container.Container) FormatController { - return &formatController{container: container, service: service.NewFormatService(container)} -} - -// GetFormatList returns the list of all formats. -// @Summary Get a format list -// @Description Get a format list -// @Tags Formats -// @Accept json -// @Produce json -// @Success 200 {array} model.Format "Success to fetch a format list." -// @Failure 401 {string} false "Failed to the authentication." -// @Router /formats [get] -func (controller *formatController) GetFormatList(c echo.Context) error { - return c.JSON(http.StatusOK, controller.service.FindAllFormats()) -} diff --git a/src/sample-golang-echo-app/controller/format_test.go b/src/sample-golang-echo-app/controller/format_test.go deleted file mode 100644 index 88ea18a2aa7b350671a70f47e6c63ac4f1d9cb4b..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/format_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package controller - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/labstack/echo/v4" - "github.com/stretchr/testify/assert" - "github.com/ybkuroki/go-webapp-sample/config" - "github.com/ybkuroki/go-webapp-sample/model" - "github.com/ybkuroki/go-webapp-sample/test" -) - -func TestGetFormatList(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - format := NewFormatController(container) - router.GET(config.APIFormats, func(c echo.Context) error { return format.GetFormatList(c) }) - - req := httptest.NewRequest("GET", config.APIFormats, nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - data := [...]*model.Format{ - {ID: 1, Name: "Paper Book"}, - {ID: 2, Name: "e-Book"}, - } - - assert.Equal(t, http.StatusOK, rec.Code) - assert.JSONEq(t, test.ConvertToString(data), rec.Body.String()) -} diff --git a/src/sample-golang-echo-app/controller/health.go b/src/sample-golang-echo-app/controller/health.go deleted file mode 100644 index f6fac2aae08789335da579a87bc79efe417d965f..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/health.go +++ /dev/null @@ -1,35 +0,0 @@ -package controller - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "github.com/ybkuroki/go-webapp-sample/container" -) - -// HealthController is a controller returns the current status of this application. -type HealthController interface { - GetHealthCheck(c echo.Context) error -} - -type healthController struct { - container container.Container -} - -// NewHealthController is constructor. -func NewHealthController(container container.Container) HealthController { - return &healthController{container: container} -} - -// GetHealthCheck returns whether this application is alive or not. -// @Summary Get the status of this application -// @Description Get the status of this application -// @Tags Health -// @Accept json -// @Produce json -// @Success 200 {string} message "healthy: This application is started." -// @Failure 404 {string} message "None: This application is stopped." -// @Router /health [get] -func (controller *healthController) GetHealthCheck(c echo.Context) error { - return c.JSON(http.StatusOK, "healthy") -} diff --git a/src/sample-golang-echo-app/controller/health_test.go b/src/sample-golang-echo-app/controller/health_test.go deleted file mode 100644 index 3f49c4cef465b853c4dc72781e5d1b28f1677d60..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/health_test.go +++ /dev/null @@ -1,27 +0,0 @@ -package controller - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/labstack/echo/v4" - "github.com/stretchr/testify/assert" - "github.com/ybkuroki/go-webapp-sample/config" - "github.com/ybkuroki/go-webapp-sample/test" -) - -func TestGetHealthCheck(t *testing.T) { - router, container := test.PrepareForControllerTest(false) - - health := NewHealthController(container) - router.GET(config.APIHealth, func(c echo.Context) error { return health.GetHealthCheck(c) }) - - req := httptest.NewRequest("GET", config.APIHealth, nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - assert.Equal(t, http.StatusOK, rec.Code) - assert.JSONEq(t, `"healthy"`, rec.Body.String()) -} diff --git a/src/sample-golang-echo-app/controller/logger_test.go b/src/sample-golang-echo-app/controller/logger_test.go deleted file mode 100644 index 8db6e9962fa91e245352b47f5bae6a1d6831851c..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/logger_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package controller - -import ( - "net/http/httptest" - "strings" - "testing" - - "github.com/labstack/echo/v4" - "github.com/stretchr/testify/assert" - "github.com/ybkuroki/go-webapp-sample/config" - "github.com/ybkuroki/go-webapp-sample/test" - "github.com/ybkuroki/go-webapp-sample/util" - "go.uber.org/zap/zaptest/observer" -) - -func TestLogging(t *testing.T) { - router, container, logs := test.PrepareForLoggerTest() - - book := NewBookController(container) - router.GET(config.APIBooksID, func(c echo.Context) error { return book.GetBook(c) }) - - setUpTestData(container) - - uri := util.NewRequestBuilder().URL(config.APIBooks).PathParams("1").Build().GetRequestURL() - req := httptest.NewRequest("GET", uri, nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - allLogs := logs.All() - assert.True(t, assertLogger("/api/books/:id Action Start", allLogs)) - assert.True(t, assertLogger("/api/books/:id Action End", allLogs)) - assert.True(t, assertLogger("/api/books/1 GET 200", allLogs)) - assert.True(t, assertLogger("[gorm] ", allLogs)) -} - -func assertLogger(message string, logs []observer.LoggedEntry) bool { - for _, l := range logs { - if strings.Contains(l.Message, message) { - return true - } - } - return false -} diff --git a/src/sample-golang-echo-app/controller/swagger_test.go b/src/sample-golang-echo-app/controller/swagger_test.go deleted file mode 100644 index 4397a5bfdeda0154d1bf960274275f1b11fa6c15..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/controller/swagger_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package controller - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/stretchr/testify/assert" - echoSwagger "github.com/swaggo/echo-swagger" - _ "github.com/ybkuroki/go-webapp-sample/docs" // for using echo-swagger - "github.com/ybkuroki/go-webapp-sample/test" -) - -func TestSwagger(t *testing.T) { - router, _ := test.PrepareForControllerTest(false) - router.GET("/swagger/*", echoSwagger.WrapHandler) - - req := httptest.NewRequest("GET", "/swagger/index.html", nil) - rec := httptest.NewRecorder() - - router.ServeHTTP(rec, req) - - assert.Equal(t, http.StatusOK, rec.Code) - assert.Regexp(t, "Swagger UI", rec.Body.String()) -} diff --git a/src/sample-golang-echo-app/docs/docs.go b/src/sample-golang-echo-app/docs/docs.go deleted file mode 100644 index abce2a9b2334cc0361261ef4ef85f3701bb8912c..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/docs/docs.go +++ /dev/null @@ -1,671 +0,0 @@ -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// This file was generated by swaggo/swag - -package docs - -import ( - "bytes" - "encoding/json" - "strings" - - "github.com/alecthomas/template" - "github.com/swaggo/swag" -) - -var doc = `{ - "schemes": {{ marshal .Schemes }}, - "swagger": "2.0", - "info": { - "description": "{{.Description}}", - "title": "{{.Title}}", - "contact": {}, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/mit-license.php" - }, - "version": "{{.Version}}" - }, - "host": "{{.Host}}", - "basePath": "{{.BasePath}}", - "paths": { - "/auth/login": { - "post": { - "description": "Login using username and password.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Auth" - ], - "summary": "Login using username and password.", - "parameters": [ - { - "description": "User name and Password for logged-in.", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.LoginDto" - } - } - ], - "responses": { - "200": { - "description": "Success to the authentication.", - "schema": { - "$ref": "#/definitions/model.Account" - } - }, - "401": { - "description": "Failed to the authentication.", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/auth/loginAccount": { - "get": { - "description": "Get the account data of logged-in user.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Auth" - ], - "summary": "Get the account data of logged-in user.", - "responses": { - "200": { - "description": "Success to fetch the account data. If the security function is disable, it returns the dummy data.", - "schema": { - "$ref": "#/definitions/model.Account" - } - }, - "401": { - "description": "The current user haven't logged-in yet. Returns false.", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/auth/loginStatus": { - "get": { - "description": "Get the login status of current logged-in user.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Auth" - ], - "summary": "Get the login status.", - "responses": { - "200": { - "description": "The current user have already logged-in. Returns true.", - "schema": { - "type": "boolean" - } - }, - "401": { - "description": "The current user haven't logged-in yet. Returns false.", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/auth/logout": { - "post": { - "description": "Logout.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Auth" - ], - "summary": "Logout.", - "responses": { - "200": { - "description": "" - } - } - } - }, - "/books": { - "get": { - "description": "Get the list of matched books by searching", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Books" - ], - "summary": "Get a book list", - "parameters": [ - { - "type": "string", - "description": "Keyword", - "name": "query", - "in": "query" - }, - { - "type": "integer", - "description": "Page number", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "Item size per page", - "name": "size", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Success to fetch a book list.", - "schema": { - "$ref": "#/definitions/model.Page" - } - }, - "400": { - "description": "Failed to fetch data.", - "schema": { - "type": "string" - } - }, - "401": { - "description": "Failed to the authentication. Returns false.", - "schema": { - "type": "boolean" - } - } - } - }, - "post": { - "description": "Create a new book", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Books" - ], - "summary": "Create a new book", - "parameters": [ - { - "description": "a new book data for creating", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BookDto" - } - } - ], - "responses": { - "200": { - "description": "Success to create a new book.", - "schema": { - "$ref": "#/definitions/model.Book" - } - }, - "400": { - "description": "Failed to the registration.", - "schema": { - "type": "string" - } - }, - "401": { - "description": "Failed to the authentication. Returns false.", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/books/{book_id}": { - "get": { - "description": "Get a book", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Books" - ], - "summary": "Get a book", - "parameters": [ - { - "type": "integer", - "description": "Book ID", - "name": "book_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Success to fetch data.", - "schema": { - "$ref": "#/definitions/model.Book" - } - }, - "400": { - "description": "Failed to fetch data.", - "schema": { - "type": "string" - } - }, - "401": { - "description": "Failed to the authentication. Returns false.", - "schema": { - "type": "boolean" - } - } - } - }, - "put": { - "description": "Update the existing book", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Books" - ], - "summary": "Update the existing book", - "parameters": [ - { - "type": "integer", - "description": "Book ID", - "name": "book_id", - "in": "path", - "required": true - }, - { - "description": "the book data for updating", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.BookDto" - } - } - ], - "responses": { - "200": { - "description": "Success to update the existing book.", - "schema": { - "$ref": "#/definitions/model.Book" - } - }, - "400": { - "description": "Failed to the update.", - "schema": { - "type": "string" - } - }, - "401": { - "description": "Failed to the authentication. Returns false.", - "schema": { - "type": "boolean" - } - } - } - }, - "delete": { - "description": "Delete the existing book", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Books" - ], - "summary": "Delete the existing book", - "parameters": [ - { - "type": "integer", - "description": "Book ID", - "name": "book_id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Success to delete the existing book.", - "schema": { - "$ref": "#/definitions/model.Book" - } - }, - "400": { - "description": "Failed to the delete.", - "schema": { - "type": "string" - } - }, - "401": { - "description": "Failed to the authentication. Returns false.", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/categories": { - "get": { - "description": "Get a category list", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Categories" - ], - "summary": "Get a category list", - "responses": { - "200": { - "description": "Success to fetch a category list.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Category" - } - } - }, - "401": { - "description": "Failed to the authentication.", - "schema": { - "type": "string" - } - } - } - } - }, - "/formats": { - "get": { - "description": "Get a format list", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Formats" - ], - "summary": "Get a format list", - "responses": { - "200": { - "description": "Success to fetch a format list.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Format" - } - } - }, - "401": { - "description": "Failed to the authentication.", - "schema": { - "type": "string" - } - } - } - } - }, - "/health": { - "get": { - "description": "Get the status of this application", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Health" - ], - "summary": "Get the status of this application", - "responses": { - "200": { - "description": "healthy: This application is started.", - "schema": { - "type": "string" - } - }, - "404": { - "description": "None: This application is stopped.", - "schema": { - "type": "string" - } - } - } - } - } - }, - "definitions": { - "dto.BookDto": { - "type": "object", - "required": [ - "isbn", - "title" - ], - "properties": { - "categoryId": { - "type": "integer" - }, - "formatId": { - "type": "integer" - }, - "isbn": { - "type": "string" - }, - "title": { - "type": "string" - } - } - }, - "dto.LoginDto": { - "type": "object", - "properties": { - "password": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, - "model.Account": { - "type": "object", - "properties": { - "authority": { - "$ref": "#/definitions/model.Authority" - }, - "authority_id": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - }, - "model.Authority": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - }, - "model.Book": { - "type": "object", - "properties": { - "category": { - "$ref": "#/definitions/model.Category" - }, - "categoryId": { - "type": "integer" - }, - "format": { - "$ref": "#/definitions/model.Format" - }, - "formatId": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "isbn": { - "type": "string" - }, - "title": { - "type": "string" - } - } - }, - "model.Category": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - }, - "model.Format": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - }, - "model.Page": { - "type": "object", - "properties": { - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/model.Book" - } - }, - "last": { - "type": "boolean" - }, - "numberOfElements": { - "type": "integer" - }, - "page": { - "type": "integer" - }, - "size": { - "type": "integer" - }, - "totalElements": { - "type": "integer" - }, - "totalPages": { - "type": "integer" - } - } - } - } -}` - -type swaggerInfo struct { - Version string - Host string - BasePath string - Schemes []string - Title string - Description string -} - -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = swaggerInfo{ - Version: "1.5.1", - Host: "localhost:8080", - BasePath: "/api", - Schemes: []string{}, - Title: "go-webapp-sample API", - Description: "This is API specification for go-webapp-sample project.", -} - -type s struct{} - -func (s *s) ReadDoc() string { - sInfo := SwaggerInfo - sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) - - t, err := template.New("swagger_info").Funcs(template.FuncMap{ - "marshal": func(v interface{}) string { - a, _ := json.Marshal(v) - return string(a) - }, - }).Parse(doc) - if err != nil { - return doc - } - - var tpl bytes.Buffer - if err := t.Execute(&tpl, sInfo); err != nil { - return doc - } - - return tpl.String() -} - -func init() { - swag.Register(swag.Name, &s{}) -} diff --git a/src/sample-golang-echo-app/go.mod b/src/sample-golang-echo-app/go.mod deleted file mode 100644 index 1232327bb266222209789e03fef33218f16511f7..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/go.mod +++ /dev/null @@ -1,65 +0,0 @@ -module github.com/ybkuroki/go-webapp-sample - -go 1.20 - -require ( - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 - github.com/garyburd/redigo v1.6.4 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.3 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/gorilla/sessions v1.2.1 - github.com/labstack/echo-contrib v0.15.0 - github.com/labstack/echo/v4 v4.10.2 - github.com/leodido/go-urn v1.2.4 // indirect - github.com/mailru/easyjson v0.7.7 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mattn/go-sqlite3 v1.14.17 // indirect - github.com/moznion/go-optional v0.10.0 - github.com/stretchr/testify v1.8.4 - github.com/swaggo/echo-swagger v1.4.0 - github.com/swaggo/swag v1.16.1 - github.com/valyala/fasttemplate v1.2.2 - go.uber.org/zap v1.24.0 - golang.org/x/crypto v0.9.0 - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/tools v0.9.3 // indirect - gopkg.in/boj/redistore.v1 v1.0.0-20160128113310-fc113767cd6b - gopkg.in/go-playground/assert.v1 v1.2.1 // indirect - gopkg.in/go-playground/validator.v9 v9.31.0 - gopkg.in/natefinch/lumberjack.v2 v2.2.1 - gopkg.in/yaml.v3 v3.0.1 - gorm.io/driver/mysql v1.5.1 - gorm.io/driver/postgres v1.5.2 - gorm.io/driver/sqlite v1.5.1 - gorm.io/gorm v1.25.1 -) - -require ( - github.com/KyleBanks/depth v1.2.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-openapi/jsonpointer v0.19.6 // indirect - github.com/go-openapi/spec v0.20.9 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-sql-driver/mysql v1.7.1 // indirect - github.com/golang-jwt/jwt v3.2.2+incompatible // indirect - github.com/gorilla/context v1.1.1 // indirect - github.com/gorilla/securecookie v1.1.1 // indirect - github.com/jackc/pgpassfile v1.0.0 // 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/labstack/gommon v0.4.0 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/swaggo/files/v2 v2.0.0 // indirect - github.com/valyala/bytebufferpool v1.0.0 // indirect - go.uber.org/atomic v1.11.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - golang.org/x/text v0.9.0 // indirect - golang.org/x/time v0.3.0 // indirect -) diff --git a/src/sample-golang-echo-app/go.sum b/src/sample-golang-echo-app/go.sum deleted file mode 100644 index 5d16da534715d34e4b652275cbc47a4e28c60dbe..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/go.sum +++ /dev/null @@ -1,165 +0,0 @@ -github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= -github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -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/garyburd/redigo v1.6.4 h1:LFu2R3+ZOPgSMWMOL+saa/zXRjw0ID2G8FepO53BGlg= -github.com/garyburd/redigo v1.6.4/go.mod h1:rTb6epsqigu3kYKBnaF028A7Tf/Aw5s0cqA47doKKqw= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8= -github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -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.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= -github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= -github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= -github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= -github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI= -github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= -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/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/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU= -github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= -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.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= -github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -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/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -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/labstack/echo-contrib v0.15.0 h1:9K+oRU265y4Mu9zpRDv3X+DGTqUALY6oRHCSZZKCRVU= -github.com/labstack/echo-contrib v0.15.0/go.mod h1:lei+qt5CLB4oa7VHTE0yEfQSEB9XTJI1LUqko9UWvo4= -github.com/labstack/echo/v4 v4.10.2 h1:n1jAhnq/elIFTHr1EYpiYtyKgx4RW9ccVgkqByZaN2M= -github.com/labstack/echo/v4 v4.10.2/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO2FzvI4J5k= -github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= -github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= -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/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -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-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-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= -github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= -github.com/moznion/go-optional v0.10.0 h1:YE42pzLDp6vc9zi/2hyaHYJesjahZEgFXEN1u5DMwMA= -github.com/moznion/go-optional v0.10.0/go.mod h1:l3mLmsyp2bWTvWKjEm5MT7lo3g5MRlNIflxFB0XTASA= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -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/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -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 v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -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/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/swaggo/echo-swagger v1.4.0 h1:RCxLKySw1SceHLqnmc41pKyiIeE+OiD7NSI7FUOBlLo= -github.com/swaggo/echo-swagger v1.4.0/go.mod h1:Wh3VlwjZGZf/LH0s81tz916JokuPG7y/ZqaqnckYqoQ= -github.com/swaggo/files/v2 v2.0.0 h1:hmAt8Dkynw7Ssz46F6pn8ok6YmGZqHSVLZ+HQM7i0kw= -github.com/swaggo/files/v2 v2.0.0/go.mod h1:24kk2Y9NYEJ5lHuCra6iVwkMjIekMCaFq/0JQj66kyM= -github.com/swaggo/swag v1.16.1 h1:fTNRhKstPKxcnoKsytm4sahr8FaYzUcT7i1/3nd/fBg= -github.com/swaggo/swag v1.16.1/go.mod h1:9/LMvHycG3NFHfR6LwvikHv5iFvmPADQ359cKikGxto= -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/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= -github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/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-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -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.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= -gopkg.in/boj/redistore.v1 v1.0.0-20160128113310-fc113767cd6b h1:U/Uqd1232+wrnHOvWNaxrNqn/kFnr4yu4blgPtQt0N8= -gopkg.in/boj/redistore.v1 v1.0.0-20160128113310-fc113767cd6b/go.mod h1:fgfIZMlsafAHpspcks2Bul+MWUNw/2dyQmjC2faKjtg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M= -gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= -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/yaml.v2 v2.2.2/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.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw= -gorm.io/driver/mysql v1.5.1/go.mod h1:Jo3Xu7mMhCyj8dlrb3WoCaRd1FhsVh+yMXb1jUInf5o= -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.5.1 h1:hYyrLkAWE71bcarJDPdZNTLWtr8XrSjOWyjUYI6xdL4= -gorm.io/driver/sqlite v1.5.1/go.mod h1:7MZZ2Z8bqyfSQA1gYEV6MagQWj3cpUkJj9Z+d1HEMEQ= -gorm.io/gorm v1.25.1 h1:nsSALe5Pr+cM3V1qwwQ7rOkw+6UeLrX5O4v3llhHa64= -gorm.io/gorm v1.25.1/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= diff --git a/src/sample-golang-echo-app/logger/gormlogger.go b/src/sample-golang-echo-app/logger/gormlogger.go deleted file mode 100644 index e1cf33116d895c5710f078993eae2f2c9cfb298c..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/logger/gormlogger.go +++ /dev/null @@ -1,60 +0,0 @@ -package logger - -import ( - "context" - "fmt" - "time" - - gormLogger "gorm.io/gorm/logger" - gormUtils "gorm.io/gorm/utils" -) - -// Customize SQL Logger for gorm library -// ref: https://github.com/wantedly/gorm-zap -// ref: https://github.com/go-gorm/gorm/blob/master/logger/logger.go - -const ( - logTitle = "[gorm] " - sqlFormat = logTitle + "%s" - messageFormat = logTitle + "%s, %s" - errorFormat = logTitle + "%s, %s, %s" - slowThreshold = 200 -) - -// LogMode The log level of gorm logger is overwrited by the log level of Zap logger. -func (log *logger) LogMode(_ gormLogger.LogLevel) gormLogger.Interface { - return log -} - -// Info prints a information log. -func (log *logger) Info(_ context.Context, msg string, data ...interface{}) { - log.Zap.Infof(messageFormat, append([]interface{}{msg, gormUtils.FileWithLineNum()}, data...)...) -} - -// Warn prints a warning log. -func (log *logger) Warn(_ context.Context, msg string, data ...interface{}) { - log.Zap.Warnf(messageFormat, append([]interface{}{msg, gormUtils.FileWithLineNum()}, data...)...) -} - -// Error prints a error log. -func (log *logger) Error(_ context.Context, msg string, data ...interface{}) { - log.Zap.Errorf(messageFormat, append([]interface{}{msg, gormUtils.FileWithLineNum()}, data...)...) -} - -// Trace prints a trace log such as sql, source file and error. -func (log *logger) Trace(_ context.Context, begin time.Time, fc func() (string, int64), err error) { - elapsed := time.Since(begin) - - switch { - case err != nil: - sql, _ := fc() - log.GetZapLogger().Errorf(errorFormat, gormUtils.FileWithLineNum(), err, sql) - case elapsed > slowThreshold*time.Millisecond && slowThreshold*time.Millisecond != 0: - sql, _ := fc() - slowLog := fmt.Sprintf("SLOW SQL >= %v", slowThreshold) - log.GetZapLogger().Warnf(errorFormat, gormUtils.FileWithLineNum(), slowLog, sql) - default: - sql, _ := fc() - log.GetZapLogger().Debugf(sqlFormat, sql) - } -} diff --git a/src/sample-golang-echo-app/logger/logger.go b/src/sample-golang-echo-app/logger/logger.go deleted file mode 100644 index 6c302027fe286d2cc4459dbf89264c1d32d79b4f..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/logger/logger.go +++ /dev/null @@ -1,71 +0,0 @@ -package logger - -import ( - "context" - "embed" - "fmt" - "os" - "time" - - "github.com/ybkuroki/go-webapp-sample/config" - "go.uber.org/zap" - "gopkg.in/natefinch/lumberjack.v2" - "gopkg.in/yaml.v3" - gormLogger "gorm.io/gorm/logger" -) - -// Config represents the setting for zap logger. -type Config struct { - ZapConfig zap.Config `json:"zap_config" yaml:"zap_config"` - LogRotate lumberjack.Logger `json:"log_rotate" yaml:"log_rotate"` -} - -// Logger is an alternative implementation of *gorm.Logger -type Logger interface { - GetZapLogger() *zap.SugaredLogger - LogMode(level gormLogger.LogLevel) gormLogger.Interface - Info(ctx context.Context, msg string, data ...interface{}) - Warn(ctx context.Context, msg string, data ...interface{}) - Error(ctx context.Context, msg string, data ...interface{}) - Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) -} - -type logger struct { - Zap *zap.SugaredLogger -} - -// NewLogger is constructor for logger -func NewLogger(sugar *zap.SugaredLogger) Logger { - return &logger{Zap: sugar} -} - -// InitLogger create logger object for *gorm.DB from *echo.Logger -func InitLogger(env string, yamlFile embed.FS) Logger { - configYaml, err := yamlFile.ReadFile(fmt.Sprintf(config.LoggerConfigPath, env)) - if err != nil { - fmt.Printf("Failed to read logger configuration: %s", err) - os.Exit(config.ErrExitStatus) - } - var myConfig *Config - if err = yaml.Unmarshal(configYaml, &myConfig); err != nil { - fmt.Printf("Failed to read zap logger configuration: %s", err) - os.Exit(config.ErrExitStatus) - } - var zap *zap.Logger - zap, err = build(myConfig) - if err != nil { - fmt.Printf("Failed to compose zap logger : %s", err) - os.Exit(config.ErrExitStatus) - } - sugar := zap.Sugar() - // set package varriable logger. - log := NewLogger(sugar) - log.GetZapLogger().Infof("Success to read zap logger configuration: zaplogger." + env + ".yml") - _ = zap.Sync() - return log -} - -// GetZapLogger returns zapSugaredLogger -func (log *logger) GetZapLogger() *zap.SugaredLogger { - return log.Zap -} diff --git a/src/sample-golang-echo-app/logger/zaplogger.go b/src/sample-golang-echo-app/logger/zaplogger.go deleted file mode 100644 index 417f788f83f68cb807515d5a9c1626fc4530cd11..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/logger/zaplogger.go +++ /dev/null @@ -1,88 +0,0 @@ -package logger - -import ( - "errors" - "os" - - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - "gopkg.in/natefinch/lumberjack.v2" -) - -func build(cfg *Config) (*zap.Logger, error) { - var zapCfg = cfg.ZapConfig - enc, _ := newEncoder(zapCfg) - writer, errWriter := openWriters(cfg) - - if zapCfg.Level == (zap.AtomicLevel{}) { - return nil, errors.New("missing Level") - } - - log := zap.New(zapcore.NewCore(enc, writer, zapCfg.Level), buildOptions(zapCfg, errWriter)...) - return log, nil -} - -func newEncoder(cfg zap.Config) (zapcore.Encoder, error) { - switch cfg.Encoding { - case "console": - return zapcore.NewConsoleEncoder(cfg.EncoderConfig), nil - case "json": - return zapcore.NewJSONEncoder(cfg.EncoderConfig), nil - } - return nil, errors.New("failed to set encoder") -} - -func openWriters(cfg *Config) (zapcore.WriteSyncer, zapcore.WriteSyncer) { - writer := open(cfg.ZapConfig.OutputPaths, &cfg.LogRotate) - errWriter := open(cfg.ZapConfig.ErrorOutputPaths, &cfg.LogRotate) - return writer, errWriter -} - -func open(paths []string, rotateCfg *lumberjack.Logger) zapcore.WriteSyncer { - writers := make([]zapcore.WriteSyncer, 0, len(paths)) - for _, path := range paths { - writer := newWriter(path, rotateCfg) - writers = append(writers, writer) - } - writer := zap.CombineWriteSyncers(writers...) - return writer -} - -func newWriter(path string, rotateCfg *lumberjack.Logger) zapcore.WriteSyncer { - switch path { - case "stdout": - return os.Stdout - case "stderr": - return os.Stderr - } - sink := zapcore.AddSync( - &lumberjack.Logger{ - Filename: path, - MaxSize: rotateCfg.MaxSize, - MaxBackups: rotateCfg.MaxBackups, - MaxAge: rotateCfg.MaxAge, - Compress: rotateCfg.Compress, - }, - ) - return sink -} - -func buildOptions(cfg zap.Config, errWriter zapcore.WriteSyncer) []zap.Option { - opts := []zap.Option{zap.ErrorOutput(errWriter)} - if cfg.Development { - opts = append(opts, zap.Development()) - } - - if !cfg.DisableCaller { - opts = append(opts, zap.AddCaller()) - } - - stackLevel := zap.ErrorLevel - if cfg.Development { - stackLevel = zap.WarnLevel - } - if !cfg.DisableStacktrace { - opts = append(opts, zap.AddStacktrace(stackLevel)) - } - return opts -} diff --git a/src/sample-golang-echo-app/main.go b/src/sample-golang-echo-app/main.go deleted file mode 100644 index 973e5c7373fec27894bca0c37935bc45be7d6fb0..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/main.go +++ /dev/null @@ -1,66 +0,0 @@ -package main - -import ( - "embed" - - "github.com/labstack/echo/v4" - - "github.com/ybkuroki/go-webapp-sample/config" - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/logger" - "github.com/ybkuroki/go-webapp-sample/middleware" - "github.com/ybkuroki/go-webapp-sample/migration" - "github.com/ybkuroki/go-webapp-sample/repository" - "github.com/ybkuroki/go-webapp-sample/router" - "github.com/ybkuroki/go-webapp-sample/session" -) - -//go:embed resources/config/application.*.yml -var yamlFile embed.FS - -//go:embed resources/config/zaplogger.*.yml -var zapYamlFile embed.FS - -//go:embed resources/public/* -var staticFile embed.FS - -//go:embed resources/config/messages.properties -var propsFile embed.FS - -// @title go-webapp-sample API -// @version 1.5.1 -// @description This is API specification for go-webapp-sample project. - -// @license.name MIT -// @license.url https://opensource.org/licenses/mit-license.php - -// @host localhost:8080 -// @BasePath /api -func main() { - e := echo.New() - - conf, env := config.LoadAppConfig(yamlFile) - logger := logger.InitLogger(env, zapYamlFile) - logger.GetZapLogger().Infof("Loaded this configuration : application." + env + ".yml") - - messages := config.LoadMessagesConfig(propsFile) - logger.GetZapLogger().Infof("Loaded messages.properties") - - rep := repository.NewBookRepository(logger, conf) - sess := session.NewSession() - container := container.NewContainer(rep, sess, conf, messages, logger, env) - - migration.CreateDatabase(container) - migration.InitMasterData(container) - - router.Init(e, container) - middleware.InitLoggerMiddleware(e, container) - middleware.InitSessionMiddleware(e, container) - middleware.StaticContentsMiddleware(e, container, staticFile) - - if err := e.Start(":8080"); err != nil { - logger.GetZapLogger().Errorf(err.Error()) - } - - defer rep.Close() -} diff --git a/src/sample-golang-echo-app/middleware/middleware.go b/src/sample-golang-echo-app/middleware/middleware.go deleted file mode 100644 index 63333457cadf9e8c96cd827dd04e488a03665573..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/middleware/middleware.go +++ /dev/null @@ -1,183 +0,0 @@ -package middleware - -import ( - "embed" - "fmt" - "io" - "net/http" - "regexp" - "strconv" - - "github.com/gorilla/sessions" - "github.com/labstack/echo-contrib/session" - "github.com/labstack/echo/v4" - echomd "github.com/labstack/echo/v4/middleware" - "github.com/valyala/fasttemplate" - "github.com/ybkuroki/go-webapp-sample/container" - "gopkg.in/boj/redistore.v1" -) - -// InitLoggerMiddleware initialize a middleware for logger. -func InitLoggerMiddleware(e *echo.Echo, container container.Container) { - e.Use(RequestLoggerMiddleware(container)) - e.Use(ActionLoggerMiddleware(container)) -} - -// InitSessionMiddleware initialize a middleware for session management. -func InitSessionMiddleware(e *echo.Echo, container container.Container) { - conf := container.GetConfig() - logger := container.GetLogger() - - e.Use(SessionMiddleware(container)) - - if conf.Extension.SecurityEnabled { - if conf.Redis.Enabled { - logger.GetZapLogger().Infof("Try redis connection") - address := fmt.Sprintf("%s:%s", conf.Redis.Host, conf.Redis.Port) - store, err := redistore.NewRediStore(conf.Redis.ConnectionPoolSize, "tcp", address, "", []byte("secret")) - if err != nil { - logger.GetZapLogger().Errorf("Failure redis connection") - } - e.Use(session.Middleware(store)) - logger.GetZapLogger().Infof(fmt.Sprintf("Success redis connection, %s", address)) - } else { - e.Use(session.Middleware(sessions.NewCookieStore([]byte("secret")))) - } - e.Use(AuthenticationMiddleware(container)) - } -} - -// RequestLoggerMiddleware is middleware for logging the contents of requests. -func RequestLoggerMiddleware(container container.Container) echo.MiddlewareFunc { - return func(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - req := c.Request() - res := c.Response() - if err := next(c); err != nil { - c.Error(err) - } - - template := fasttemplate.New(container.GetConfig().Log.RequestLogFormat, "${", "}") - logstr := template.ExecuteFuncString(func(w io.Writer, tag string) (int, error) { - switch tag { - case "remote_ip": - return w.Write([]byte(c.RealIP())) - case "account_name": - if account := container.GetSession().GetAccount(); account != nil { - return w.Write([]byte(account.Name)) - } - return w.Write([]byte("None")) - case "uri": - return w.Write([]byte(req.RequestURI)) - case "method": - return w.Write([]byte(req.Method)) - case "status": - return w.Write([]byte(strconv.Itoa(res.Status))) - default: - return w.Write([]byte("")) - } - }) - container.GetLogger().GetZapLogger().Infof(logstr) - return nil - } - } -} - -// ActionLoggerMiddleware is middleware for logging the start and end of controller processes. -// ref: https://echo.labstack.com/cookbook/middleware -func ActionLoggerMiddleware(container container.Container) echo.MiddlewareFunc { - return func(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - logger := container.GetLogger() - logger.GetZapLogger().Debugf(c.Path() + " Action Start") - if err := next(c); err != nil { - c.Error(err) - } - logger.GetZapLogger().Debugf(c.Path() + " Action End") - return nil - } - } -} - -// SessionMiddleware is a middleware for setting a context to a session. -func SessionMiddleware(container container.Container) echo.MiddlewareFunc { - return func(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - container.GetSession().SetContext(c) - if err := next(c); err != nil { - c.Error(err) - } - return nil - } - } -} - -// StaticContentsMiddleware is the middleware for loading the static files. -func StaticContentsMiddleware(e *echo.Echo, container container.Container, staticFile embed.FS) { - conf := container.GetConfig() - if conf.StaticContents.Enabled { - staticConfig := echomd.StaticConfig{ - Root: "resources/public", - Index: "index.html", - Browse: false, - HTML5: true, - Filesystem: http.FS(staticFile), - } - if conf.Swagger.Enabled { - staticConfig.Skipper = func(c echo.Context) bool { - return equalPath(c.Path(), []string{conf.Swagger.Path}) - } - } - e.Use(echomd.StaticWithConfig(staticConfig)) - container.GetLogger().GetZapLogger().Infof("Served the static contents.") - } -} - -// AuthenticationMiddleware is the middleware of session authentication for echo. -func AuthenticationMiddleware(container container.Container) echo.MiddlewareFunc { - return func(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - if !hasAuthorization(c, container) { - return c.JSON(http.StatusUnauthorized, false) - } - if err := next(c); err != nil { - c.Error(err) - } - return nil - } - } -} - -// hasAuthorization judges whether the user has the right to access the path. -func hasAuthorization(c echo.Context, container container.Container) bool { - currentPath := c.Path() - if equalPath(currentPath, container.GetConfig().Security.AuthPath) { - if equalPath(currentPath, container.GetConfig().Security.ExculdePath) { - return true - } - account := container.GetSession().GetAccount() - if account == nil { - return false - } - if account.Authority.Name == "Admin" && equalPath(currentPath, container.GetConfig().Security.AdminPath) { - _ = container.GetSession().Save() - return true - } - if account.Authority.Name == "User" && equalPath(currentPath, container.GetConfig().Security.UserPath) { - _ = container.GetSession().Save() - return true - } - return false - } - return true -} - -// equalPath judges whether a given path contains in the path list. -func equalPath(cpath string, paths []string) bool { - for i := range paths { - if regexp.MustCompile(paths[i]).Match([]byte(cpath)) { - return true - } - } - return false -} diff --git a/src/sample-golang-echo-app/migration/db_generator.go b/src/sample-golang-echo-app/migration/db_generator.go deleted file mode 100644 index 2e4e3acc46aab58abca0db85eb1dc14e483b9905..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/migration/db_generator.go +++ /dev/null @@ -1,25 +0,0 @@ -package migration - -import ( - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/model" -) - -// CreateDatabase creates the tables used in this application. -func CreateDatabase(container container.Container) { - if container.GetConfig().Database.Migration { - db := container.GetRepository() - - _ = db.DropTableIfExists(&model.Book{}) - _ = db.DropTableIfExists(&model.Category{}) - _ = db.DropTableIfExists(&model.Format{}) - _ = db.DropTableIfExists(&model.Account{}) - _ = db.DropTableIfExists(&model.Authority{}) - - _ = db.AutoMigrate(&model.Book{}) - _ = db.AutoMigrate(&model.Category{}) - _ = db.AutoMigrate(&model.Format{}) - _ = db.AutoMigrate(&model.Account{}) - _ = db.AutoMigrate(&model.Authority{}) - } -} diff --git a/src/sample-golang-echo-app/migration/master_generator.go b/src/sample-golang-echo-app/migration/master_generator.go deleted file mode 100644 index 007decdb3329d5c68a0bf923e9c61dc1dd0ae1a1..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/migration/master_generator.go +++ /dev/null @@ -1,32 +0,0 @@ -package migration - -import ( - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/model" -) - -// InitMasterData creates the master data used in this application. -func InitMasterData(container container.Container) { - if container.GetConfig().Extension.MasterGenerator { - rep := container.GetRepository() - - r := model.NewAuthority("Admin") - _, _ = r.Create(rep) - a := model.NewAccountWithPlainPassword("test", "test", r.ID) - _, _ = a.Create(rep) - a = model.NewAccountWithPlainPassword("test2", "test2", r.ID) - _, _ = a.Create(rep) - - c := model.NewCategory("Technical Book") - _, _ = c.Create(rep) - c = model.NewCategory("Magazine") - _, _ = c.Create(rep) - c = model.NewCategory("Novel") - _, _ = c.Create(rep) - - f := model.NewFormat("Paper Book") - _, _ = f.Create(rep) - f = model.NewFormat("e-Book") - _, _ = f.Create(rep) - } -} diff --git a/src/sample-golang-echo-app/model/account.go b/src/sample-golang-echo-app/model/account.go deleted file mode 100644 index 6f9d8b9ca19ad5c099c288f9665525d5beb6c1d9..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/model/account.go +++ /dev/null @@ -1,74 +0,0 @@ -package model - -import ( - "github.com/ybkuroki/go-webapp-sample/config" - "github.com/ybkuroki/go-webapp-sample/repository" - "golang.org/x/crypto/bcrypt" -) - -// Account defines struct of account data. -type Account struct { - ID uint `gorm:"primary_key" json:"id"` - Name string `json:"name"` - Password string `json:"-"` - AuthorityID uint `json:"authority_id"` - Authority *Authority `json:"authority"` -} - -// RecordAccount defines struct represents the record of the database. -type RecordAccount struct { - ID uint - Name string - Password string - AuthorityID uint - AuthorityName string -} - -const selectAccount = "select a.id as id, a.name as name, a.password as password," + - " r.id as authority_id, r.name as authority_name " + - " from account_master a inner join authority_master r on a.authority_id = r.id " - -// TableName returns the table name of account struct and it is used by gorm. -func (Account) TableName() string { - return "account_master" -} - -// NewAccount is constructor. -func NewAccount(name string, password string, authorityID uint) *Account { - return &Account{Name: name, Password: password, AuthorityID: authorityID} -} - -// NewAccountWithPlainPassword is constructor. And it is encoded plain text password by using bcrypt. -func NewAccountWithPlainPassword(name string, password string, authorityID uint) *Account { - hashed, _ := bcrypt.GenerateFromPassword([]byte(password), config.PasswordHashCost) - return &Account{Name: name, Password: string(hashed), AuthorityID: authorityID} -} - -// FindByName returns accounts full matched given account name. -func (a *Account) FindByName(rep repository.Repository, name string) (*Account, error) { - var account *Account - - var rec RecordAccount - rep.Raw(selectAccount+" where a.name = ?", name).Scan(&rec) - account = convertToAccount(&rec) - - return account, nil -} - -// Create persists this account data. -func (a *Account) Create(rep repository.Repository) (*Account, error) { - if err := rep.Select("name", "password", "authority_id").Create(a).Error; err != nil { - return nil, err - } - return a, nil -} - -func convertToAccount(rec *RecordAccount) *Account { - r := &Authority{ID: rec.AuthorityID, Name: rec.AuthorityName} - return &Account{ID: rec.ID, Name: rec.Name, Password: rec.Password, AuthorityID: rec.AuthorityID, Authority: r} -} - -// ToString is return string of object -func (a *Account) ToString() string { - return toString(a) -} diff --git a/src/sample-golang-echo-app/model/authority.go b/src/sample-golang-echo-app/model/authority.go deleted file mode 100644 index 3097c7ddcc06c0343c27f1afeed9d951d704aace..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/model/authority.go +++ /dev/null @@ -1,34 +0,0 @@ -package model - -import ( - "github.com/ybkuroki/go-webapp-sample/repository" -) - -// Authority defines struct of authority data. -type Authority struct { - ID uint `gorm:"primary_key" json:"id"` - Name string `json:"name"` -} - -// TableName returns the table name of authority struct and it is used by gorm. -func (Authority) TableName() string { - return "authority_master" -} - -// NewAuthority is constructor. -func NewAuthority(name string) *Authority { - return &Authority{Name: name} -} - -// Create persists this authority data. -func (a *Authority) Create(rep repository.Repository) (*Authority, error) { - if err := rep.Create(a).Error; err != nil { - return nil, err - } - return a, nil -} - -// ToString is return string of object -func (a *Authority) ToString() string { - return toString(a) -} diff --git a/src/sample-golang-echo-app/model/base.go b/src/sample-golang-echo-app/model/base.go deleted file mode 100644 index f4c48f6a05e11dd15be8e01414ebe19491de4846..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/model/base.go +++ /dev/null @@ -1,18 +0,0 @@ -package model - -import "encoding/json" - -// DomainObject defines the common interface for domain models. -type DomainObject interface { - Account | Authority | Book | Category | Format -} - -// toString returns the JSON data of the domain models. -func toString[T DomainObject](o *T) string { - var bytes []byte - var err error - if bytes, err = json.Marshal(o); err != nil { - return "" - } - return string(bytes) -} diff --git a/src/sample-golang-echo-app/model/book.go b/src/sample-golang-echo-app/model/book.go deleted file mode 100644 index f6a8358888ea7a23ff4b37d32f9612ed6dbbf836..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/model/book.go +++ /dev/null @@ -1,197 +0,0 @@ -package model - -import ( - "database/sql" - "errors" - "math" - - "github.com/moznion/go-optional" - "github.com/ybkuroki/go-webapp-sample/repository" - "github.com/ybkuroki/go-webapp-sample/util" - "gorm.io/gorm" -) - -// Book defines struct of book data. -type Book struct { - ID uint `gorm:"primary_key" json:"id"` - Title string `json:"title"` - Isbn string `json:"isbn"` - CategoryID uint `json:"categoryId"` - Category *Category `json:"category"` - FormatID uint `json:"formatId"` - Format *Format `json:"format"` -} - -// RecordBook defines struct represents the record of the database. -type RecordBook struct { - ID uint - Title string - Isbn string - CategoryID uint - CategoryName string - FormatID uint - FormatName string -} - -const ( - selectBook = "select b.id as id, b.title as title, b.isbn as isbn, " + - "c.id as category_id, c.name as category_name, f.id as format_id, f.name as format_name " + - "from book b inner join category_master c on c.id = b.category_id inner join format_master f on f.id = b.format_id " - findByID = " where b.id = ?" - findByTitle = " where title like ? " -) - -// TableName returns the table name of book struct and it is used by gorm. -func (Book) TableName() string { - return "book" -} - -// NewBook is constructor -func NewBook(title string, isbn string, categoryID uint, formatID uint) *Book { - return &Book{Title: title, Isbn: isbn, CategoryID: categoryID, FormatID: formatID} -} - -// FindByID returns a book full matched given book's ID. -func (b *Book) FindByID(rep repository.Repository, id uint) optional.Option[*Book] { - var rec RecordBook - args := []interface{}{id} - - createRaw(rep, selectBook+findByID, "", "", args).Scan(&rec) - return convertToBook(&rec) -} - -// FindAll returns all books of the book table. -func (b *Book) FindAll(rep repository.Repository) (*[]Book, error) { - var books []Book - var err error - - if books, err = findRows(rep, selectBook, "", "", []interface{}{}); err != nil { - return nil, err - } - return &books, nil -} - -// FindAllByPage returns the page object of all books. -func (b *Book) FindAllByPage(rep repository.Repository, page string, size string) (*Page, error) { - var books []Book - var err error - - if books, err = findRows(rep, selectBook, page, size, []interface{}{}); err != nil { - return nil, err - } - p := createPage(&books, page, size) - return p, nil -} - -// FindByTitle returns the page object of books partially matched given book title. -func (b *Book) FindByTitle(rep repository.Repository, title string, page string, size string) (*Page, error) { - var books []Book - var err error - args := []interface{}{"%" + title + "%"} - - if books, err = findRows(rep, selectBook+findByTitle, page, size, args); err != nil { - return nil, err - } - p := createPage(&books, page, size) - return p, nil -} - -func findRows(rep repository.Repository, sqlquery string, page string, size string, args []interface{}) ([]Book, error) { - var books []Book - - var rec RecordBook - var rows *sql.Rows - var err error - - if rows, err = createRaw(rep, sqlquery, page, size, args).Rows(); err != nil { - return nil, err - } - for rows.Next() { - if err = rep.ScanRows(rows, &rec); err != nil { - return nil, err - } - - opt := convertToBook(&rec) - if opt.IsNone() { - return nil, errors.New("failed to fetch data") - } - book, _ := opt.Take() - books = append(books, *book) - } - return books, nil -} - -func createRaw(rep repository.Repository, sql string, pageNum string, pageSize string, args []interface{}) *gorm.DB { - if util.IsNumeric(pageNum) && util.IsNumeric(pageSize) { - page := util.ConvertToInt(pageNum) - size := util.ConvertToInt(pageSize) - args = append(args, size) - args = append(args, page*size) - sql += " limit ? offset ? " - } - if len(args) > 0 { - return rep.Raw(sql, args...) - } - return rep.Raw(sql) -} - -func createPage(books *[]Book, page string, size string) *Page { - p := NewPage() - p.Page = util.ConvertToInt(page) - p.Size = util.ConvertToInt(size) - p.NumberOfElements = p.Size - p.TotalElements = len(*books) - if p.TotalPages = int(math.Ceil(float64(p.TotalElements) / float64(p.Size))); p.TotalPages < 0 { - p.TotalPages = 0 - } - p.Content = books - - return p -} - -// Save persists this book data. -func (b *Book) Save(rep repository.Repository) (*Book, error) { - if err := rep.Save(b).Error; err != nil { - return nil, err - } - return b, nil -} - -// Update updates this book data. -func (b *Book) Update(rep repository.Repository) (*Book, error) { - if err := rep.Model(Book{}).Where("id = ?", b.ID).Select("title", "isbn", "category_id", "format_id").Updates(b).Error; err != nil { - return nil, err - } - return b, nil -} - -// Create persists this book data. -func (b *Book) Create(rep repository.Repository) (*Book, error) { - if err := rep.Select("title", "isbn", "category_id", "format_id").Create(b).Error; err != nil { - return nil, err - } - return b, nil -} - -// Delete deletes this book data. -func (b *Book) Delete(rep repository.Repository) (*Book, error) { - if err := rep.Delete(b).Error; err != nil { - return nil, err - } - return b, nil -} - -func convertToBook(rec *RecordBook) optional.Option[*Book] { - if rec.ID == 0 { - return optional.None[*Book]() - } - c := &Category{ID: rec.CategoryID, Name: rec.CategoryName} - f := &Format{ID: rec.FormatID, Name: rec.FormatName} - return optional.Some( - &Book{ID: rec.ID, Title: rec.Title, Isbn: rec.Isbn, CategoryID: rec.CategoryID, Category: c, FormatID: rec.FormatID, Format: f}) -} - -// ToString is return string of object -func (b *Book) ToString() string { - return toString(b) -} diff --git a/src/sample-golang-echo-app/model/category.go b/src/sample-golang-echo-app/model/category.go deleted file mode 100644 index 4f4a42a6d8a96626c89fc53f2497226a0cac6987..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/model/category.go +++ /dev/null @@ -1,65 +0,0 @@ -package model - -import ( - "github.com/moznion/go-optional" - "github.com/ybkuroki/go-webapp-sample/repository" -) - -// Category defines struct of category data. -type Category struct { - ID uint `gorm:"primary_key" json:"id"` - Name string `validate:"required" json:"name"` -} - -// TableName returns the table name of category struct and it is used by gorm. -func (Category) TableName() string { - return "category_master" -} - -// NewCategory is constructor -func NewCategory(name string) *Category { - return &Category{Name: name} -} - -// Exist returns true if a given category exits. -func (c *Category) Exist(rep repository.Repository, id uint) (bool, error) { - var count int64 - if err := rep.Where("id = ?", id).Count(&count).Error; err != nil { - return false, err - } - if count > 0 { - return true, nil - } - return false, nil -} - -// FindByID returns a category full matched given category's ID. -func (c *Category) FindByID(rep repository.Repository, id uint) optional.Option[*Category] { - var category Category - if err := rep.Where("id = ?", id).First(&category).Error; err != nil { - return optional.None[*Category]() - } - return optional.Some(&category) -} - -// FindAll returns all categories of the category table. -func (c *Category) FindAll(rep repository.Repository) (*[]Category, error) { - var categories []Category - if err := rep.Find(&categories).Error; err != nil { - return nil, err - } - return &categories, nil -} - -// Create persists this category data. -func (c *Category) Create(rep repository.Repository) (*Category, error) { - if err := rep.Create(c).Error; err != nil { - return nil, err - } - return c, nil -} - -// ToString is return string of object -func (c *Category) ToString() string { - return toString(c) -} diff --git a/src/sample-golang-echo-app/model/dto/account.go b/src/sample-golang-echo-app/model/dto/account.go deleted file mode 100644 index 986d664781b2155dd704482bd549d58ab0f9d6bf..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/model/dto/account.go +++ /dev/null @@ -1,20 +0,0 @@ -package dto - -import "encoding/json" - -// LoginDto defines a data transfer object for login. -type LoginDto struct { - UserName string `json:"username"` - Password string `json:"password"` -} - -// NewLoginDto is constructor. -func NewLoginDto() *LoginDto { - return &LoginDto{} -} - -// ToString is return string of object -func (l *LoginDto) ToString() (string, error) { - bytes, err := json.Marshal(l) - return string(bytes), err -} diff --git a/src/sample-golang-echo-app/model/dto/book.go b/src/sample-golang-echo-app/model/dto/book.go deleted file mode 100644 index 3cf141bba3c6e1e8315deef5c2ed3dc40d4794dc..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/model/dto/book.go +++ /dev/null @@ -1,77 +0,0 @@ -package dto - -import ( - "encoding/json" - - "github.com/ybkuroki/go-webapp-sample/model" - "gopkg.in/go-playground/validator.v9" -) - -const ( - required string = "required" - max string = "max" - min string = "min" -) - -// BookDto defines a data transfer object for book. -type BookDto struct { - Title string `validate:"required,min=3,max=50" json:"title"` - Isbn string `validate:"required,min=10,max=20" json:"isbn"` - CategoryID uint `json:"categoryId"` - FormatID uint `json:"formatId"` - messages map[string]string -} - -// NewBookDto is constructor. -func NewBookDto(messages map[string]string) *BookDto { - return &BookDto{messages: messages} -} - -// Create creates a book model from this DTO. -func (b *BookDto) Create() *model.Book { - return model.NewBook(b.Title, b.Isbn, b.CategoryID, b.FormatID) -} - -// Validate performs validation check for the each item. -func (b *BookDto) Validate() map[string]string { - return validateDto(b) -} - -func validateDto(b *BookDto) map[string]string { - err := validator.New().Struct(b) - if err == nil { - return nil - } - - errors := err.(validator.ValidationErrors) - if len(errors) == 0 { - return nil - } - - return createErrorMessages(b, errors) -} - -func createErrorMessages(b *BookDto, errors validator.ValidationErrors) map[string]string { - result := make(map[string]string) - for i := range errors { - switch errors[i].StructField() { - case "Title": - switch errors[i].Tag() { - case required, min, max: - result["title"] = b.messages["ValidationErrMessageBookTitle"] - } - case "Isbn": - switch errors[i].Tag() { - case required, min, max: - result["isbn"] = b.messages["ValidationErrMessageBookISBN"] - } - } - } - return result -} - -// ToString is return string of object -func (b *BookDto) ToString() (string, error) { - bytes, err := json.Marshal(b) - return string(bytes), err -} diff --git a/src/sample-golang-echo-app/model/dto/book_test.go b/src/sample-golang-echo-app/model/dto/book_test.go deleted file mode 100644 index 25ae4664dd7d90a4fd9ef51b63dd28cd1295f0f1..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/model/dto/book_test.go +++ /dev/null @@ -1,216 +0,0 @@ -package dto - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -const ( - ValidationErrMessageBookTitle string = "Please enter the title with 3 to 50 characters." - ValidationErrMessageBookISBN string = "Please enter the ISBN with 10 to 20 characters." -) - -func TestValidate_Title2Error(t *testing.T) { - dto := createBookForTitle2() - result := dto.Validate() - assert.Equal(t, ValidationErrMessageBookTitle, result["title"]) -} - -func TestValidate_Title3Success(t *testing.T) { - dto := createBookForTitle3() - result := dto.Validate() - assert.Empty(t, result) -} - -func TestValidate_Title4Success(t *testing.T) { - dto := createBookForTitle4() - result := dto.Validate() - assert.Empty(t, result) -} - -func TestValidate_Title49Success(t *testing.T) { - dto := createBookForTitle49() - result := dto.Validate() - assert.Empty(t, result) -} - -func TestValidate_Title50Success(t *testing.T) { - dto := createBookForTitle50() - result := dto.Validate() - assert.Empty(t, result) -} - -func TestValidate_Title51Error(t *testing.T) { - dto := createBookForTitle51() - result := dto.Validate() - assert.Equal(t, ValidationErrMessageBookTitle, result["title"]) -} - -func TestValidate_Isbn9Error(t *testing.T) { - dto := createBookForIsbn9() - result := dto.Validate() - assert.Equal(t, ValidationErrMessageBookISBN, result["isbn"]) -} - -func TestValidate_Isbn10Success(t *testing.T) { - dto := createBookForIsbn10() - result := dto.Validate() - assert.Empty(t, result) -} - -func TestValidate_Isbn11Success(t *testing.T) { - dto := createBookForIsbn11() - result := dto.Validate() - assert.Empty(t, result) -} - -func TestValidate_Isbn19Success(t *testing.T) { - dto := createBookForIsbn19() - result := dto.Validate() - assert.Empty(t, result) -} - -func TestValidate_Isbn20Success(t *testing.T) { - dto := createBookForIsbn20() - result := dto.Validate() - assert.Empty(t, result) -} - -func TestValidate_Isbn21Error(t *testing.T) { - dto := createBookForIsbn21() - result := dto.Validate() - assert.Equal(t, ValidationErrMessageBookISBN, result["isbn"]) -} - -func TestToString(t *testing.T) { - dto := createBookForTitle4() - result, _ := dto.ToString() - assert.Equal(t, "{\"title\":\"Test\",\"isbn\":\"123-123-123-1\",\"categoryId\":1,\"formatId\":1}", result) -} - -func createValidationMessages() map[string]string { - return map[string]string{ - "ValidationErrMessageBookTitle": "Please enter the title with 3 to 50 characters.", - "ValidationErrMessageBookISBN": "Please enter the ISBN with 10 to 20 characters."} -} - -func createBookForTitle2() *BookDto { - return &BookDto{ - Title: "Te", - Isbn: "123-123-123-1", - CategoryID: 1, - FormatID: 1, - messages: createValidationMessages(), - } -} - -func createBookForTitle3() *BookDto { - return &BookDto{ - Title: "Tes", - Isbn: "123-123-123-1", - CategoryID: 1, - FormatID: 1, - messages: createValidationMessages(), - } -} - -func createBookForTitle4() *BookDto { - return &BookDto{ - Title: "Test", - Isbn: "123-123-123-1", - CategoryID: 1, - FormatID: 1, - messages: createValidationMessages(), - } -} - -func createBookForTitle49() *BookDto { - return &BookDto{ - Title: "Test012345Test012345Test012345Test012345Test01234", - Isbn: "123-123-123-1", - CategoryID: 1, - FormatID: 1, - messages: createValidationMessages(), - } -} - -func createBookForTitle50() *BookDto { - return &BookDto{ - Title: "Test012345Test012345Test012345Test012345Test012345", - Isbn: "123-123-123-1", - CategoryID: 1, - FormatID: 1, - messages: createValidationMessages(), - } -} - -func createBookForTitle51() *BookDto { - return &BookDto{ - Title: "Test012345Test012345Test012345Test012345Test012345T", - Isbn: "123-123-123-1", - CategoryID: 1, - FormatID: 1, - messages: createValidationMessages(), - } -} - -func createBookForIsbn9() *BookDto { - return &BookDto{ - Title: "Test", - Isbn: "123456789", - CategoryID: 1, - FormatID: 1, - messages: createValidationMessages(), - } -} - -func createBookForIsbn10() *BookDto { - return &BookDto{ - Title: "Test", - Isbn: "1234567890", - CategoryID: 1, - FormatID: 1, - messages: createValidationMessages(), - } -} - -func createBookForIsbn19() *BookDto { - return &BookDto{ - Title: "Test", - Isbn: "1234567890123456789", - CategoryID: 1, - FormatID: 1, - messages: createValidationMessages(), - } -} - -func createBookForIsbn20() *BookDto { - return &BookDto{ - Title: "Test", - Isbn: "12345678901234567890", - CategoryID: 1, - FormatID: 1, - messages: createValidationMessages(), - } -} - -func createBookForIsbn21() *BookDto { - return &BookDto{ - Title: "Test", - Isbn: "123456789012345678901", - CategoryID: 1, - FormatID: 1, - messages: createValidationMessages(), - } -} - -func createBookForIsbn11() *BookDto { - return &BookDto{ - Title: "Test", - Isbn: "12345678901", - CategoryID: 1, - FormatID: 1, - messages: createValidationMessages(), - } -} diff --git a/src/sample-golang-echo-app/model/format.go b/src/sample-golang-echo-app/model/format.go deleted file mode 100644 index 74371a2bcd497577ba227578a28c5d0666032bc3..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/model/format.go +++ /dev/null @@ -1,53 +0,0 @@ -package model - -import ( - "github.com/moznion/go-optional" - "github.com/ybkuroki/go-webapp-sample/repository" -) - -// Format defines struct of format data. -type Format struct { - ID uint `gorm:"primary_key" json:"id"` - Name string `validate:"required" json:"name"` -} - -// TableName returns the table name of format struct and it is used by gorm. -func (Format) TableName() string { - return "format_master" -} - -// NewFormat is constructor -func NewFormat(name string) *Format { - return &Format{Name: name} -} - -// FindByID returns a format full matched given format's ID. -func (f *Format) FindByID(rep repository.Repository, id uint) optional.Option[*Format] { - var format Format - if err := rep.Where("id = ?", id).First(&format).Error; err != nil { - return optional.None[*Format]() - } - return optional.Some(&format) -} - -// FindAll returns all formats of the format table. -func (f *Format) FindAll(rep repository.Repository) (*[]Format, error) { - var formats []Format - if err := rep.Find(&formats).Error; err != nil { - return nil, err - } - return &formats, nil -} - -// Create persists this category data. -func (f *Format) Create(rep repository.Repository) (*Format, error) { - if err := rep.Create(f).Error; err != nil { - return nil, err - } - return f, nil -} - -// ToString is return string of object -func (f *Format) ToString() string { - return toString(f) -} diff --git a/src/sample-golang-echo-app/model/page.go b/src/sample-golang-echo-app/model/page.go deleted file mode 100644 index 5d5317d216d551e44bd5dc951a8fa55cac7d9bd0..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/model/page.go +++ /dev/null @@ -1,17 +0,0 @@ -package model - -// Page defines struct of pagination data. -type Page struct { - Content *[]Book `json:"content"` - Last bool `json:"last"` - TotalElements int `json:"totalElements"` - TotalPages int `json:"totalPages"` - Size int `json:"size"` - Page int `json:"page"` - NumberOfElements int `json:"numberOfElements"` -} - -// NewPage is constructor -func NewPage() *Page { - return &Page{} -} diff --git a/src/sample-golang-echo-app/repository/repository.go b/src/sample-golang-echo-app/repository/repository.go deleted file mode 100644 index da970ddcb0fc84b0850044f5c207591e6a094414..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/repository/repository.go +++ /dev/null @@ -1,192 +0,0 @@ -package repository - -import ( - "database/sql" - "fmt" - "os" - - "github.com/ybkuroki/go-webapp-sample/config" - "github.com/ybkuroki/go-webapp-sample/logger" - "gorm.io/driver/mysql" - "gorm.io/driver/postgres" - "gorm.io/driver/sqlite" - "gorm.io/gorm" -) - -// Repository defines a interface for access the database. -type Repository interface { - Model(value interface{}) *gorm.DB - Select(query interface{}, args ...interface{}) *gorm.DB - Find(out interface{}, where ...interface{}) *gorm.DB - Exec(sql string, values ...interface{}) *gorm.DB - First(out interface{}, where ...interface{}) *gorm.DB - Raw(sql string, values ...interface{}) *gorm.DB - Create(value interface{}) *gorm.DB - Save(value interface{}) *gorm.DB - Updates(value interface{}) *gorm.DB - Delete(value interface{}) *gorm.DB - Where(query interface{}, args ...interface{}) *gorm.DB - Preload(column string, conditions ...interface{}) *gorm.DB - Scopes(funcs ...func(*gorm.DB) *gorm.DB) *gorm.DB - ScanRows(rows *sql.Rows, result interface{}) error - Transaction(fc func(tx Repository) error) (err error) - Close() error - DropTableIfExists(value interface{}) error - AutoMigrate(value interface{}) error -} - -// repository defines a repository for access the database. -type repository struct { - db *gorm.DB -} - -// bookRepository is a concrete repository that implements repository. -type bookRepository struct { - *repository -} - -// NewBookRepository is constructor for bookRepository. -func NewBookRepository(logger logger.Logger, conf *config.Config) Repository { - logger.GetZapLogger().Infof("Try database connection") - db, err := connectDatabase(logger, conf) - if err != nil { - logger.GetZapLogger().Errorf("Failure database connection") - os.Exit(config.ErrExitStatus) - } - logger.GetZapLogger().Infof("Success database connection, %s:%s", conf.Database.Host, conf.Database.Port) - return &bookRepository{&repository{db: db}} -} - -const ( - // SQLITE represents SQLite3 - SQLITE = "sqlite3" - // POSTGRES represents PostgreSQL - POSTGRES = "postgres" - // MYSQL represents MySQL - MYSQL = "mysql" -) - -func connectDatabase(logger logger.Logger, config *config.Config) (*gorm.DB, error) { - var dsn string - gormConfig := &gorm.Config{Logger: logger} - - if config.Database.Dialect == POSTGRES { - dsn = fmt.Sprintf("host=%s port=%s user=%s dbname=%s password=%s sslmode=disable", config.Database.Host, config.Database.Port, config.Database.Username, config.Database.Dbname, config.Database.Password) - return gorm.Open(postgres.Open(dsn), gormConfig) - } else if config.Database.Dialect == MYSQL { - dsn = fmt.Sprintf("%s:%s@(%s)/%s?charset=utf8&parseTime=True&loc=Local", config.Database.Username, config.Database.Password, config.Database.Host, config.Database.Dbname) - return gorm.Open(mysql.Open(dsn), gormConfig) - } - return gorm.Open(sqlite.Open(config.Database.Host), gormConfig) -} - -// Model specify the model you would like to run db operations -func (rep *repository) Model(value interface{}) *gorm.DB { - return rep.db.Model(value) -} - -// Select specify fields that you want to retrieve from database when querying, by default, will select all fields; -func (rep *repository) Select(query interface{}, args ...interface{}) *gorm.DB { - return rep.db.Select(query, args...) -} - -// Find find records that match given conditions. -func (rep *repository) Find(out interface{}, where ...interface{}) *gorm.DB { - return rep.db.Find(out, where...) -} - -// Exec exec given SQL using by gorm.DB. -func (rep *repository) Exec(sql string, values ...interface{}) *gorm.DB { - return rep.db.Exec(sql, values...) -} - -// First returns first record that match given conditions, order by primary key. -func (rep *repository) First(out interface{}, where ...interface{}) *gorm.DB { - return rep.db.First(out, where...) -} - -// Raw returns the record that executed the given SQL using gorm.DB. -func (rep *repository) Raw(sql string, values ...interface{}) *gorm.DB { - return rep.db.Raw(sql, values...) -} - -// Create insert the value into database. -func (rep *repository) Create(value interface{}) *gorm.DB { - return rep.db.Create(value) -} - -// Save update value in database, if the value doesn't have primary key, will insert it. -func (rep *repository) Save(value interface{}) *gorm.DB { - return rep.db.Save(value) -} - -// Update update value in database -func (rep *repository) Updates(value interface{}) *gorm.DB { - return rep.db.Updates(value) -} - -// Delete delete value match given conditions. -func (rep *repository) Delete(value interface{}) *gorm.DB { - return rep.db.Delete(value) -} - -// Where returns a new relation. -func (rep *repository) Where(query interface{}, args ...interface{}) *gorm.DB { - return rep.db.Where(query, args...) -} - -// Preload preload associations with given conditions. -func (rep *repository) Preload(column string, conditions ...interface{}) *gorm.DB { - return rep.db.Preload(column, conditions...) -} - -// Scopes pass current database connection to arguments `func(*DB) *DB`, which could be used to add conditions dynamically -func (rep *repository) Scopes(funcs ...func(*gorm.DB) *gorm.DB) *gorm.DB { - return rep.db.Scopes(funcs...) -} - -// ScanRows scan `*sql.Rows` to give struct -func (rep *repository) ScanRows(rows *sql.Rows, result interface{}) error { - return rep.db.ScanRows(rows, result) -} - -// Close close current db connection. If database connection is not an io.Closer, returns an error. -func (rep *repository) Close() error { - sqlDB, _ := rep.db.DB() - return sqlDB.Close() -} - -// DropTableIfExists drop table if it is exist -func (rep *repository) DropTableIfExists(value interface{}) error { - return rep.db.Migrator().DropTable(value) -} - -// AutoMigrate run auto migration for given models, will only add missing fields, won't delete/change current data -func (rep *repository) AutoMigrate(value interface{}) error { - return rep.db.AutoMigrate(value) -} - -// Transaction start a transaction as a block. -// If it is failed, will rollback and return error. -// If it is sccuessed, will commit. -// ref: https://github.com/jinzhu/gorm/blob/master/main.go#L533 -func (rep *repository) Transaction(fc func(tx Repository) error) (err error) { - panicked := true - tx := rep.db.Begin() - defer func() { - if panicked || err != nil { - tx.Rollback() - } - }() - - txrep := &repository{} - txrep.db = tx - err = fc(txrep) - - if err == nil { - err = tx.Commit().Error - } - - panicked = false - return -} diff --git a/src/sample-golang-echo-app/resources/config/application.develop.yml b/src/sample-golang-echo-app/resources/config/application.develop.yml deleted file mode 100644 index 1f4c5af43ddd4d8cb9372f11378012371eeaf150..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/config/application.develop.yml +++ /dev/null @@ -1,36 +0,0 @@ -database: - dialect: sqlite3 - host: book.db - port: - dbname: - username: - password: - migration: true - -extension: - master_generator: true - cors_enabled: true - security_enabled: true - -log: - request_log_format: ${remote_ip} ${account_name} ${uri} ${method} ${status} - -staticcontents: - enabled: true - -swagger: - enabled: true - path: /swagger/.* - -security: - auth_path: - - /api/.* - exclude_path: - - /swagger/.* - - /api/auth/login$ - - /api/auth/logout$ - - /api/health$ - user_path: - - /api/.* - admin_path: - - /api/.* \ No newline at end of file diff --git a/src/sample-golang-echo-app/resources/config/application.docker.yml b/src/sample-golang-echo-app/resources/config/application.docker.yml deleted file mode 100644 index 62b8af7dc46289a7b90dcb04029e3d44ca585084..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/config/application.docker.yml +++ /dev/null @@ -1,28 +0,0 @@ -database: - dialect: postgres - host: postgres-db - port: 5432 - dbname: testdb - username: testusr - password: testusr - migration: false - -extension: - master_generator: false - cors_enabled: false - security_enabled: true - -log: - request_log_format: ${remote_ip} ${account_name} ${uri} ${method} ${status} - -security: - auth_path: - - /api/.* - exclude_path: - - /api/auth/login$ - - /api/auth/logout$ - - /api/health$ - user_path: - - /api/.* - admin_path: - - /api/.* \ No newline at end of file diff --git a/src/sample-golang-echo-app/resources/config/application.k8s.yml b/src/sample-golang-echo-app/resources/config/application.k8s.yml deleted file mode 100644 index 378e43294277426f972559f25876a94d90247193..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/config/application.k8s.yml +++ /dev/null @@ -1,34 +0,0 @@ -database: - dialect: postgres - host: dbserver-k8s-service - port: 5432 - dbname: testdb - username: testusr - password: testusr - migration: false - -redis: - enabled: true - connection_pool_size: 10 - host: redis-k8s-service - port: 6379 - -extension: - master_generator: false - cors_enabled: false - security_enabled: true - -log: - request_log_format: ${remote_ip} ${account_name} ${uri} ${method} ${status} - -security: - auth_path: - - /api/.* - exclude_path: - - /api/auth/login$ - - /api/auth/logout$ - - /api/health$ - user_path: - - /api/.* - admin_path: - - /api/.* \ No newline at end of file diff --git a/src/sample-golang-echo-app/resources/config/messages.properties b/src/sample-golang-echo-app/resources/config/messages.properties deleted file mode 100644 index 475ad0e14e640e314ce0f422b304b6433f52241f..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/config/messages.properties +++ /dev/null @@ -1,3 +0,0 @@ -# validation messages for book model -ValidationErrMessageBookTitle = Please enter the title with 3 to 50 characters. -ValidationErrMessageBookISBN = Please enter the ISBN with 10 to 20 characters. diff --git a/src/sample-golang-echo-app/resources/config/zaplogger.develop.yml b/src/sample-golang-echo-app/resources/config/zaplogger.develop.yml deleted file mode 100644 index b21670adc4722172c49d0640ffcfd99139beee17..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/config/zaplogger.develop.yml +++ /dev/null @@ -1,24 +0,0 @@ -zap_config: - level: "debug" - encoding: "console" - development: true - encoderConfig: - messageKey: "Msg" - levelKey: "Level" - timeKey: "Time" - nameKey: "Name" - callerKey: "Caller" - stacktraceKey: "St" - levelEncoder: "capital" - timeEncoder: "iso8601" - durationEncoder: "string" - callerEncoder: "short" - outputPaths: - - "stdout" - errorOutputPaths: - - "stdout" - -log_rotate: - maxsize: 3 - maxage: 7 - maxbackups: 7 \ No newline at end of file diff --git a/src/sample-golang-echo-app/resources/config/zaplogger.docker.yml b/src/sample-golang-echo-app/resources/config/zaplogger.docker.yml deleted file mode 100644 index 6aebbf95082790e2365101038f414afe2bf1f6cb..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/config/zaplogger.docker.yml +++ /dev/null @@ -1,26 +0,0 @@ -zap_config: - level: "info" - encoding: "console" - development: true - encoderConfig: - messageKey: "Msg" - levelKey: "Level" - timeKey: "Time" - nameKey: "Name" - callerKey: "Caller" - stacktraceKey: "St" - levelEncoder: "capital" - timeEncoder: "iso8601" - durationEncoder: "string" - callerEncoder: "short" - outputPaths: - - "stdout" - - "./application.log" - errorOutputPaths: - - "stderr" - - "./error.log" - -log_rotate: - maxsize: 3 - maxage: 7 - maxbackups: 7 \ No newline at end of file diff --git a/src/sample-golang-echo-app/resources/config/zaplogger.k8s.yml b/src/sample-golang-echo-app/resources/config/zaplogger.k8s.yml deleted file mode 100644 index 6aebbf95082790e2365101038f414afe2bf1f6cb..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/config/zaplogger.k8s.yml +++ /dev/null @@ -1,26 +0,0 @@ -zap_config: - level: "info" - encoding: "console" - development: true - encoderConfig: - messageKey: "Msg" - levelKey: "Level" - timeKey: "Time" - nameKey: "Name" - callerKey: "Caller" - stacktraceKey: "St" - levelEncoder: "capital" - timeEncoder: "iso8601" - durationEncoder: "string" - callerEncoder: "short" - outputPaths: - - "stdout" - - "./application.log" - errorOutputPaths: - - "stderr" - - "./error.log" - -log_rotate: - maxsize: 3 - maxage: 7 - maxbackups: 7 \ No newline at end of file diff --git a/src/sample-golang-echo-app/resources/public/css/app.750b60b0.css b/src/sample-golang-echo-app/resources/public/css/app.750b60b0.css deleted file mode 100644 index 85aa344a749c119ec9a25fa1db0976def7f052b4..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/public/css/app.750b60b0.css +++ /dev/null @@ -1,3 +0,0 @@ -.margin { - height: 70px -} diff --git a/src/sample-golang-echo-app/resources/public/favicon.ico b/src/sample-golang-echo-app/resources/public/favicon.ico deleted file mode 100644 index df36fcfb72584e00488330b560ebcf34a41c64c2..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/favicon.ico and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/android-chrome-192x192.png b/src/sample-golang-echo-app/resources/public/img/icons/android-chrome-192x192.png deleted file mode 100644 index b02aa64d97167ad649e496908b35f14c603d9249..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/img/icons/android-chrome-192x192.png and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/android-chrome-512x512.png b/src/sample-golang-echo-app/resources/public/img/icons/android-chrome-512x512.png deleted file mode 100644 index 06088b011eccebb820b6e8de0cd244aa443208ba..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/img/icons/android-chrome-512x512.png and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-120x120.png b/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-120x120.png deleted file mode 100644 index 1427cf62752646ad7217df0a61aa01fdef7475d1..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-120x120.png and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-152x152.png b/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-152x152.png deleted file mode 100644 index f24d454a2ecb8851bb893192b64ee09386d30e24..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-152x152.png and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-180x180.png b/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-180x180.png deleted file mode 100644 index 404e192a95ccccbede087203c42b1f25f6bc6e67..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-180x180.png and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-60x60.png b/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-60x60.png deleted file mode 100644 index cf10a5602e653bb126332934e2b7f34081c19a01..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-60x60.png and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-76x76.png b/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-76x76.png deleted file mode 100644 index c500769e3df9d6a6f1977ace8be4e63a8095e36a..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon-76x76.png and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon.png b/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon.png deleted file mode 100644 index 03c0c5d5ec302ed7b0ee2c401df9427fb9d3c117..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/img/icons/apple-touch-icon.png and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/favicon-16x16.png b/src/sample-golang-echo-app/resources/public/img/icons/favicon-16x16.png deleted file mode 100644 index 42af00963d81b8e39a30435c60ac482d1f8756e0..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/img/icons/favicon-16x16.png and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/favicon-32x32.png b/src/sample-golang-echo-app/resources/public/img/icons/favicon-32x32.png deleted file mode 100644 index 46ca04dee251a4fa85a2891a145fbe20cc619d96..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/img/icons/favicon-32x32.png and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/msapplication-icon-144x144.png b/src/sample-golang-echo-app/resources/public/img/icons/msapplication-icon-144x144.png deleted file mode 100644 index 7808237a18d4009501f950044f8388d13c5e1044..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/img/icons/msapplication-icon-144x144.png and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/mstile-150x150.png b/src/sample-golang-echo-app/resources/public/img/icons/mstile-150x150.png deleted file mode 100644 index 3b37a43ae2fdef53050291d95da2e49f78cf398e..0000000000000000000000000000000000000000 Binary files a/src/sample-golang-echo-app/resources/public/img/icons/mstile-150x150.png and /dev/null differ diff --git a/src/sample-golang-echo-app/resources/public/img/icons/safari-pinned-tab.svg b/src/sample-golang-echo-app/resources/public/img/icons/safari-pinned-tab.svg deleted file mode 100644 index 732afd8eb0aa8d33d077e92bb148901b454b40a1..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/public/img/icons/safari-pinned-tab.svg +++ /dev/null @@ -1,149 +0,0 @@ - - - - -Created by potrace 1.11, written by Peter Selinger 2001-2013 - - - - - diff --git a/src/sample-golang-echo-app/resources/public/index.html b/src/sample-golang-echo-app/resources/public/index.html deleted file mode 100644 index 41d99b8a4c403d2f3c7fc721f16ad36f7373da51..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/public/index.html +++ /dev/null @@ -1 +0,0 @@ -vuejs-webapp-sample
\ No newline at end of file diff --git a/src/sample-golang-echo-app/resources/public/js/app.b3c19b4f.js b/src/sample-golang-echo-app/resources/public/js/app.b3c19b4f.js deleted file mode 100644 index d86792a88e9caa2a4bf2b5eb420df2bfc6aeefd9..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/public/js/app.b3c19b4f.js +++ /dev/null @@ -1 +0,0 @@ -(function(t){function e(e){for(var o,r,s=e[0],c=e[1],u=e[2],d=0,m=[];d1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=this.createParameter(e);u.a.get(t,{params:i}).then((function(t){n&&n(t.data)})).catch((function(t){o&&o(t)}))}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;u.a.post(t,e).then((function(t){n&&n(t.data)})).catch((function(t){o&&o(t)}))}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;u.a.put(t,e).then((function(t){n&&n(t.data)})).catch((function(t){o&&o(t)}))}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;u.a.delete(t,e).then((function(t){n&&n(t.data)})).catch((function(t){o&&o(t)}))}},{key:"createParameter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new URLSearchParams;return Object.keys(t).forEach((function(n){t[n]&&e.append(n,t[n])})),e}}]),t}(),d={AppName:"vuejs-webapp-sample",AppDeveloper:"ybkuroki",GithubLink:"https://github.com/ybkuroki/vuejs-webapp-sample"},m="/api",f=m+"/auth",p=m+"/books",v=m+"/categories",g=m+"/formats",b={LoginStatus:f+"/loginStatus",LoginAccount:f+"/loginAccount",Login:f+"/login",Logout:f+"/logout"},h={loginStatus:function(t,e){l.get(b.LoginStatus,{},t,e)},loginAccount:function(t){l.get(b.LoginAccount,{},t,(function(){return!1}))},login:function(t,e,n){l.post(b.Login,t,e,n)},logout:function(t){l.post(b.Logout,{},t,(function(){return!1}))}},_="GET_LOGIN_ACCOUNT",k="GET_CATEGORY",y="GET_FORMAT",w={name:"App",data:function(){return{login:!1}},methods:{checkLogin:function(t,e,n){var o=this;h.loginStatus((function(){o.login=!0,o.setStore(),n()}),(function(){o.login=!1,o.$router.push("/login")}))},setStore:function(){var t=this.$store.getters.getLoginAccount,e=this.$store.getters.getCategory,n=this.$store.getters.getFormat;null==t&&null==e&&null==n&&(this.$store.dispatch(_),this.$store.dispatch(k),this.$store.dispatch(y))}}},C=w,x=n("2877"),O=Object(x["a"])(C,i,a,!1,null,null,null),A=O.exports,j=n("8c4f"),L=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"centered-container"},[n("md-content",{staticClass:"md-elevation-3"},[n("div",{staticClass:"title"},[n("div",{staticClass:"md-title"},[t._v(t._s(t.AppInfo.AppName))])]),n("div",{staticClass:"form"},[n("md-field",[n("label",[t._v("User")]),n("md-input",{attrs:{autofocus:""},model:{value:t.user,callback:function(e){t.user=e},expression:"user"}})],1),n("md-field",{attrs:{"md-has-password":""}},[n("label",[t._v("Password")]),n("md-input",{attrs:{type:"password"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.login.apply(null,arguments)}},model:{value:t.password,callback:function(e){t.password=e},expression:"password"}})],1)],1),n("div",{staticClass:"actions md-layout md-alignment-center-space-between"},[n("md-button",{staticClass:"md-raised md-primary",on:{click:t.login}},[t._v("Log in")])],1),t.isLoading?n("div",{staticClass:"loading-overlay"},[n("md-progress-spinner",{attrs:{"md-mode":"indeterminate","md-stroke":2}})],1):t._e(),n("md-snackbar",{attrs:{"md-position":"center","md-active":t.showErrorMessage,"md-persistent":""},on:{"update:mdActive":function(e){t.showErrorMessage=e},"update:md-active":function(e){t.showErrorMessage=e}}},[n("span",[t._v(t._s(t.message))])])],1)],1)},$=[],E={name:"LoginView",data:function(){return{AppInfo:d,user:"",password:"",message:"",showErrorMessage:!1,isLoading:!1}},methods:{login:function(){var t=this;this.isLoading=!0,h.login({username:this.user,password:this.password},(function(){t.isLoading=!1,t.$router.push("/home")}),(function(){t.isLoading=!1,t.showErrorMessage=!0,t.message="Failed to logged-in."}))}}},M=E,S=(n("24f6"),Object(x["a"])(M,L,$,!1,null,null,null)),N=S.exports,P=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ViewBase",[n("template",{slot:"header"},[n("md-field",{staticClass:"search-box md-autocomplete md-autocomplete-box md-inline",attrs:{"md-clearable":""}},[n("div",{staticClass:"md-menu"},[n("md-input",{on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.search.apply(null,arguments)}},model:{value:t.keyword,callback:function(e){t.keyword=e},expression:"keyword"}})],1),n("label",[t._v("Search...")])]),n("md-button",{staticClass:"md-icon-button",on:{click:t.search}},[n("md-icon",[t._v("search")])],1)],1),n("template",{slot:"main"},[t.isCreate?n("CreateCard",{on:{cancel:t.createCancel}}):t._e(),t.isLoading?n("md-progress-spinner",{attrs:{"md-mode":"indeterminate"}}):t._l(t.books,(function(e){return n("EditCard",{key:e.id,attrs:{book:e},on:{cancel:t.getBookList}})})),n("div",{staticClass:"margin"})],2),n("template",{slot:"overlay"},[n("md-button",{staticClass:"md-fab md-fab-bottom-right md-primary",on:{click:t.create}},[n("md-icon",[t._v("add")])],1)],1)],2)},T=[],B=(n("ac1f"),n("841c"),{get:function(t,e){l.get(p+"/".concat(t.id),"",e,(function(){return!1}))},search:function(t,e){l.get(p,t,e,(function(){return!1}))},create:function(t,e,n){l.post(p,t,e,n)},edit:function(t,e,n){l.put(p+"/".concat(t.id),t,e,n)},delete:function(t,e){l.delete(p+"/".concat(t),"",e,(function(){return!1}))}}),V=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("md-app",{attrs:{"md-waterfall":"","md-mode":"fixed"}},[n("md-app-toolbar",{staticClass:"md-primary"},[n("div",{staticClass:"md-toolbar-row"},[n("md-button",{staticClass:"md-icon-button",on:{click:function(e){t.menuVisible=!t.menuVisible}}},[n("md-icon",[t._v("menu")])],1),t._t("header"),n("div",{staticClass:"md-toolbar-section-end"},[n("md-button",{staticClass:"md-icon-button",on:{click:t.clickGithub}},[n("md-icon",[n("font-awesome-icon",{attrs:{icon:["fab","github"]}})],1)],1),""!=t.userName?n("label",[t._v(t._s(t.userName))]):t._e(),n("md-button",{staticClass:"md-icon-button",on:{click:t.logout}},[n("md-icon",[n("font-awesome-icon",{attrs:{icon:["fas","sign-out-alt"]}})],1)],1)],1)],2)]),n("md-app-drawer",{attrs:{"md-active":t.menuVisible},on:{"update:mdActive":function(e){t.menuVisible=e},"update:md-active":function(e){t.menuVisible=e}}},[n("md-toolbar",{staticClass:"md-transparent",attrs:{"md-elevation":"0"}},[t._v("Navigation")]),n("md-list",[n("md-list-item",{on:{click:t.clickHome}},[n("md-icon",[t._v("home")]),n("span",{staticClass:"md-list-item-text"},[t._v("Home")])],1),n("md-list-item",{on:{click:t.clickAbout}},[n("md-icon",[t._v("info")]),n("span",{staticClass:"md-list-item-text"},[t._v("About")])],1),n("md-list-item",{on:{click:t.clickGithub}},[n("md-icon",[n("font-awesome-icon",{attrs:{icon:["fab","github"]}})],1),n("span",{staticClass:"md-list-item-text"},[t._v("GitHub")])],1)],1)],1),n("md-app-content",[t._t("main")],2)],1),t.menuVisible?t._e():t._t("overlay")],2)},I=[],D=(n("b0c0"),{name:"ViewBase",data:function(){return{menuVisible:!1}},computed:{userName:function(){var t=this.$store.getters.getLoginAccount;return null!=t?t.name:""}},methods:{clickHome:function(){this.$router.push("home",(function(){}))},clickAbout:function(){this.$router.push("about",(function(){}))},clickGithub:function(){window.open(d.GithubLink)},logout:function(){var t=this;h.logout((function(){return t.$router.push("/login")}))}}}),F=D,G=(n("93d8"),Object(x["a"])(F,V,I,!1,null,null,null)),R=G.exports,q=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-card",{attrs:{"md-with-hover":""}},[n("md-card-content",[n("md-field",{class:{"md-invalid":t.errors.hasOwnProperty("title")}},[n("label",[t._v("Title")]),n("md-input",{attrs:{autofocus:"",required:""},model:{value:t.title,callback:function(e){t.title=e},expression:"title"}}),n("span",{staticClass:"md-error"},[t._v(t._s(t.errors["title"]))])],1),n("md-field",{class:{"md-invalid":t.errors.hasOwnProperty("isbn")}},[n("label",[t._v("ISBN")]),n("md-input",{attrs:{required:""},model:{value:t.isbn,callback:function(e){t.isbn=e},expression:"isbn"}}),n("span",{staticClass:"md-error"},[t._v(t._s(t.errors["isbn"]))])],1),n("md-field",[n("label",[t._v("Category")]),n("md-select",{model:{value:t.category,callback:function(e){t.category=e},expression:"category"}},t._l(t.categories,(function(e){return n("md-option",{key:e.id,attrs:{value:e.id}},[t._v(t._s(e.name))])})),1)],1),n("md-field",[n("label",[t._v("Format")]),n("md-select",{model:{value:t.format,callback:function(e){t.format=e},expression:"format"}},t._l(t.formats,(function(e){return n("md-option",{key:e.id,attrs:{value:e.id}},[t._v(t._s(e.name))])})),1)],1)],1),n("md-card-actions",[n("md-button",{on:{click:t.cancel}},[t._v("Cancel")]),n("md-button",{on:{click:t.create}},[t._v("Create")])],1)],1)},H=[],U=n("1da1"),J=(n("96cf"),{name:"CreateCard",data:function(){return{title:"",isbn:"",errors:[],category:1,format:1}},computed:{categories:function(){return this.$store.getters.getCategory},formats:function(){return this.$store.getters.getFormat}},methods:{create:function(){var t=this;return Object(U["a"])(regeneratorRuntime.mark((function e(){var n,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n={title:t.title,isbn:t.isbn,categoryId:t.category,formatId:t.format},e.next=3,t.$confirm("Do you want to register it?");case 3:o=e.sent,o&&B.create(n,(function(){return t.cancel()}),(function(e){return t.errors=e.response.data}));case 5:case"end":return e.stop()}}),e)})))()},cancel:function(){this.$emit("cancel")}}}),K=J,Y=Object(x["a"])(K,q,H,!1,null,null,null),z=Y.exports,Q=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-card",{attrs:{"md-with-hover":""}},[t.isEdit?[n("md-card-content",[n("md-field",{class:{"md-invalid":t.errors.hasOwnProperty("title")}},[n("label",[t._v("Title")]),n("md-input",{attrs:{autofocus:"",required:""},model:{value:t.title,callback:function(e){t.title=e},expression:"title"}}),n("span",{staticClass:"md-error"},[t._v(t._s(t.errors["title"]))])],1),n("md-field",{class:{"md-invalid":t.errors.hasOwnProperty("isbn")}},[n("label",[t._v("ISBN")]),n("md-input",{attrs:{required:""},model:{value:t.isbn,callback:function(e){t.isbn=e},expression:"isbn"}}),n("span",{staticClass:"md-error"},[t._v(t._s(t.errors["isbn"]))])],1),n("md-field",[n("label",[t._v("Category")]),n("md-select",{model:{value:t.category,callback:function(e){t.category=e},expression:"category"}},t._l(t.categories,(function(e){return n("md-option",{key:e.id,attrs:{value:e.id}},[t._v(t._s(e.name))])})),1)],1),n("md-field",[n("label",[t._v("Format")]),n("md-select",{model:{value:t.format,callback:function(e){t.format=e},expression:"format"}},t._l(t.formats,(function(e){return n("md-option",{key:e.id,attrs:{value:e.id}},[t._v(t._s(e.name))])})),1)],1)],1)]:[n("md-card-header",[n("div",{staticClass:"md-title"},[t._v(t._s(t.book.title))])]),n("md-card-content",[n("p",[t._v(t._s(t.book.category.name))]),n("p",[t._v(t._s(t.book.format.name))])])],n("md-card-actions",{attrs:{"md-alignment":"space-between"}},[n("md-button",{on:{click:t.remove}},[t._v("Delete")]),n("div",[t.isEdit?n("md-button",{on:{click:t.cancel}},[t._v("Cancel")]):t._e(),n("md-button",{on:{click:t.edit}},[t._v("Edit")])],1)],1)],2)},W=[],X={name:"EditCard",props:{book:Object},data:function(){return{title:"",isbn:"",category:1,format:1,editable:!1,errors:[]}},computed:{isEdit:{get:function(){return this.editable},set:function(t){this.editable=t}},categories:function(){return this.$store.getters.getCategory},formats:function(){return this.$store.getters.getFormat}},methods:{edit:function(){var t=this;return Object(U["a"])(regeneratorRuntime.mark((function e(){var n,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.isEdit){e.next=8;break}return n={id:t.book.id,title:t.title,isbn:t.isbn,categoryId:t.category,formatId:t.format},e.next=4,t.$confirm("Do you want to update it?");case 4:o=e.sent,o&&B.edit(n,(function(){return t.cancel()}),(function(e){return t.errors=e.response.data})),e.next=9;break;case 8:B.get({id:t.book.id},(function(e){t.errors="",t.title=e.title,t.isbn=e.isbn,t.category=e.category.id,t.format=e.format.id,t.isEdit=!0}));case 9:case"end":return e.stop()}}),e)})))()},remove:function(){var t=this;return Object(U["a"])(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$confirm("Do you want to delete it?");case 2:n=e.sent,n&&B.delete(t.book.id,(function(){return t.cancel()}));case 4:case"end":return e.stop()}}),e)})))()},cancel:function(){this.isEdit=!1,this.$emit("cancel")}}},Z=X,tt=Object(x["a"])(Z,Q,W,!1,null,null,null),et=tt.exports,nt={name:"HomeView",data:function(){return{books:[],keyword:"",contents:[],isLoading:!1,isCreate:!1}},components:{CreateCard:z,EditCard:et,ViewBase:R},created:function(){this.getBookList()},methods:{search:function(){this.getBookList()},getBookList:function(){var t=this;this.isLoading=!0,B.search({query:this.keyword},(function(e){t.books=e.content,t.isLoading=!1}))},create:function(){this.isCreate=!0,document.querySelector(".md-app-scroller").scrollTop=0},createCancel:function(){this.isCreate=!1,this.getBookList()}}},ot=nt,it=(n("0471"),Object(x["a"])(ot,P,T,!1,null,null,null)),at=it.exports,rt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ViewBase",[n("template",{slot:"header"},[n("span",{staticClass:"md-title"},[t._v("About")])]),n("template",{slot:"main"},[n("md-list",[n("md-subheader",{staticClass:"md-primary"},[t._v("Application Name")]),n("md-list-item",[n("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.AppInfo.AppName))])]),n("md-subheader",{staticClass:"md-primary"},[t._v("Developer")]),n("md-list-item",[n("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.AppInfo.AppDeveloper))])]),n("md-subheader",{staticClass:"md-primary"},[t._v("Github")]),n("md-list-item",[n("span",{staticClass:"md-list-item-text"},[t._v(t._s(t.AppInfo.GithubLink))])])],1)],1)],2)},st=[],ct={name:"AboutView",data:function(){return{AppInfo:d}},components:{ViewBase:R}},ut=ct,lt=Object(x["a"])(ut,rt,st,!1,null,null,null),dt=lt.exports;o["default"].use(j["a"]);var mt=new j["a"]({base:"/",routes:[{path:"/login",component:N,meta:{anonymous:!0}},{path:"/home",name:"home",component:at},{path:"/about",name:"about",component:dt},{path:"/*",redirect:"/home"}]});mt.beforeEach((function(t,e,n){t.matched.some((function(t){return t.meta.anonymous}))?n():o["default"].nextTick((function(){return mt.app.$children[0].checkLogin(t,e,n)}))}));var ft,pt,vt=mt,gt=n("ade3"),bt=n("2f62"),ht={list:function(t){l.get(v,{},t,(function(){return!1}))}},_t={list:function(t){l.get(g,{},t,(function(){return!1}))}};o["default"].use(bt["a"]);var kt={account:null,category:null,format:null},yt=(ft={},Object(gt["a"])(ft,_,(function(t){var e=t.commit;h.loginAccount((function(t){return e(_,t)}))})),Object(gt["a"])(ft,k,(function(t){var e=t.commit;ht.list((function(t){return e(k,t)}))})),Object(gt["a"])(ft,y,(function(t){var e=t.commit;_t.list((function(t){return e(y,t)}))})),ft),wt={getLoginAccount:function(t){return t.account},getCategory:function(t){return t.category},getFormat:function(t){return t.format}},Ct=(pt={},Object(gt["a"])(pt,_,(function(t,e){t.account=e})),Object(gt["a"])(pt,k,(function(t,e){t.category=e})),Object(gt["a"])(pt,y,(function(t,e){t.format=e})),pt),xt=new bt["a"].Store({state:kt,getters:wt,actions:yt,mutations:Ct}),Ot=xt,At=n("9483");Object(At["a"])("".concat("/","service-worker.js"),{ready:function(){console.log("App is being served from cache by a service worker.\nFor more details, visit https://goo.gl/AFskqB")},registered:function(){console.log("Service worker has been registered.")},cached:function(){console.log("Content has been cached for offline use.")},updatefound:function(){console.log("New content is downloading.")},updated:function(){console.log("New content is available; please refresh.")},offline:function(){console.log("No internet connection found. App is running in offline mode.")},error:function(t){console.error("Error during service worker registration:",t)}});var jt=n("9c30");n("51de"),n("e094");o["default"].use(jt["MdApp"]),o["default"].use(jt["MdButton"]),o["default"].use(jt["MdCard"]),o["default"].use(jt["MdContent"]),o["default"].use(jt["MdDrawer"]),o["default"].use(jt["MdField"]),o["default"].use(jt["MdIcon"]),o["default"].use(jt["MdSnackbar"]),o["default"].use(jt["MdSpeedDial"]),o["default"].use(jt["MdToolbar"]),o["default"].use(jt["MdProgress"]),o["default"].use(jt["MdList"]),o["default"].use(jt["MdSubheader"]),o["default"].use(jt["MdMenu"]),o["default"].use(jt["MdDialog"]),o["default"].use(jt["MdDialogConfirm"]);var Lt=n("ecee"),$t=n("c074"),Et=n("f2d1"),Mt=n("ad3d");Lt["c"].add(Et["a"]),Lt["c"].add($t["a"]),o["default"].component("font-awesome-icon",Mt["a"]);var St=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-dialog-confirm",{attrs:{"md-active":t.isActive,"md-title":"Confirmation","md-content":t.message,"md-confirm-text":"OK","md-cancel-text":"Cancel"},on:{"update:mdActive":function(e){t.isActive=e},"update:md-active":function(e){t.isActive=e},"md-cancel":t.onCancel,"md-confirm":t.onConfirm}})},Nt=[],Pt={name:"ConfirmDialog",props:{message:String,success:Function,failure:Function},data:function(){return{isActive:!1}},created:function(){var t=document.createElement("div");document.getElementsByTagName("body")[0].appendChild(t),this.$mount(t),this.isActive=!0},methods:{onConfirm:function(){this.success(),this.destroy()},onCancel:function(){this.failure(),this.destroy()},destroy:function(){var t=this;this.isActive=!1,setTimeout((function(){t.$el.parentNode.removeChild(t.$el),t.$destroy()}),200)}}},Tt=Pt,Bt=Object(x["a"])(Tt,St,Nt,!1,null,null,null),Vt=Bt.exports,It=function(){function t(){Object(r["a"])(this,t)}return Object(s["a"])(t,null,[{key:"install",value:function(t){t.mixin({methods:{$confirm:function(e){return new Promise((function(n){var o=t.extend(Vt);new o({propsData:{message:e,success:function(){return n(!0)},failure:function(){return n(!1)}}})}))}}})}}]),t}();o["default"].use(It),o["default"].config.productionTip=!1,new o["default"]({router:vt,store:Ot,render:function(t){return t(A)}}).$mount("#app")},"789b":function(t,e,n){},"93d8":function(t,e,n){"use strict";n("5077")},acb5:function(t,e,n){}}); \ No newline at end of file diff --git a/src/sample-golang-echo-app/resources/public/js/chunk-vendors.2abeaede.js b/src/sample-golang-echo-app/resources/public/js/chunk-vendors.2abeaede.js deleted file mode 100644 index 1f1dd2c40eae801ec1ae96809c010383b412733c..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/public/js/chunk-vendors.2abeaede.js +++ /dev/null @@ -1,39 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{"00ee":function(t,e,n){var r=n("b622"),i=r("toStringTag"),o={};o[i]="z",t.exports="[object z]"===String(o)},"01b4":function(t,e){var n=function(){this.head=null,this.tail=null};n.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=n},"0366":function(t,e,n){var r=n("e330"),i=n("59ed"),o=r(r.bind);t.exports=function(t,e){return i(t),void 0===e?t:o?o(t,e):function(){return t.apply(e,arguments)}}},"06cf":function(t,e,n){var r=n("83ab"),i=n("c65b"),o=n("d1e7"),a=n("5c6c"),s=n("fc6a"),u=n("a04b"),c=n("1a2d"),l=n("0cfb"),d=Object.getOwnPropertyDescriptor;e.f=r?d:function(t,e){if(t=s(t),e=u(e),l)try{return d(t,e)}catch(n){}if(c(t,e))return a(!i(o.f,t,e),t[e])}},"07fa":function(t,e,n){var r=n("50c4");t.exports=function(t){return r(t.length)}},"0a06":function(t,e,n){"use strict";var r=n("c532"),i=n("30b5"),o=n("f6b4"),a=n("5270"),s=n("4a7b"),u=n("848b"),c=u.validators;function l(t){this.defaults=t,this.interceptors={request:new o,response:new o}}l.prototype.request=function(t){"string"===typeof t?(t=arguments[1]||{},t.url=arguments[0]):t=t||{},t=s(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&u.assertOptions(e,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(e){"function"===typeof e.runWhen&&!1===e.runWhen(t)||(r=r&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var i,o=[];if(this.interceptors.response.forEach((function(t){o.push(t.fulfilled,t.rejected)})),!r){var l=[a,void 0];Array.prototype.unshift.apply(l,n),l=l.concat(o),i=Promise.resolve(t);while(l.length)i=i.then(l.shift(),l.shift());return i}var d=t;while(n.length){var f=n.shift(),p=n.shift();try{d=f(d)}catch(h){p(h);break}}try{i=a(d)}catch(h){return Promise.reject(h)}while(o.length)i=i.then(o.shift(),o.shift());return i},l.prototype.getUri=function(t){return t=s(this.defaults,t),i(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(t){l.prototype[t]=function(e,n){return this.request(s(n||{},{method:t,url:e,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(t){l.prototype[t]=function(e,n,r){return this.request(s(r||{},{method:t,url:e,data:n}))}})),t.exports=l},"0b42":function(t,e,n){var r=n("da84"),i=n("e8b5"),o=n("68ee"),a=n("861d"),s=n("b622"),u=s("species"),c=r.Array;t.exports=function(t){var e;return i(t)&&(e=t.constructor,o(e)&&(e===c||i(e.prototype))?e=void 0:a(e)&&(e=e[u],null===e&&(e=void 0))),void 0===e?c:e}},"0cfb":function(t,e,n){var r=n("83ab"),i=n("d039"),o=n("cc12");t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},"0d3b":function(t,e,n){var r=n("d039"),i=n("b622"),o=n("c430"),a=i("iterator");t.exports=!r((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,n="";return t.pathname="c%20d",e.forEach((function(t,r){e["delete"]("b"),n+=r+t})),o&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},"0d51":function(t,e,n){var r=n("da84"),i=r.String;t.exports=function(t){try{return i(t)}catch(e){return"Object"}}},"0df6":function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},"107c":function(t,e,n){var r=n("d039"),i=n("da84"),o=i.RegExp;t.exports=r((function(){var t=o("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")}))},"129f":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},"14c3":function(t,e,n){var r=n("da84"),i=n("c65b"),o=n("825a"),a=n("1626"),s=n("c6b6"),u=n("9263"),c=r.TypeError;t.exports=function(t,e){var n=t.exec;if(a(n)){var r=i(n,t,e);return null!==r&&o(r),r}if("RegExp"===s(t))return i(u,t,e);throw c("RegExp#exec called on incompatible receiver")}},"159b":function(t,e,n){var r=n("da84"),i=n("fdbc"),o=n("785a"),a=n("17c2"),s=n("9112"),u=function(t){if(t&&t.forEach!==a)try{s(t,"forEach",a)}catch(e){t.forEach=a}};for(var c in i)i[c]&&u(r[c]&&r[c].prototype);u(o)},1626:function(t,e){t.exports=function(t){return"function"==typeof t}},"17c2":function(t,e,n){"use strict";var r=n("b727").forEach,i=n("a640"),o=i("forEach");t.exports=o?[].forEach:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}},"19aa":function(t,e,n){var r=n("da84"),i=n("3a9b"),o=r.TypeError;t.exports=function(t,e){if(i(e,t))return t;throw o("Incorrect invocation")}},"1a2d":function(t,e,n){var r=n("e330"),i=n("7b0b"),o=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},"1be4":function(t,e,n){var r=n("d066");t.exports=r("document","documentElement")},"1c7e":function(t,e,n){var r=n("b622"),i=r("iterator"),o=!1;try{var a=0,s={next:function(){return{done:!!a++}},return:function(){o=!0}};s[i]=function(){return this},Array.from(s,(function(){throw 2}))}catch(u){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var r={};r[i]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(u){}return n}},"1cdc":function(t,e,n){var r=n("342f");t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},"1d2b":function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;ry;y++)if(w=P(t[y]),w&&l(v,w))return w;return new m(!1)}r=d(t,g)}_=r.next;while(!(M=o(_,r)).done){try{w=P(M.value)}catch(j){p(r,"throw",j)}if("object"==typeof w&&w&&l(v,w))return w}return new m(!1)}},"23cb":function(t,e,n){var r=n("5926"),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},"23e7":function(t,e,n){var r=n("da84"),i=n("06cf").f,o=n("9112"),a=n("6eeb"),s=n("ce4e"),u=n("e893"),c=n("94ca");t.exports=function(t,e){var n,l,d,f,p,h,m=t.target,v=t.global,g=t.stat;if(l=v?r:g?r[m]||s(m,{}):(r[m]||{}).prototype,l)for(d in e){if(p=e[d],t.noTargetGet?(h=i(l,d),f=h&&h.value):f=l[d],n=c(v?d:m+(g?".":"#")+d,t.forced),!n&&void 0!==f){if(typeof p==typeof f)continue;u(p,f)}(t.sham||f&&f.sham)&&o(p,"sham",!0),a(l,d,p,t)}}},"241c":function(t,e,n){var r=n("ca84"),i=n("7839"),o=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},2444:function(t,e,n){"use strict";(function(e){var r=n("c532"),i=n("c8af"),o=n("387f"),a={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function u(){var t;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof e&&"[object process]"===Object.prototype.toString.call(e))&&(t=n("b50d")),t}function c(t,e,n){if(r.isString(t))try{return(e||JSON.parse)(t),r.trim(t)}catch(i){if("SyntaxError"!==i.name)throw i}return(n||JSON.stringify)(t)}var l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:u(),transformRequest:[function(t,e){return i(e,"Accept"),i(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)||e&&"application/json"===e["Content-Type"]?(s(e,"application/json"),c(t)):t}],transformResponse:[function(t){var e=this.transitional||l.transitional,n=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||i&&r.isString(t)&&t.length)try{return JSON.parse(t)}catch(s){if(a){if("SyntaxError"===s.name)throw o(s,this,"E_JSON_PARSE");throw s}}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, */*"}}};r.forEach(["delete","get","head"],(function(t){l.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){l.headers[t]=r.merge(a)})),t.exports=l}).call(this,n("4362"))},2626:function(t,e,n){"use strict";var r=n("d066"),i=n("9bf2"),o=n("b622"),a=n("83ab"),s=o("species");t.exports=function(t){var e=r(t),n=i.f;a&&e&&!e[s]&&n(e,s,{configurable:!0,get:function(){return this}})}},2877:function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){var u,c="function"===typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=u):i&&(u=s?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),u)if(c.functional){c._injectStyles=u;var l=c.render;c.render=function(t,e){return u.call(e),l(t,e)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,u):[u]}return{exports:t,options:c}}n.d(e,"a",(function(){return r}))},"2a62":function(t,e,n){var r=n("c65b"),i=n("825a"),o=n("dc4a");t.exports=function(t,e,n){var a,s;i(t);try{if(a=o(t,"return"),!a){if("throw"===e)throw n;return n}a=r(a,t)}catch(u){s=!0,a=u}if("throw"===e)throw n;if(s)throw a;return i(a),n}},"2b0e":function(t,e,n){"use strict";n.r(e),function(t){ -/*! - * Vue.js v2.6.14 - * (c) 2014-2021 Evan You - * Released under the MIT License. - */ -var n=Object.freeze({});function r(t){return void 0===t||null===t}function i(t){return void 0!==t&&null!==t}function o(t){return!0===t}function a(t){return!1===t}function s(t){return"string"===typeof t||"number"===typeof t||"symbol"===typeof t||"boolean"===typeof t}function u(t){return null!==t&&"object"===typeof t}var c=Object.prototype.toString;function l(t){return"[object Object]"===c.call(t)}function d(t){return"[object RegExp]"===c.call(t)}function f(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function p(t){return i(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function h(t){return null==t?"":Array.isArray(t)||l(t)&&t.toString===c?JSON.stringify(t,null,2):String(t)}function m(t){var e=parseFloat(t);return isNaN(e)?t:e}function v(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function w(t,e){return b.call(t,e)}function _(t){var e=Object.create(null);return function(n){var r=e[n];return r||(e[n]=t(n))}}var M=/-(\w)/g,x=_((function(t){return t.replace(M,(function(t,e){return e?e.toUpperCase():""}))})),C=_((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),S=/\B([A-Z])/g,O=_((function(t){return t.replace(S,"-$1").toLowerCase()}));function T(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function k(t,e){return t.bind(e)}var P=Function.prototype.bind?k:T;function j(t,e){e=e||0;var n=t.length-e,r=new Array(n);while(n--)r[n]=t[n+e];return r}function E(t,e){for(var n in e)t[n]=e[n];return t}function A(t){for(var e={},n=0;n0,nt=Z&&Z.indexOf("edge/")>0,rt=(Z&&Z.indexOf("android"),Z&&/iphone|ipad|ipod|ios/.test(Z)||"ios"===J),it=(Z&&/chrome\/\d+/.test(Z),Z&&/phantomjs/.test(Z),Z&&Z.match(/firefox\/(\d+)/)),ot={}.watch,at=!1;if(K)try{var st={};Object.defineProperty(st,"passive",{get:function(){at=!0}}),window.addEventListener("test-passive",null,st)}catch(Ca){}var ut=function(){return void 0===G&&(G=!K&&!Q&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),G},ct=K&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function lt(t){return"function"===typeof t&&/native code/.test(t.toString())}var dt,ft="undefined"!==typeof Symbol&<(Symbol)&&"undefined"!==typeof Reflect&<(Reflect.ownKeys);dt="undefined"!==typeof Set&<(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var pt=$,ht=0,mt=function(){this.id=ht++,this.subs=[]};mt.prototype.addSub=function(t){this.subs.push(t)},mt.prototype.removeSub=function(t){y(this.subs,t)},mt.prototype.depend=function(){mt.target&&mt.target.addDep(this)},mt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e-1)if(o&&!w(i,"default"))a=!1;else if(""===a||a===O(t)){var u=ee(String,i.type);(u<0||s0&&(a=ke(a,(e||"")+"_"+n),Te(a[0])&&Te(c)&&(l[u]=Mt(c.text+a[0].text),a.shift()),l.push.apply(l,a)):s(a)?Te(c)?l[u]=Mt(c.text+a):""!==a&&l.push(Mt(a)):Te(a)&&Te(c)?l[u]=Mt(c.text+a.text):(o(t._isVList)&&i(a.tag)&&r(a.key)&&i(e)&&(a.key="__vlist"+e+"_"+n+"__"),l.push(a)));return l}function Pe(t){var e=t.$options.provide;e&&(t._provided="function"===typeof e?e.call(t):e)}function je(t){var e=Ee(t.$options.inject,t);e&&(Pt(!1),Object.keys(e).forEach((function(n){Dt(t,n,e[n])})),Pt(!0))}function Ee(t,e){if(t){for(var n=Object.create(null),r=ft?Reflect.ownKeys(t):Object.keys(t),i=0;i0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==n&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var u in i={},t)t[u]&&"$"!==u[0]&&(i[u]=Le(e,u,t[u]))}else i={};for(var c in e)c in i||(i[c]=Re(e,c));return t&&Object.isExtensible(t)&&(t._normalized=i),q(i,"$stable",a),q(i,"$key",s),q(i,"$hasNormal",o),i}function Le(t,e,n){var r=function(){var t=arguments.length?n.apply(null,arguments):n({});t=t&&"object"===typeof t&&!Array.isArray(t)?[t]:Oe(t);var e=t&&t[0];return t&&(!e||1===t.length&&e.isComment&&!De(e))?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:r,enumerable:!0,configurable:!0}),r}function Re(t,e){return function(){return t[e]}}function Fe(t,e){var n,r,o,a,s;if(Array.isArray(t)||"string"===typeof t)for(n=new Array(t.length),r=0,o=t.length;r1?j(n):n;for(var r=j(arguments,1),i='event handler for "'+t+'"',o=0,a=n.length;odocument.createEvent("Event").timeStamp&&(Xn=function(){return Kn.now()})}function Qn(){var t,e;for(Gn=Xn(),qn=!0,Hn.sort((function(t,e){return t.id-e.id})),Wn=0;WnWn&&Hn[n].id>t.id)n--;Hn.splice(n+1,0,t)}else Hn.push(t);Vn||(Vn=!0,me(Qn))}}var nr=0,rr=function(t,e,n,r,i){this.vm=t,i&&(t._watcher=this),t._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++nr,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new dt,this.newDepIds=new dt,this.expression="","function"===typeof e?this.getter=e:(this.getter=Y(e),this.getter||(this.getter=$)),this.value=this.lazy?void 0:this.get()};rr.prototype.get=function(){var t;gt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(Ca){if(!this.user)throw Ca;ne(Ca,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&ge(t),yt(),this.cleanupDeps()}return t},rr.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},rr.prototype.cleanupDeps=function(){var t=this.deps.length;while(t--){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},rr.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():er(this)},rr.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||u(t)||this.deep){var e=this.value;if(this.value=t,this.user){var n='callback for watcher "'+this.expression+'"';re(this.cb,this.vm,[t,e],this.vm,n)}else this.cb.call(this.vm,t,e)}}},rr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},rr.prototype.depend=function(){var t=this.deps.length;while(t--)this.deps[t].depend()},rr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);var t=this.deps.length;while(t--)this.deps[t].removeSub(this);this.active=!1}};var ir={enumerable:!0,configurable:!0,get:$,set:$};function or(t,e,n){ir.get=function(){return this[e][n]},ir.set=function(t){this[e][n]=t},Object.defineProperty(t,n,ir)}function ar(t){t._watchers=[];var e=t.$options;e.props&&sr(t,e.props),e.methods&&mr(t,e.methods),e.data?ur(t):$t(t._data={},!0),e.computed&&dr(t,e.computed),e.watch&&e.watch!==ot&&vr(t,e.watch)}function sr(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[],o=!t.$parent;o||Pt(!1);var a=function(o){i.push(o);var a=Kt(o,e,n,t);Dt(r,o,a),o in t||or(t,"_props",o)};for(var s in e)a(s);Pt(!0)}function ur(t){var e=t.$options.data;e=t._data="function"===typeof e?cr(e,t):e||{},l(e)||(e={});var n=Object.keys(e),r=t.$options.props,i=(t.$options.methods,n.length);while(i--){var o=n[i];0,r&&w(r,o)||V(o)||or(t,"_data",o)}$t(e,!0)}function cr(t,e){gt();try{return t.call(e,e)}catch(Ca){return ne(Ca,e,"data()"),{}}finally{yt()}}var lr={lazy:!0};function dr(t,e){var n=t._computedWatchers=Object.create(null),r=ut();for(var i in e){var o=e[i],a="function"===typeof o?o:o.get;0,r||(n[i]=new rr(t,a||$,$,lr)),i in t||fr(t,i,o)}}function fr(t,e,n){var r=!ut();"function"===typeof n?(ir.get=r?pr(e):hr(n),ir.set=$):(ir.get=n.get?r&&!1!==n.cache?pr(e):hr(n.get):$,ir.set=n.set||$),Object.defineProperty(t,e,ir)}function pr(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),mt.target&&e.depend(),e.value}}function hr(t){return function(){return t.call(this,this)}}function mr(t,e){t.$options.props;for(var n in e)t[n]="function"!==typeof e[n]?$:P(e[n],t)}function vr(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i-1)return this;var n=j(arguments,1);return n.unshift(this),"function"===typeof t.install?t.install.apply(t,n):"function"===typeof t&&t.apply(null,n),e.push(t),this}}function Or(t){t.mixin=function(t){return this.options=Gt(this.options,t),this}}function Tr(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name;var a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=Gt(n.options,t),a["super"]=n,a.options.props&&kr(a),a.options.computed&&Pr(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,B.forEach((function(t){a[t]=n[t]})),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=E({},a.options),i[r]=a,a}}function kr(t){var e=t.options.props;for(var n in e)or(t.prototype,"_props",n)}function Pr(t){var e=t.options.computed;for(var n in e)fr(t.prototype,n,e[n])}function jr(t){B.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&l(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"===typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}function Er(t){return t&&(t.Ctor.options.name||t.tag)}function Ar(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"===typeof t?t.split(",").indexOf(e)>-1:!!d(t)&&t.test(e)}function $r(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=a.name;s&&!e(s)&&Dr(n,o,r,i)}}}function Dr(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,y(n,e)}wr(Cr),yr(Cr),jn(Cr),Dn(Cr),wn(Cr);var Ir=[String,RegExp,Array],Lr={name:"keep-alive",abstract:!0,props:{include:Ir,exclude:Ir,max:[String,Number]},methods:{cacheVNode:function(){var t=this,e=t.cache,n=t.keys,r=t.vnodeToCache,i=t.keyToCache;if(r){var o=r.tag,a=r.componentInstance,s=r.componentOptions;e[i]={name:Er(s),tag:o,componentInstance:a},n.push(i),this.max&&n.length>parseInt(this.max)&&Dr(e,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Dr(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){$r(t,(function(t){return Ar(e,t)}))})),this.$watch("exclude",(function(e){$r(t,(function(t){return!Ar(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Cn(t),n=e&&e.componentOptions;if(n){var r=Er(n),i=this,o=i.include,a=i.exclude;if(o&&(!r||!Ar(o,r))||a&&r&&Ar(a,r))return e;var s=this,u=s.cache,c=s.keys,l=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;u[l]?(e.componentInstance=u[l].componentInstance,y(c,l),c.push(l)):(this.vnodeToCache=e,this.keyToCache=l),e.data.keepAlive=!0}return e||t&&t[0]}},Rr={KeepAlive:Lr};function Fr(t){var e={get:function(){return z}};Object.defineProperty(t,"config",e),t.util={warn:pt,extend:E,mergeOptions:Gt,defineReactive:Dt},t.set=It,t.delete=Lt,t.nextTick=me,t.observable=function(t){return $t(t),t},t.options=Object.create(null),B.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,E(t.options.components,Rr),Sr(t),Or(t),Tr(t),jr(t)}Fr(Cr),Object.defineProperty(Cr.prototype,"$isServer",{get:ut}),Object.defineProperty(Cr.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Cr,"FunctionalRenderContext",{value:Ze}),Cr.version="2.6.14";var Nr=v("style,class"),Br=v("input,textarea,option,select,progress"),Hr=function(t,e,n){return"value"===n&&Br(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},zr=v("contenteditable,draggable,spellcheck"),Ur=v("events,caret,typing,plaintext-only"),Vr=function(t,e){return Xr(e)||"false"===e?"false":"contenteditable"===t&&Ur(e)?e:"true"},qr=v("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Wr="http://www.w3.org/1999/xlink",Yr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Gr=function(t){return Yr(t)?t.slice(6,t.length):""},Xr=function(t){return null==t||!1===t};function Kr(t){var e=t.data,n=t,r=t;while(i(r.componentInstance))r=r.componentInstance._vnode,r&&r.data&&(e=Qr(r.data,e));while(i(n=n.parent))n&&n.data&&(e=Qr(e,n.data));return Jr(e.staticClass,e.class)}function Qr(t,e){return{staticClass:Zr(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function Jr(t,e){return i(t)||i(e)?Zr(t,ti(e)):""}function Zr(t,e){return t?e?t+" "+e:t:e||""}function ti(t){return Array.isArray(t)?ei(t):u(t)?ni(t):"string"===typeof t?t:""}function ei(t){for(var e,n="",r=0,o=t.length;r-1?ui[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ui[t]=/HTMLUnknownElement/.test(e.toString())}var li=v("text,number,password,search,email,tel,url");function di(t){if("string"===typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function fi(t,e){var n=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n}function pi(t,e){return document.createElementNS(ri[t],e)}function hi(t){return document.createTextNode(t)}function mi(t){return document.createComment(t)}function vi(t,e,n){t.insertBefore(e,n)}function gi(t,e){t.removeChild(e)}function yi(t,e){t.appendChild(e)}function bi(t){return t.parentNode}function wi(t){return t.nextSibling}function _i(t){return t.tagName}function Mi(t,e){t.textContent=e}function xi(t,e){t.setAttribute(e,"")}var Ci=Object.freeze({createElement:fi,createElementNS:pi,createTextNode:hi,createComment:mi,insertBefore:vi,removeChild:gi,appendChild:yi,parentNode:bi,nextSibling:wi,tagName:_i,setTextContent:Mi,setStyleScope:xi}),Si={create:function(t,e){Oi(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Oi(t,!0),Oi(e))},destroy:function(t){Oi(t,!0)}};function Oi(t,e){var n=t.data.ref;if(i(n)){var r=t.context,o=t.componentInstance||t.elm,a=r.$refs;e?Array.isArray(a[n])?y(a[n],o):a[n]===o&&(a[n]=void 0):t.data.refInFor?Array.isArray(a[n])?a[n].indexOf(o)<0&&a[n].push(o):a[n]=[o]:a[n]=o}}var Ti=new bt("",{},[]),ki=["create","activate","update","remove","destroy"];function Pi(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&i(t.data)===i(e.data)&&ji(t,e)||o(t.isAsyncPlaceholder)&&r(e.asyncFactory.error))}function ji(t,e){if("input"!==t.tag)return!0;var n,r=i(n=t.data)&&i(n=n.attrs)&&n.type,o=i(n=e.data)&&i(n=n.attrs)&&n.type;return r===o||li(r)&&li(o)}function Ei(t,e,n){var r,o,a={};for(r=e;r<=n;++r)o=t[r].key,i(o)&&(a[o]=r);return a}function Ai(t){var e,n,a={},u=t.modules,c=t.nodeOps;for(e=0;em?(d=r(n[y+1])?null:n[y+1].elm,x(t,d,n,h,y,o)):h>y&&S(e,f,m)}function k(t,e,n,r){for(var o=n;o-1?Ui(t,e,n):qr(e)?Xr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):zr(e)?t.setAttribute(e,Vr(e,n)):Yr(e)?Xr(n)?t.removeAttributeNS(Wr,Gr(e)):t.setAttributeNS(Wr,e,n):Ui(t,e,n)}function Ui(t,e,n){if(Xr(n))t.removeAttribute(e);else{if(tt&&!et&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Vi={create:Hi,update:Hi};function qi(t,e){var n=e.elm,o=e.data,a=t.data;if(!(r(o.staticClass)&&r(o.class)&&(r(a)||r(a.staticClass)&&r(a.class)))){var s=Kr(e),u=n._transitionClasses;i(u)&&(s=Zr(s,ti(u))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Wi,Yi={create:qi,update:qi},Gi="__r",Xi="__c";function Ki(t){if(i(t[Gi])){var e=tt?"change":"input";t[e]=[].concat(t[Gi],t[e]||[]),delete t[Gi]}i(t[Xi])&&(t.change=[].concat(t[Xi],t.change||[]),delete t[Xi])}function Qi(t,e,n){var r=Wi;return function i(){var o=e.apply(null,arguments);null!==o&&to(t,i,n,r)}}var Ji=se&&!(it&&Number(it[1])<=53);function Zi(t,e,n,r){if(Ji){var i=Gn,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}Wi.addEventListener(t,e,at?{capture:n,passive:r}:n)}function to(t,e,n,r){(r||Wi).removeEventListener(t,e._wrapper||e,n)}function eo(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},i=t.data.on||{};Wi=e.elm,Ki(n),_e(n,i,Zi,to,Qi,e.context),Wi=void 0}}var no,ro={create:eo,update:eo};function io(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,a=e.elm,s=t.data.domProps||{},u=e.data.domProps||{};for(n in i(u.__ob__)&&(u=e.data.domProps=E({},u)),s)n in u||(a[n]="");for(n in u){if(o=u[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=o;var c=r(o)?"":String(o);oo(a,c)&&(a.value=c)}else if("innerHTML"===n&&oi(a.tagName)&&r(a.innerHTML)){no=no||document.createElement("div"),no.innerHTML=""+o+"";var l=no.firstChild;while(a.firstChild)a.removeChild(a.firstChild);while(l.firstChild)a.appendChild(l.firstChild)}else if(o!==s[n])try{a[n]=o}catch(Ca){}}}}function oo(t,e){return!t.composing&&("OPTION"===t.tagName||ao(t,e)||so(t,e))}function ao(t,e){var n=!0;try{n=document.activeElement!==t}catch(Ca){}return n&&t.value!==e}function so(t,e){var n=t.value,r=t._vModifiers;if(i(r)){if(r.number)return m(n)!==m(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}var uo={create:io,update:io},co=_((function(t){var e={},n=/;(?![^(]*\))/g,r=/:(.+)/;return t.split(n).forEach((function(t){if(t){var n=t.split(r);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}));function lo(t){var e=fo(t.style);return t.staticStyle?E(t.staticStyle,e):e}function fo(t){return Array.isArray(t)?A(t):"string"===typeof t?co(t):t}function po(t,e){var n,r={};if(e){var i=t;while(i.componentInstance)i=i.componentInstance._vnode,i&&i.data&&(n=lo(i.data))&&E(r,n)}(n=lo(t.data))&&E(r,n);var o=t;while(o=o.parent)o.data&&(n=lo(o.data))&&E(r,n);return r}var ho,mo=/^--/,vo=/\s*!important$/,go=function(t,e,n){if(mo.test(e))t.style.setProperty(e,n);else if(vo.test(n))t.style.setProperty(O(e),n.replace(vo,""),"important");else{var r=bo(e);if(Array.isArray(n))for(var i=0,o=n.length;i-1?e.split(Mo).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Co(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Mo).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";while(n.indexOf(r)>=0)n=n.replace(r," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function So(t){if(t){if("object"===typeof t){var e={};return!1!==t.css&&E(e,Oo(t.name||"v")),E(e,t),e}return"string"===typeof t?Oo(t):void 0}}var Oo=_((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),To=K&&!et,ko="transition",Po="animation",jo="transition",Eo="transitionend",Ao="animation",$o="animationend";To&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(jo="WebkitTransition",Eo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Ao="WebkitAnimation",$o="webkitAnimationEnd"));var Do=K?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Io(t){Do((function(){Do(t)}))}function Lo(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),xo(t,e))}function Ro(t,e){t._transitionClasses&&y(t._transitionClasses,e),Co(t,e)}function Fo(t,e,n){var r=Bo(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ko?Eo:$o,u=0,c=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++u>=a&&c()};setTimeout((function(){u0&&(n=ko,l=a,d=o.length):e===Po?c>0&&(n=Po,l=c,d=u.length):(l=Math.max(a,c),n=l>0?a>c?ko:Po:null,d=n?n===ko?o.length:u.length:0);var f=n===ko&&No.test(r[jo+"Property"]);return{type:n,timeout:l,propCount:d,hasTransform:f}}function Ho(t,e){while(t.length1}function Yo(t,e){!0!==e.data.show&&Uo(e)}var Go=K?{create:Yo,activate:Yo,remove:function(t,e){!0!==t.data.show?Vo(t,e):e()}}:{},Xo=[Vi,Yi,ro,uo,_o,Go],Ko=Xo.concat(Bi),Qo=Ai({nodeOps:Ci,modules:Ko});et&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&oa(t,"input")}));var Jo={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?Me(n,"postpatch",(function(){Jo.componentUpdated(t,e,n)})):Zo(t,e,n.context),t._vOptions=[].map.call(t.options,na)):("textarea"===n.tag||li(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",ra),t.addEventListener("compositionend",ia),t.addEventListener("change",ia),et&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Zo(t,e,n.context);var r=t._vOptions,i=t._vOptions=[].map.call(t.options,na);if(i.some((function(t,e){return!L(t,r[e])}))){var o=t.multiple?e.value.some((function(t){return ea(t,i)})):e.value!==e.oldValue&&ea(e.value,i);o&&oa(t,"change")}}}};function Zo(t,e,n){ta(t,e,n),(tt||nt)&&setTimeout((function(){ta(t,e,n)}),0)}function ta(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,u=t.options.length;s-1,a.selected!==o&&(a.selected=o);else if(L(na(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function ea(t,e){return e.every((function(e){return!L(e,t)}))}function na(t){return"_value"in t?t._value:t.value}function ra(t){t.target.composing=!0}function ia(t){t.target.composing&&(t.target.composing=!1,oa(t.target,"input"))}function oa(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function aa(t){return!t.componentInstance||t.data&&t.data.transition?t:aa(t.componentInstance._vnode)}var sa={bind:function(t,e,n){var r=e.value;n=aa(n);var i=n.data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,Uo(n,(function(){t.style.display=o}))):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value,i=e.oldValue;if(!r!==!i){n=aa(n);var o=n.data&&n.data.transition;o?(n.data.show=!0,r?Uo(n,(function(){t.style.display=t.__vOriginalDisplay})):Vo(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none"}},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}},ua={model:Jo,show:sa},ca={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function la(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?la(Cn(e.children)):t}function da(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[x(o)]=i[o];return e}function fa(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function pa(t){while(t=t.parent)if(t.data.transition)return!0}function ha(t,e){return e.key===t.key&&e.tag===t.tag}var ma=function(t){return t.tag||De(t)},va=function(t){return"show"===t.name},ga={name:"transition",props:ca,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(ma),n.length)){0;var r=this.mode;0;var i=n[0];if(pa(this.$vnode))return i;var o=la(i);if(!o)return i;if(this._leaving)return fa(t,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:s(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var u=(o.data||(o.data={})).transition=da(this),c=this._vnode,l=la(c);if(o.data.directives&&o.data.directives.some(va)&&(o.data.show=!0),l&&l.data&&!ha(o,l)&&!De(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var d=l.data.transition=E({},u);if("out-in"===r)return this._leaving=!0,Me(d,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),fa(t,i);if("in-out"===r){if(De(o))return c;var f,p=function(){f()};Me(u,"afterEnter",p),Me(u,"enterCancelled",p),Me(d,"delayLeave",(function(t){f=t}))}}return i}}},ya=E({tag:String,moveClass:String},ca);delete ya.mode;var ba={props:ya,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=An(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=da(this),s=0;s0&&r[0]<4?1:+(r[0]+r[1])),!i&&a&&(r=a.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/),r&&(i=+r[1]))),t.exports=i},"2d83":function(t,e,n){"use strict";var r=n("387f");t.exports=function(t,e,n,i,o){var a=new Error(t);return r(a,e,n,i,o)}},"2e67":function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},"2f62":function(t,e,n){"use strict";(function(t){ -/*! - * vuex v3.6.2 - * (c) 2021 Evan You - * @license MIT - */ -function n(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:r});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,n.call(this,t)}}function r(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}var r="undefined"!==typeof window?window:"undefined"!==typeof t?t:{},i=r.__VUE_DEVTOOLS_GLOBAL_HOOK__;function o(t){i&&(t._devtoolHook=i,i.emit("vuex:init",t),i.on("vuex:travel-to-state",(function(e){t.replaceState(e)})),t.subscribe((function(t,e){i.emit("vuex:mutation",t,e)}),{prepend:!0}),t.subscribeAction((function(t,e){i.emit("vuex:action",t,e)}),{prepend:!0}))}function a(t,e){return t.filter(e)[0]}function s(t,e){if(void 0===e&&(e=[]),null===t||"object"!==typeof t)return t;var n=a(e,(function(e){return e.original===t}));if(n)return n.copy;var r=Array.isArray(t)?[]:{};return e.push({original:t,copy:r}),Object.keys(t).forEach((function(n){r[n]=s(t[n],e)})),r}function u(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}function c(t){return null!==t&&"object"===typeof t}function l(t){return t&&"function"===typeof t.then}function d(t,e){return function(){return t(e)}}var f=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"===typeof n?n():n)||{}},p={namespaced:{configurable:!0}};p.namespaced.get=function(){return!!this._rawModule.namespaced},f.prototype.addChild=function(t,e){this._children[t]=e},f.prototype.removeChild=function(t){delete this._children[t]},f.prototype.getChild=function(t){return this._children[t]},f.prototype.hasChild=function(t){return t in this._children},f.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)},f.prototype.forEachChild=function(t){u(this._children,t)},f.prototype.forEachGetter=function(t){this._rawModule.getters&&u(this._rawModule.getters,t)},f.prototype.forEachAction=function(t){this._rawModule.actions&&u(this._rawModule.actions,t)},f.prototype.forEachMutation=function(t){this._rawModule.mutations&&u(this._rawModule.mutations,t)},Object.defineProperties(f.prototype,p);var h=function(t){this.register([],t,!1)};function m(t,e,n){if(e.update(n),n.modules)for(var r in n.modules){if(!e.getChild(r))return void 0;m(t.concat(r),e.getChild(r),n.modules[r])}}h.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},h.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,n){return e=e.getChild(n),t+(e.namespaced?n+"/":"")}),"")},h.prototype.update=function(t){m([],this.root,t)},h.prototype.register=function(t,e,n){var r=this;void 0===n&&(n=!0);var i=new f(e,n);if(0===t.length)this.root=i;else{var o=this.get(t.slice(0,-1));o.addChild(t[t.length-1],i)}e.modules&&u(e.modules,(function(e,i){r.register(t.concat(i),e,n)}))},h.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1],r=e.getChild(n);r&&r.runtime&&e.removeChild(n)},h.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];return!!e&&e.hasChild(n)};var v;var g=function(t){var e=this;void 0===t&&(t={}),!v&&"undefined"!==typeof window&&window.Vue&&E(window.Vue);var n=t.plugins;void 0===n&&(n=[]);var r=t.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new h(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new v,this._makeLocalGettersCache=Object.create(null);var i=this,a=this,s=a.dispatch,u=a.commit;this.dispatch=function(t,e){return s.call(i,t,e)},this.commit=function(t,e,n){return u.call(i,t,e,n)},this.strict=r;var c=this._modules.root.state;M(this,c,[],this._modules.root),_(this,c),n.forEach((function(t){return t(e)}));var l=void 0!==t.devtools?t.devtools:v.config.devtools;l&&o(this)},y={state:{configurable:!0}};function b(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function w(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;M(t,n,[],t._modules.root,!0),_(t,n,e)}function _(t,e,n){var r=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var i=t._wrappedGetters,o={};u(i,(function(e,n){o[n]=d(e,t),Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})}));var a=v.config.silent;v.config.silent=!0,t._vm=new v({data:{$$state:e},computed:o}),v.config.silent=a,t.strict&&k(t),r&&(n&&t._withCommit((function(){r._data.$$state=null})),v.nextTick((function(){return r.$destroy()})))}function M(t,e,n,r,i){var o=!n.length,a=t._modules.getNamespace(n);if(r.namespaced&&(t._modulesNamespaceMap[a],t._modulesNamespaceMap[a]=r),!o&&!i){var s=P(e,n.slice(0,-1)),u=n[n.length-1];t._withCommit((function(){v.set(s,u,r.state)}))}var c=r.context=x(t,a,n);r.forEachMutation((function(e,n){var r=a+n;S(t,r,e,c)})),r.forEachAction((function(e,n){var r=e.root?n:a+n,i=e.handler||e;O(t,r,i,c)})),r.forEachGetter((function(e,n){var r=a+n;T(t,r,e,c)})),r.forEachChild((function(r,o){M(t,e,n.concat(o),r,i)}))}function x(t,e,n){var r=""===e,i={dispatch:r?t.dispatch:function(n,r,i){var o=j(n,r,i),a=o.payload,s=o.options,u=o.type;return s&&s.root||(u=e+u),t.dispatch(u,a)},commit:r?t.commit:function(n,r,i){var o=j(n,r,i),a=o.payload,s=o.options,u=o.type;s&&s.root||(u=e+u),t.commit(u,a,s)}};return Object.defineProperties(i,{getters:{get:r?function(){return t.getters}:function(){return C(t,e)}},state:{get:function(){return P(t.state,n)}}}),i}function C(t,e){if(!t._makeLocalGettersCache[e]){var n={},r=e.length;Object.keys(t.getters).forEach((function(i){if(i.slice(0,r)===e){var o=i.slice(r);Object.defineProperty(n,o,{get:function(){return t.getters[i]},enumerable:!0})}})),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}function S(t,e,n,r){var i=t._mutations[e]||(t._mutations[e]=[]);i.push((function(e){n.call(t,r.state,e)}))}function O(t,e,n,r){var i=t._actions[e]||(t._actions[e]=[]);i.push((function(e){var i=n.call(t,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:t.getters,rootState:t.state},e);return l(i)||(i=Promise.resolve(i)),t._devtoolHook?i.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):i}))}function T(t,e,n,r){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(t){return n(r.state,r.getters,t.state,t.getters)})}function k(t){t._vm.$watch((function(){return this._data.$$state}),(function(){0}),{deep:!0,sync:!0})}function P(t,e){return e.reduce((function(t,e){return t[e]}),t)}function j(t,e,n){return c(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function E(t){v&&t===v||(v=t,n(v))}y.state.get=function(){return this._vm._data.$$state},y.state.set=function(t){0},g.prototype.commit=function(t,e,n){var r=this,i=j(t,e,n),o=i.type,a=i.payload,s=(i.options,{type:o,payload:a}),u=this._mutations[o];u&&(this._withCommit((function(){u.forEach((function(t){t(a)}))})),this._subscribers.slice().forEach((function(t){return t(s,r.state)})))},g.prototype.dispatch=function(t,e){var n=this,r=j(t,e),i=r.type,o=r.payload,a={type:i,payload:o},s=this._actions[i];if(s){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(a,n.state)}))}catch(c){0}var u=s.length>1?Promise.all(s.map((function(t){return t(o)}))):s[0](o);return new Promise((function(t,e){u.then((function(e){try{n._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(a,n.state)}))}catch(c){0}t(e)}),(function(t){try{n._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(a,n.state,t)}))}catch(c){0}e(t)}))}))}},g.prototype.subscribe=function(t,e){return b(t,this._subscribers,e)},g.prototype.subscribeAction=function(t,e){var n="function"===typeof t?{before:t}:t;return b(n,this._actionSubscribers,e)},g.prototype.watch=function(t,e,n){var r=this;return this._watcherVM.$watch((function(){return t(r.state,r.getters)}),e,n)},g.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._vm._data.$$state=t}))},g.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"===typeof t&&(t=[t]),this._modules.register(t,e),M(this,this.state,t,this._modules.get(t),n.preserveState),_(this,this.state)},g.prototype.unregisterModule=function(t){var e=this;"string"===typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var n=P(e.state,t.slice(0,-1));v.delete(n,t[t.length-1])})),w(this)},g.prototype.hasModule=function(t){return"string"===typeof t&&(t=[t]),this._modules.isRegistered(t)},g.prototype.hotUpdate=function(t){this._modules.update(t),w(this,!0)},g.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(g.prototype,y);var A=N((function(t,e){var n={};return R(e).forEach((function(e){var r=e.key,i=e.val;n[r]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var r=B(this.$store,"mapState",t);if(!r)return;e=r.context.state,n=r.context.getters}return"function"===typeof i?i.call(this,e,n):e[i]},n[r].vuex=!0})),n})),$=N((function(t,e){var n={};return R(e).forEach((function(e){var r=e.key,i=e.val;n[r]=function(){var e=[],n=arguments.length;while(n--)e[n]=arguments[n];var r=this.$store.commit;if(t){var o=B(this.$store,"mapMutations",t);if(!o)return;r=o.context.commit}return"function"===typeof i?i.apply(this,[r].concat(e)):r.apply(this.$store,[i].concat(e))}})),n})),D=N((function(t,e){var n={};return R(e).forEach((function(e){var r=e.key,i=e.val;i=t+i,n[r]=function(){if(!t||B(this.$store,"mapGetters",t))return this.$store.getters[i]},n[r].vuex=!0})),n})),I=N((function(t,e){var n={};return R(e).forEach((function(e){var r=e.key,i=e.val;n[r]=function(){var e=[],n=arguments.length;while(n--)e[n]=arguments[n];var r=this.$store.dispatch;if(t){var o=B(this.$store,"mapActions",t);if(!o)return;r=o.context.dispatch}return"function"===typeof i?i.apply(this,[r].concat(e)):r.apply(this.$store,[i].concat(e))}})),n})),L=function(t){return{mapState:A.bind(null,t),mapGetters:D.bind(null,t),mapMutations:$.bind(null,t),mapActions:I.bind(null,t)}};function R(t){return F(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function F(t){return Array.isArray(t)||c(t)}function N(t){return function(e,n){return"string"!==typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function B(t,e,n){var r=t._modulesNamespaceMap[n];return r}function H(t){void 0===t&&(t={});var e=t.collapsed;void 0===e&&(e=!0);var n=t.filter;void 0===n&&(n=function(t,e,n){return!0});var r=t.transformer;void 0===r&&(r=function(t){return t});var i=t.mutationTransformer;void 0===i&&(i=function(t){return t});var o=t.actionFilter;void 0===o&&(o=function(t,e){return!0});var a=t.actionTransformer;void 0===a&&(a=function(t){return t});var u=t.logMutations;void 0===u&&(u=!0);var c=t.logActions;void 0===c&&(c=!0);var l=t.logger;return void 0===l&&(l=console),function(t){var d=s(t.state);"undefined"!==typeof l&&(u&&t.subscribe((function(t,o){var a=s(o);if(n(t,d,a)){var u=V(),c=i(t),f="mutation "+t.type+u;z(l,f,e),l.log("%c prev state","color: #9E9E9E; font-weight: bold",r(d)),l.log("%c mutation","color: #03A9F4; font-weight: bold",c),l.log("%c next state","color: #4CAF50; font-weight: bold",r(a)),U(l)}d=a})),c&&t.subscribeAction((function(t,n){if(o(t,n)){var r=V(),i=a(t),s="action "+t.type+r;z(l,s,e),l.log("%c action","color: #03A9F4; font-weight: bold",i),U(l)}})))}}function z(t,e,n){var r=n?t.groupCollapsed:t.group;try{r.call(t,e)}catch(i){t.log(e)}}function U(t){try{t.groupEnd()}catch(e){t.log("—— log end ——")}}function V(){var t=new Date;return" @ "+W(t.getHours(),2)+":"+W(t.getMinutes(),2)+":"+W(t.getSeconds(),2)+"."+W(t.getMilliseconds(),3)}function q(t,e){return new Array(e+1).join(t)}function W(t,e){return q("0",e-t.toString().length)+t}var Y={Store:g,install:E,version:"3.6.2",mapState:A,mapMutations:$,mapGetters:D,mapActions:I,createNamespacedHelpers:L,createLogger:H};e["a"]=Y}).call(this,n("c8ba"))},"30b5":function(t,e,n){"use strict";var r=n("c532");function i(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(r.isURLSearchParams(e))o=e.toString();else{var a=[];r.forEach(e,(function(t,e){null!==t&&"undefined"!==typeof t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),a.push(i(e)+"="+i(t))})))})),o=a.join("&")}if(o){var s=t.indexOf("#");-1!==s&&(t=t.slice(0,s)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}},"342f":function(t,e,n){var r=n("d066");t.exports=r("navigator","userAgent")||""},"35a1":function(t,e,n){var r=n("f5df"),i=n("dc4a"),o=n("3f8c"),a=n("b622"),s=a("iterator");t.exports=function(t){if(void 0!=t)return i(t,s)||i(t,"@@iterator")||o[r(t)]}},"37e8":function(t,e,n){var r=n("83ab"),i=n("aed9"),o=n("9bf2"),a=n("825a"),s=n("fc6a"),u=n("df75");e.f=r&&!i?Object.defineProperties:function(t,e){a(t);var n,r=s(e),i=u(e),c=i.length,l=0;while(c>l)o.f(t,n=i[l++],r[n]);return t}},"387f":function(t,e,n){"use strict";t.exports=function(t,e,n,r,i){return t.config=e,n&&(t.code=n),t.request=r,t.response=i,t.isAxiosError=!0,t.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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t}},3934:function(t,e,n){"use strict";var r=n("c532");t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{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 t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return function(){return!0}}()},"3a9b":function(t,e,n){var r=n("e330");t.exports=r({}.isPrototypeOf)},"3bbe":function(t,e,n){var r=n("da84"),i=n("1626"),o=r.String,a=r.TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw a("Can't set "+o(t)+" as a prototype")}},"3ca3":function(t,e,n){"use strict";var r=n("6547").charAt,i=n("577e"),o=n("69f3"),a=n("7dd0"),s="String Iterator",u=o.set,c=o.getterFor(s);a(String,"String",(function(t){u(this,{type:s,string:i(t),index:0})}),(function(){var t,e=c(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=r(n,i),e.index+=t.length,{value:t,done:!1})}))},"3f8c":function(t,e){t.exports={}},4362:function(t,e,n){e.nextTick=function(t){var e=Array.prototype.slice.call(arguments);e.shift(),setTimeout((function(){t.apply(null,e)}),0)},e.platform=e.arch=e.execPath=e.title="browser",e.pid=1,e.browser=!0,e.env={},e.argv=[],e.binding=function(t){throw new Error("No such module. (Possibly not yet loaded)")},function(){var t,r="/";e.cwd=function(){return r},e.chdir=function(e){t||(t=n("df7c")),r=t.resolve(e,r)}}(),e.exit=e.kill=e.umask=e.dlopen=e.uptime=e.memoryUsage=e.uvCounters=function(){},e.features={}},"44ad":function(t,e,n){var r=n("da84"),i=n("e330"),o=n("d039"),a=n("c6b6"),s=r.Object,u=i("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?u(t,""):s(t)}:s},"44d2":function(t,e,n){var r=n("b622"),i=n("7c73"),o=n("9bf2"),a=r("unscopables"),s=Array.prototype;void 0==s[a]&&o.f(s,a,{configurable:!0,value:i(null)}),t.exports=function(t){s[a][t]=!0}},"44de":function(t,e,n){var r=n("da84");t.exports=function(t,e){var n=r.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))}},"467f":function(t,e,n){"use strict";var r=n("2d83");t.exports=function(t,e,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},4840:function(t,e,n){var r=n("825a"),i=n("5087"),o=n("b622"),a=o("species");t.exports=function(t,e){var n,o=r(t).constructor;return void 0===o||void 0==(n=r(o)[a])?e:i(n)}},"485a":function(t,e,n){var r=n("da84"),i=n("c65b"),o=n("1626"),a=n("861d"),s=r.TypeError;t.exports=function(t,e){var n,r;if("string"===e&&o(n=t.toString)&&!a(r=i(n,t)))return r;if(o(n=t.valueOf)&&!a(r=i(n,t)))return r;if("string"!==e&&o(n=t.toString)&&!a(r=i(n,t)))return r;throw s("Can't convert object to primitive value")}},4930:function(t,e,n){var r=n("2d00"),i=n("d039");t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},"4a7b":function(t,e,n){"use strict";var r=n("c532");t.exports=function(t,e){e=e||{};var n={};function i(t,e){return r.isPlainObject(t)&&r.isPlainObject(e)?r.merge(t,e):r.isPlainObject(e)?r.merge({},e):r.isArray(e)?e.slice():e}function o(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(t[n],e[n])}function a(t){if(!r.isUndefined(e[t]))return i(void 0,e[t])}function s(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(void 0,e[n])}function u(n){return n in e?i(t[n],e[n]):n in t?i(void 0,t[n]):void 0}var c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u};return r.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=c[t]||o,i=e(t);r.isUndefined(i)&&e!==u||(n[t]=i)})),n}},"4d64":function(t,e,n){var r=n("fc6a"),i=n("23cb"),o=n("07fa"),a=function(t){return function(e,n,a){var s,u=r(e),c=o(u),l=i(a,c);if(t&&n!=n){while(c>l)if(s=u[l++],s!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},"4dae":function(t,e,n){var r=n("da84"),i=n("23cb"),o=n("07fa"),a=n("8418"),s=r.Array,u=Math.max;t.exports=function(t,e,n){for(var r=o(t),c=i(e,r),l=i(void 0===n?r:n,r),d=s(u(l-c,0)),f=0;c0?i(r(t),9007199254740991):0}},"51de":function(t,e,n){},5270:function(t,e,n){"use strict";var r=n("c532"),i=n("c401"),o=n("2e67"),a=n("2444"),s=n("7a77");function u(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new s("canceled")}t.exports=function(t){u(t),t.headers=t.headers||{},t.data=i.call(t,t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]}));var e=t.adapter||a.adapter;return e(t).then((function(e){return u(t),e.data=i.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(u(t),e&&e.response&&(e.response.data=i.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},5692:function(t,e,n){var r=n("c430"),i=n("c6cd");(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.20.2",mode:r?"pure":"global",copyright:"© 2022 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,e,n){var r=n("d066"),i=n("e330"),o=n("241c"),a=n("7418"),s=n("825a"),u=i([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(s(t)),n=a.f;return n?u(e,n(t)):e}},"577e":function(t,e,n){var r=n("da84"),i=n("f5df"),o=r.String;t.exports=function(t){if("Symbol"===i(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},5926:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){var e=+t;return e!==e||0===e?0:(e>0?r:n)(e)}},"59ed":function(t,e,n){var r=n("da84"),i=n("1626"),o=n("0d51"),a=r.TypeError;t.exports=function(t){if(i(t))return t;throw a(o(t)+" is not a function")}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"5cce":function(t,e){t.exports={version:"0.24.0"}},"5e77":function(t,e,n){var r=n("83ab"),i=n("1a2d"),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),u=s&&"something"===function(){}.name,c=s&&(!r||r&&a(o,"name").configurable);t.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},"5f02":function(t,e,n){"use strict";t.exports=function(t){return"object"===typeof t&&!0===t.isAxiosError}},"605d":function(t,e,n){var r=n("c6b6"),i=n("da84");t.exports="process"==r(i.process)},6069:function(t,e){t.exports="object"==typeof window},"60da":function(t,e,n){"use strict";var r=n("83ab"),i=n("e330"),o=n("c65b"),a=n("d039"),s=n("df75"),u=n("7418"),c=n("d1e7"),l=n("7b0b"),d=n("44ad"),f=Object.assign,p=Object.defineProperty,h=i([].concat);t.exports=!f||a((function(){if(r&&1!==f({b:1},f(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach((function(t){e[t]=t})),7!=f({},t)[n]||s(f({},e)).join("")!=i}))?function(t,e){var n=l(t),i=arguments.length,a=1,f=u.f,p=c.f;while(i>a){var m,v=d(arguments[a++]),g=f?h(s(v),f(v)):s(v),y=g.length,b=0;while(y>b)m=g[b++],r&&!o(p,v,m)||(n[m]=v[m])}return n}:f},6547:function(t,e,n){var r=n("e330"),i=n("5926"),o=n("577e"),a=n("1d80"),s=r("".charAt),u=r("".charCodeAt),c=r("".slice),l=function(t){return function(e,n){var r,l,d=o(a(e)),f=i(n),p=d.length;return f<0||f>=p?t?"":void 0:(r=u(d,f),r<55296||r>56319||f+1===p||(l=u(d,f+1))<56320||l>57343?t?s(d,f):r:t?c(d,f,f+2):l-56320+(r-55296<<10)+65536)}};t.exports={codeAt:l(!1),charAt:l(!0)}},"65f0":function(t,e,n){var r=n("0b42");t.exports=function(t,e){return new(r(t))(0===e?0:e)}},"68ee":function(t,e,n){var r=n("e330"),i=n("d039"),o=n("1626"),a=n("f5df"),s=n("d066"),u=n("8925"),c=function(){},l=[],d=s("Reflect","construct"),f=/^\s*(?:class|function)\b/,p=r(f.exec),h=!f.exec(c),m=function(t){if(!o(t))return!1;try{return d(c,l,t),!0}catch(e){return!1}},v=function(t){if(!o(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!p(f,u(t))}catch(e){return!0}};v.sham=!0,t.exports=!d||i((function(){var t;return m(m.call)||!m(Object)||!m((function(){t=!0}))||t}))?v:m},"69f3":function(t,e,n){var r,i,o,a=n("7f9a"),s=n("da84"),u=n("e330"),c=n("861d"),l=n("9112"),d=n("1a2d"),f=n("c6cd"),p=n("f772"),h=n("d012"),m="Object already initialized",v=s.TypeError,g=s.WeakMap,y=function(t){return o(t)?i(t):r(t,{})},b=function(t){return function(e){var n;if(!c(e)||(n=i(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return n}};if(a||f.state){var w=f.state||(f.state=new g),_=u(w.get),M=u(w.has),x=u(w.set);r=function(t,e){if(M(w,t))throw new v(m);return e.facade=t,x(w,t,e),e},i=function(t){return _(w,t)||{}},o=function(t){return M(w,t)}}else{var C=p("state");h[C]=!0,r=function(t,e){if(d(t,C))throw new v(m);return e.facade=t,l(t,C,e),e},i=function(t){return d(t,C)?t[C]:{}},o=function(t){return d(t,C)}}t.exports={set:r,get:i,has:o,enforce:y,getterFor:b}},"6eeb":function(t,e,n){var r=n("da84"),i=n("1626"),o=n("1a2d"),a=n("9112"),s=n("ce4e"),u=n("8925"),c=n("69f3"),l=n("5e77").CONFIGURABLE,d=c.get,f=c.enforce,p=String(String).split("String");(t.exports=function(t,e,n,u){var c,d=!!u&&!!u.unsafe,h=!!u&&!!u.enumerable,m=!!u&&!!u.noTargetGet,v=u&&void 0!==u.name?u.name:e;i(n)&&("Symbol("===String(v).slice(0,7)&&(v="["+String(v).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!o(n,"name")||l&&n.name!==v)&&a(n,"name",v),c=f(n),c.source||(c.source=p.join("string"==typeof v?v:""))),t!==r?(d?!m&&t[e]&&(h=!0):delete t[e],h?t[e]=n:a(t,e,n)):h?t[e]=n:s(e,n)})(Function.prototype,"toString",(function(){return i(this)&&d(this).source||u(this)}))},7418:function(t,e){e.f=Object.getOwnPropertySymbols},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"785a":function(t,e,n){var r=n("cc12"),i=r("span").classList,o=i&&i.constructor&&i.constructor.prototype;t.exports=o===Object.prototype?void 0:o},"7a77":function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},"7aac":function(t,e,n){"use strict";var r=n("c532");t.exports=r.isStandardBrowserEnv()?function(){return{write:function(t,e,n,i,o,a){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},"7b0b":function(t,e,n){var r=n("da84"),i=n("1d80"),o=r.Object;t.exports=function(t){return o(i(t))}},"7c73":function(t,e,n){var r,i=n("825a"),o=n("37e8"),a=n("7839"),s=n("d012"),u=n("1be4"),c=n("cc12"),l=n("f772"),d=">",f="<",p="prototype",h="script",m=l("IE_PROTO"),v=function(){},g=function(t){return f+h+d+t+f+"/"+h+d},y=function(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e},b=function(){var t,e=c("iframe"),n="java"+h+":";return e.style.display="none",u.appendChild(e),e.src=String(n),t=e.contentWindow.document,t.open(),t.write(g("document.F=Object")),t.close(),t.F},w=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}w="undefined"!=typeof document?document.domain&&r?y(r):b():y(r);var t=a.length;while(t--)delete w[p][a[t]];return w()};s[m]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(v[p]=i(t),n=new v,v[p]=null,n[m]=t):n=w(),void 0===e?n:o.f(n,e)}},"7dd0":function(t,e,n){"use strict";var r=n("23e7"),i=n("c65b"),o=n("c430"),a=n("5e77"),s=n("1626"),u=n("9ed3"),c=n("e163"),l=n("d2bb"),d=n("d44e"),f=n("9112"),p=n("6eeb"),h=n("b622"),m=n("3f8c"),v=n("ae93"),g=a.PROPER,y=a.CONFIGURABLE,b=v.IteratorPrototype,w=v.BUGGY_SAFARI_ITERATORS,_=h("iterator"),M="keys",x="values",C="entries",S=function(){return this};t.exports=function(t,e,n,a,h,v,O){u(n,e,a);var T,k,P,j=function(t){if(t===h&&I)return I;if(!w&&t in $)return $[t];switch(t){case M:return function(){return new n(this,t)};case x:return function(){return new n(this,t)};case C:return function(){return new n(this,t)}}return function(){return new n(this)}},E=e+" Iterator",A=!1,$=t.prototype,D=$[_]||$["@@iterator"]||h&&$[h],I=!w&&D||j(h),L="Array"==e&&$.entries||D;if(L&&(T=c(L.call(new t)),T!==Object.prototype&&T.next&&(o||c(T)===b||(l?l(T,b):s(T[_])||p(T,_,S)),d(T,E,!0,!0),o&&(m[E]=S))),g&&h==x&&D&&D.name!==x&&(!o&&y?f($,"name",x):(A=!0,I=function(){return i(D,this)})),h)if(k={values:j(x),keys:v?I:j(M),entries:j(C)},O)for(P in k)(w||A||!(P in $))&&p($,P,k[P]);else r({target:e,proto:!0,forced:w||A},k);return o&&!O||$[_]===I||p($,_,I,{name:h}),m[e]=I,k}},"7f9a":function(t,e,n){var r=n("da84"),i=n("1626"),o=n("8925"),a=r.WeakMap;t.exports=i(a)&&/native code/.test(o(a))},"825a":function(t,e,n){var r=n("da84"),i=n("861d"),o=r.String,a=r.TypeError;t.exports=function(t){if(i(t))return t;throw a(o(t)+" is not an object")}},"83ab":function(t,e,n){var r=n("d039");t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"83b9":function(t,e,n){"use strict";var r=n("d925"),i=n("e683");t.exports=function(t,e){return t&&!r(e)?i(t,e):e}},8418:function(t,e,n){"use strict";var r=n("a04b"),i=n("9bf2"),o=n("5c6c");t.exports=function(t,e,n){var a=r(e);a in t?i.f(t,a,o(0,n)):t[a]=n}},"841c":function(t,e,n){"use strict";var r=n("c65b"),i=n("d784"),o=n("825a"),a=n("1d80"),s=n("129f"),u=n("577e"),c=n("dc4a"),l=n("14c3");i("search",(function(t,e,n){return[function(e){var n=a(this),i=void 0==e?void 0:c(e,t);return i?r(i,e,n):new RegExp(e)[t](u(n))},function(t){var r=o(this),i=u(t),a=n(e,r,i);if(a.done)return a.value;var c=r.lastIndex;s(c,0)||(r.lastIndex=0);var d=l(r,i);return s(r.lastIndex,c)||(r.lastIndex=c),null===d?-1:d.index}]}))},"848b":function(t,e,n){"use strict";var r=n("5cce").version,i={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){i[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));var o={};function a(t,e,n){if("object"!==typeof t)throw new TypeError("options must be an object");var r=Object.keys(t),i=r.length;while(i-- >0){var o=r[i],a=e[o];if(a){var s=t[o],u=void 0===s||a(s,o,t);if(!0!==u)throw new TypeError("option "+o+" must be "+u)}else if(!0!==n)throw Error("Unknown option "+o)}}i.transitional=function(t,e,n){function i(t,e){return"[Axios v"+r+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,r,a){if(!1===t)throw new Error(i(r," has been removed"+(e?" in "+e:"")));return e&&!o[r]&&(o[r]=!0,console.warn(i(r," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,r,a)}},t.exports={assertOptions:a,validators:i}},"861d":function(t,e,n){var r=n("1626");t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},8925:function(t,e,n){var r=n("e330"),i=n("1626"),o=n("c6cd"),a=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return a(t)}),t.exports=o.inspectSource},"8c4f":function(t,e,n){"use strict"; -/*! - * vue-router v3.5.3 - * (c) 2021 Evan You - * @license MIT - */function r(t,e){for(var n in e)t[n]=e[n];return t}var i=/[!'()*]/g,o=function(t){return"%"+t.charCodeAt(0).toString(16)},a=/%2C/g,s=function(t){return encodeURIComponent(t).replace(i,o).replace(a,",")};function u(t){try{return decodeURIComponent(t)}catch(e){0}return t}function c(t,e,n){void 0===e&&(e={});var r,i=n||d;try{r=i(t||"")}catch(s){r={}}for(var o in e){var a=e[o];r[o]=Array.isArray(a)?a.map(l):l(a)}return r}var l=function(t){return null==t||"object"===typeof t?t:String(t)};function d(t){var e={};return t=t.trim().replace(/^(\?|#|&)/,""),t?(t.split("&").forEach((function(t){var n=t.replace(/\+/g," ").split("="),r=u(n.shift()),i=n.length>0?u(n.join("=")):null;void 0===e[r]?e[r]=i:Array.isArray(e[r])?e[r].push(i):e[r]=[e[r],i]})),e):e}function f(t){var e=t?Object.keys(t).map((function(e){var n=t[e];if(void 0===n)return"";if(null===n)return s(e);if(Array.isArray(n)){var r=[];return n.forEach((function(t){void 0!==t&&(null===t?r.push(s(e)):r.push(s(e)+"="+s(t)))})),r.join("&")}return s(e)+"="+s(n)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var p=/\/?$/;function h(t,e,n,r){var i=r&&r.options.stringifyQuery,o=e.query||{};try{o=m(o)}catch(s){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:o,params:e.params||{},fullPath:y(e,i),matched:t?g(t):[]};return n&&(a.redirectedFrom=y(n,i)),Object.freeze(a)}function m(t){if(Array.isArray(t))return t.map(m);if(t&&"object"===typeof t){var e={};for(var n in t)e[n]=m(t[n]);return e}return t}var v=h(null,{path:"/"});function g(t){var e=[];while(t)e.unshift(t),t=t.parent;return e}function y(t,e){var n=t.path,r=t.query;void 0===r&&(r={});var i=t.hash;void 0===i&&(i="");var o=e||f;return(n||"/")+o(r)+i}function b(t,e,n){return e===v?t===e:!!e&&(t.path&&e.path?t.path.replace(p,"")===e.path.replace(p,"")&&(n||t.hash===e.hash&&w(t.query,e.query)):!(!t.name||!e.name)&&(t.name===e.name&&(n||t.hash===e.hash&&w(t.query,e.query)&&w(t.params,e.params))))}function w(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var n=Object.keys(t).sort(),r=Object.keys(e).sort();return n.length===r.length&&n.every((function(n,i){var o=t[n],a=r[i];if(a!==n)return!1;var s=e[n];return null==o||null==s?o===s:"object"===typeof o&&"object"===typeof s?w(o,s):String(o)===String(s)}))}function _(t,e){return 0===t.path.replace(p,"/").indexOf(e.path.replace(p,"/"))&&(!e.hash||t.hash===e.hash)&&M(t.query,e.query)}function M(t,e){for(var n in e)if(!(n in t))return!1;return!0}function x(t){for(var e=0;e=0&&(e=t.slice(r),t=t.slice(0,r));var i=t.indexOf("?");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{path:t,query:n,hash:e}}function P(t){return t.replace(/\/+/g,"/")}var j=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},E=K,A=R,$=F,D=H,I=X,L=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function R(t,e){var n,r=[],i=0,o=0,a="",s=e&&e.delimiter||"/";while(null!=(n=L.exec(t))){var u=n[0],c=n[1],l=n.index;if(a+=t.slice(o,l),o=l+u.length,c)a+=c[1];else{var d=t[o],f=n[2],p=n[3],h=n[4],m=n[5],v=n[6],g=n[7];a&&(r.push(a),a="");var y=null!=f&&null!=d&&d!==f,b="+"===v||"*"===v,w="?"===v||"*"===v,_=n[2]||s,M=h||m;r.push({name:p||i++,prefix:f||"",delimiter:_,optional:w,repeat:b,partial:y,asterisk:!!g,pattern:M?U(M):g?".*":"[^"+z(_)+"]+?"})}}return o1||!C.length)return 0===C.length?t():t("span",{},C)}if("a"===this.tag)x.on=M,x.attrs={href:u,"aria-current":y};else{var S=at(this.$slots.default);if(S){S.isStatic=!1;var O=S.data=r({},S.data);for(var T in O.on=O.on||{},O.on){var k=O.on[T];T in M&&(O.on[T]=Array.isArray(k)?k:[k])}for(var P in M)P in O.on?O.on[P].push(M[P]):O.on[P]=w;var j=S.data.attrs=r({},S.data.attrs);j.href=u,j["aria-current"]=y}else x.on=M}return t(this.tag,x,this.$slots.default)}};function ot(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&(void 0===t.button||0===t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){var e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function at(t){if(t)for(var e,n=0;n-1&&(s.params[d]=n.params[d]);return s.path=J(c.path,s.params,'named route "'+u+'"'),f(c,s,a)}if(s.path){s.params={};for(var p=0;p=t.length?n():t[i]?e(t[i],(function(){r(i+1)})):r(i+1)};r(0)}var Ft={redirected:2,aborted:4,cancelled:8,duplicated:16};function Nt(t,e){return Ut(t,e,Ft.redirected,'Redirected when going from "'+t.fullPath+'" to "'+qt(e)+'" via a navigation guard.')}function Bt(t,e){var n=Ut(t,e,Ft.duplicated,'Avoided redundant navigation to current location: "'+t.fullPath+'".');return n.name="NavigationDuplicated",n}function Ht(t,e){return Ut(t,e,Ft.cancelled,'Navigation cancelled from "'+t.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function zt(t,e){return Ut(t,e,Ft.aborted,'Navigation aborted from "'+t.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}function Ut(t,e,n,r){var i=new Error(r);return i._isRouter=!0,i.from=t,i.to=e,i.type=n,i}var Vt=["params","query","hash"];function qt(t){if("string"===typeof t)return t;if("path"in t)return t.path;var e={};return Vt.forEach((function(n){n in t&&(e[n]=t[n])})),JSON.stringify(e,null,2)}function Wt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function Yt(t,e){return Wt(t)&&t._isRouter&&(null==e||t.type===e)}function Gt(t){return function(e,n,r){var i=!1,o=0,a=null;Xt(t,(function(t,e,n,s){if("function"===typeof t&&void 0===t.cid){i=!0,o++;var u,c=Zt((function(e){Jt(e)&&(e=e.default),t.resolved="function"===typeof e?e:tt.extend(e),n.components[s]=e,o--,o<=0&&r()})),l=Zt((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=Wt(t)?t:new Error(e),r(a))}));try{u=t(c,l)}catch(f){l(f)}if(u)if("function"===typeof u.then)u.then(c,l);else{var d=u.component;d&&"function"===typeof d.then&&d.then(c,l)}}})),i||r()}}function Xt(t,e){return Kt(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function Kt(t){return Array.prototype.concat.apply([],t)}var Qt="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag;function Jt(t){return t.__esModule||Qt&&"Module"===t[Symbol.toStringTag]}function Zt(t){var e=!1;return function(){var n=[],r=arguments.length;while(r--)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var te=function(t,e){this.router=t,this.base=ee(e),this.current=v,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function ee(t){if(!t)if(ut){var e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}function ne(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n0)){var e=this.router,n=e.options.scrollBehavior,r=Dt&&n;r&&this.listeners.push(Mt());var i=function(){var n=t.current,i=de(t.base);t.current===v&&i===t._startLocation||t.transitionTo(i,(function(t){r&&xt(e,t,n,!0)}))};window.addEventListener("popstate",i),this.listeners.push((function(){window.removeEventListener("popstate",i)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var r=this,i=this,o=i.current;this.transitionTo(t,(function(t){It(P(r.base+t.fullPath)),xt(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,i=this,o=i.current;this.transitionTo(t,(function(t){Lt(P(r.base+t.fullPath)),xt(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(de(this.base)!==this.current.fullPath){var e=P(this.base+this.current.fullPath);t?It(e):Lt(e)}},e.prototype.getCurrentLocation=function(){return de(this.base)},e}(te);function de(t){var e=window.location.pathname,n=e.toLowerCase(),r=t.toLowerCase();return!t||n!==r&&0!==n.indexOf(P(r+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var fe=function(t){function e(e,n,r){t.call(this,e,n),r&&pe(this.base)||he()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router,n=e.options.scrollBehavior,r=Dt&&n;r&&this.listeners.push(Mt());var i=function(){var e=t.current;he()&&t.transitionTo(me(),(function(n){r&&xt(t.router,n,e,!0),Dt||ye(n.fullPath)}))},o=Dt?"popstate":"hashchange";window.addEventListener(o,i),this.listeners.push((function(){window.removeEventListener(o,i)}))}},e.prototype.push=function(t,e,n){var r=this,i=this,o=i.current;this.transitionTo(t,(function(t){ge(t.fullPath),xt(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,i=this,o=i.current;this.transitionTo(t,(function(t){ye(t.fullPath),xt(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;me()!==e&&(t?ge(e):ye(e))},e.prototype.getCurrentLocation=function(){return me()},e}(te);function pe(t){var e=de(t);if(!/^\/#/.test(e))return window.location.replace(P(t+"/#"+e)),!0}function he(){var t=me();return"/"===t.charAt(0)||(ye("/"+t),!1)}function me(){var t=window.location.href,e=t.indexOf("#");return e<0?"":(t=t.slice(e+1),t)}function ve(t){var e=window.location.href,n=e.indexOf("#"),r=n>=0?e.slice(0,n):e;return r+"#"+t}function ge(t){Dt?It(ve(t)):window.location.hash=t}function ye(t){Dt?Lt(ve(t)):window.location.replace(ve(t))}var be=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,(function(){var t=e.current;e.index=n,e.updateRoute(r),e.router.afterHooks.forEach((function(e){e&&e(r,t)}))}),(function(t){Yt(t,Ft.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(te),we=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=pt(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!Dt&&!1!==t.fallback,this.fallback&&(e="hash"),ut||(e="abstract"),this.mode=e,e){case"history":this.history=new le(this,t.base);break;case"hash":this.history=new fe(this,t.base,this.fallback);break;case"abstract":this.history=new be(this,t.base);break;default:0}},_e={currentRoute:{configurable:!0}};function Me(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function xe(t,e,n){var r="hash"===n?"#"+e:e;return t?P(t+"/"+r):r}we.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},_e.currentRoute.get=function(){return this.history&&this.history.current},we.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var n=this.history;if(n instanceof le||n instanceof fe){var r=function(t){var r=n.current,i=e.options.scrollBehavior,o=Dt&&i;o&&"fullPath"in t&&xt(e,t,r,!1)},i=function(t){n.setupListeners(),r(t)};n.transitionTo(n.getCurrentLocation(),i,i)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},we.prototype.beforeEach=function(t){return Me(this.beforeHooks,t)},we.prototype.beforeResolve=function(t){return Me(this.resolveHooks,t)},we.prototype.afterEach=function(t){return Me(this.afterHooks,t)},we.prototype.onReady=function(t,e){this.history.onReady(t,e)},we.prototype.onError=function(t){this.history.onError(t)},we.prototype.push=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!==typeof Promise)return new Promise((function(e,n){r.history.push(t,e,n)}));this.history.push(t,e,n)},we.prototype.replace=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!==typeof Promise)return new Promise((function(e,n){r.history.replace(t,e,n)}));this.history.replace(t,e,n)},we.prototype.go=function(t){this.history.go(t)},we.prototype.back=function(){this.go(-1)},we.prototype.forward=function(){this.go(1)},we.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},we.prototype.resolve=function(t,e,n){e=e||this.history.current;var r=Z(t,e,n,this),i=this.match(r,e),o=i.redirectedFrom||i.fullPath,a=this.history.base,s=xe(a,o,this.mode);return{location:r,route:i,href:s,normalizedTo:r,resolved:i}},we.prototype.getRoutes=function(){return this.matcher.getRoutes()},we.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==v&&this.history.transitionTo(this.history.getCurrentLocation())},we.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==v&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(we.prototype,_e),we.install=st,we.version="3.5.3",we.isNavigationFailure=Yt,we.NavigationFailureType=Ft,we.START_LOCATION=v,ut&&window.Vue&&window.Vue.use(we),e["a"]=we},"8df4":function(t,e,n){"use strict";var r=n("7a77");function i(t){if("function"!==typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;this.promise.then((function(t){if(n._listeners){var e,r=n._listeners.length;for(e=0;e0&&(!x.multiline||x.multiline&&"\n"!==v(S,x.lastIndex-1))&&(j="(?: "+j+")",A=" "+A,E++),n=new RegExp("^(?:"+j+")",P)),M&&(n=new RegExp("^"+j+"$(?!\\s)",P)),w&&(i=x.lastIndex),s=r(h,k?n:x,A),k?s?(s.input=b(s.input,E),s[0]=b(s[0],E),s.index=x.lastIndex,x.lastIndex+=s[0].length):x.lastIndex=0:w&&s&&(x.lastIndex=x.global?s.index+s[0].length:i),M&&s&&s.length>1&&r(p,s[0],n,(function(){for(u=1;u0)n[r]=arguments[r+1];e&&e[t]&&e[t].apply(e,n)};"serviceWorker"in navigator&&r.then((function(){i()?(u(t,o,n),navigator.serviceWorker.ready.then((function(t){o("ready",t)})).catch((function(t){return a(o,t)}))):(s(t,o,n),navigator.serviceWorker.ready.then((function(t){o("ready",t)})).catch((function(t){return a(o,t)})))}))}function a(t,e){navigator.onLine||t("offline"),t("error",e)}function s(t,e,n){navigator.serviceWorker.register(t,n).then((function(t){e("registered",t),t.waiting?e("updated",t):t.onupdatefound=function(){e("updatefound",t);var n=t.installing;n.onstatechange=function(){"installed"===n.state&&(navigator.serviceWorker.controller?e("updated",t):e("cached",t))}}})).catch((function(t){return a(e,t)}))}function u(t,e,n){fetch(t).then((function(r){404===r.status?(e("error",new Error("Service worker not found at "+t)),c()):-1===r.headers.get("content-type").indexOf("javascript")?(e("error",new Error("Expected "+t+" to have javascript content-type, but received "+r.headers.get("content-type"))),c()):s(t,e,n)})).catch((function(t){return a(e,t)}))}function c(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(t){t.unregister()})).catch((function(t){return a(emit,t)}))}"undefined"!==typeof window&&(r="undefined"!==typeof Promise?new Promise((function(t){return window.addEventListener("load",t)})):{then:function(t){return window.addEventListener("load",t)}})},"94ca":function(t,e,n){var r=n("d039"),i=n("1626"),o=/#|\.prototype\./,a=function(t,e){var n=u[s(t)];return n==l||n!=c&&(i(e)?r(e):!!e)},s=a.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=a.data={},c=a.NATIVE="N",l=a.POLYFILL="P";t.exports=a},"96cf":function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(A){u=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),a=new P(r||[]);return o._invoke=S(t,n,a),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(A){return{type:"throw",arg:A}}}t.wrap=c;var d="suspendedStart",f="suspendedYield",p="executing",h="completed",m={};function v(){}function g(){}function y(){}var b={};u(b,o,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(j([])));_&&_!==n&&r.call(_,o)&&(b=_);var M=y.prototype=v.prototype=Object.create(b);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,o,a,s){var u=l(t[i],t,o);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"===typeof d&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(d).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;function o(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}this._invoke=o}function S(t,e,n){var r=d;return function(i,o){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return E()}n.method=i,n.arg=o;while(1){var a=n.delegate;if(a){var s=O(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=l(t,e,n);if("normal"===u.type){if(r=n.done?h:f,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}function O(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator["return"]&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=l(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function j(t){if(t){var n=t[o];if(n)return n.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){while(++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}(t.exports);try{regeneratorRuntime=r}catch(i){"object"===typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},9861:function(t,e,n){"use strict";n("e260");var r=n("23e7"),i=n("da84"),o=n("d066"),a=n("c65b"),s=n("e330"),u=n("0d3b"),c=n("6eeb"),l=n("e2cc"),d=n("d44e"),f=n("9ed3"),p=n("69f3"),h=n("19aa"),m=n("1626"),v=n("1a2d"),g=n("0366"),y=n("f5df"),b=n("825a"),w=n("861d"),_=n("577e"),M=n("7c73"),x=n("5c6c"),C=n("9a1f"),S=n("35a1"),O=n("b622"),T=n("addb"),k=O("iterator"),P="URLSearchParams",j=P+"Iterator",E=p.set,A=p.getterFor(P),$=p.getterFor(j),D=o("fetch"),I=o("Request"),L=o("Headers"),R=I&&I.prototype,F=L&&L.prototype,N=i.RegExp,B=i.TypeError,H=i.decodeURIComponent,z=i.encodeURIComponent,U=s("".charAt),V=s([].join),q=s([].push),W=s("".replace),Y=s([].shift),G=s([].splice),X=s("".split),K=s("".slice),Q=/\+/g,J=Array(4),Z=function(t){return J[t-1]||(J[t-1]=N("((?:%[\\da-f]{2}){"+t+"})","gi"))},tt=function(t){try{return H(t)}catch(e){return t}},et=function(t){var e=W(t,Q," "),n=4;try{return H(e)}catch(r){while(n)e=W(e,Z(n--),tt);return e}},nt=/[!'()~]|%20/g,rt={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},it=function(t){return rt[t]},ot=function(t){return W(z(t),nt,it)},at=function(t,e){if(t0?arguments[0]:void 0;E(this,new ut(t))},lt=ct.prototype;if(l(lt,{append:function(t,e){at(arguments.length,2);var n=A(this);q(n.entries,{key:_(t),value:_(e)}),n.updateURL()},delete:function(t){at(arguments.length,1);var e=A(this),n=e.entries,r=_(t),i=0;while(ie.key?1:-1})),t.updateURL()},forEach:function(t){var e,n=A(this).entries,r=g(t,arguments.length>1?arguments[1]:void 0),i=0;while(i1?pt(arguments[1]):{})}}),m(I)){var ht=function(t){return h(this,R),new I(t,arguments.length>1?pt(arguments[1]):{})};R.constructor=ht,ht.prototype=R,r({global:!0,forced:!0},{Request:ht})}}t.exports={URLSearchParams:ct,getState:A}},"9a1f":function(t,e,n){var r=n("da84"),i=n("c65b"),o=n("59ed"),a=n("825a"),s=n("0d51"),u=n("35a1"),c=r.TypeError;t.exports=function(t,e){var n=arguments.length<2?u(t):e;if(o(n))return a(i(n,t));throw c(s(t)+" is not iterable")}},"9bf2":function(t,e,n){var r=n("da84"),i=n("83ab"),o=n("0cfb"),a=n("aed9"),s=n("825a"),u=n("a04b"),c=r.TypeError,l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f="enumerable",p="configurable",h="writable";e.f=i?a?function(t,e,n){if(s(t),e=u(e),s(n),"function"===typeof t&&"prototype"===e&&"value"in n&&h in n&&!n[h]){var r=d(t,e);r&&r[h]&&(t[e]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:f in n?n[f]:r[f],writable:!1})}return l(t,e,n)}:l:function(t,e,n){if(s(t),e=u(e),s(n),o)try{return l(t,e,n)}catch(r){}if("get"in n||"set"in n)throw c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},"9c30":function(t,e,n){ -/*! - * vue-material v1.0.0-beta-14 - * Made with <3 by marcosmoura 2020 - * Released under the MIT License. - */ -!function(e,r){t.exports=r(n("2b0e"))}("undefined"!=typeof self&&self,(function(t){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=505)}([function(t,e){t.exports=function(t,e,n,r,i,o){var a,s,u,c,l,d=t=t||{},f=typeof t.default;return"object"!==f&&"function"!==f||(a=t,d=t.default),s="function"==typeof d?d.options:d,e&&(s.render=e.render,s.staticRenderFns=e.staticRenderFns,s._compiled=!0),n&&(s.functional=!0),i&&(s._scopeId=i),o?(u=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},s._ssrRegister=u):r&&(u=r),u&&(c=s.functional,l=c?s.render:s.beforeCreate,c?(s._injectStyles=u,s.render=function(t,e){return u.call(e),l(t,e)}):s.beforeCreate=l?[].concat(l,u):[u]),{esModule:a,exports:d,options:s}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e={props:{mdTheme:null},computed:{$mdActiveTheme:function(){var t=o.default.enabled,e=o.default.getThemeName,n=o.default.getAncestorTheme;return t&&!1!==this.mdTheme?e(this.mdTheme||n(this)):null}}};return(0,s.default)(e,t)},i=n(4),o=r(i),a=n(6),s=r(a)},function(e,n){e.exports=t},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u;Object.defineProperty(e,"__esModule",{value:!0}),n(7),i=n(5),o=r(i),a=n(4),s=r(a),u=function(){var t=new o.default({ripple:!0,theming:{},locale:{startYear:1900,endYear:2099,dateFormat:"yyyy-MM-dd",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shorterDays:["S","M","T","W","T","F","S"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],shorterMonths:["J","F","M","A","M","Ju","Ju","A","Se","O","N","D"],firstDayOfAWeek:0},router:{linkActiveClass:"router-link-active"}});return Object.defineProperties(t.theming,{metaColors:{get:function(){return s.default.metaColors},set:function(t){s.default.metaColors=t}},theme:{get:function(){return s.default.theme},set:function(t){s.default.theme=t}},enabled:{get:function(){return s.default.enabled},set:function(t){s.default.enabled=t}}}),t},e.default=function(t){t.material||(t.material=u(),t.prototype.$material=t.material)}},function(t,e,n){"use strict";var r,i,o,a,s;Object.defineProperty(e,"__esModule",{value:!0}),r=n(2),i=function(t){return t&&t.__esModule?t:{default:t}}(r),o=null,a=null,s=null,e.default=new i.default({data:function(){return{prefix:"md-theme-",theme:"default",enabled:!0,metaColors:!1}},computed:{themeTarget:function(){return!this.$isServer&&document.documentElement},fullThemeName:function(){return this.getThemeName()}},watch:{enabled:{immediate:!0,handler:function(){var t=this.fullThemeName,e=this.themeTarget,n=this.enabled;e&&(n?(e.classList.add(t),this.metaColors&&this.setHtmlMetaColors(t)):(e.classList.remove(t),this.metaColors&&this.setHtmlMetaColors()))}},theme:function(t,e){var n=this.getThemeName,r=this.themeTarget;t=n(t),r.classList.remove(n(e)),r.classList.add(t),this.metaColors&&this.setHtmlMetaColors(t)},metaColors:function(t){t?this.setHtmlMetaColors(this.fullThemeName):this.setHtmlMetaColors()}},methods:{getAncestorTheme:function(t){var e,n=this;return t?(e=t.mdTheme,function t(r){if(r){var i=r.mdTheme,o=r.$parent;return i&&i!==e?i:t(o)}return n.theme}(t.$parent)):null},getThemeName:function(t){var e=t||this.theme;return this.prefix+e},setMicrosoftColors:function(t){o&&o.setAttribute("content",t)},setThemeColors:function(t){a&&a.setAttribute("content",t)},setMaskColors:function(t){s&&s.setAttribute("color",t)},setHtmlMetaColors:function(t){var e,n="#fff";t&&(e=window.getComputedStyle(document.documentElement),n=e.getPropertyValue("--"+t+"-primary")),n&&(this.setMicrosoftColors(n),this.setThemeColors(n),this.setMaskColors(n))}},mounted:function(){var t=this;o=document.querySelector('[name="msapplication-TileColor"]'),a=document.querySelector('[name="theme-color"]'),s=document.querySelector('[rel="mask-icon"]'),this.enabled&&this.metaColors&&window.addEventListener("load",(function(){t.setHtmlMetaColors(t.fullThemeName)}))}})},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e={};return i.default.util.defineReactive(e,"reactive",t),e.reactive},r=n(2),i=function(t){return t&&t.__esModule?t:{default:t}}(r)},function(t,e,n){!function(e,n){t.exports=n()}(0,(function(){"use strict";function t(t){return!!t&&"object"==typeof t}function e(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||n(t)}function n(t){return t.$$typeof===d}function r(t){return Array.isArray(t)?[]:{}}function i(t,e){return!1!==e.clone&&e.isMergeableObject(t)?u(r(t),t,e):t}function o(t,e,n){return t.concat(e).map((function(t){return i(t,n)}))}function a(t,e){if(!e.customMerge)return u;var n=e.customMerge(t);return"function"==typeof n?n:u}function s(t,e,n){var r={};return n.isMergeableObject(t)&&Object.keys(t).forEach((function(e){r[e]=i(t[e],n)})),Object.keys(e).forEach((function(o){n.isMergeableObject(e[o])&&t[o]?r[o]=a(o,n)(t[o],e[o],n):r[o]=i(e[o],n)})),r}function u(t,e,n){var r,a,u;return n=n||{},n.arrayMerge=n.arrayMerge||o,n.isMergeableObject=n.isMergeableObject||c,r=Array.isArray(e),a=Array.isArray(t),u=r===a,u?r?n.arrayMerge(t,e,n):s(t,e,n):i(e,n)}var c=function(n){return t(n)&&!e(n)},l="function"==typeof Symbol&&Symbol.for,d=l?Symbol.for("react.element"):60103;return u.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce((function(t,n){return u(t,n,e)}),{})},u}))},function(t,e){},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(2),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default=function(t,e){return{validator:function(n){return!!e.includes(n)||(i.default.util.warn("The "+t+" prop is invalid. Given value: "+n+". Available options: "+e.join(", ")+".",void 0),!1)}}}},function(t,e,n){"use strict";function r(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fpAk2"),console.warn(Error().stack)),new Date(NaN))}e.a=r},function(t,e,n){(function(e){var r,i,o,a,s,u=n(14),c="undefined"==typeof window?e:window,l=["moz","webkit"],d="AnimationFrame",f=c["request"+d],p=c["cancel"+d]||c["cancelRequest"+d];for(r=0;!f&&r1)for(e=1;e=0},setHtml:function(t){var e=this;r[this.mdSrc].then((function(t){return e.html=t,e.$nextTick()})).then((function(){return e.$emit("md-loaded")}))},unexpectedError:function(t){this.error="Something bad happened trying to fetch "+this.mdSrc+".",t(this.error)},loadSVG:function(){var t=this;r.hasOwnProperty(this.mdSrc)?this.setHtml():r[this.mdSrc]=new Promise((function(e,n){var r=new window.XMLHttpRequest;r.open("GET",t.mdSrc,!0),r.onload=function(){var i=r.getResponseHeader("content-type");200===r.status?t.isSVG(i)?(e(r.response),t.setHtml()):(t.error="The file "+t.mdSrc+" is not a valid SVG.",n(t.error)):r.status>=400&&r.status<500?(t.error="The file "+t.mdSrc+" do not exists.",n(t.error)):t.unexpectedError(n)},r.onerror=function(){return t.unexpectedError(n)},r.onabort=function(){return t.unexpectedError(n)},r.send()}))}},mounted:function(){this.loadSVG()}}},function(t,e,n){"use strict";function r(t){n(24)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(19),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(25),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"md-ripple",appear:""},on:{"after-enter":t.end}},[t.animating?n("span"):t._e()])},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["md-ripple",t.rippleClasses],on:{"&touchstart":function(e){return function(e){return t.mdEventTrigger&&t.touchStartCheck(e)}(e)},"&touchmove":function(e){return function(e){return t.mdEventTrigger&&t.touchMoveCheck(e)}(e)},"&mousedown":function(e){return function(e){return t.mdEventTrigger&&t.startRipple(e)}(e)}}},[t._t("default"),t._v(" "),t._l(t.ripples,(function(e){return t.isDisabled?t._e():n("md-wave",{key:e.uuid,class:["md-ripple-wave",t.waveClasses],style:e.waveStyles,on:{"md-end":function(n){return t.clearWave(e.uuid)}}})}))],2)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s;Object.defineProperty(e,"__esModule",{value:!0}),i=n(2),o=r(i),a=n(10),s=r(a),e.default={name:"MdPortal",abstract:!0,props:{mdAttachToParent:Boolean,mdTarget:{type:null,validator:function(t){return!!(HTMLElement&&t&&t instanceof HTMLElement)||(o.default.util.warn("The md-target-el prop is invalid. You should pass a valid HTMLElement.",this),!1)}}},data:function(){return{leaveTimeout:null,originalParentEl:null}},computed:{transitionName:function(){var t,e,n=this._vnode.componentOptions.children[0];if(n){if(t=n.data.transition)return t.name;if(e=n.componentOptions.propsData.name)return e}return"v"},leaveClass:function(){return this.transitionName+"-leave"},leaveActiveClass:function(){return this.transitionName+"-leave-active"},leaveToClass:function(){return this.transitionName+"-leave-to"}},watch:{mdTarget:function(t,e){this.changeParentEl(t),e&&this.$forceUpdate()}},methods:{getTransitionDuration:function(t){var e=window.getComputedStyle(t).transitionDuration,n=parseFloat(e,10),r=e.match(/m?s/);return r&&(r=r[0]),"s"===r?1e3*n:"ms"===r?n:0},killGhostElement:function(t){t.parentNode&&(this.changeParentEl(this.originalParentEl),this.$options._parentElm=this.originalParentEl,t.parentNode.removeChild(t))},initDestroy:function(t){var e=this,n=this.$el;t&&this.$el.nodeType===Node.COMMENT_NODE&&(n=this.$vnode.elm),n.classList.add(this.leaveClass),n.classList.add(this.leaveActiveClass),this.$nextTick().then((function(){n.classList.add(e.leaveToClass),clearTimeout(e.leaveTimeout),e.leaveTimeout=setTimeout((function(){e.destroyElement(n)}),e.getTransitionDuration(n))}))},destroyElement:function(t){var e=this;(0,s.default)((function(){t.classList.remove(e.leaveClass),t.classList.remove(e.leaveActiveClass),t.classList.remove(e.leaveToClass),e.$emit("md-destroy"),e.killGhostElement(t)}))},changeParentEl:function(t){t&&t.appendChild(this.$el)}},mounted:function(){this.originalParentEl||(this.originalParentEl=this.$el.parentNode,this.$emit("md-initial-parent",this.$el.parentNode)),this.mdAttachToParent&&this.$el.parentNode.parentNode?this.changeParentEl(this.$el.parentNode.parentNode):document&&this.changeParentEl(this.mdTarget||document.body)},beforeDestroy:function(){this.$el.classList?this.initDestroy():this.killGhostElement(this.$el)},render:function(t){var e=this.$slots.default;if(e&&e[0])return e[0]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{to:[String,Object],replace:Boolean,append:Boolean,activeClass:String,exact:Boolean,event:[String,Array],exactActiveClass:String}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){var e,n,r;for(e=1;e=0)&&t.setAttribute("for",this.id)},setFormResetListener:function(){this.$el.form&&this.$el.form.addEventListener("reset",this.onParentFormReset)},removeFormResetListener:function(){this.$el.form&&this.$el.form.removeEventListener("reset",this.onParentFormReset)},onParentFormReset:function(){this.clearField()},setFieldValue:function(){this.MdField.value=this.model},setPlaceholder:function(){this.MdField.placeholder=!!this.placeholder},setDisabled:function(){this.MdField.disabled=!!this.disabled},setRequired:function(){this.MdField.required=!!this.required},setMaxlength:function(){this.mdCounter?this.MdField.counter=parseInt(this.mdCounter,10):this.MdField.maxlength=parseInt(this.maxlength,10)},onFocus:function(){this.MdField.focused=!0},onBlur:function(){this.MdField.focused=!1}},created:function(){this.setFieldValue(),this.setPlaceholder(),this.setDisabled(),this.setRequired(),this.setMaxlength()},mounted:function(){this.setLabelFor(),this.setFormResetListener()},beforeDestroy:function(){this.removeFormResetListener()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={methods:{isAssetIcon:function(t){return/\w+[/\\.]\w+/.test(t)}}}},function(t,e){},function(t,e,n){"use strict";function r(t){n(46)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(32),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(47),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-ripple",{attrs:{"md-disabled":!t.mdRipple||t.disabled,"md-event-trigger":!1,"md-active":t.mdRippleActive},on:{"update:mdActive":function(e){return t.$emit("update:mdRippleActive",e)}}},[n("div",{staticClass:"md-button-content"},[t._t("default")],2)])},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n){if("MutationObserver"in window){var r=new window.MutationObserver(n);return r.observe(t,e),{disconnect:function(){r.disconnect()}}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c,l,d;Object.defineProperty(e,"__esModule",{value:!0}),i=n(1),o=r(i),a=n(63),s=r(a),u=n(87),c=r(u),l=n(89),d=r(l),e.default=new o.default({name:"MdField",components:{MdClearIcon:s.default,MdPasswordOffIcon:c.default,MdPasswordOnIcon:d.default},props:{mdInline:Boolean,mdClearable:Boolean,mdCounter:{type:Boolean,default:!0},mdTogglePassword:{type:Boolean,default:!0}},data:function(){return{showPassword:!1,MdField:{value:null,focused:!1,highlighted:!1,disabled:!1,required:!1,placeholder:!1,textarea:!1,autogrow:!1,maxlength:null,counter:null,password:null,togglePassword:!1,clear:!1,file:!1}}},provide:function(){return{MdField:this.MdField}},computed:{stringValue:function(){return(this.MdField.value||0===this.MdField.value)&&""+this.MdField.value},hasCounter:function(){return this.mdCounter&&(this.MdField.maxlength||this.MdField.counter)},hasPasswordToggle:function(){return this.mdTogglePassword&&this.MdField.password},hasValue:function(){return this.stringValue&&this.stringValue.length>0},valueLength:function(){return this.stringValue?this.stringValue.length:0},fieldClasses:function(){return{"md-inline":this.mdInline,"md-clearable":this.mdClearable,"md-focused":this.MdField.focused,"md-highlight":this.MdField.highlighted,"md-disabled":this.MdField.disabled,"md-required":this.MdField.required,"md-has-value":this.hasValue,"md-has-placeholder":this.MdField.placeholder,"md-has-textarea":this.MdField.textarea,"md-has-password":this.MdField.password,"md-has-file":this.MdField.file,"md-has-select":this.MdField.select,"md-autogrow":this.MdField.autogrow}}},methods:{clearInput:function(){var t=this;this.MdField.clear=!0,this.$emit("md-clear"),this.$nextTick().then((function(){t.MdField.clear=!1}))},togglePassword:function(){this.MdField.togglePassword=!this.MdField.togglePassword},onBlur:function(){this.MdField.highlighted=!1}}})},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(13),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default={name:"MdClearIcon",components:{MdIcon:i.default}}},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(13),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default={name:"MdPasswordOffIcon",components:{MdIcon:i.default}}},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(13),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default={name:"MdPasswordOnIcon",components:{MdIcon:i.default}}},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(54),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(92),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c,l;Object.defineProperty(e,"__esModule",{value:!0}),i=Object.assign||function(t){var e,n,r;for(e=1;e1)throw Error();return t[0]}catch(t){i.default.util.warn("MdFocusTrap can only render one, and exactly one child component.",this)}return null}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,n,r){function i(){t.removeEventListener(e,n)}return e&&e.indexOf("click")>=0&&/iP/i.test(navigator.userAgent)&&(t.style.cursor="pointer"),t.addEventListener(e,n,r||!1),{destroy:i}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s;Object.defineProperty(e,"__esModule",{value:!0}),i=n(10),o=r(i),a=n(60),s=r(a),e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,e=arguments[1];return{destroy:(0,s.default)(t,"resize",(function(){(0,o.default)(e)}),{passive:!0}).destroy}}},function(t,e,n){"use strict";function r(t){n(85)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(49),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(91),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(50),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(86),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";function r(t){var e,n,r,o;if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return e=1,n=Object(i.a)(t),r=n.getUTCDay(),o=(r=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");return c=Object(o.a)(t),l=c.getUTCDay(),d=(l1&&void 0!==arguments[1]?arguments[1]:"top",i="top"===r?"scrollTop":"scrollLeft",o=t.nodeName;return"BODY"===o||"HTML"===o?(e=t.ownerDocument.documentElement,n=t.ownerDocument.scrollingElement||e,n[i]):t[i]}function h(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=p(e,"top"),i=p(e,"left"),o=n?-1:1;return t.top+=r*o,t.bottom+=r*o,t.left+=i*o,t.right+=i*o,t}function m(t,e){var n="x"===e?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"],10)+parseFloat(t["border"+r+"Width"],10)}function v(t,e,n,r){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],u(10)?parseInt(n["offset"+t])+parseInt(r["margin"+("Height"===t?"Top":"Left")])+parseInt(r["margin"+("Height"===t?"Bottom":"Right")]):0)}function g(t){var e=t.body,n=t.documentElement,r=u(10)&&getComputedStyle(n);return{height:v("Height",e,n,r),width:v("Width",e,n,r)}}function y(t){return yt({},t,{right:t.left+t.width,bottom:t.top+t.height})}function b(t){var e,n,r,i,a,s,c,l,d,f={};try{u(10)?(f=t.getBoundingClientRect(),e=p(t,"top"),n=p(t,"left"),f.top+=e,f.left+=n,f.bottom+=e,f.right+=n):f=t.getBoundingClientRect()}catch(t){}return r={left:f.left,top:f.top,width:f.right-f.left,height:f.bottom-f.top},i="HTML"===t.nodeName?g(t.ownerDocument):{},a=i.width||t.clientWidth||r.right-r.left,s=i.height||t.clientHeight||r.bottom-r.top,c=t.offsetWidth-a,l=t.offsetHeight-s,(c||l)&&(d=o(t),c-=m(d,"x"),l-=m(d,"y"),r.width-=c,r.height-=l),y(r)}function w(t,e){var n,r,i,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=u(10),l="HTML"===e.nodeName,d=b(t),f=b(e),p=s(t),m=o(e),v=parseFloat(m.borderTopWidth,10),g=parseFloat(m.borderLeftWidth,10);return a&&l&&(f.top=Math.max(f.top,0),f.left=Math.max(f.left,0)),n=y({top:d.top-f.top-v,left:d.left-f.left-g,width:d.width,height:d.height}),n.marginTop=0,n.marginLeft=0,!c&&l&&(r=parseFloat(m.marginTop,10),i=parseFloat(m.marginLeft,10),n.top-=v-r,n.bottom-=v-r,n.left-=g-i,n.right-=g-i,n.marginTop=r,n.marginLeft=i),(c&&!a?e.contains(p):e===p&&"BODY"!==p.nodeName)&&(n=h(n,e)),n}function _(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.ownerDocument.documentElement,r=w(t,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=e?0:p(n),s=e?0:p(n,"left");return y({top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o})}function M(t){var e,n=t.nodeName;return"BODY"!==n&&"HTML"!==n&&("fixed"===o(t,"position")||!!(e=a(t))&&M(e))}function x(t){if(!t||!t.parentElement||u())return document.documentElement;for(var e=t.parentElement;e&&"none"===o(e,"transform");)e=e.parentElement;return e||document.documentElement}function C(t,e,n,r){var i,o,u,c,l,d,p=arguments.length>4&&void 0!==arguments[4]&&arguments[4],h={top:0,left:0},m=p?x(t):f(t,e);return"viewport"===r?h=_(m,p):(i=void 0,"scrollParent"===r?(i=s(a(e)),"BODY"===i.nodeName&&(i=t.ownerDocument.documentElement)):i="window"===r?t.ownerDocument.documentElement:r,o=w(i,m,p),"HTML"!==i.nodeName||M(m)?h=o:(u=g(t.ownerDocument),c=u.height,l=u.width,h.top+=o.top-o.marginTop,h.bottom=c+o.top,h.left+=o.left-o.marginLeft,h.right=l+o.left)),n=n||0,d="number"==typeof n,h.left+=d?n:n.left||0,h.top+=d?n:n.top||0,h.right-=d?n:n.right||0,h.bottom-=d?n:n.bottom||0,h}function S(t){return t.width*t.height}function O(t,e,n,r,i){var o,a,s,u,c,l,d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;return-1===t.indexOf("auto")?t:(o=C(n,r,d,i),a={top:{width:o.width,height:e.top-o.top},right:{width:o.right-e.right,height:o.height},bottom:{width:o.width,height:o.bottom-e.bottom},left:{width:e.left-o.left,height:o.height}},s=Object.keys(a).map((function(t){return yt({key:t},a[t],{area:S(a[t])})})).sort((function(t,e){return e.area-t.area})),u=s.filter((function(t){var e=t.width,r=t.height;return e>=n.clientWidth&&r>=n.clientHeight})),c=u.length>0?u[0].key:s[0].key,l=t.split("-")[1],c+(l?"-"+l:""))}function T(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return w(n,r?x(e):f(e,n),r)}function k(t){var e=t.ownerDocument.defaultView,n=e.getComputedStyle(t),r=parseFloat(n.marginTop||0)+parseFloat(n.marginBottom||0),i=parseFloat(n.marginLeft||0)+parseFloat(n.marginRight||0);return{width:t.offsetWidth+i,height:t.offsetHeight+r}}function P(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,(function(t){return e[t]}))}function j(t,e,n){var r,i,o,a,s,u,c;return n=n.split("-")[0],r=k(t),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",u=o?"height":"width",c=o?"width":"height",i[a]=e[a]+e[u]/2-r[u]/2,i[s]=n===s?e[s]-r[c]:e[P(s)],i}function E(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function A(t,e,n){if(Array.prototype.findIndex)return t.findIndex((function(t){return t[e]===n}));var r=E(t,(function(t){return t[e]===n}));return t.indexOf(r)}function $(t,e,n){return(void 0===n?t:t.slice(0,A(t,"name",n))).forEach((function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&i(n)&&(e.offsets.popper=y(e.offsets.popper),e.offsets.reference=y(e.offsets.reference),e=n(e,t))})),e}function D(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=T(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=O(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=j(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=$(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function I(t,e){return t.some((function(t){var n=t.name;return t.enabled&&n===e}))}function L(t){var e,n,r,i=[!1,"ms","Webkit","Moz","O"],o=t.charAt(0).toUpperCase()+t.slice(1);for(e=0;es[h]&&(t.offsets.popper[f]+=u[f]+m-s[h]),t.offsets.popper=y(t.offsets.popper),v=u[f]+u[l]/2-m/2,g=o(t.instance.popper),b=parseFloat(g["margin"+d],10),w=parseFloat(g["border"+d+"Width"],10),_=v-t.offsets.popper[f]-b-w,_=Math.max(Math.min(s[l]-m,_),0),t.arrowElement=r,t.offsets.arrow=(n={},gt(n,f,Math.round(_)),gt(n,p,""),n),t}function Z(t){return"end"===t?"start":"start"===t?"end":t}function tt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=_t.indexOf(t),r=_t.slice(n+1).concat(_t.slice(0,n));return e?r.reverse():r}function et(t,e){var n,r,i,o,a;if(I(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;switch(n=C(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),r=t.placement.split("-")[0],i=P(r),o=t.placement.split("-")[1]||"",a=[],e.behavior){case Mt.FLIP:a=[r,i];break;case Mt.CLOCKWISE:a=tt(r);break;case Mt.COUNTERCLOCKWISE:a=tt(r,!0);break;default:a=e.behavior}return a.forEach((function(s,u){var c,l,d,f,p,h,m,v,g,y,b,w,_;if(r!==s||a.length===u+1)return t;r=t.placement.split("-")[0],i=P(r),c=t.offsets.popper,l=t.offsets.reference,d=Math.floor,f="left"===r&&d(c.right)>d(l.left)||"right"===r&&d(c.left)d(l.top)||"bottom"===r&&d(c.top)d(n.right),m=d(c.top)d(n.bottom),g="left"===r&&p||"right"===r&&h||"top"===r&&m||"bottom"===r&&v,y=-1!==["top","bottom"].indexOf(r),b=!!e.flipVariations&&(y&&"start"===o&&p||y&&"end"===o&&h||!y&&"start"===o&&m||!y&&"end"===o&&v),w=!!e.flipVariationsByContent&&(y&&"start"===o&&h||y&&"end"===o&&p||!y&&"start"===o&&v||!y&&"end"===o&&m),_=b||w,(f||g||_)&&(t.flipped=!0,(f||g)&&(r=a[u+1]),_&&(o=Z(o)),t.placement=r+(o?"-"+o:""),t.offsets.popper=yt({},t.offsets.popper,j(t.instance.popper,t.offsets.reference,t.placement)),t=$(t.instance.modifiers,t,"flip"))})),t}function nt(t){var e=t.offsets,n=e.popper,r=e.reference,i=t.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",u=a?"left":"top",c=a?"width":"height";return n[s]o(r[s])&&(t.offsets.popper[u]=o(r[s])),t}function rt(t,e,n,r){var i,o,a=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),s=+a[1],u=a[2];if(!s)return t;if(0===u.indexOf("%")){switch(i=void 0,u){case"%p":i=n;break;case"%":case"%r":default:i=r}return o=y(i),o[e]/100*s}return"vh"===u||"vw"===u?("vh"===u?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*s:s}function it(t,e,n,r){var i,o,a=[0,0],s=-1!==["right","left"].indexOf(r),u=t.split(/(\+|\-)/).map((function(t){return t.trim()})),c=u.indexOf(E(u,(function(t){return-1!==t.search(/,|\s/)})));return u[c]&&-1===u[c].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead."),i=/\s*,\s*|\s+/,o=-1!==c?[u.slice(0,c).concat([u[c].split(i)[0]]),[u[c].split(i)[1]].concat(u.slice(c+1))]:[u],o=o.map((function(t,r){var i=(1===r?!s:s)?"height":"width",o=!1;return t.reduce((function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,o=!0,t):o?(t[t.length-1]+=e,o=!1,t):t.concat(e)}),[]).map((function(t){return rt(t,i,e,n)}))})),o.forEach((function(t,e){t.forEach((function(n,r){V(n)&&(a[e]+=n*("-"===t[r-1]?-1:1))}))})),a}function ot(t,e){var n=e.offset,r=t.placement,i=t.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],u=void 0;return u=V(+n)?[+n,0]:it(n,o,a,s),"left"===s?(o.top+=u[0],o.left-=u[1]):"right"===s?(o.top+=u[0],o.left+=u[1]):"top"===s?(o.left+=u[0],o.top-=u[1]):"bottom"===s&&(o.left+=u[0],o.top+=u[1]),t.popper=o,t}function at(t,e){var n,r,i,o,a,s,u,l,d,f=e.boundariesElement||c(t.instance.popper);return t.instance.reference===f&&(f=c(f)),n=L("transform"),r=t.instance.popper.style,i=r.top,o=r.left,a=r[n],r.top="",r.left="",r[n]="",s=C(t.instance.popper,t.instance.reference,e.padding,f,t.positionFixed),r.top=i,r.left=o,r[n]=a,e.boundaries=s,u=e.priority,l=t.offsets.popper,d={primary:function(t){var n=l[t];return l[t]s[t]&&!e.escapeWithReference&&(r=Math.min(l[n],s[t]-("right"===t?l.width:l.height))),gt({},n,r)}},u.forEach((function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";l=yt({},l,d[e](t))})),t.offsets.popper=l,t}function st(t){var e,n,r,i,o,a,s,u=t.placement,c=u.split("-")[0],l=u.split("-")[1];return l&&(e=t.offsets,n=e.reference,r=e.popper,i=-1!==["bottom","top"].indexOf(c),o=i?"left":"top",a=i?"width":"height",s={start:gt({},o,n[o]),end:gt({},o,n[o]+n[a]-r[a])},t.offsets.popper=yt({},r,s[l])),t}function ut(t){var e,n;if(!Q(t.instance.modifiers,"hide","preventOverflow"))return t;if(e=t.offsets.reference,n=E(t.instance.modifiers,(function(t){return"preventOverflow"===t.name})).boundaries,e.bottomn.right||e.top>n.bottom||e.right=0){kt=1;break}dt=Ot&&window.Promise,ft=dt?n:r,pt=Ot&&!(!window.MSInputMethodContext||!document.documentMode),ht=Ot&&/MSIE 10/.test(navigator.userAgent),mt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},vt=function(){function t(t,e){var n,r;for(n=0;n2&&void 0!==arguments[2]?arguments[2]:{};mt(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(o.update)},this.update=ft(this.update.bind(this)),this.options=yt({},t.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(yt({},t.Defaults.modifiers,a.modifiers)).forEach((function(e){o.options.modifiers[e]=yt({},t.Defaults.modifiers[e]||{},a.modifiers?a.modifiers[e]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(t){return yt({name:t},o.options.modifiers[t])})).sort((function(t,e){return t.order-e.order})),this.modifiers.forEach((function(t){t.enabled&&i(t.onLoad)&&t.onLoad(o.reference,o.popper,o.options,t,o.state)})),this.update(),r=this.options.eventsEnabled,r&&this.enableEventListeners(),this.state.eventsEnabled=r}return vt(t,[{key:"update",value:function(){return D.call(this)}},{key:"destroy",value:function(){return R.call(this)}},{key:"enableEventListeners",value:function(){return H.call(this)}},{key:"disableEventListeners",value:function(){return U.call(this)}}]),t}(),St.Utils=("undefined"!=typeof window?window:t).PopperUtils,St.placements=wt,St.Defaults=Ct,e.default=St}.call(e,n(12))},function(t,e,n){"use strict";function r(t){n(154)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(70),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(155),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(1),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default=new i.default({name:"MdContent",props:{mdTag:{type:String,default:"div"}},render:function(t){return t(this.mdTag,{staticClass:"md-content",class:[this.$mdActiveTheme],attrs:this.$attrs,on:this.$listeners},this.$slots.default)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c,l,d;Object.defineProperty(e,"__esModule",{value:!0}),i=n(1),o=r(i),a=n(27),s=r(a),u=n(58),c=r(u),l=n(59),d=r(l),e.default=new o.default({name:"MdDialog",components:{MdPortal:s.default,MdOverlay:c.default,MdFocusTrap:d.default},props:{mdActive:Boolean,mdBackdrop:{type:Boolean,default:!0},mdBackdropClass:{type:String,default:"md-dialog-overlay"},mdCloseOnEsc:{type:Boolean,default:!0},mdClickOutsideToClose:{type:Boolean,default:!0},mdFullscreen:{type:Boolean,default:!0},mdAnimateFromSource:Boolean},computed:{dialogClasses:function(){return{"md-active":this.mdActive}},dialogContainerClasses:function(){return{"md-dialog-fullscreen":this.mdFullscreen}}},watch:{mdActive:function(t){var e=this;this.$nextTick().then((function(){t?e.$emit("md-opened"):e.$emit("md-closed")}))}},methods:{closeDialog:function(){this.$emit("update:mdActive",!1)},onClick:function(){this.mdClickOutsideToClose&&this.closeDialog(),this.$emit("md-clicked-outside")},onEsc:function(){this.mdCloseOnEsc&&this.closeDialog()}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c;Object.defineProperty(e,"__esModule",{value:!0}),i=n(1),o=r(i),a=n(97),s=r(a),u=n(43),c=r(u),e.default=new o.default({name:"MdEmptyState",mixins:[c.default],props:s.default,computed:{emptyStateClasses:function(){return{"md-rounded":this.mdRounded}},emptyStateStyles:function(){if(this.mdRounded){var t=this.mdSize+"px";return{width:t,height:t}}}}})},function(t,e,n){"use strict";var r,i,o;Object.defineProperty(e,"__esModule",{value:!0}),r=Object.assign||function(t){var e,n,r;for(e=1;e-1:t.model},on:{focus:t.onFocus,blur:t.onBlur,change:function(e){var n,r,i=t.model,o=e.target,a=!!o.checked;Array.isArray(i)?(n=null,r=t._i(i,n),o.checked?r<0&&(t.model=i.concat([n])):r>-1&&(t.model=i.slice(0,r).concat(i.slice(r+1)))):t.model=a}}},"input",t.attributes,!1),t.listeners)):"radio"===t.attributes.type?n("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"md-input",attrs:{type:"radio"},domProps:{checked:t._q(t.model,null)},on:{focus:t.onFocus,blur:t.onBlur,change:function(e){t.model=null}}},"input",t.attributes,!1),t.listeners)):n("input",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"md-input",attrs:{type:t.attributes.type},domProps:{value:t.model},on:{focus:t.onFocus,blur:t.onBlur,input:function(e){e.target.composing||(t.model=e.target.value)}}},"input",t.attributes,!1),t.listeners))},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t,e){var n,r,s,u,c,l,d,f,p,h,m;if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n=Object(o.a)(t,e),r=n.getUTCFullYear(),s=e||{},u=s.locale,c=u&&u.options&&u.options.firstWeekContainsDate,l=null==c?1:Object(i.a)(c),!((d=null==s.firstWeekContainsDate?l:Object(i.a)(s.firstWeekContainsDate))>=1&&d<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");return f=new Date(0),f.setUTCFullYear(r+1,0,d),f.setUTCHours(0,0,0,0),p=Object(a.a)(f,e),h=new Date(0),h.setUTCFullYear(r,0,d),h.setUTCHours(0,0,0,0),m=Object(a.a)(h,e),n.getTime()>=p.getTime()?r+1:n.getTime()>=m.getTime()?r:r-1}var i,o,a;e.a=r,i=n(17),o=n(9),a=n(65)},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-portal",{attrs:{"md-attach-to-parent":t.mdAttachToParent}},[n("transition",{attrs:{name:"md-overlay"}},[t.mdActive?n("div",t._g({staticClass:"md-overlay",class:t.overlayClasses},t.$listeners)):t._e()])],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){var e,n,r,o;if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return e=Object(i.a)(t),n=e.getFullYear(),r=e.getMonth(),o=new Date(0),o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var i=n(9)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={mdRounded:Boolean,mdSize:{type:Number,default:420},mdIcon:String,mdLabel:String,mdDescription:String}},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement;return(t._self._c||e)("ul",t._g(t._b({staticClass:"md-list",class:[t.$mdActiveTheme]},"ul",t.$attrs,!1),t.$listeners),[t._t("default")],2)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=["click","dblclick","mousedown","mouseup"]},function(t,e,n){"use strict";function r(t){n(464)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(217),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(467),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e,n){"use strict";var r,i,o;Object.defineProperty(e,"__esModule",{value:!0}),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(16),o=function(t){return t&&t.__esModule?t:{default:t}}(i),e.default={components:{MdRipple:o.default},props:{model:[String,Boolean,Object,Number,Array],value:{type:[String,Boolean,Object,Number]},name:[String,Number],required:Boolean,disabled:Boolean,indeterminate:Boolean,trueValue:{default:!0},falseValue:{default:!1}},model:{prop:"model",event:"change"},data:function(){return{rippleActive:!1}},computed:{attrs:function(){var t={id:this.id,name:this.name,disabled:this.disabled,required:this.required,"true-value":this.trueValue,"false-value":this.falseValue};return this.$options.propsData.hasOwnProperty("value")&&(null!==this.value&&"object"===r(this.value)||(t.value=null===this.value||void 0===this.value?"":this.value+"")),t},isSelected:function(){return this.isModelArray?this.model.includes(this.value):this.hasValue?this.model===this.value:this.model===this.trueValue},isModelArray:function(){return Array.isArray(this.model)},checkClasses:function(){return{"md-checked":this.isSelected,"md-disabled":this.disabled,"md-required":this.required,"md-indeterminate":this.indeterminate}},hasValue:function(){return this.$options.propsData.hasOwnProperty("value")}},methods:{removeItemFromModel:function(t){var e=t.indexOf(this.value);-1!==e&&t.splice(e,1)},handleArrayCheckbox:function(){var t=this.model;this.isSelected?this.removeItemFromModel(t):t.push(this.value),this.$emit("change",t)},handleSingleSelectCheckbox:function(){this.$emit("change",this.isSelected?null:this.value)},handleSimpleCheckbox:function(){this.$emit("change",this.isSelected?this.falseValue:this.trueValue)},toggleCheck:function(){this.disabled||(this.rippleActive=!0,this.isModelArray?this.handleArrayCheckbox():this.hasValue?this.handleSingleSelectCheckbox():this.handleSimpleCheckbox())}}}},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(69),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(0),s=null,u=!1,c=null,l=null,d=null,f=a(i.a,s,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={props:{mdSwipeable:Boolean,mdSwipeThreshold:{type:Number,default:150},mdSwipeRestraint:{type:Number,default:100},mdSwipeTime:{type:Number,default:300}},data:function(){return{swipeStart:!1,swipeStartTime:null,swiped:null,touchPosition:{startX:0,startY:0}}},computed:{getSwipeElement:function(){return this.mdSwipeElement||window}},methods:{handleTouchStart:function(t){this.touchPosition.startX=t.touches[0].screenX,this.touchPosition.startY=t.touches[0].screenY,this.swipeStartTime=new Date,this.swipeStart=!0},handleTouchMove:function(t){var e,n,r,i;this.swipeStart&&(e=t.touches[0].screenX,n=t.touches[0].screenY,r=e-this.touchPosition.startX,i=n-this.touchPosition.startY,new Date-this.swipeStartTime<=this.mdSwipeTime&&(Math.abs(r)>=this.mdSwipeThreshold&&Math.abs(i)<=this.mdSwipeRestraint?this.swiped=r<0?"left":"right":Math.abs(i)>=this.mdSwipeThreshold&&Math.abs(r)<=this.mdSwipeRestraint&&(this.swiped=i<0?"up":"down")))},handleTouchEnd:function(){this.touchPosition={startX:0,startY:0},this.swiped=null,this.swipeStart=!1}},mounted:function(){this.mdSwipeable&&(this.getSwipeElement.addEventListener("touchstart",this.handleTouchStart,!1),this.getSwipeElement.addEventListener("touchend",this.handleTouchEnd,!1),this.getSwipeElement.addEventListener("touchmove",this.handleTouchMove,!1))},beforeDestroy:function(){this.mdSwipeable&&(this.getSwipeElement.removeEventListener("touchstart",this.handleTouchStart,!1),this.getSwipeElement.removeEventListener("touchend",this.handleTouchEnd,!1),this.getSwipeElement.removeEventListener("touchmove",this.handleTouchMove,!1))}}},function(t,e,n){"use strict";function r(t){n(162)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(71),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(163),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(13),s=r(a),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default)}},function(t,e,n){"use strict";function r(t){n(166)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(72),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(167),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e,n){"use strict";function r(t){n(168)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(73),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(170),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e,n){"use strict";function r(t){n(178)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(75),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(0),u=null,c=!1,l=r,d=null,f=null,p=s(o.a,u,c,l,d,f),e.default=p.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){return!t||!1!==t[e]};e.default=function(t,e,n){var i=r(n,"leading"),o=(r(n,"trailing"),null);return function(){var e=this,n=arguments,r=function(){return t.apply(e,n)};if(o)return!0,!1;i&&r()}}},function(t,e,n){"use strict";function r(t){n(227)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(84),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(228),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function o(t){return t&&_.includes(i(t.tag))}function a(t){return!!t&&(""===t.mdRight||!!t.mdRight)}function s(t,e){return t&&_.includes(t.slot)||o(e)}function u(t){return JSON.stringify({persistent:t&&t["md-persistent"],permanent:t&&t["md-permanent"]})}function c(t,e,n,r,o){var c=[],l=!1;return t&&t.forEach((function(t){var d,p,m,v=t.data,g=t.componentOptions;if(s(v,g)){if(d=v.slot||i(g.tag),t.data.slot=d,"md-app-drawer"===d){if(p=a(g.propsData),l)return void h.default.util.warn("There shouldn't be more than one drawer in a MdApp at one time.");l=!0,t.data.slot+="-"+(p?"right":"left"),t.key=u(v.attrs),p&&(m=o(w.default,{props:f({},t.data.attrs)}),m.data.slot="md-app-drawer-right-previous",c.push(m))}t.data.provide=r.Ctor.options.provide,t.context=e,t.functionalContext=n,c.push(t)}})),c}function l(t){var e=t.filter((function(t){return["md-app-drawer","md-app-drawer-right","md-app-drawer-left"].indexOf(t.data.slot||i(t.componentOptions.tag))>-1}));return e.length?e:[]}function d(t){var e=t&&t["md-permanent"];return e&&("clipped"===e||"card"===e)}var f,p,h,m,v,g,y,b,w,_;Object.defineProperty(e,"__esModule",{value:!0}),f=Object.assign||function(t){var e,n,r;for(e=1;e=i},handleFlexibleMode:function(t){var e,n,r,i,o,a,s,u=this.getToolbarConstrants(t),c=u.scrollTop,l=u.initialHeight,d=this.MdApp.toolbar.element,f=d.querySelector(".md-toolbar-row:first-child"),p=f.offsetHeight,h=l-c,m=c=i)||this.revealLastPos>o+r},handleFixedLastMode:function(t){var e=this.getToolbarConstrants(t),n=e.scrollTop,r=e.toolbarHeight,i=e.safeAmount,o=this.MdApp.toolbar.element,a=o.querySelector(".md-toolbar-row:first-child"),s=a.offsetHeight;this.setToolbarTimer(n),this.setToolbarMarginAndHeight(n-s,r),this.MdApp.toolbar.fixedLastHeight=s,this.MdApp.toolbar.fixedLastActive=!(n>=s)||this.revealLastPos>n+i},handleOverlapMode:function(t){var e=this.getToolbarConstrants(t),n=e.toolbarHeight,r=e.scrollTop,i=e.initialHeight,o=this.MdApp.toolbar.element,a=o.querySelector(".md-toolbar-row:first-child"),s=a.offsetHeight,u=i-r-100*r/(i-s-s/1.5);s&&(r=s?(this.MdApp.toolbar.overlapOff=!1,o.style.height=u+"px"):(this.MdApp.toolbar.overlapOff=!0,o.style.height=s+"px")),this.setToolbarMarginAndHeight(r,n)},handleModeScroll:function(t){"reveal"===this.mdMode?this.handleRevealMode(t):"fixed-last"===this.mdMode?this.handleFixedLastMode(t):"overlap"===this.mdMode?this.handleOverlapMode(t):"flexible"===this.mdMode&&this.handleFlexibleMode(t)},handleScroll:function(t){var e=this;this.MdApp.toolbar.element&&(0,s.default)((function(){e.mdWaterfall&&e.handleWaterfallScroll(t),e.mdMode&&e.handleModeScroll(t)}))}},created:function(){this.MdApp.options.mode=this.mdMode,this.MdApp.options.waterfall=this.mdWaterfall,this.setToolbarElevation()},mounted:function(){var t={target:{scrollTop:0}};"reveal"===this.mdMode&&(this.MdApp.toolbar.revealActive=!0,this.handleRevealMode(t)),"flexible"===this.mdMode&&(this.MdApp.toolbar.revealActive=!0,this.handleFlexibleMode(t)),"fixed-last"===this.mdMode&&(this.MdApp.toolbar.fixedLastActive=!0,this.handleFixedLastMode(t)),"overlap"===this.mdMode&&this.handleOverlapMode(t)}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s;Object.defineProperty(e,"__esModule",{value:!0}),i=n(1),o=r(i),a=n(114),s=r(a),e.default=new o.default({name:"MdAppInternalDrawer",mixins:[s.default]})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u;Object.defineProperty(e,"__esModule",{value:!0}),i=Object.assign||function(t){var e,n,r;for(e=1;e0||this.filteredAsyncOptions.length>0},hasScopedEmptySlot:function(){return this.$scopedSlots["md-autocomplete-empty"]}},watch:{mdOptions:{deep:!0,immediate:!0,handler:function(){var t=this;this.isPromise(this.mdOptions)&&(this.isPromisePending=!0,this.mdOptions.then((function(e){t.filteredAsyncOptions=e,t.isPromisePending=!1})))}},value:function(t){this.searchTerm=t}},methods:{getOptions:function(){return this.isPromise(this.mdOptions)?this.filteredAsyncOptions:this.filteredStaticOptions},isPromise:function(t){return(0,c.default)(t)},matchText:function(t){var e=t.toLowerCase(),n=this.searchTerm.toLowerCase();return this.mdFuzzySearch?(0,s.default)(n,e):e.includes(n)},filterByString:function(){var t=this;return this.mdOptions.filter((function(e){return t.matchText(e)}))},filterByObject:function(){var t=this;return this.mdOptions.filter((function(e){var n,r=Object.values(e),i=r.length;for(n=0;n<=i;n++)if("string"==typeof r[n]&&t.matchText(r[n]))return!0}))},openOnFocus:function(){this.mdOpenOnFocus&&this.showOptions()},onInput:function(t){this.$emit("input",t),this.mdOpenOnFocus||this.showOptions(),"inputevent"!==(""+this.searchTerm.constructor).match(/function (\w*)/)[1].toLowerCase()&&this.$emit("md-changed",this.searchTerm)},showOptions:function(){var t=this;if(this.showMenu)return!1;this.showMenu=!0,this.$nextTick((function(){t.triggerPopover=!0,t.$emit("md-opened")}))},hideOptions:function(){var t=this;this.$nextTick((function(){t.triggerPopover=!1,t.$emit("md-closed")}))},selectItem:function(t,e){var n=e.target.textContent.trim();this.searchTerm=n,this.$emit("input",t),this.$emit("md-selected",t),this.hideOptions()}}}},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(1),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default=new i.default({name:"MdAvatar"})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var o,a,s,u,c,l,d;Object.defineProperty(e,"__esModule",{value:!0}),o=Object.assign||function(t){var e,n,r;for(e=1;e0&&void 0!==arguments[0]?arguments[0]:.6;t.mdTextScrim?t.applyScrimColor(e):t.mdSolid&&t.applySolidColor(e)},n=this.$el.querySelector("img");n&&(this.mdTextScrim||this.mdSolid)&&this.getImageLightness(n,(function(t){var n=256,r=(100*Math.abs(n-t)/n+15)/100;r>=.7&&(r=.7),e(r)}),e)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"MdCardContent"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"MdCardExpand",inject:["MdCard"]}},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=Object.assign||function(t){var e,n,r;for(e=1;e=0},isModelTypeDate:function(){return"object"===i(this.value)&&this.value instanceof Date&&(0,m.default)(this.value)},localString:function(){return this.localDate&&(0,d.default)(this.localDate,this.dateFormat)},localNumber:function(){return this.localDate&&+this.localDate},parsedInputDate:function(){var t=(0,p.default)(this.inputDate,this.dateFormat,new Date);return t&&(0,m.default)(t)?t:null},pattern:function(){return this.dateFormat.replace(/yyyy|MM|dd/g,(function(t){switch(t){case"yyyy":return"[0-9]{4}";case"MM":case"dd":return"[0-9]{2}"}}))}},watch:{inputDate:function(t){this.inputDateToLocalDate()},localDate:function(){this.inputDate=this.localString,this.modelType===Date&&this.$emit("input",this.localDate)},localString:function(){this.modelType===String&&this.$emit("input",this.localString)},localNumber:function(){this.modelType===Number&&this.$emit("input",this.localNumber)},value:{immediate:!0,handler:function(){this.valueDateToLocalDate()}},mdModelType:function(t){switch(t){case Date:this.$emit("input",this.localDate);break;case String:this.$emit("input",this.localString);break;case Number:this.$emit("input",this.localNumber)}},dateFormat:function(){this.localDate&&(this.inputDate=(0,d.default)(this.localDate,this.dateFormat))}},methods:{toggleDialog:function(){!c.default||this.mdOverrideNative?(this.showDialog=!this.showDialog,this.showDialog?this.$emit("md-opened"):this.$emit("md-closed")):this.$refs.input.$el.click()},onFocus:function(){this.mdOpenOnFocus&&this.toggleDialog()},inputDateToLocalDate:function(){this.inputDate?this.parsedInputDate&&(this.localDate=this.parsedInputDate):this.localDate=null},valueDateToLocalDate:function(){if(this.isModelNull)this.localDate=null;else if(this.isModelTypeNumber)this.localDate=new Date(this.value);else if(this.isModelTypeDate)this.localDate=this.value;else if(this.isModelTypeString){var t=(0,p.default)(this.value,this.dateFormat,new Date);(0,m.default)(t)?this.localDate=(0,p.default)(this.value,this.dateFormat,new Date):s.default.util.warn("The datepicker value is not a valid date. Given value: "+this.value+", format: "+this.dateFormat)}else s.default.util.warn("The datepicker value is not a valid date. Given value: "+this.value)},onClear:function(){this.$emit("md-clear")}},created:function(){this.inputDateToLocalDate=(0,S.default)(this.inputDateToLocalDate,this.MdDebounce)}}},function(t,e,n){"use strict";function r(t){var e,n=new Date(t.getTime()),r=n.getTimezoneOffset();return n.setSeconds(0,0),e=n.getTime()%i,r*i+e}e.a=r;var i=6e4},function(t,e,n){"use strict";function r(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var e=Object(i.a)(t);return!isNaN(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var i=n(9)},function(t,e,n){"use strict";function r(t,e,n){var r;return n=n||{},r="string"==typeof l[t]?l[t]:1===e?l[t].one:l[t].other.replace("{{count}}",e),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r}function i(t){return function(e){var n=e||{},r=n.width?n.width+"":t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}function o(t,e,n,r){return v[t]}function a(t){return function(e,n){var r,i,o=n||{},a=o.width?o.width+"":t.defaultWidth;return r="formatting"==(o.context?o.context+"":"standalone")&&t.formattingValues?t.formattingValues[a]||t.formattingValues[t.defaultFormattingWidth]:t.values[a]||t.values[t.defaultWidth],i=t.argumentCallback?t.argumentCallback(e):e,r[i]}}function s(t,e){var n=+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"}function u(t){return function(e,n){var r,i,o,a=e+"",s=n||{},u=s.width,l=u&&t.matchPatterns[u]||t.matchPatterns[t.defaultMatchWidth],d=a.match(l);return d?(r=d[0],i=u&&t.parsePatterns[u]||t.parsePatterns[t.defaultParseWidth],o="[object Array]"===Object.prototype.toString.call(i)?i.findIndex((function(t){return t.test(a)})):c(i,(function(t){return t.test(a)})),o=t.valueCallback?t.valueCallback(o):o,o=s.valueCallback?s.valueCallback(o):o,{value:o,rest:a.slice(r.length)}):null}}function c(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}var l={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"},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"}},d={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},f={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},p={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},h={date:i({formats:d,defaultWidth:"full"}),time:i({formats:f,defaultWidth:"full"}),dateTime:i({formats:p,defaultWidth:"full"})},m=h,v={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},g={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},y={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},b={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"]},w={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"]},_={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"}},M={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"}},x={ordinalNumber:s,era:a({values:g,defaultWidth:"wide"}),quarter:a({values:y,defaultWidth:"wide",argumentCallback:function(t){return+t-1}}),month:a({values:b,defaultWidth:"wide"}),day:a({values:w,defaultWidth:"wide"}),dayPeriod:a({values:_,defaultWidth:"wide",formattingValues:M,defaultFormattingWidth:"wide"})},C=x,S=/^(\d+)(th|st|nd|rd)?/i,O=/\d+/i,T={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},k={any:[/^b/i,/^(a|c)/i]},P={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},j={any:[/1/i,/2/i,/3/i,/4/i]},E={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},A={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},D={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]},I={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},L={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}},R={ordinalNumber:function(t){return function(e,n){var r,i,o,a=e+"",s=n||{},u=a.match(t.matchPattern);return u?(r=u[0],(i=a.match(t.parsePattern))?(o=t.valueCallback?t.valueCallback(i[0]):i[0],o=s.valueCallback?s.valueCallback(o):o,{value:o,rest:a.slice(r.length)}):null):null}}({matchPattern:S,parsePattern:O,valueCallback:function(t){return parseInt(t,10)}}),era:u({matchPatterns:T,defaultMatchWidth:"wide",parsePatterns:k,defaultParseWidth:"any"}),quarter:u({matchPatterns:P,defaultMatchWidth:"wide",parsePatterns:j,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:u({matchPatterns:E,defaultMatchWidth:"wide",parsePatterns:A,defaultParseWidth:"any"}),day:u({matchPatterns:$,defaultMatchWidth:"wide",parsePatterns:D,defaultParseWidth:"any"}),dayPeriod:u({matchPatterns:I,defaultMatchWidth:"any",parsePatterns:L,defaultParseWidth:"any"})},F=R,N={formatDistance:r,formatLong:m,formatRelative:o,localize:C,match:F,options:{weekStartsOn:0,firstWeekContainsDate:1}};e.a=N},function(t,e,n){"use strict";function r(t){var e,n;if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return e=Object(u.a)(t),n=new Date(0),n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0),Object(s.a)(n)}function i(t){var e,n;if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return e=Object(a.a)(t),n=Object(s.a)(e).getTime()-r(e).getTime(),Math.round(n/o)+1}var o,a=n(9),s=n(64),u=n(146);e.a=i,o=6048e5},function(t,e,n){"use strict";function r(t){var e,n,r,a,s,u;if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return e=Object(i.a)(t),n=e.getUTCFullYear(),r=new Date(0),r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0),a=Object(o.a)(r),s=new Date(0),s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0),u=Object(o.a)(s),e.getTime()>=a.getTime()?n+1:e.getTime()>=u.getTime()?n:n-1}var i,o;e.a=r,i=n(9),o=n(64)},function(t,e,n){"use strict";function r(t,e){var n,r,i,o,a,l,d;if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return n=e||{},r=n.locale,i=r&&r.options&&r.options.firstWeekContainsDate,o=null==i?1:Object(u.a)(i),a=null==n.firstWeekContainsDate?o:Object(u.a)(n.firstWeekContainsDate),l=Object(c.a)(t,e),d=new Date(0),d.setUTCFullYear(l,0,a),d.setUTCHours(0,0,0,0),Object(s.a)(d,e)}function i(t,e){var n,i;if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return n=Object(a.a)(t),i=Object(s.a)(n,e).getTime()-r(n,e).getTime(),Math.round(i/o)+1}var o,a=n(9),s=n(65),u=n(17),c=n(93);e.a=i,o=6048e5},function(t,e,n){"use strict";function r(t,e){var n,r;if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return n=Object(a.a)(t).getTime(),r=Object(o.a)(e),new Date(n+r)}function i(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return r(t,-Object(o.a)(e))}var o=n(17),a=n(9);e.a=i},function(t,e,n){"use strict";function r(t){return-1!==o.indexOf(t)}function i(t){throw new RangeError("`options.awareOfUnicodeTokens` must be set to `true` to use `"+t+"` token; see: https://git.io/fxCyr")}e.a=r,e.b=i;var o=["D","DD","YY","YYYY"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c,l,d,f,p,h,m,v,g,y,b,w,_,M,x,C,S,O,T,k,P,j,E,A,$,D,I,L,R,F,N,B,H;Object.defineProperty(e,"__esModule",{value:!0}),i=n(151),o=r(i),a=n(333),s=r(a),u=n(334),c=r(u),l=n(335),d=r(l),f=n(336),p=r(f),h=n(96),m=r(h),v=n(337),g=r(v),y=n(338),b=r(y),w=n(339),_=r(w),M=n(340),x=r(M),C=n(341),S=r(C),O=n(342),T=r(O),k=n(343),P=r(k),j=n(1),E=r(j),A=n(56),$=r(A),D=n(344),I=r(D),L=n(346),R=r(L),F=n(68),N=r(F),B=7,H=function(t,e){return!(!t||!t.querySelector)&&t.querySelectorAll(e)},e.default=new E.default({name:"MdDatepickerDialog",components:{MdPopover:$.default,MdArrowRightIcon:I.default,MdArrowLeftIcon:R.default,MdDialog:N.default},props:{mdDate:Date,mdDisabledDates:[Array,Function],mdImmediately:{type:Boolean,default:!1}},data:function(){return{currentDate:null,selectedDate:null,showDialog:!1,monthAction:null,currentView:"day",contentStyles:{},availableYears:null}},computed:{firstDayOfAWeek:function(){var t=+this.locale.firstDayOfAWeek;return Number.isNaN(t)||!Number.isFinite(t)?0:(t=Math.floor(t)%B,t+=t<0?B:0,t)},locale:function(){return this.$material.locale},popperSettings:function(){return{placement:"bottom-start",modifiers:{keepTogether:{enabled:!0},flip:{enabled:!1}}}},calendarClasses:function(){return"next"===this.monthAction?"md-next":"md-previous"},firstDayOfMonth:function(){return(0,s.default)(this.currentDate).getDay()},prefixEmptyDays:function(){var t=this.firstDayOfMonth-this.firstDayOfAWeek;return t+=t<0?B:0,t},daysInMonth:function(){return(0,m.default)(this.currentDate)},currentDay:function(){return this.selectedDate?(0,d.default)(this.selectedDate):(0,d.default)(this.currentDate)},currentMonth:function(){return(0,g.default)(this.currentDate)},currentMonthName:function(){return this.locale.months[this.currentMonth]},currentYear:function(){return(0,b.default)(this.currentDate)},selectedYear:function(){return this.selectedDate?(0,b.default)(this.selectedDate):(0,b.default)(this.currentDate)},shortDayName:function(){return this.selectedDate?this.locale.shortDays[(0,p.default)(this.selectedDate)]:this.locale.shortDays[(0,p.default)(this.currentDate)]},shortMonthName:function(){return this.selectedDate?this.locale.shortMonths[(0,g.default)(this.selectedDate)]:this.locale.shortMonths[(0,g.default)(this.currentDate)]}},watch:{mdDate:function(){this.currentDate=this.mdDate||new Date,this.selectedDate=this.mdDate},currentDate:function(t,e){var n=this;this.$nextTick().then((function(){e&&n.setContentStyles()}))},currentView:function(){var t=this;this.$nextTick().then((function(){if("year"===t.currentView){var e=H(t.$el,".md-datepicker-year-button.md-datepicker-selected");e.length&&e[0].scrollIntoView({behavior:"instant",block:"center",inline:"center"})}}))}},methods:{setContentStyles:function(){var t,e=H(this.$el,".md-datepicker-month");e.length&&(t=e[e.length-1],this.contentStyles={height:t.offsetHeight+10+"px"})},setAvailableYears:function(){for(var t=this.locale,e=t.startYear,n=t.endYear,r=e,i=[];r<=n;)i.push(r++);this.availableYears=i},handleDisabledDateByArray:function(t){return this.mdDisabledDates.some((function(e){return(0,x.default)(e,t)}))},isDisabled:function(t){if(this.mdDisabledDates){var e=(0,S.default)(this.currentDate,t);if(Array.isArray(this.mdDisabledDates))return this.handleDisabledDateByArray(e);if("function"==typeof this.mdDisabledDates)return this.mdDisabledDates(e)}},isSelectedDay:function(t){return(0,_.default)(this.selectedDate,(0,S.default)(this.currentDate,t))},isToday:function(t){return(0,x.default)(new Date,(0,S.default)(this.currentDate,t))},previousMonth:function(){this.monthAction="previous",this.currentDate=(0,c.default)(this.currentDate,1)},nextMonth:function(){this.monthAction="next",this.currentDate=(0,o.default)(this.currentDate,1)},switchMonth:function(t){this.currentDate=(0,T.default)(this.currentDate,t),this.currentView="day"},switchYear:function(t){this.currentDate=(0,P.default)(this.currentDate,t),this.currentView="month"},selectDate:function(t){this.currentDate=(0,S.default)(this.currentDate,t),this.selectedDate=this.currentDate,this.mdImmediately&&(this.$emit("update:mdDate",this.selectedDate),this.closeDialog())},closeDialog:function(){this.$emit("md-closed")},onClose:function(){this.closeDialog()},onCancel:function(){this.closeDialog()},onConfirm:function(){this.$emit("update:mdDate",this.selectedDate),this.closeDialog()},resetDate:function(){this.currentDate=this.mdDate||new Date,this.selectedDate=this.mdDate,this.currentView="day"}},created:function(){this.setAvailableYears(),this.resetDate()}})},function(t,e,n){"use strict";function r(t,e){var n,r,s,u,c;if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return n=Object(o.a)(t),r=Object(i.a)(e),s=n.getMonth()+r,u=new Date(0),u.setFullYear(n.getFullYear(),s,1),u.setHours(0,0,0,0),c=Object(a.default)(u),n.setMonth(s,Math.min(c,n.getDate())),n}var i,o,a;Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,i=n(17),o=n(9),a=n(96)},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(13),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default={name:"MdArrowRightIcon",components:{MdIcon:i.default}}},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(13),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default={name:"MdArrowLeftIcon",components:{MdIcon:i.default}}},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-portal",[n("transition",{attrs:{name:"md-dialog"}},[t.mdActive?n("div",{staticClass:"md-dialog"},[n("md-focus-trap",[n("div",t._g({staticClass:"md-dialog-container",class:[t.dialogContainerClasses,t.$mdActiveTheme],on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.onEsc(e)}}},t.$listeners),[t._t("default"),t._v(" "),n("keep-alive",[t.mdBackdrop?n("md-overlay",{class:t.mdBackdropClass,attrs:{"md-fixed":"","md-active":t.mdActive},on:{click:t.onClick}}):t._e()],1)],2)])],1):t._e()])],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(13),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default={name:"MdDateIcon",components:{MdIcon:i.default}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"MdDialogTitle"}},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(1),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default=new i.default({name:"MdDialogContent"})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"MdDialogActions"}},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(1),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default=new i.default({name:"MdDivider",computed:{insideList:function(){return"md-list"===this.$parent.$options._componentTag}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c,l,d,f;Object.defineProperty(e,"__esModule",{value:!0}),i=Object.assign||function(t){var e,n,r;for(e=1;et.offsetHeight},scrollToSelectedOption:function(t,e){var n=t.offsetTop,r=t.offsetHeight,i=e.offsetHeight;e.scrollTop=n-(i-r)/2},setOffsets:function(t){var e,n;this.$isServer||(e=this.$refs.menu.$refs.container)&&(n=t||e.querySelector(".md-selected"),n?(this.scrollToSelectedOption(n,e),this.offset.y=g.y-n.offsetTop+e.scrollTop+8,this.menuStyles={"transform-origin":"0 "+Math.abs(this.offset.y)+"px"}):(this.offset.y=g.y+1,this.menuStyles={}))},onMenuEnter:function(){this.didMount&&(this.setOffsets(),this.MdField.focused=!0,this.$emit("md-opened"))},applyHighlight:function(){this.MdField.focused=!1,this.MdField.highlighted=!0,this.$refs.input.$el.focus()},onClose:function(){this.$emit("md-closed"),this.didMount&&this.applyHighlight()},onFocus:function(){this.didMount&&this.applyHighlight()},removeHighlight:function(){this.MdField.highlighted=!1},openSelect:function(){this.disabled||(this.showSelect=!0)},arrayAccessorRemove:function(t,e){var n=t.slice(0,e),r=t.slice(e+1,t.length);return n.concat(r)},toggleArrayValue:function(t){var e=this.localValue.indexOf(t),n=e>-1;this.localValue=n?this.arrayAccessorRemove(this.localValue,e):this.localValue.concat([t])},setValue:function(t){this.model=t,this.setFieldValue(),this.showSelect=!1},setContent:function(t){this.MdSelect.label=t},setContentByValue:function(){var t=this.MdSelect.items[this.localValue];t?this.setContent(t):this.setContent("")},setMultipleValue:function(t){var e=t;this.toggleArrayValue(e),this.setFieldValue()},setMultipleContentByValue:function(){var t,e=this;this.localValue||this.initialLocalValueByDefault(),t=[],this.localValue.forEach((function(n){var r=e.MdSelect.items[n];r&&t.push(r)})),this.setContent(t.join(", "))},setFieldContent:function(){this.multiple?this.setMultipleContentByValue():this.setContentByValue()},isLocalValueSet:function(){return void 0!==this.localValue&&null!==this.localValue},setLocalValueIfMultiple:function(){this.isLocalValueSet()?this.localValue=[this.localValue]:this.localValue=[]},setLocalValueIfNotMultiple:function(){this.localValue.length>0?this.localValue=this.localValue[0]:this.localValue=null},initialLocalValueByDefault:function(){var t=Array.isArray(this.localValue);this.multiple&&!t?this.setLocalValueIfMultiple():!this.multiple&&t&&this.setLocalValueIfNotMultiple()},emitSelected:function(t){this.$emit("md-selected",t)}},mounted:function(){var t=this;this.showSelect=!1,this.setFieldContent(),this.$nextTick().then((function(){t.didMount=!0}))},updated:function(){this.setFieldContent()}}},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(13),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default={name:"MdDropDownIcon",components:{MdIcon:i.default}}},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",t._g({staticClass:"md-menu"},t.$listeners),[t._t("default")],2)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e){},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return"function"==typeof Node.prototype.contains?Node.prototype.contains.call(t,e):0!=(Node.prototype.compareDocumentPosition.call(e,t)&Node.prototype.DOCUMENT_POSITION_CONTAINS)}},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-popover",{attrs:{"md-settings":t.popperSettings,"md-active":t.shouldRender}},[t.shouldRender?n("transition",t._g({attrs:{name:"md-menu-content",css:t.didMount}},t.$listeners),[n("div",{ref:"menu",class:[t.menuClasses,t.mdContentClass,t.$mdActiveTheme],style:t.menuStyles},[n("div",{ref:"container",staticClass:"md-menu-content-container md-scrollbar",class:t.$mdActiveTheme},[n("md-list",t._b({class:t.listClasses},"md-list",t.filteredAttrs,!1),[t._t("default")],2)],1)])]):t._e()],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(11),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default={name:"MdOption",props:{value:[String,Number,Boolean],disabled:Boolean},inject:{MdSelect:{},MdOptgroup:{default:{}}},data:function(){return{uniqueId:"md-option-"+(0,i.default)(),isSelected:!1,isChecked:!1}},computed:{selectValue:function(){return this.MdSelect.modelValue},isMultiple:function(){return this.MdSelect.multiple},isDisabled:function(){return this.MdOptgroup.disabled||this.disabled},key:function(){return this.value||0===this.value||!1===this.value?this.value:this.uniqueId},inputLabel:function(){return this.MdSelect.label},optionClasses:function(){return{"md-selected":this.isSelected||this.isChecked}}},watch:{selectValue:function(){this.setIsSelected()},isChecked:function(t){t!==this.isSelected&&this.setSelection()},isSelected:function(t){this.isChecked=t}},methods:{getTextContent:function(){if(this.$el)return this.$el.textContent.trim();var t=this.$slots.default;return t?t[0].text.trim():""},setIsSelected:function(){return this.isMultiple?void 0===this.selectValue?void(this.isSelected=!1):void(this.isSelected=this.selectValue.includes(this.value)):void(this.isSelected=this.selectValue===this.value)},setSingleSelection:function(){this.MdSelect.setValue(this.value)},setMultipleSelection:function(){this.MdSelect.setMultipleValue(this.value)},setSelection:function(){this.isDisabled||(this.isMultiple?this.setMultipleSelection():this.setSingleSelection())},setItem:function(){this.$set(this.MdSelect.items,this.key,this.getTextContent())}},updated:function(){this.setItem()},created:function(){this.setItem(),this.setIsSelected()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"MdOptgroup",props:{label:String,disabled:Boolean},provide:function(){return{MdOptgroup:{disabled:this.disabled}}}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e1?this.getMultipleName(t):1===t.length?t[0].name:null:e.value.split("\\").pop()},openPicker:function(){this.onFocus(),this.$refs.inputFile.click()},onChange:function(t){this.onFileSelected(t)},onFileSelected:function(t){var e=t.target,n=t.dataTransfer,r=e.files||n.files;this.model=this.getFileName(r,e),this.$emit("md-change",r||e.value)}},created:function(){this.MdField.file=!0},beforeDestroy:function(){this.MdField.file=!1}}},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(13),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default={name:"MdFileIcon",components:{MdIcon:i.default}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var n=t.style.height,r=t.offsetHeight,i=t.scrollHeight;return t.style.overflow="hidden",r>=i&&(t.style.height=r+e+"px",i'+e+""}function o(t,e){var n,r,a,s,u,c;if(0===e.length)return t;if(-1===(n=t.toLowerCase().indexOf(e[0].toLowerCase())))return"";for(r=0,a=1;a1||e[0].tag)throw Error();return n=s(e[0],this.mdTerm,this.mdFuzzySearch),t("div",{staticClass:"md-highlight-text",class:this.$mdActiveTheme,domProps:{innerHTML:n}})}catch(t){c.default.util.warn("MdHighlightText can only render text nodes.",this)}return null}})},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(1),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default=new i.default({name:"MdImage",props:{mdSrc:String}})},function(t,e){},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(76),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(182),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(77),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(181),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement;return(t._self._c||e)("md-ripple",{staticClass:"md-list-item-content",attrs:{"md-disabled":t.mdDisabled}},[t._t("default")],2)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"md-list-item-default",on:{click:t.toggleControl}},[n("md-list-item-content",{attrs:{"md-disabled":""}},[t._t("default")],2)],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(78),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(184),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"md-list-item-fake-button",attrs:{disabled:t.disabled}},[n("md-list-item-content",{attrs:{"md-disabled":t.isDisabled}},[t._t("default")],2)],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(79),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(186),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("button",{staticClass:"md-list-item-button",attrs:{type:"button",disabled:t.disabled}},[n("md-list-item-content",{attrs:{"md-disabled":t.isDisabled}},[t._t("default")],2)],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(80),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(188),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("a",t._b({staticClass:"md-list-item-link"},"a",t.$props,!1),[n("md-list-item-content",{attrs:{"md-disabled":t.isDisabled}},[t._t("default")],2)],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(81),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(190),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("router-link",t._b({staticClass:"md-list-item-router"},"router-link",t.routerProps,!1),[n("md-list-item-content",{attrs:{"md-disabled":t.isDisabled}},[t._t("default")],2)],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){n(192)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(82),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(195),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(83),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(194),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this;t.$createElement;return t._self._c,t._m(0)},i=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-icon",{staticClass:"md-icon-image"},[n("svg",{attrs:{height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M7.41 7.84L12 12.42l4.59-4.58L18 9.25l-6 6-6-6z"}}),t._v(" "),n("path",{attrs:{d:"M0-.75h24v24H0z",fill:"none"}})])])}],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"md-list-item-expand",class:t.expandClasses},[n("md-list-item-content",{attrs:{"md-disabled":t.isDisabled},nativeOn:{click:function(e){return t.toggleExpand(e)}}},[t._t("default"),t._v(" "),n("md-arrow-down-icon",{staticClass:"md-list-expand-icon"})],2),t._v(" "),n("div",{ref:"listExpand",staticClass:"md-list-expand",style:t.expandStyles},[t._t("md-expand")],2)],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u;Object.defineProperty(e,"__esModule",{value:!0}),i=n(1),o=r(i),a=n(100),s=r(a),u=n(109),r(u),e.default=new o.default({name:"MdMenuItem",props:{disabled:Boolean},inject:["MdMenu"],data:function(){return{highlighted:!1}},computed:{itemClasses:function(){return{"md-highlight":this.highlighted}},listeners:function(){var t,e,n=this;return this.disabled?{}:this.MdMenu.closeOnSelect?(t={},e=Object.keys(this.$listeners),e.forEach((function(e){s.default.includes(e)?t[e]=function(t){n.$listeners[e](t),n.closeMenu()}:t[e]=n.$listeners[e]})),t):this.$listeners}},methods:{closeMenu:function(){this.MdMenu.active=!1,this.MdMenu.eventObserver&&this.MdMenu.eventObserver.destroy()},triggerCloseMenu:function(){this.disabled||this.closeMenu()}},mounted:function(){this.$el.children&&this.$el.children[0]&&"A"===this.$el.children[0].tagName.toUpperCase()&&this.$el.addEventListener("click",this.triggerCloseMenu)},beforeDestroy:function(){this.$el.removeEventListener("click",this.triggerCloseMenu)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u;Object.defineProperty(e,"__esModule",{value:!0}),i=Object.assign||function(t){var e,n,r;for(e=1;ee&&this.setStepperAsDone(this.MdSteppers.activeStep)},setActiveStep:function(t){if(this.mdLinear&&!this.isPreviousStepperDone(t))return!1;t===this.MdSteppers.activeStep||!this.isStepperEditable(t)&&this.isStepperDone(t)||(this.setPreviousStepperAsDone(t),this.MdSteppers.activeStep=t,this.$emit("md-changed",t),this.$emit("update:mdActiveStep",t),this.MdSteppers.items[t].error=null)},setActiveButtonEl:function(){this.activeButtonEl=this.$el.querySelector(".md-stepper-header.md-button.md-active")},setActiveStepByIndex:function(t){var e=this.getItemsAndKeys(),n=e.keys;this.hasActiveStep()||(this.MdSteppers.activeStep=n[t])},setupObservers:function(){var t=this.$el.querySelector(".md-steppers-wrapper");"ResizeObserver"in window?(this.resizeObserver=new window.ResizeObserver(this.calculateStepperPos),this.resizeObserver.observe(this.$el)):window.addEventListener("resize",this.calculateStepperPos),t&&(this.resizeObserver=(0,s.default)(this.$el.querySelector(".md-steppers-wrapper"),{childList:!0,characterData:!0,subtree:!0},this.calculateStepperPos))},calculateStepperPos:function(){if(!this.mdVertical){var t=this.$el.querySelector(".md-stepper:nth-child("+(this.activeStepIndex+1)+")");this.contentStyles={height:t.offsetHeight+"px"}}},onActiveStepIndex:function(){var t,e=this.getItemsAndKeys(),n=(e.items,e.keys);if(this.hasActiveStep()||this.activeStepIndex)for(this.MdSteppers.activeStep=n[this.activeStepIndex],t=0;t0}))},setHeaderScroll:function(t){var e=this;(0,a.default)((function(){e.MdTable.contentEl.scrollLeft=t.target.scrollLeft}))},getContentEl:function(){return this.$el.querySelector(".md-table-content")},setContentEl:function(){this.MdTable.contentEl=this.getContentEl()},setHeaderPadding:function(){var t,e;this.setContentEl(),t=this.MdTable.contentEl,e=t.childNodes[0],this.fixedHeaderPadding=t.offsetWidth-e.offsetWidth},getModel:function(){return this.value},getModelItem:function(t){return this.value[t]},manageItemSelection:function(t){this.MdTable.selectedItems.includes(t)?this.MdTable.selectedItems=this.MdTable.selectedItems.filter((function(e){return e!==t})):this.MdTable.selectedItems=this.MdTable.selectedItems.concat([t])},sortTable:function(){Array.isArray(this.value)&&this.$emit("input",this.mdSortFn(this.value))},select:function(t){this.$emit("update:mdSelectedValue",t),this.$emit("md-selected",t)},syncSelectedValue:function(){var t=this;this.$nextTick().then((function(){"single"===t.MdTable.selectingMode?t.MdTable.singleSelection=t.mdSelectedValue:"multiple"===t.MdTable.selectingMode&&(t.MdTable.selectedItems=t.mdSelectedValue||[])}))},setWidth:function(){this.mdFixedHeader&&(this.fixedHeaderTableWidth=this.$refs.contentTable.offsetWidth)}},created:function(){this.mdSort&&this.sortTable(),this.syncSelectedValue()},mounted:function(){this.setContentEl(),this.$nextTick().then(this.setWidth),this.mdFixedHeader&&(this.setHeaderPadding(),this.windowResizeObserver=new C.default(window,this.setWidth))},beforeDestroy:function(){this.windowResizeObserver&&this.windowResizeObserver.destroy()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){var e,n,r;for(e=1;e0&&void 0!==arguments[0]?arguments[0]:this.mdItem;"multiple"===this.mdSelectable&&(this.MdTable.selectable=this.MdTable.selectable.filter((function(e){return e!==t})))}},created:function(){var t=this;this.$nextTick((function(){t.addSelectableItem(),t.MdTable.selectingMode=t.mdSelectable}))},beforeDestroy:function(){this.removeSelectableItem()}}},function(t,e,n){"use strict";function r(t){n(475)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(224),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(476),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"MdTableCellSelection",props:{value:Boolean,mdRowId:[Number,String],mdSelectable:Boolean,mdDisabled:Boolean},inject:["MdTable"],data:function(){return{isSelected:!1}},watch:{value:{immediate:!0,handler:function(t){this.isSelected=t}}},methods:{onChange:function(){this.$emit("input",this.isSelected)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"MdTableRowGhost",props:{mdIndex:[String,Number],mdId:[String,Number],mdItem:[Array,Object]},render:function(){return this.$slots.default[0].componentOptions.propsData.mdIndex=this.mdIndex,this.$slots.default[0].componentOptions.propsData.mdId=this.mdId,this.$slots.default[0].componentOptions.propsData.mdItem=this.mdItem,this.$slots.default[0]}}},function(t,e,n){"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),r=n(111),i=function(t){return t&&t.__esModule?t:{default:t}}(r),e.default={name:"MdTableToolbar",components:{MdToolbar:i.default},inject:["MdTable"]}},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"md-toolbar",class:[t.$mdActiveTheme,"md-elevation-"+t.mdElevation]},[t._t("default")],2)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a;Object.defineProperty(e,"__esModule",{value:!0}),i=n(105),r(i),o=n(97),a=r(o),e.default={name:"MdTableEmptyState",props:a.default,inject:["MdTable"]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"MdTableCell",props:{mdId:[String,Number],mdLabel:String,mdNumeric:Boolean,mdTooltip:String,mdSortBy:String},inject:["MdTable"],data:function(){return{index:null,parentNode:null}},computed:{cellClasses:function(){return{"md-numeric":this.mdNumeric}}},watch:{mdSortBy:function(){this.setCellData()},mdNumeric:function(){this.setCellData()},mdLabel:function(){this.setCellData()},mdTooltip:function(){this.setCellData()}},methods:{setCellData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;this.$set(this.MdTable.items,t.index,{id:t.mdId,label:t.mdLabel,numeric:t.mdNumeric,tooltip:t.mdTooltip,sortBy:t.mdSortBy})},updateAllCellData:function(){var t,e=this;this.MdTable.items={},t=Array.from(this.parentNode.childNodes).filter((function(t){var e=t.tagName,n=t.classList,r=n&&n.contains("md-table-cell-selection");return e&&"td"===e.toLowerCase()&&!r})),t.forEach((function(t,n){var r=t.__vue__;r.index=n,e.setCellData(r)}))}},mounted:function(){this.parentNode=this.$el.parentNode,this.updateAllCellData()},destroyed:function(){if(null!==this.$el.parentNode)return!1;this.updateAllCellData()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"MdTablePagination",inject:["MdTable"],props:{mdPageSize:{type:[String,Number],default:10},mdPageOptions:{type:Array,default:function(){return[10,25,50,100]}},mdPage:{type:Number,default:1},mdTotal:{type:[String,Number],default:"Many"},mdLabel:{type:String,default:"Rows per page:"},mdSeparator:{type:String,default:"of"}},data:function(){return{currentPageSize:0}},computed:{currentItemCount:function(){return(this.mdPage-1)*this.mdPageSize+1},currentPageCount:function(){return this.mdPage*this.mdPageSize}},watch:{mdPageSize:{immediate:!0,handler:function(t){this.currentPageSize=this.pageSize}}},methods:{setPageSize:function(){this.$emit("update:mdPageSize",this.currentPageSize)},goToPrevious:function(){},goToNext:function(){}},created:function(){this.currentPageSize=this.mdPageSize}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var o,a,s,u,c,l,d,f,p,h,m,v,g,y,b,w,_;Object.defineProperty(e,"__esModule",{value:!0}),o=Object.assign||function(t){var e,n,r;for(e=1;e0&&"left"===t&&this.setSwipeActiveTabByIndex(this.activeTabIndex-1)}},methods:{hasActiveTab:function(){return this.activeTab||this.mdActiveTab},getItemsAndKeys:function(){var t=this.MdTabs.items;return{items:t,keys:Object.keys(t)}},setActiveTab:function(t){this.mdSyncRoute||(this.activeTab=t)},setActiveButtonEl:function(){this.activeButtonEl=this.$refs.navigation.querySelector(".md-tab-nav-button.md-active")},setSwipeActiveTabByIndex:function(t){var e=this.getItemsAndKeys(),n=e.keys;n&&(this.activeTab=n[t])},setActiveTabByIndex:function(t){var e=this.getItemsAndKeys(),n=e.keys;this.hasActiveTab()||(this.activeTab=n[t])},setHasContent:function(){var t=this.getItemsAndKeys(),e=t.items,n=t.keys;this.hasContent=n.some((function(t){return e[t].hasContent}))},setIndicatorStyles:function(){var t=this;(0,s.default)((function(){t.$nextTick().then((function(){var e,n,r;t.activeButtonEl&&t.$refs.indicator?(e=t.activeButtonEl.offsetWidth,n=t.activeButtonEl.offsetLeft,r=t.$refs.indicator.offsetLeft,t.indicatorClass=ro)return!1;if(a===o)return t===e;t:for(n=0,r=0;n0?"-":"+",o=Math.abs(t),a=Math.floor(o/60),s=o%60;return 0===s?i+(a+""):(n=e||"",i+(a+"")+n+r(s,2))}function a(t,e){return t%60==0?(t>0?"-":"+")+r(Math.abs(t)/60,2):s(t,e)}function s(t,e){var n=e||"",i=t>0?"-":"+",o=Math.abs(t);return i+r(Math.floor(o/60),2)+n+r(o%60,2)}function u(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}}function c(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}}function l(t,e){var n,r=t.match(/(P+)(p+)?/),i=r[1],o=r[2];if(!o)return u(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;case"PPPP":default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",u(i,e)).replace("{{time}}",c(o,e))}function d(t,e,n){var r,i,o,a,s,u,c,l,d,y,b,w,_;if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");if(r=e+"",i=n||{},o=i.locale||g.a,a=o.options&&o.options.firstWeekContainsDate,s=null==a?1:Object(p.a)(a),!((u=null==i.firstWeekContainsDate?s:Object(p.a)(i.firstWeekContainsDate))>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");if(c=o.options&&o.options.weekStartsOn,l=null==c?0:Object(p.a)(c),!((d=null==i.weekStartsOn?l:Object(p.a)(i.weekStartsOn))>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");if(y=Object(m.a)(t),!Object(v.default)(y))throw new RangeError("Invalid time value");return b=Object(h.a)(y),w=Object(j.a)(y,b),_={firstWeekContainsDate:u,weekStartsOn:d,locale:o,_originalDate:y},r.match($).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,P[e])(t,o.formatLong,_):t})).join("").match(A).map((function(t){var e,n;return"''"===t?"'":"'"===(e=t[0])?f(t):(n=T[e],n?(!i.awareOfUnicodeTokens&&Object(E.a)(t)&&Object(E.b)(t),n(w,t,o.localize,_)):t)})).join("")}function f(t){return t.match(D)[1].replace(I,"'")}var p,h,m,v,g,y,b,w,_,M,x,C,S,O,T,k,P,j,E,A,$,D,I;Object.defineProperty(e,"__esModule",{value:!0}),p=n(17),h=n(142),m=n(9),v=n(143),g=n(144),y={y:function(t,e){var n=t.getUTCFullYear(),i=n>0?n:1-n;return r("yy"===e?i%100:i,e.length)},M:function(t,e){var n=t.getUTCMonth();return"M"===e?n+1+"":r(n+1,2)},d:function(t,e){return r(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":case"aaa":return n.toUpperCase();case"aaaaa":return n[0];case"aaaa":default:return"am"===n?"a.m.":"p.m."}},h:function(t,e){return r(t.getUTCHours()%12||12,e.length)},H:function(t,e){return r(t.getUTCHours(),e.length)},m:function(t,e){return r(t.getUTCMinutes(),e.length)},s:function(t,e){return r(t.getUTCSeconds(),e.length)}},b=y,w=864e5,_=n(145),M=n(146),x=n(147),C=n(93),S={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},O={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){var r,i;return"yo"===e?(r=t.getUTCFullYear(),i=r>0?r:1-r,n.ordinalNumber(i,{unit:"year"})):b.y(t,e)},Y:function(t,e,n,i){var o,a=Object(C.a)(t,i),s=a>0?a:1-a;return"YY"===e?(o=s%100,r(o,2)):"Yo"===e?n.ordinalNumber(s,{unit:"year"}):r(s,e.length)},R:function(t,e){return r(Object(M.a)(t),e.length)},u:function(t,e){return r(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return i+"";case"QQ":return r(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return i+"";case"qq":return r(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return b.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var i=t.getUTCMonth();switch(e){case"L":return i+1+"";case"LL":return r(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){var o=Object(x.a)(t,i);return"wo"===e?n.ordinalNumber(o,{unit:"week"}):r(o,e.length)},I:function(t,e,n){var i=Object(_.a)(t);return"Io"===e?n.ordinalNumber(i,{unit:"week"}):r(i,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):b.d(t,e)},D:function(t,e,n){var o=i(t);return"Do"===e?n.ordinalNumber(o,{unit:"dayOfYear"}):r(o,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){var o=t.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(e){case"e":return a+"";case"ee":return r(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){var o=t.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(e){case"c":return a+"";case"cc":return r(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,n){var i=t.getUTCDay(),o=0===i?7:i;switch(e){case"i":return o+"";case"ii":return r(o,e.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours(),i=r/12>=1?"pm":"am";switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?S.noon:0===i?S.midnight:i/12>=1?"pm":"am",e){case"b":case"bb":case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?S.evening:i>=12?S.afternoon:i>=4?S.morning:S.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return b.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):b.H(t,e)},K:function(t,e,n){var i=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(i,{unit:"hour"}):r(i,e.length)},k:function(t,e,n){var i=t.getUTCHours();return 0===i&&(i=24),"ko"===e?n.ordinalNumber(i,{unit:"hour"}):r(i,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):b.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):b.s(t,e)},S:function(t,e){var n=e.length,i=t.getUTCMilliseconds();return r(Math.floor(i*Math.pow(10,n-3)),n)},X:function(t,e,n,r){var i=r._originalDate||t,o=i.getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return a(o);case"XXXX":case"XX":return s(o);case"XXXXX":case"XXX":default:return s(o,":")}},x:function(t,e,n,r){var i=r._originalDate||t,o=i.getTimezoneOffset();switch(e){case"x":return a(o);case"xxxx":case"xx":return s(o);case"xxxxx":case"xxx":default:return s(o,":")}},O:function(t,e,n,r){var i=r._originalDate||t,a=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+o(a,":");case"OOOO":default:return"GMT"+s(a,":")}},z:function(t,e,n,r){var i=r._originalDate||t,a=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+o(a,":");case"zzzz":default:return"GMT"+s(a,":")}},t:function(t,e,n,i){var o=i._originalDate||t;return r(Math.floor(o.getTime()/1e3),e.length)},T:function(t,e,n,i){return r((i._originalDate||t).getTime(),e.length)}},T=O,k={p:c,P:l},P=k,j=n(148),E=n(149),e.default=d,A=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,D=/^'(.*?)'?$/,I=/''/g},function(t,e,n){"use strict";function r(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e=e||{},e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function i(t,e,n){var r,i,o,a,s,u,c,l,d,f,p;if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");if(r=n||{},i=r.locale,o=i&&i.options&&i.options.weekStartsOn,a=null==o?0:Object(b.a)(o),!((s=null==r.weekStartsOn?a:Object(b.a)(r.weekStartsOn))>=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");return u=Object(_.a)(t),c=Object(b.a)(e),l=u.getUTCDay(),d=c%7,f=(d+7)%7,p=(f0,s=a?e:1-e;return s<=50?n=t||100:(r=s+50,i=100*Math.floor(r/100),o=t>=r%100,n=t+i-(o?100:0)),a?n:1-n}function m(t){return t%400==0||t%4==0&&t%100!=0}function v(t,e,n,i){var o,a,s,u,c,l,d,f,p,h,m,v,C,S,O,T,k,P,j,E,A,$,D,I;if(arguments.length<3)throw new TypeError("3 arguments required, but only "+arguments.length+" present");if(o=t+"",a=e+"",s=i||{},u=s.locale||x.a,!u.match)throw new RangeError("locale must contain match property");if(c=u.options&&u.options.firstWeekContainsDate,l=null==c?1:Object(b.a)(c),!((d=null==s.firstWeekContainsDate?l:Object(b.a)(s.firstWeekContainsDate))>=1&&d<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");if(f=u.options&&u.options.weekStartsOn,p=null==f?0:Object(b.a)(f),!((h=null==s.weekStartsOn?p:Object(b.a)(s.weekStartsOn))>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===a)return""===o?Object(_.a)(n):new Date(NaN);for(m={firstWeekContainsDate:d,weekStartsOn:h,locale:u},v=[{priority:N,set:g,index:0}],S=a.match(B),C=0;C0&&U.test(o))return new Date(NaN);if(j=v.map((function(t){return t.priority})).sort((function(t,e){return e-t})).filter((function(t,e,n){return n.indexOf(t)===e})).map((function(t){return v.filter((function(e){return e.priority===t})).reverse()})).map((function(t){return t[0]})),E=Object(_.a)(n),isNaN(E))return new Date(NaN);for(A=Object(M.a)(E,Object(w.a)(E)),$={},C=0;C0},set:function(t,e,n,r){var i,o,a=Object(C.a)(t,r);return n.isTwoDigitYear?(i=h(n.year,a),t.setUTCFullYear(i,0,1),t.setUTCHours(0,0,0,0),t):(o=a>0?n.year:1-n.year,t.setUTCFullYear(o,0,1),t.setUTCHours(0,0,0,0),t)}},Y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return d(4,t,i);case"Yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return d(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i,o,a=t.getUTCFullYear();return n.isTwoDigitYear?(i=h(n.year,a),t.setUTCFullYear(i,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),Object(O.a)(t,r)):(o=a>0?n.year:1-n.year,t.setUTCFullYear(o,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),Object(O.a)(t,r))}},R:{priority:130,parse:function(t,e,n,r){return f("R"===e?4:e.length,t)},set:function(t,e,n,r){var i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),Object(k.a)(i)}},u:{priority:130,parse:function(t,e,n,r){return f("u"===e?4:e.length,t)},set:function(t,e,n,r){return t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t}},Q:{priority:120,parse:function(t,e,n,r){switch(e){case"Q":case"QQ":return d(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t}},q:{priority:120,parse:function(t,e,n,r){switch(e){case"q":case"qq":return d(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t}},M:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"M":return u(A.month,t,i);case"MM":return d(2,t,i);case"Mo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t}},L:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"L":return u(A.month,t,i);case"LL":return d(2,t,i);case"Lo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t}},w:{priority:100,parse:function(t,e,n,r){switch(e){case"w":return u(A.week,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return d(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return Object(O.a)(o(t,n,r),r)}},I:{priority:100,parse:function(t,e,n,r){switch(e){case"I":return u(A.week,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return d(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return Object(k.a)(s(t,n,r),r)}},d:{priority:90,parse:function(t,e,n,r){switch(e){case"d":return u(A.date,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return d(e.length,t)}},validate:function(t,e,n){var r=t.getUTCFullYear(),i=m(r),o=t.getUTCMonth();return i?e>=1&&e<=I[o]:e>=1&&e<=D[o]},set:function(t,e,n,r){return t.setUTCDate(n),t.setUTCHours(0,0,0,0),t}},D:{priority:90,parse:function(t,e,n,r){switch(e){case"D":case"DD":return u(A.dayOfYear,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return d(e.length,t)}},validate:function(t,e,n){return m(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,n,r){return t.setUTCMonth(0,n),t.setUTCHours(0,0,0,0),t}},E:{priority:90,parse:function(t,e,n,r){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return t=i(t,n,r),t.setUTCHours(0,0,0,0),t}},e:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return d(e.length,t,i);case"eo":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return t=i(t,n,r),t.setUTCHours(0,0,0,0),t}},c:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return d(e.length,t,i);case"co":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return t=i(t,n,r),t.setUTCHours(0,0,0,0),t}},i:{priority:90,parse:function(t,e,n,r){var i=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return d(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiii":return n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiiii":return n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiii":default:return n.day(t,{width:"wide",context:"formatting",valueCallback:i})||n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i})}},validate:function(t,e,n){return e>=1&&e<=7},set:function(t,e,n,r){return t=a(t,n,r),t.setUTCHours(0,0,0,0),t}},a:{priority:80,parse:function(t,e,n,r){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,r){return t.setUTCHours(p(n),0,0,0),t}},b:{priority:80,parse:function(t,e,n,r){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,r){return t.setUTCHours(p(n),0,0,0),t}},B:{priority:80,parse:function(t,e,n,r){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,r){return t.setUTCHours(p(n),0,0,0),t}},h:{priority:70,parse:function(t,e,n,r){switch(e){case"h":return u(A.hour12h,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return d(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=12},set:function(t,e,n,r){var i=t.getUTCHours()>=12;return i&&n<12?t.setUTCHours(n+12,0,0,0):i||12!==n?t.setUTCHours(n,0,0,0):t.setUTCHours(0,0,0,0),t}},H:{priority:70,parse:function(t,e,n,r){switch(e){case"H":return u(A.hour23h,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return d(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=23},set:function(t,e,n,r){return t.setUTCHours(n,0,0,0),t}},K:{priority:70,parse:function(t,e,n,r){switch(e){case"K":return u(A.hour11h,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return d(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.getUTCHours()>=12&&n<12?t.setUTCHours(n+12,0,0,0):t.setUTCHours(n,0,0,0),t}},k:{priority:70,parse:function(t,e,n,r){switch(e){case"k":return u(A.hour24h,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return d(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=24},set:function(t,e,n,r){var i=n<=24?n%24:n;return t.setUTCHours(i,0,0,0),t}},m:{priority:60,parse:function(t,e,n,r){switch(e){case"m":return u(A.minute,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return d(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCMinutes(n,0,0),t}},s:{priority:50,parse:function(t,e,n,r){switch(e){case"s":return u(A.second,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return d(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCSeconds(n,0),t}},S:{priority:30,parse:function(t,e,n,r){var i=function(t){return Math.floor(t*Math.pow(10,3-e.length))};return d(e.length,t,i)},set:function(t,e,n,r){return t.setUTCMilliseconds(n),t}},X:{priority:10,parse:function(t,e,n,r){switch(e){case"X":return c($.basicOptionalMinutes,t);case"XX":return c($.basic,t);case"XXXX":return c($.basicOptionalSeconds,t);case"XXXXX":return c($.extendedOptionalSeconds,t);case"XXX":default:return c($.extended,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)}},x:{priority:10,parse:function(t,e,n,r){switch(e){case"x":return c($.basicOptionalMinutes,t);case"xx":return c($.basic,t);case"xxxx":return c($.basicOptionalSeconds,t);case"xxxxx":return c($.extendedOptionalSeconds,t);case"xxx":default:return c($.extended,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)}},t:{priority:40,parse:function(t,e,n,r){return l(t)},set:function(t,e,n,r){return[new Date(1e3*n),{timestampIsSet:!0}]}},T:{priority:20,parse:function(t,e,n,r){return l(t)},set:function(t,e,n,r){return[new Date(n),{timestampIsSet:!0}]}}},R=L,F=n(149),e.default=v,N=10,B=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,H=/^'(.*?)'?$/,z=/''/g,U=/\S/},function(t,e,n){"use strict";function r(t){n(332)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(150),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(348),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";function r(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var e=Object(i.a)(t);return e.setDate(1),e.setHours(0,0,0,0),e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var i=n(9)},function(t,e,n){"use strict";function r(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=Object(i.a)(e);return Object(o.default)(t,-n)}var i,o;Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,i=n(17),o=n(151)},function(t,e,n){"use strict";function r(t){var e;if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return e=Object(i.a)(t),e.getDate()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var i=n(9)},function(t,e,n){"use strict";function r(t){var e;if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return e=Object(i.a)(t),e.getDay()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var i=n(9)},function(t,e,n){"use strict";function r(t){var e;if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return e=Object(i.a)(t),e.getMonth()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var i=n(9)},function(t,e,n){"use strict";function r(t){var e;if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return e=Object(i.a)(t),e.getFullYear()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var i=n(9)},function(t,e,n){"use strict";function r(t,e){var n,r;if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return n=Object(i.a)(t),r=Object(i.a)(e),n.getTime()===r.getTime()}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var i=n(9)},function(t,e,n){"use strict";function r(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var e=Object(o.a)(t);return e.setHours(0,0,0,0),e}function i(t,e){var n,i;if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return n=r(t),i=r(e),n.getTime()===i.getTime()}Object.defineProperty(e,"__esModule",{value:!0});var o=n(9);e.default=i},function(t,e,n){"use strict";function r(t,e){var n,r;if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return n=Object(o.a)(t),r=Object(i.a)(e),n.setDate(r),n}var i,o;Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,i=n(17),o=n(9)},function(t,e,n){"use strict";function r(t,e){var n,r,s,u,c,l;if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return n=Object(o.a)(t),r=Object(i.a)(e),s=n.getFullYear(),u=n.getDate(),c=new Date(0),c.setFullYear(s,r,15),c.setHours(0,0,0,0),l=Object(a.default)(c),n.setMonth(r,Math.min(u,l)),n}var i,o,a;Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,i=n(17),o=n(9),a=n(96)},function(t,e,n){"use strict";function r(t,e){var n,r;if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return n=Object(o.a)(t),r=Object(i.a)(e),isNaN(n)?new Date(NaN):(n.setFullYear(r),n)}var i,o;Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,i=n(17),o=n(9)},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(152),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(345),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this;t.$createElement;return t._self._c,t._m(0)},i=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-icon",{staticClass:"md-icon-image"},[n("svg",{attrs:{height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}}),t._v(" "),n("path",{attrs:{d:"M0-.25h24v24H0z",fill:"none"}})])])}],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(153),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(347),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this;t.$createElement;return t._self._c,t._m(0)},i=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-icon",{staticClass:"md-icon-image"},[n("svg",{attrs:{height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}}),t._v(" "),n("path",{attrs:{d:"M0-.5h24v24H0z",fill:"none"}})])])}],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-popover",{attrs:{"md-settings":t.popperSettings,"md-active":""}},[n("transition",{attrs:{name:"md-datepicker-dialog",appear:""},on:{enter:t.setContentStyles,"after-leave":t.resetDate}},[n("div",{staticClass:"md-datepicker-dialog",class:[t.$mdActiveTheme]},[n("div",{staticClass:"md-datepicker-header"},[n("span",{staticClass:"md-datepicker-year-select",class:{"md-selected":"year"===t.currentView},on:{click:function(e){t.currentView="year"}}},[t._v(t._s(t.selectedYear))]),t._v(" "),n("div",{staticClass:"md-datepicker-date-select",class:{"md-selected":"year"!==t.currentView},on:{click:function(e){t.currentView="day"}}},[n("strong",{staticClass:"md-datepicker-dayname"},[t._v(t._s(t.shortDayName)+", ")]),t._v(" "),n("strong",{staticClass:"md-datepicker-monthname"},[t._v(t._s(t.shortMonthName))]),t._v(" "),n("strong",{staticClass:"md-datepicker-day"},[t._v(t._s(t.currentDay))])])]),t._v(" "),n("div",{staticClass:"md-datepicker-body"},[n("transition",{attrs:{name:"md-datepicker-body-header"}},["day"===t.currentView?n("div",{staticClass:"md-datepicker-body-header"},[n("md-button",{staticClass:"md-dense md-icon-button",on:{click:t.previousMonth}},[n("md-arrow-left-icon")],1),t._v(" "),n("md-button",{staticClass:"md-dense md-icon-button",on:{click:t.nextMonth}},[n("md-arrow-right-icon")],1)],1):t._e()]),t._v(" "),n("div",{staticClass:"md-datepicker-body-content",style:t.contentStyles},[n("transition",{attrs:{name:"md-datepicker-view"}},["day"===t.currentView?n("transition-group",{staticClass:"md-datepicker-panel md-datepicker-calendar",class:t.calendarClasses,attrs:{tag:"div",name:"md-datepicker-month"}},t._l([t.currentDate],(function(e){return n("div",{key:e.getMonth(),staticClass:"md-datepicker-panel md-datepicker-month"},[n("md-button",{staticClass:"md-dense md-datepicker-month-trigger",on:{click:function(e){t.currentView="month"}}},[t._v(t._s(t.currentMonthName)+" "+t._s(t.currentYear))]),t._v(" "),n("div",{staticClass:"md-datepicker-week"},[t._l(t.locale.shorterDays,(function(e,r){return r>=t.firstDayOfAWeek?n("span",{key:r},[t._v(t._s(e))]):t._e()})),t._v(" "),t._l(t.locale.shorterDays,(function(e,r){return r-1:t.model},on:{click:t.openPicker,blur:t.onBlur,change:function(e){var n,r,i=t.model,o=e.target,a=!!o.checked;Array.isArray(i)?(n=null,r=t._i(i,n),o.checked?r<0&&(t.model=i.concat([n])):r>-1&&(t.model=i.slice(0,r).concat(i.slice(r+1)))):t.model=a}}},"input",{disabled:t.disabled,required:t.required,placeholder:t.placeholder},!1)):"radio"==={disabled:t.disabled,required:t.required,placeholder:t.placeholder}.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"md-input",attrs:{readonly:"",type:"radio"},domProps:{checked:t._q(t.model,null)},on:{click:t.openPicker,blur:t.onBlur,change:function(e){t.model=null}}},"input",{disabled:t.disabled,required:t.required,placeholder:t.placeholder},!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"md-input",attrs:{readonly:"",type:{disabled:t.disabled,required:t.required,placeholder:t.placeholder}.type},domProps:{value:t.model},on:{click:t.openPicker,blur:t.onBlur,input:function(e){e.target.composing||(t.model=e.target.value)}}},"input",{disabled:t.disabled,required:t.required,placeholder:t.placeholder},!1)),t._v(" "),n("input",t._g(t._b({ref:"inputFile",attrs:{type:"file"},on:{change:t.onChange}},"input",t.attributes,!1),t.$listeners))],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(175),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(393),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement;return(t._self._c||e)("textarea",t._g(t._b({directives:[{name:"model",rawName:"v-model",value:t.model,expression:"model"}],staticClass:"md-textarea",style:t.textareaStyles,domProps:{value:t.model},on:{focus:t.onFocus,blur:t.onBlur,input:function(e){e.target.composing||(t.model=e.target.value)}}},"textarea",t.attributes,!1),t.listeners))},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(395),s=r(a),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default)}},function(t,e,n){"use strict";function r(t){n(396)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(176),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(0),u=null,c=!1,l=r,d=null,f=null,p=s(o.a,u,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(398),s=r(a),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default)}},function(t,e,n){"use strict";function r(t){n(399)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(177),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(400),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"md-image",class:[t.$mdActiveTheme]},[t._t("default")],2)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(402),e.default=function(t){}},function(t,e){},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(74),s=r(a),u=n(109),c=r(u),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default),t.component(c.default.name,c.default)}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c,l,d;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(107),s=r(a),u=n(108),c=r(u),l=n(405),d=r(l),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default),t.component(c.default.name,c.default),t.component(d.default.name,d.default)}},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(196),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(406),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement;return(t._self._c||e)("md-list-item",t._g(t._b({staticClass:"md-menu-item",class:[t.itemClasses,t.$mdActiveTheme],attrs:{disabled:t.disabled,tabindex:t.highlighted&&-1}},"md-list-item",t.$attrs,!1),t.listeners),[t._t("default")],2)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(408),s=r(a),u=n(411),c=r(u),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default),t.component(c.default.name,c.default)}},function(t,e,n){"use strict";function r(t){n(409)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(197),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(410),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"md-progress-bar",appear:""}},[n("div",{staticClass:"md-progress-bar",class:[t.progressClasses,t.$mdActiveTheme]},[n("div",{staticClass:"md-progress-bar-track",style:t.progressTrackStyle}),t._v(" "),n("div",{staticClass:"md-progress-bar-fill",style:t.progressValueStyle}),t._v(" "),n("div",{staticClass:"md-progress-bar-buffer",attrs:{Style:t.progressBufferStyle}})])])},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){n(412)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(198),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(413),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"md-progress-spinner",appear:""}},[n("div",{staticClass:"md-progress-spinner",class:[t.progressClasses,t.$mdActiveTheme]},[n("svg",{ref:"md-progress-spinner-draw",staticClass:"md-progress-spinner-draw",attrs:{preserveAspectRatio:"xMidYMid meet",focusable:"false",viewBox:"0 0 "+t.mdDiameter+" "+t.mdDiameter}},[n("circle",{ref:"md-progress-spinner-circle",staticClass:"md-progress-spinner-circle",attrs:{cx:"50%",cy:"50%",r:t.circleRadius}})])])])},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(415),s=r(a),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default)}},function(t,e,n){"use strict";function r(t){n(416)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(199),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(417),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"md-radio",class:[t.$mdActiveTheme,t.radioClasses]},[n("div",{staticClass:"md-radio-container",on:{click:function(e){return e.stopPropagation(),t.toggleCheck(e)}}},[n("md-ripple",{attrs:{"md-centered":"","md-active":t.rippleActive,"md-disabled":t.disabled},on:{"update:mdActive":function(e){t.rippleActive=e},"update:md-active":function(e){t.rippleActive=e}}},[n("input",t._b({attrs:{type:"radio"}},"input",{id:t.id,name:t.name,disabled:t.disabled,required:t.required,value:t.value,checked:t.isSelected},!1))])],1),t._v(" "),t.$slots.default?n("label",{staticClass:"md-radio-label",attrs:{for:t.id},on:{click:function(e){return e.preventDefault(),t.toggleCheck(e)}}},[t._t("default")],2):t._e()])},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(16),s=r(a),u=n(22),c=r(u),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default),t.component(c.default.name,c.default)}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(420),s=r(a),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default)}},function(t,e,n){"use strict";function r(t){n(421)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(200),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(425),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(201),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(423),s=n(0),u=!0,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(t,e){var n=e._c;return n("transition",{attrs:{name:"md-snackbar",appear:""}},[n("div",{staticClass:"md-snackbar",class:e.props.mdClasses},[n("div",{staticClass:"md-snackbar-content"},[e._t("default")],2)])])},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t,e,n){return new Promise((function(r){i={destroy:function(){i=null,r()}},t!==1/0&&(o=window.setTimeout((function(){a(),e||n._vnode.componentInstance.initDestroy(!0)}),t))}))}var i,o,a;Object.defineProperty(e,"__esModule",{value:!0}),i=null,o=null,a=e.destroySnackbar=function(){return new Promise((function(t){i?(window.clearTimeout(o),i.destroy(),window.setTimeout(t,400)):t()}))},e.createSnackbar=function(t,e,n){return i?a().then((function(){return r(t,e,n)})):r(t,e,n)}},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.mdPersistent&&t.mdDuration!==1/0?n("md-portal",[n("keep-alive",[t.mdActive?n("md-snackbar-content",{attrs:{"md-classes":[t.snackbarClasses,t.$mdActiveTheme]}},[t._t("default")],2):t._e()],1)],1):n("md-portal",[t.mdActive?n("md-snackbar-content",{attrs:{"md-classes":[t.snackbarClasses,t.$mdActiveTheme]}},[t._t("default")],2):t._e()],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c,l,d;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(427),s=r(a),u=n(430),c=r(u),l=n(433),d=r(l),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default),t.component(c.default.name,c.default),t.component(d.default.name,d.default)}},function(t,e,n){"use strict";function r(t){n(428)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(202),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(429),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"md-speed-dial",class:[t.$mdActiveTheme,t.speedDialClasses]},[t._t("default")],2)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){n(431)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(203),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(432),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement;return(t._self._c||e)("md-button",t._g(t._b({staticClass:"md-speed-dial-target md-fab",on:{click:t.handleClick}},"md-button",t.$attrs,!1),t.$listeners),[t._t("default")],2)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){n(434)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(204),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(435),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"md-speed-dial-content"},[t._t("default")],2)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(437),s=r(a),u=n(447),c=r(u),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default),t.component(c.default.name,c.default)}},function(t,e,n){"use strict";function r(t){n(438)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(205),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(446),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(208),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(440),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this;t.$createElement;return t._self._c,t._m(0)},i=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-icon",{staticClass:"md-icon-image"},[n("svg",{attrs:{height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),t._v(" "),n("path",{attrs:{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}})])])}],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(209),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(442),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this;t.$createElement;return t._self._c,t._m(0)},i=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-icon",{staticClass:"md-icon-image"},[n("svg",{attrs:{height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),t._v(" "),n("path",{attrs:{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}})])])}],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r,i,o,a,s,u,c,l,d,f;for(o in Object.defineProperty(e,"__esModule",{value:!0}),r=n(210),i=n.n(r),r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);a=n(444),s=n(0),u=!1,c=null,l=null,d=null,f=s(i.a,a.a,u,c,l,d),e.default=f.exports},function(t,e,n){"use strict";var r=function(){var t=this;t.$createElement;return t._self._c,t._m(0)},i=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-icon",{staticClass:"md-icon-image"},[n("svg",{attrs:{height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}}),t._v(" "),n("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])])}],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-button",t._g(t._b({staticClass:"md-stepper-header",class:t.classes,attrs:{disabled:t.shouldDisable},nativeOn:{click:function(e){!t.MdSteppers.syncRoute&&t.MdSteppers.setActiveStep(t.index)}}},"md-button",t.data.props,!1),t.data.events),[t.data.error?n("md-warning-icon",{staticClass:"md-stepper-icon"}):n("div",{staticClass:"md-stepper-number"},[t.data.done&&t.data.editable?n("md-edit-icon",{staticClass:"md-stepper-editable"}):t.data.done?n("md-check-icon",{staticClass:"md-stepper-done"}):[t._v(t._s(t.MdSteppers.getStepperNumber(t.index)))]],2),t._v(" "),n("div",{staticClass:"md-stepper-text"},[n("span",{staticClass:"md-stepper-label"},[t._v(t._s(t.data.label))]),t._v(" "),t.data.error?n("span",{staticClass:"md-stepper-error"},[t._v(t._s(t.data.error))]):t.data.description?n("span",{staticClass:"md-stepper-description"},[t._v(t._s(t.data.description))]):t._e()])],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"md-steppers",class:[t.steppersClasses,t.$mdActiveTheme]},[t.mdVertical?t._e():n("div",{staticClass:"md-steppers-navigation"},t._l(t.MdSteppers.items,(function(t,e){return n("md-step-header",{key:e,attrs:{index:e}})})),1),t._v(" "),n("div",{staticClass:"md-steppers-wrapper",style:t.contentStyles},[n("div",{staticClass:"md-steppers-container",style:t.containerStyles},[t._t("default")],2)])])},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){n(448)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(211),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(449),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"md-stepper"},[t.MdSteppers.isVertical?n("md-step-header",{attrs:{index:t.id}}):t._e(),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isActive,expression:"isActive"}],class:["md-stepper-content",{"md-active":t.isActive}],attrs:{tabindex:t.tabIndex}},[t._t("default")],2)],1)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(451),s=r(a),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default)}},function(t,e,n){"use strict";function r(t){n(452)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(212),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(453),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.insideList?n("li",{staticClass:"md-subheader",class:[t.$mdActiveTheme]},[t._t("default")],2):n("div",{staticClass:"md-subheader",class:[t.$mdActiveTheme]},[t._t("default")],2)},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(455),s=r(a),e.default=function(t){(0,o.default)(t),t.component(s.default.name,s.default)}},function(t,e,n){"use strict";function r(t){n(456)}var i,o,a,s,u,c,l,d,f,p;for(a in Object.defineProperty(e,"__esModule",{value:!0}),i=n(213),o=n.n(i),i)"default"!==a&&function(t){n.d(e,t,(function(){return i[t]}))}(a);s=n(457),u=n(0),c=!1,l=r,d=null,f=null,p=u(o.a,s.a,c,l,d,f),e.default=p.exports},function(t,e){},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"md-switch",class:[t.$mdActiveTheme,t.checkClasses]},[n("div",{staticClass:"md-switch-container",on:{click:function(e){return e.stopPropagation(),t.toggleCheck(e)}}},[n("div",{staticClass:"md-switch-thumb"},[n("md-ripple",{attrs:{"md-centered":"","md-active":t.rippleActive,"md-disabled":t.disabled},on:{"update:mdActive":function(e){t.rippleActive=e},"update:md-active":function(e){t.rippleActive=e}}},[n("input",t._b({attrs:{id:t.id,type:"checkbox"}},"input",{id:t.id,name:t.name,disabled:t.disabled,required:t.required,value:t.value},!1))])],1)]),t._v(" "),t.$slots.default?n("label",{staticClass:"md-switch-label",attrs:{for:t.id},on:{click:function(e){return e.preventDefault(),t.toggleCheck(e)}}},[t._t("default")],2):t._e()])},i=[],o={render:r,staticRenderFns:i};e.a=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i,o,a,s,u,c,l,d,f,p,h,m,v,g,y,b;Object.defineProperty(e,"__esModule",{value:!0}),i=n(3),o=r(i),a=n(459),s=r(a),u=n(480),c=r(u),l=n(483),d=r(l),f=n(221),p=r(f),h=n(101),m=r(h),v=n(486),g=r(v),y=n(489),b=r(y),e.default=function(t){(0,o.default)(t),t.component("MdTable",s.default),t.component(c.default.name,c.default),t.component(d.default.name,d.default),t.component(p.default.name,p.default),t.component(m.default.name,m.default),t.component(g.default.name,g.default),t.component(b.default.name,b.default)}},function(t,e,n){"use strict";function r(t,e){function n(t){var e=t.componentOptions;return e&&e.tag}var r=["md-table-toolbar","md-table-empty-state","md-table-pagination"],i=Array.from(t),o={};return i.forEach((function(t,e){if(t&&t.tag){var a=n(t);a&&r.includes(a)&&(t.data.slot=a,t.data.attrs=t.data.attrs||{},o[a]=function(){return t},i.splice(e,1))}})),{childNodes:i,slots:o}}var i,o,a;Object.defineProperty(e,"__esModule",{value:!0}),i=Object.assign||function(t){var e,n,r;for(e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},d=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(e.children||[]).map(m.bind(null,t)),o=Object.keys(e.attributes||{}).reduce((function(t,n){var r=e.attributes[n];switch(n){case"class":t["class"]=p(r);break;case"style":t["style"]=f(r);break;default:t.attrs[n]=r}return t}),{class:{},style:{},attrs:{}}),a=r.class,s=void 0===a?{}:a,u=r.style,d=void 0===u?{}:u,v=r.attrs,g=void 0===v?{}:v,y=l(r,["class","style","attrs"]);return"string"===typeof e?e:t(e.tag,c({class:h(o.class,s),style:c({},o.style,d),attrs:c({},o.attrs,g)},y,{props:n}),i)}var v=!1;try{v=!0}catch(x){}function g(){var t;!v&&console&&"function"===typeof console.error&&(t=console).error.apply(t,arguments)}function y(t,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?u({},t,e):{}}function b(t){var e,n=(e={"fa-spin":t.spin,"fa-spin-pulse":t.spinPulse,"fa-spin-reverse":t.spinReverse,"fa-pulse":t.pulse,"fa-beat":t.beat,"fa-fade":t.fade,"fa-flash":t.flash,"fa-fw":t.fixedWidth,"fa-border":t.border,"fa-li":t.listItem,"fa-inverse":t.inverse,"fa-flip-horizontal":"horizontal"===t.flip||"both"===t.flip,"fa-flip-vertical":"vertical"===t.flip||"both"===t.flip},u(e,"fa-"+t.size,null!==t.size),u(e,"fa-rotate-"+t.rotation,null!==t.rotation),u(e,"fa-pull-"+t.pull,null!==t.pull),u(e,"fa-swap-opacity",t.swapOpacity),e);return Object.keys(n).map((function(t){return n[t]?t:null})).filter((function(t){return t}))}function w(t,e){var n=0===(t||"").length?[]:[t];return n.concat(e).join(" ")}function _(t){return t&&"object"===("undefined"===typeof t?"undefined":s(t))&&t.prefix&&t.iconName&&t.icon?t:r["d"].icon?r["d"].icon(t):null===t?null:"object"===("undefined"===typeof t?"undefined":s(t))&&t.prefix&&t.iconName?t:Array.isArray(t)&&2===t.length?{prefix:t[0],iconName:t[1]}:"string"===typeof t?{prefix:"fas",iconName:t}:void 0}var M={name:"FontAwesomeIcon",functional:!0,props:{beat:{type:Boolean,default:!1},border:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flash:{type:Boolean,default:!1},flip:{type:String,default:null,validator:function(t){return["horizontal","vertical","both"].indexOf(t)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(t){return["right","left"].indexOf(t)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(t){return[90,180,270].indexOf(parseInt(t,10))>-1}},swapOpacity:{type:Boolean,default:!1},size:{type:String,default:null,validator:function(t){return["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(t)>-1}},spin:{type:Boolean,default:!1},spinPulse:{type:Boolean,default:!1},spinReverse:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null},inverse:{type:Boolean,default:!1}},render:function(t,e){var n=e.props,i=n.icon,o=n.mask,a=n.symbol,s=n.title,u=_(i),l=y("classes",b(n)),d=y("transform","string"===typeof n.transform?r["d"].transform(n.transform):n.transform),f=y("mask",_(o)),p=Object(r["b"])(u,c({},l,d,f,{symbol:a,title:s}));if(!p)return g("Could not find one or more icon(s)",u,f);var h=p.abstract,v=m.bind(null,t);return v(h[0],{},e.data)}};Boolean,Boolean}).call(this,n("c8ba"))},ad6d:function(t,e,n){"use strict";var r=n("825a");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},addb:function(t,e,n){var r=n("4dae"),i=Math.floor,o=function(t,e){var n=t.length,u=i(n/2);return n<8?a(t,e):s(t,o(r(t,0,u),e),o(r(t,u),e),e)},a=function(t,e){var n,r,i=t.length,o=1;while(o0)t[r]=t[--r];r!==o++&&(t[r]=n)}return t},s=function(t,e,n,r){var i=e.length,o=n.length,a=0,s=0;while(aC;C++)if((p||C in _)&&(y=_[C],b=M(y,C,w),t))if(e)O[C]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return C;case 2:c(O,y)}else switch(t){case 4:return!1;case 7:c(O,y)}return d?-1:i||l?l:O}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},bc3a:function(t,e,n){t.exports=n("cee4")},bee2:function(t,e,n){"use strict";function r(t,e){for(var n=0;n=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}})),a):a}},c401:function(t,e,n){"use strict";var r=n("c532"),i=n("2444");t.exports=function(t,e,n){var o=this||i;return r.forEach(n,(function(n){t=n.call(o,t,e)})),t}},c430:function(t,e){t.exports=!1},c532:function(t,e,n){"use strict";var r=n("1d2b"),i=Object.prototype.toString;function o(t){return"[object Array]"===i.call(t)}function a(t){return"undefined"===typeof t}function s(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"===typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function u(t){return"[object ArrayBuffer]"===i.call(t)}function c(t){return"undefined"!==typeof FormData&&t instanceof FormData}function l(t){var e;return e="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer,e}function d(t){return"string"===typeof t}function f(t){return"number"===typeof t}function p(t){return null!==t&&"object"===typeof t}function h(t){if("[object Object]"!==i.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function m(t){return"[object Date]"===i.call(t)}function v(t){return"[object File]"===i.call(t)}function g(t){return"[object Blob]"===i.call(t)}function y(t){return"[object Function]"===i.call(t)}function b(t){return p(t)&&y(t.pipe)}function w(t){return"undefined"!==typeof URLSearchParams&&t instanceof URLSearchParams}function _(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function M(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function x(t,e){if(null!==t&&"undefined"!==typeof t)if("object"!==typeof t&&(t=[t]),o(t))for(var n=0,r=t.length;nc)i(r,n=e[c++])&&(~a(l,n)||u(l,n));return l}},cc12:function(t,e,n){var r=n("da84"),i=n("861d"),o=r.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},cca6:function(t,e,n){var r=n("23e7"),i=n("60da");r({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},cdf9:function(t,e,n){var r=n("825a"),i=n("861d"),o=n("f069");t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t),a=n.resolve;return a(e),n.promise}},ce4e:function(t,e,n){var r=n("da84"),i=Object.defineProperty;t.exports=function(t,e){try{i(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},cee4:function(t,e,n){"use strict";var r=n("c532"),i=n("1d2b"),o=n("0a06"),a=n("4a7b"),s=n("2444");function u(t){var e=new o(t),n=i(o.prototype.request,e);return r.extend(n,o.prototype,e),r.extend(n,e),n.create=function(e){return u(a(t,e))},n}var c=u(s);c.Axios=o,c.Cancel=n("7a77"),c.CancelToken=n("8df4"),c.isCancel=n("2e67"),c.VERSION=n("5cce").version,c.all=function(t){return Promise.all(t)},c.spread=n("0df6"),c.isAxiosError=n("5f02"),t.exports=c,t.exports.default=c},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var r=n("da84"),i=n("1626"),o=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t]):r[t]&&r[t][e]}},d1e7:function(t,e,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);e.f=o?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},d2bb:function(t,e,n){var r=n("e330"),i=n("825a"),o=n("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(n,[]),e=n instanceof Array}catch(a){}return function(n,r){return i(n),o(r),e?t(n,r):n.__proto__=r,n}}():void 0)},d3b7:function(t,e,n){var r=n("00ee"),i=n("6eeb"),o=n("b041");r||i(Object.prototype,"toString",o,{unsafe:!0})},d44e:function(t,e,n){var r=n("9bf2").f,i=n("1a2d"),o=n("b622"),a=o("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!i(t,a)&&r(t,a,{configurable:!0,value:e})}},d4c3:function(t,e,n){var r=n("342f"),i=n("da84");t.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==i.Pebble},d4ec:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},d784:function(t,e,n){"use strict";n("ac1f");var r=n("e330"),i=n("6eeb"),o=n("9263"),a=n("d039"),s=n("b622"),u=n("9112"),c=s("species"),l=RegExp.prototype;t.exports=function(t,e,n,d){var f=s(t),p=!a((function(){var e={};return e[f]=function(){return 7},7!=""[t](e)})),h=p&&!a((function(){var e=!1,n=/a/;return"split"===t&&(n={},n.constructor={},n.constructor[c]=function(){return n},n.flags="",n[f]=/./[f]),n.exec=function(){return e=!0,null},n[f](""),!e}));if(!p||!h||n){var m=r(/./[f]),v=e(f,""[t],(function(t,e,n,i,a){var s=r(t),u=e.exec;return u===o||u===l.exec?p&&!a?{done:!0,value:m(e,n,i)}:{done:!0,value:s(n,e,i)}:{done:!1}}));i(String.prototype,t,v[0]),i(l,f,v[1])}d&&u(l[f],"sham",!0)}},d925:function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},d9b5:function(t,e,n){var r=n("da84"),i=n("d066"),o=n("1626"),a=n("3a9b"),s=n("fdbf"),u=r.Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return o(e)&&a(e.prototype,u(t))}},da84:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n("c8ba"))},dc4a:function(t,e,n){var r=n("59ed");t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},ddb0:function(t,e,n){var r=n("da84"),i=n("fdbc"),o=n("785a"),a=n("e260"),s=n("9112"),u=n("b622"),c=u("iterator"),l=u("toStringTag"),d=a.values,f=function(t,e){if(t){if(t[c]!==d)try{s(t,c,d)}catch(r){t[c]=d}if(t[l]||s(t,l,e),i[e])for(var n in a)if(t[n]!==a[n])try{s(t,n,a[n])}catch(r){t[n]=a[n]}}};for(var p in i)f(r[p]&&r[p].prototype,p);f(o,"DOMTokenList")},df75:function(t,e,n){var r=n("ca84"),i=n("7839");t.exports=Object.keys||function(t){return r(t,i)}},df7c:function(t,e,n){(function(t){function n(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t){"string"!==typeof t&&(t+="");var e,n=0,r=-1,i=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!i){n=e+1;break}}else-1===r&&(i=!1,r=e+1);return-1===r?"":t.slice(n,r)}function i(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!r;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!==typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,r="/"===a.charAt(0))}return e=n(i(e.split("/"),(function(t){return!!t})),!r).join("/"),(r?"/":"")+e||"."},e.normalize=function(t){var r=e.isAbsolute(t),a="/"===o(t,-1);return t=n(i(t.split("/"),(function(t){return!!t})),!r).join("/"),t||r||(t="."),t&&a&&(t+="/"),(r?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,(function(t,e){if("string"!==typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,n){function r(t){for(var e=0;e=0;n--)if(""!==t[n])break;return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var i=r(t.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u=1;--o)if(e=t.charCodeAt(o),47===e){if(!i){r=o;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":t.slice(0,r)},e.basename=function(t,e){var n=r(t);return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){"string"!==typeof t&&(t+="");for(var e=-1,n=0,r=-1,i=!0,o=0,a=t.length-1;a>=0;--a){var s=t.charCodeAt(a);if(47!==s)-1===r&&(i=!1,r=a+1),46===s?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){n=a+1;break}}return-1===e||-1===r||0===o||1===o&&e===r-1&&e===n+1?"":t.slice(e,r)};var o="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n("4362"))},e094:function(t,e,n){},e163:function(t,e,n){var r=n("da84"),i=n("1a2d"),o=n("1626"),a=n("7b0b"),s=n("f772"),u=n("e177"),c=s("IE_PROTO"),l=r.Object,d=l.prototype;t.exports=u?l.getPrototypeOf:function(t){var e=a(t);if(i(e,c))return e[c];var n=e.constructor;return o(n)&&e instanceof n?n.prototype:e instanceof l?d:null}},e177:function(t,e,n){var r=n("d039");t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},e260:function(t,e,n){"use strict";var r=n("fc6a"),i=n("44d2"),o=n("3f8c"),a=n("69f3"),s=n("9bf2").f,u=n("7dd0"),c=n("c430"),l=n("83ab"),d="Array Iterator",f=a.set,p=a.getterFor(d);t.exports=u(Array,"Array",(function(t,e){f(this,{type:d,target:r(t),index:0,kind:e})}),(function(){var t=p(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values");var h=o.Arguments=o.Array;if(i("keys"),i("values"),i("entries"),!c&&l&&"values"!==h.name)try{s(h,"name",{value:"values"})}catch(m){}},e2cc:function(t,e,n){var r=n("6eeb");t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},e330:function(t,e){var n=Function.prototype,r=n.bind,i=n.call,o=r&&r.bind(i,i);t.exports=r?function(t){return t&&o(t)}:function(t){return t&&function(){return i.apply(t,arguments)}}},e667:function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},e683:function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},e6cf:function(t,e,n){"use strict";var r,i,o,a,s=n("23e7"),u=n("c430"),c=n("da84"),l=n("d066"),d=n("c65b"),f=n("fea9"),p=n("6eeb"),h=n("e2cc"),m=n("d2bb"),v=n("d44e"),g=n("2626"),y=n("59ed"),b=n("1626"),w=n("861d"),_=n("19aa"),M=n("8925"),x=n("2266"),C=n("1c7e"),S=n("4840"),O=n("2cf4").set,T=n("b575"),k=n("cdf9"),P=n("44de"),j=n("f069"),E=n("e667"),A=n("01b4"),$=n("69f3"),D=n("94ca"),I=n("b622"),L=n("6069"),R=n("605d"),F=n("2d00"),N=I("species"),B="Promise",H=$.getterFor(B),z=$.set,U=$.getterFor(B),V=f&&f.prototype,q=f,W=V,Y=c.TypeError,G=c.document,X=c.process,K=j.f,Q=K,J=!!(G&&G.createEvent&&c.dispatchEvent),Z=b(c.PromiseRejectionEvent),tt="unhandledrejection",et="rejectionhandled",nt=0,rt=1,it=2,ot=1,at=2,st=!1,ut=D(B,(function(){var t=M(q),e=t!==String(q);if(!e&&66===F)return!0;if(u&&!W["finally"])return!0;if(F>=51&&/native code/.test(t))return!1;var n=new q((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))},i=n.constructor={};return i[N]=r,st=n.then((function(){}))instanceof r,!st||!e&&L&&!Z})),ct=ut||!C((function(t){q.all(t)["catch"]((function(){}))})),lt=function(t){var e;return!(!w(t)||!b(e=t.then))&&e},dt=function(t,e){var n,r,i,o=e.value,a=e.state==rt,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,l=t.domain;try{s?(a||(e.rejection===at&&vt(e),e.rejection=ot),!0===s?n=o:(l&&l.enter(),n=s(o),l&&(l.exit(),i=!0)),n===t.promise?c(Y("Promise-chain cycle")):(r=lt(n))?d(r,n,u,c):u(n)):c(o)}catch(f){l&&!i&&l.exit(),c(f)}},ft=function(t,e){t.notified||(t.notified=!0,T((function(){var n,r=t.reactions;while(n=r.get())dt(n,t);t.notified=!1,e&&!t.rejection&&ht(t)})))},pt=function(t,e,n){var r,i;J?(r=G.createEvent("Event"),r.promise=e,r.reason=n,r.initEvent(t,!1,!0),c.dispatchEvent(r)):r={promise:e,reason:n},!Z&&(i=c["on"+t])?i(r):t===tt&&P("Unhandled promise rejection",n)},ht=function(t){d(O,c,(function(){var e,n=t.facade,r=t.value,i=mt(t);if(i&&(e=E((function(){R?X.emit("unhandledRejection",r,n):pt(tt,n,r)})),t.rejection=R||mt(t)?at:ot,e.error))throw e.value}))},mt=function(t){return t.rejection!==ot&&!t.parent},vt=function(t){d(O,c,(function(){var e=t.facade;R?X.emit("rejectionHandled",e):pt(et,e,t.value)}))},gt=function(t,e,n){return function(r){t(e,r,n)}},yt=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=it,ft(t,!0))},bt=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw Y("Promise can't be resolved itself");var r=lt(e);r?T((function(){var n={done:!1};try{d(r,e,gt(bt,n,t),gt(yt,n,t))}catch(i){yt(n,i,t)}})):(t.value=e,t.state=rt,ft(t,!1))}catch(i){yt({done:!1},i,t)}}};if(ut&&(q=function(t){_(this,W),y(t),d(r,this);var e=H(this);try{t(gt(bt,e),gt(yt,e))}catch(n){yt(e,n)}},W=q.prototype,r=function(t){z(this,{type:B,done:!1,notified:!1,parent:!1,reactions:new A,rejection:!1,state:nt,value:void 0})},r.prototype=h(W,{then:function(t,e){var n=U(this),r=K(S(this,q));return n.parent=!0,r.ok=!b(t)||t,r.fail=b(e)&&e,r.domain=R?X.domain:void 0,n.state==nt?n.reactions.add(r):T((function(){dt(r,n)})),r.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r,e=H(t);this.promise=t,this.resolve=gt(bt,e),this.reject=gt(yt,e)},j.f=K=function(t){return t===q||t===o?new i(t):Q(t)},!u&&b(f)&&V!==Object.prototype)){a=V.then,st||(p(V,"then",(function(t,e){var n=this;return new q((function(t,e){d(a,n,t,e)})).then(t,e)}),{unsafe:!0}),p(V,"catch",W["catch"],{unsafe:!0}));try{delete V.constructor}catch(wt){}m&&m(V,W)}s({global:!0,wrap:!0,forced:ut},{Promise:q}),v(q,B,!1,!0),g(B),o=l(B),s({target:B,stat:!0,forced:ut},{reject:function(t){var e=K(this);return d(e.reject,void 0,t),e.promise}}),s({target:B,stat:!0,forced:u||ut},{resolve:function(t){return k(u&&this===o?q:this,t)}}),s({target:B,stat:!0,forced:ct},{all:function(t){var e=this,n=K(e),r=n.resolve,i=n.reject,o=E((function(){var n=y(e.resolve),o=[],a=0,s=1;x(t,(function(t){var u=a++,c=!1;s++,d(n,e,t).then((function(t){c||(c=!0,o[u]=t,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise},race:function(t){var e=this,n=K(e),r=n.reject,i=E((function(){var i=y(e.resolve);x(t,(function(t){d(i,e,t).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}})},e893:function(t,e,n){var r=n("1a2d"),i=n("56ef"),o=n("06cf"),a=n("9bf2");t.exports=function(t,e,n){for(var s=i(e),u=a.f,c=o.f,l=0;l-1;i--){var o=n[i],a=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(a)>-1&&(r=o)}return S.head.insertBefore(e,r),t}}var wt="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function _t(){var t=12,e="";while(t-- >0)e+=wt[62*Math.random()|0];return e}function Mt(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function xt(t){return Object.keys(t||{}).reduce((function(e,n){return e+"".concat(n,'="').concat(Mt(t[n]),'" ')}),"").trim()}function Ct(t){return Object.keys(t||{}).reduce((function(e,n){return e+"".concat(n,": ").concat(t[n],";")}),"")}function St(t){return t.size!==yt.size||t.x!==yt.x||t.y!==yt.y||t.rotate!==yt.rotate||t.flipX||t.flipY}function Ot(t){var e=t.transform,n=t.containerWidth,r=t.iconWidth,i={transform:"translate(".concat(n/2," 256)")},o="translate(".concat(32*e.x,", ").concat(32*e.y,") "),a="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),s="rotate(".concat(e.rotate," 0 0)"),u={transform:"".concat(o," ").concat(a," ").concat(s)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:u,path:c}}function Tt(t){var e=t.transform,n=t.width,r=void 0===n?j:n,i=t.height,o=void 0===i?j:i,a=t.startCentered,s=void 0!==a&&a,u="";return u+=s&&k?"translate(".concat(e.x/gt-r/2,"em, ").concat(e.y/gt-o/2,"em) "):s?"translate(calc(-50% + ".concat(e.x/gt,"em), calc(-50% + ").concat(e.y/gt,"em)) "):"translate(".concat(e.x/gt,"em, ").concat(e.y/gt,"em) "),u+="scale(".concat(e.size/gt*(e.flipX?-1:1),", ").concat(e.size/gt*(e.flipY?-1:1),") "),u+="rotate(".concat(e.rotate,"deg) "),u}var kt={x:0,y:0,width:"100%",height:"100%"};function Pt(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.attributes&&(t.attributes.fill||e)&&(t.attributes.fill="black"),t}function jt(t){return"g"===t.tag?t.children:[t]}function Et(t){var e=t.children,n=t.attributes,r=t.main,i=t.mask,o=t.maskId,a=t.transform,s=r.width,c=r.icon,l=i.width,d=i.icon,f=Ot({transform:a,containerWidth:l,iconWidth:s}),p={tag:"rect",attributes:u({},kt,{fill:"white"})},h=c.children?{children:c.children.map(Pt)}:{},m={tag:"g",attributes:u({},f.inner),children:[Pt(u({tag:c.tag,attributes:u({},c.attributes,f.path)},h))]},v={tag:"g",attributes:u({},f.outer),children:[m]},g="mask-".concat(o||_t()),y="clip-".concat(o||_t()),b={tag:"mask",attributes:u({},kt,{id:g,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[p,v]},w={tag:"defs",children:[{tag:"clipPath",attributes:{id:y},children:jt(d)},b]};return e.push(w,{tag:"rect",attributes:u({fill:"currentColor","clip-path":"url(#".concat(y,")"),mask:"url(#".concat(g,")")},kt)}),{children:e,attributes:n}}function At(t){var e=t.children,n=t.attributes,r=t.main,i=t.transform,o=t.styles,a=Ct(o);if(a.length>0&&(n["style"]=a),St(i)){var s=Ot({transform:i,containerWidth:r.width,iconWidth:r.width});e.push({tag:"g",attributes:u({},s.outer),children:[{tag:"g",attributes:u({},s.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:u({},r.icon.attributes,s.path)}]}]})}else e.push(r.icon);return{children:e,attributes:n}}function $t(t){var e=t.children,n=t.main,r=t.mask,i=t.attributes,o=t.styles,a=t.transform;if(St(a)&&n.found&&!r.found){var s=n.width,c=n.height,l={x:s/c/2,y:.5};i["style"]=Ct(u({},o,{"transform-origin":"".concat(l.x+a.x/16,"em ").concat(l.y+a.y/16,"em")}))}return[{tag:"svg",attributes:i,children:e}]}function Dt(t){var e=t.prefix,n=t.iconName,r=t.children,i=t.attributes,o=t.symbol,a=!0===o?"".concat(e,"-").concat(U.familyPrefix,"-").concat(n):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:u({},i,{id:a}),children:r}]}]}function It(t){var e=t.icons,n=e.main,r=e.mask,i=t.prefix,o=t.iconName,a=t.transform,s=t.symbol,c=t.title,l=t.maskId,d=t.titleId,f=t.extra,p=t.watchable,h=void 0!==p&&p,m=r.found?r:n,v=m.width,g=m.height,y="fak"===i,b=y?"":"fa-w-".concat(Math.ceil(v/g*16)),w=[U.replacementClass,o?"".concat(U.familyPrefix,"-").concat(o):"",b].filter((function(t){return-1===f.classes.indexOf(t)})).filter((function(t){return""!==t||!!t})).concat(f.classes).join(" "),_={children:[],attributes:u({},f.attributes,{"data-prefix":i,"data-icon":o,class:w,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(v," ").concat(g)})},M=y&&!~f.classes.indexOf("fa-fw")?{width:"".concat(v/g*16*.0625,"em")}:{};h&&(_.attributes[$]=""),c&&_.children.push({tag:"title",attributes:{id:_.attributes["aria-labelledby"]||"title-".concat(d||_t())},children:[c]});var x=u({},_,{prefix:i,iconName:o,main:n,mask:r,maskId:l,transform:a,symbol:s,styles:u({},M,f.styles)}),C=r.found&&n.found?Et(x):At(x),S=C.children,O=C.attributes;return x.children=S,x.attributes=O,s?Dt(x):$t(x)}function Lt(t){var e=t.content,n=t.width,r=t.height,i=t.transform,o=t.title,a=t.extra,s=t.watchable,c=void 0!==s&&s,l=u({},a.attributes,o?{title:o}:{},{class:a.classes.join(" ")});c&&(l[$]="");var d=u({},a.styles);St(i)&&(d["transform"]=Tt({transform:i,startCentered:!0,width:n,height:r}),d["-webkit-transform"]=d["transform"]);var f=Ct(d);f.length>0&&(l["style"]=f);var p=[];return p.push({tag:"span",attributes:l,children:[e]}),o&&p.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),p}var Rt=function(){},Ft=(U.measurePerformance&&O&&O.mark&&O.measure,function(t,e){return function(n,r,i,o){return t.call(e,n,r,i,o)}}),Nt=function(t,e,n,r){var i,o,a,s=Object.keys(t),u=s.length,c=void 0!==r?Ft(e,r):e;for(void 0===n?(i=1,a=t[s[0]]):(i=0,a=n);i2&&void 0!==arguments[2]?arguments[2]:{},r=n.skipHooks,i=void 0!==r&&r,o=Object.keys(e).reduce((function(t,n){var r=e[n],i=!!r.icon;return i?t[r.iconName]=r.icon:t[n]=r,t}),{});"function"!==typeof q.hooks.addPack||i?q.styles[t]=u({},q.styles[t]||{},o):q.hooks.addPack(t,o),"fas"===t&&Bt("fa",e)}var Ht=q.styles,zt=q.shims,Ut=function(){var t=function(t){return Nt(Ht,(function(e,n,r){return e[r]=Nt(n,t,{}),e}),{})};t((function(t,e,n){return e[3]&&(t[e[3]]=n),t})),t((function(t,e,n){var r=e[2];return t[n]=n,r.forEach((function(e){t[e]=n})),t}));var e="far"in Ht;Nt(zt,(function(t,n){var r=n[0],i=n[1],o=n[2];return"far"!==i||e||(i="fas"),t[r]={prefix:i,iconName:o},t}),{})};Ut();q.styles;function Vt(t,e,n){if(t&&t[e]&&t[e][n])return{prefix:e,iconName:n,icon:t[e][n]}}function qt(t){var e=t.tag,n=t.attributes,r=void 0===n?{}:n,i=t.children,o=void 0===i?[]:i;return"string"===typeof t?Mt(t):"<".concat(e," ").concat(xt(r),">").concat(o.map(qt).join(""),"")}var Wt=function(t){var e={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t?t.toLowerCase().split(" ").reduce((function(t,e){var n=e.toLowerCase().split("-"),r=n[0],i=n.slice(1).join("-");if(r&&"h"===i)return t.flipX=!0,t;if(r&&"v"===i)return t.flipY=!0,t;if(i=parseFloat(i),isNaN(i))return t;switch(r){case"grow":t.size=t.size+i;break;case"shrink":t.size=t.size-i;break;case"left":t.x=t.x-i;break;case"right":t.x=t.x+i;break;case"up":t.y=t.y-i;break;case"down":t.y=t.y+i;break;case"rotate":t.rotate=t.rotate+i;break}return t}),e):e};function Yt(t){this.name="MissingIcon",this.message=t||"Icon unavailable",this.stack=(new Error).stack}Yt.prototype=Object.create(Error.prototype),Yt.prototype.constructor=Yt;var Gt={fill:"currentColor"},Xt={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},Kt=(u({},Gt,{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}),u({},Xt,{attributeName:"opacity"}));u({},Gt,{cx:"256",cy:"364",r:"28"}),u({},Xt,{attributeName:"r",values:"28;14;28;28;14;28;"}),u({},Kt,{values:"1;0;1;1;0;1;"}),u({},Gt,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),u({},Kt,{values:"1;0;0;0;0;1;"}),u({},Gt,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),u({},Kt,{values:"0;0;1;1;0;0;"}),q.styles;function Qt(t){var e=t[0],n=t[1],r=t.slice(4),i=c(r,1),o=i[0],a=null;return a=Array.isArray(o)?{tag:"g",attributes:{class:"".concat(U.familyPrefix,"-").concat(L.GROUP)},children:[{tag:"path",attributes:{class:"".concat(U.familyPrefix,"-").concat(L.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(U.familyPrefix,"-").concat(L.PRIMARY),fill:"currentColor",d:o[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:e,height:n,icon:a}}q.styles;var Jt='svg:not(:root).svg-inline--fa {\n overflow: visible;\n}\n\n.svg-inline--fa {\n display: inline-block;\n font-size: inherit;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-border {\n height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n width: 2em;\n}\n.svg-inline--fa.fa-fw {\n width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: #ff253a;\n border-radius: 1em;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: #fff;\n height: 1.5em;\n line-height: 1;\n max-width: 5em;\n min-width: 1.5em;\n overflow: hidden;\n padding: 0.25em;\n right: 0;\n text-overflow: ellipsis;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: 0;\n right: 0;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: 0;\n left: 0;\n right: auto;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n right: 0;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: 0;\n right: auto;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-lg {\n font-size: 1.3333333333em;\n line-height: 0.75em;\n vertical-align: -0.0667em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: 2.5em;\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit;\n}\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: 0.1em;\n padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n float: left;\n}\n\n.fa-pull-right {\n float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n margin-left: 0.3em;\n}\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n -webkit-filter: none;\n filter: none;\n}\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: #fff;\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n clip: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n position: static;\n width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse {\n color: #fff;\n}';function Zt(){var t=E,e=A,n=U.familyPrefix,r=U.replacementClass,i=Jt;if(n!==t||r!==e){var o=new RegExp("\\.".concat(t,"\\-"),"g"),a=new RegExp("\\--".concat(t,"\\-"),"g"),s=new RegExp("\\.".concat(e),"g");i=i.replace(o,".".concat(n,"-")).replace(a,"--".concat(n,"-")).replace(s,".".concat(r))}return i}var te=function(){function t(){i(this,t),this.definitions={}}return a(t,[{key:"add",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=(e||{}).icon?e:re(e||{}),i=n.mask;return i&&(i=(i||{}).icon?i:re(i||{})),t(r,u({},n,{mask:i}))}}var oe=new te,ae=!1,se={transform:function(t){return Wt(t)}},ue=ie((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.transform,r=void 0===n?yt:n,i=e.symbol,o=void 0!==i&&i,a=e.mask,s=void 0===a?null:a,c=e.maskId,l=void 0===c?null:c,d=e.title,f=void 0===d?null:d,p=e.titleId,h=void 0===p?null:p,m=e.classes,v=void 0===m?[]:m,g=e.attributes,y=void 0===g?{}:g,b=e.styles,w=void 0===b?{}:b;if(t){var _=t.prefix,M=t.iconName,x=t.icon;return ne(u({type:"icon"},t),(function(){return ee(),U.autoA11y&&(f?y["aria-labelledby"]="".concat(U.replacementClass,"-title-").concat(h||_t()):(y["aria-hidden"]="true",y["focusable"]="false")),It({icons:{main:Qt(x),mask:s?Qt(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:_,iconName:M,transform:u({},yt,r),symbol:o,title:f,maskId:l,titleId:h,extra:{attributes:y,styles:w,classes:v}})}))}})),ce=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.transform,r=void 0===n?yt:n,i=e.title,o=void 0===i?null:i,a=e.classes,s=void 0===a?[]:a,c=e.attributes,d=void 0===c?{}:c,f=e.styles,p=void 0===f?{}:f;return ne({type:"text",content:t},(function(){return ee(),Lt({content:t,transform:u({},yt,r),title:o,extra:{attributes:d,styles:p,classes:["".concat(U.familyPrefix,"-layers-text")].concat(l(s))}})}))}}).call(this,n("c8ba"))},f069:function(t,e,n){"use strict";var r=n("59ed"),i=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new i(t)}},f2d1:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})); -/*! - * Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com - * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */ -var r={prefix:"fab",iconName:"github",icon:[496,512,[],"f09b","M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"]}},f36a:function(t,e,n){var r=n("e330");t.exports=r([].slice)},f5df:function(t,e,n){var r=n("da84"),i=n("00ee"),o=n("1626"),a=n("c6b6"),s=n("b622"),u=s("toStringTag"),c=r.Object,l="Arguments"==a(function(){return arguments}()),d=function(t,e){try{return t[e]}catch(n){}};t.exports=i?a:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=d(e=c(t),u))?n:l?a(e):"Object"==(r=a(e))&&o(e.callee)?"Arguments":r}},f6b4:function(t,e,n){"use strict";var r=n("c532");function i(){this.handlers=[]}i.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},f772:function(t,e,n){var r=n("5692"),i=n("90e3"),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},fc6a:function(t,e,n){var r=n("44ad"),i=n("1d80");t.exports=function(t){return r(i(t))}},fce3:function(t,e,n){var r=n("d039"),i=n("da84"),o=i.RegExp;t.exports=r((function(){var t=o(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},fdbc:function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},fdbf:function(t,e,n){var r=n("4930");t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fea9:function(t,e,n){var r=n("da84");t.exports=r.Promise}}]); \ No newline at end of file diff --git a/src/sample-golang-echo-app/resources/public/manifest.json b/src/sample-golang-echo-app/resources/public/manifest.json deleted file mode 100644 index 326d591953013f98c8652d5e31ce494aada0505c..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/public/manifest.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"vuejs-webapp-sample","short_name":"vuejs-webapp-sample","theme_color":"#4DBA87","icons":[{"src":"./img/icons/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"./img/icons/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"start_url":"./index.html","display":"standalone","background_color":"#000000"} \ No newline at end of file diff --git a/src/sample-golang-echo-app/resources/public/precache-manifest.58c5972fecd8f435b235873557cb99ac.js b/src/sample-golang-echo-app/resources/public/precache-manifest.58c5972fecd8f435b235873557cb99ac.js deleted file mode 100644 index f912e9b6569c84bf49f6bb6c60d5f947dc1e78cc..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/public/precache-manifest.58c5972fecd8f435b235873557cb99ac.js +++ /dev/null @@ -1,30 +0,0 @@ -self.__precacheManifest = (self.__precacheManifest || []).concat([ - { - "revision": "b62791d580c2471b5421", - "url": "/css/app.750b60b0.css" - }, - { - "revision": "cb107f742b7116a5ee37", - "url": "/css/chunk-vendors.533831d3.css" - }, - { - "revision": "6715c71a2c6c2a9951cd3d8e3a17d14f", - "url": "/index.html" - }, - { - "revision": "b62791d580c2471b5421", - "url": "/js/app.b3c19b4f.js" - }, - { - "revision": "cb107f742b7116a5ee37", - "url": "/js/chunk-vendors.2abeaede.js" - }, - { - "revision": "30a1780d264c79567fae09fac31b3072", - "url": "/manifest.json" - }, - { - "revision": "735ab4f94fbcd57074377afca324c813", - "url": "/robots.txt" - } -]); \ No newline at end of file diff --git a/src/sample-golang-echo-app/resources/public/robots.txt b/src/sample-golang-echo-app/resources/public/robots.txt deleted file mode 100644 index eb0536286f3081c6c0646817037faf5446e3547d..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/public/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -User-agent: * -Disallow: diff --git a/src/sample-golang-echo-app/resources/public/service-worker.js b/src/sample-golang-echo-app/resources/public/service-worker.js deleted file mode 100644 index 3d1af22740db97dc5c842579b1f750ef6e90b81f..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/resources/public/service-worker.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Welcome to your Workbox-powered service worker! - * - * You'll need to register this file in your web app and you should - * disable HTTP caching for this file too. - * See https://goo.gl/nhQhGp - * - * The rest of the code is auto-generated. Please don't update this file - * directly; instead, make changes to your Workbox build configuration - * and re-run your build process. - * See https://goo.gl/2aRDsh - */ - -importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); - -importScripts( - "/precache-manifest.58c5972fecd8f435b235873557cb99ac.js" -); - -workbox.core.setCacheNameDetails({prefix: "vuejs-webapp-sample"}); - -self.addEventListener('message', (event) => { - if (event.data && event.data.type === 'SKIP_WAITING') { - self.skipWaiting(); - } -}); - -workbox.core.clientsClaim(); - -/** - * The workboxSW.precacheAndRoute() method efficiently caches and responds to - * requests for URLs in the manifest. - * See https://goo.gl/S9QRab - */ -self.__precacheManifest = [].concat(self.__precacheManifest || []); -workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); - -workbox.routing.registerRoute(/\/api\/*/, new workbox.strategies.NetworkFirst({ "cacheName":"api","fetchOptions":{"mode":"cors"},"matchOptions":{"ignoreSearch":true}, plugins: [new workbox.expiration.Plugin({ maxAgeSeconds: 86400, purgeOnQuotaError: false })] }), 'GET'); diff --git a/src/sample-golang-echo-app/router/router.go b/src/sample-golang-echo-app/router/router.go deleted file mode 100644 index b75e7265660700164adf61e9334ed5ca17f0c57a..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/router/router.go +++ /dev/null @@ -1,98 +0,0 @@ -package router - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "github.com/labstack/echo/v4/middleware" - "github.com/ybkuroki/go-webapp-sample/config" - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/controller" - - echoSwagger "github.com/swaggo/echo-swagger" - _ "github.com/ybkuroki/go-webapp-sample/docs" // for using echo-swagger -) - -// Init initialize the routing of this application. -func Init(e *echo.Echo, container container.Container) { - setCORSConfig(e, container) - - setErrorController(e, container) - setBookController(e, container) - setCategoryController(e, container) - setFormatController(e, container) - setAccountController(e, container) - setHealthController(e, container) - - setSwagger(container, e) -} - -func setCORSConfig(e *echo.Echo, container container.Container) { - if container.GetConfig().Extension.CorsEnabled { - e.Use(middleware.CORSWithConfig(middleware.CORSConfig{ - AllowCredentials: true, - UnsafeWildcardOriginWithAllowCredentials: true, - AllowOrigins: []string{"*"}, - AllowHeaders: []string{ - echo.HeaderAccessControlAllowHeaders, - echo.HeaderContentType, - echo.HeaderContentLength, - echo.HeaderAcceptEncoding, - }, - AllowMethods: []string{ - http.MethodGet, - http.MethodPost, - http.MethodPut, - http.MethodDelete, - }, - MaxAge: 86400, - })) - } -} - -func setErrorController(e *echo.Echo, container container.Container) { - errorHandler := controller.NewErrorController(container) - e.HTTPErrorHandler = errorHandler.JSONError - e.Use(middleware.Recover()) -} - -func setBookController(e *echo.Echo, container container.Container) { - book := controller.NewBookController(container) - e.GET(config.APIBooksID, func(c echo.Context) error { return book.GetBook(c) }) - e.GET(config.APIBooks, func(c echo.Context) error { return book.GetBookList(c) }) - e.POST(config.APIBooks, func(c echo.Context) error { return book.CreateBook(c) }) - e.PUT(config.APIBooksID, func(c echo.Context) error { return book.UpdateBook(c) }) - e.DELETE(config.APIBooksID, func(c echo.Context) error { return book.DeleteBook(c) }) -} - -func setCategoryController(e *echo.Echo, container container.Container) { - category := controller.NewCategoryController(container) - e.GET(config.APICategories, func(c echo.Context) error { return category.GetCategoryList(c) }) -} - -func setFormatController(e *echo.Echo, container container.Container) { - format := controller.NewFormatController(container) - e.GET(config.APIFormats, func(c echo.Context) error { return format.GetFormatList(c) }) -} - -func setAccountController(e *echo.Echo, container container.Container) { - account := controller.NewAccountController(container) - e.GET(config.APIAccountLoginStatus, func(c echo.Context) error { return account.GetLoginStatus(c) }) - e.GET(config.APIAccountLoginAccount, func(c echo.Context) error { return account.GetLoginAccount(c) }) - - if container.GetConfig().Extension.SecurityEnabled { - e.POST(config.APIAccountLogin, func(c echo.Context) error { return account.Login(c) }) - e.POST(config.APIAccountLogout, func(c echo.Context) error { return account.Logout(c) }) - } -} - -func setHealthController(e *echo.Echo, container container.Container) { - health := controller.NewHealthController(container) - e.GET(config.APIHealth, func(c echo.Context) error { return health.GetHealthCheck(c) }) -} - -func setSwagger(container container.Container, e *echo.Echo) { - if container.GetConfig().Swagger.Enabled { - e.GET("/swagger/*", echoSwagger.WrapHandler) - } -} diff --git a/src/sample-golang-echo-app/service/account.go b/src/sample-golang-echo-app/service/account.go deleted file mode 100644 index 9a381419f2487f7279dfb02d13f19d338be445fe..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/service/account.go +++ /dev/null @@ -1,40 +0,0 @@ -package service - -import ( - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/model" - "golang.org/x/crypto/bcrypt" -) - -// AccountService is a service for managing user account. -type AccountService interface { - AuthenticateByUsernameAndPassword(username string, password string) (bool, *model.Account) -} - -type accountService struct { - container container.Container -} - -// NewAccountService is constructor. -func NewAccountService(container container.Container) AccountService { - return &accountService{container: container} -} - -// AuthenticateByUsernameAndPassword authenticates by using username and plain text password. -func (a *accountService) AuthenticateByUsernameAndPassword(username string, password string) (bool, *model.Account) { - rep := a.container.GetRepository() - logger := a.container.GetLogger() - account := model.Account{} - result, err := account.FindByName(rep, username) - if err != nil { - logger.GetZapLogger().Errorf(err.Error()) - return false, nil - } - - if err := bcrypt.CompareHashAndPassword([]byte(result.Password), []byte(password)); err != nil { - logger.GetZapLogger().Errorf(err.Error()) - return false, nil - } - - return true, result -} diff --git a/src/sample-golang-echo-app/service/account_test.go b/src/sample-golang-echo-app/service/account_test.go deleted file mode 100644 index 3f3d82507c1b4f52f06a753ac8cdb22cbb00170a..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/service/account_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package service - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/ybkuroki/go-webapp-sample/model" - "github.com/ybkuroki/go-webapp-sample/test" -) - -func TestAuthenticateByUsernameAndPassword_Success(t *testing.T) { - container := test.PrepareForServiceTest() - - service := NewAccountService(container) - result, account := service.AuthenticateByUsernameAndPassword("test", "test") - - a := model.Account{} - data, _ := a.FindByName(container.GetRepository(), "test") - - assert.Equal(t, data, account) - assert.True(t, result) -} - -func TestAuthenticateByUsernameAndPassword_EntityNotFound(t *testing.T) { - container := test.PrepareForServiceTest() - - service := NewAccountService(container) - result, account := service.AuthenticateByUsernameAndPassword("abcde", "abcde") - - assert.Nil(t, account) - assert.False(t, result) -} - -func TestAuthenticateByUsernameAndPassword_AuthenticationFailure(t *testing.T) { - container := test.PrepareForServiceTest() - - service := NewAccountService(container) - result, account := service.AuthenticateByUsernameAndPassword("test", "abcde") - - assert.Nil(t, account) - assert.False(t, result) -} diff --git a/src/sample-golang-echo-app/service/book.go b/src/sample-golang-echo-app/service/book.go deleted file mode 100644 index e1a8d5cf7a9e13ebe3de9e3fb7129a788489a102..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/service/book.go +++ /dev/null @@ -1,208 +0,0 @@ -package service - -import ( - "errors" - - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/model" - "github.com/ybkuroki/go-webapp-sample/model/dto" - "github.com/ybkuroki/go-webapp-sample/repository" - "github.com/ybkuroki/go-webapp-sample/util" -) - -// BookService is a service for managing books. -type BookService interface { - FindByID(id string) (*model.Book, error) - FindAllBooks() (*[]model.Book, error) - FindAllBooksByPage(page string, size string) (*model.Page, error) - FindBooksByTitle(title string, page string, size string) (*model.Page, error) - CreateBook(dto *dto.BookDto) (*model.Book, map[string]string) - UpdateBook(dto *dto.BookDto, id string) (*model.Book, map[string]string) - DeleteBook(id string) (*model.Book, map[string]string) -} - -type bookService struct { - container container.Container -} - -// NewBookService is constructor. -func NewBookService(container container.Container) BookService { - return &bookService{container: container} -} - -// FindByID returns one record matched book's id. -func (b *bookService) FindByID(id string) (*model.Book, error) { - if !util.IsNumeric(id) { - return nil, errors.New("failed to fetch data") - } - - rep := b.container.GetRepository() - book := model.Book{} - var result *model.Book - var err error - if result, err = book.FindByID(rep, util.ConvertToUint(id)).Take(); err != nil { - return nil, err - } - return result, nil -} - -// FindAllBooks returns the list of all books. -func (b *bookService) FindAllBooks() (*[]model.Book, error) { - rep := b.container.GetRepository() - book := model.Book{} - result, err := book.FindAll(rep) - if err != nil { - b.container.GetLogger().GetZapLogger().Errorf(err.Error()) - return nil, err - } - return result, nil -} - -// FindAllBooksByPage returns the page object of all books. -func (b *bookService) FindAllBooksByPage(page string, size string) (*model.Page, error) { - rep := b.container.GetRepository() - book := model.Book{} - result, err := book.FindAllByPage(rep, page, size) - if err != nil { - b.container.GetLogger().GetZapLogger().Errorf(err.Error()) - return nil, err - } - return result, nil -} - -// FindBooksByTitle returns the page object of books matched given book title. -func (b *bookService) FindBooksByTitle(title string, page string, size string) (*model.Page, error) { - rep := b.container.GetRepository() - book := model.Book{} - result, err := book.FindByTitle(rep, title, page, size) - if err != nil { - b.container.GetLogger().GetZapLogger().Errorf(err.Error()) - return nil, err - } - return result, nil -} - -// CreateBook register the given book data. -func (b *bookService) CreateBook(dto *dto.BookDto) (*model.Book, map[string]string) { - if errors := dto.Validate(); errors != nil { - return nil, errors - } - - rep := b.container.GetRepository() - var result *model.Book - var err error - - if trerr := rep.Transaction(func(txrep repository.Repository) error { - result, err = txCreateBook(txrep, dto) - return err - }); trerr != nil { - b.container.GetLogger().GetZapLogger().Errorf(trerr.Error()) - return nil, map[string]string{"error": "Failed to the registration"} - } - return result, nil -} - -func txCreateBook(txrep repository.Repository, dto *dto.BookDto) (*model.Book, error) { - var result *model.Book - var err error - book := dto.Create() - - category := model.Category{} - if book.Category, err = category.FindByID(txrep, dto.CategoryID).Take(); err != nil { - return nil, err - } - - format := model.Format{} - if book.Format, err = format.FindByID(txrep, dto.FormatID).Take(); err != nil { - return nil, err - } - - if result, err = book.Create(txrep); err != nil { - return nil, err - } - - return result, nil -} - -// UpdateBook updates the given book data. -func (b *bookService) UpdateBook(dto *dto.BookDto, id string) (*model.Book, map[string]string) { - if errors := dto.Validate(); errors != nil { - return nil, errors - } - - rep := b.container.GetRepository() - var result *model.Book - var err error - - if trerr := rep.Transaction(func(txrep repository.Repository) error { - result, err = txUpdateBook(txrep, dto, id) - return err - }); trerr != nil { - b.container.GetLogger().GetZapLogger().Errorf(trerr.Error()) - return nil, map[string]string{"error": "Failed to the update"} - } - return result, nil -} - -func txUpdateBook(txrep repository.Repository, dto *dto.BookDto, id string) (*model.Book, error) { - var book, result *model.Book - var err error - - b := model.Book{} - if book, err = b.FindByID(txrep, util.ConvertToUint(id)).Take(); err != nil { - return nil, err - } - - book.Title = dto.Title - book.Isbn = dto.Isbn - book.CategoryID = dto.CategoryID - book.FormatID = dto.FormatID - - category := model.Category{} - if book.Category, err = category.FindByID(txrep, dto.CategoryID).Take(); err != nil { - return nil, err - } - - format := model.Format{} - if book.Format, err = format.FindByID(txrep, dto.FormatID).Take(); err != nil { - return nil, err - } - - if result, err = book.Update(txrep); err != nil { - return nil, err - } - - return result, nil -} - -// DeleteBook deletes the given book data. -func (b *bookService) DeleteBook(id string) (*model.Book, map[string]string) { - rep := b.container.GetRepository() - var result *model.Book - var err error - - if trerr := rep.Transaction(func(txrep repository.Repository) error { - result, err = txDeleteBook(txrep, id) - return err - }); trerr != nil { - b.container.GetLogger().GetZapLogger().Errorf(trerr.Error()) - return nil, map[string]string{"error": "Failed to the delete"} - } - return result, nil -} - -func txDeleteBook(txrep repository.Repository, id string) (*model.Book, error) { - var book, result *model.Book - var err error - - b := model.Book{} - if book, err = b.FindByID(txrep, util.ConvertToUint(id)).Take(); err != nil { - return nil, err - } - - if result, err = book.Delete(txrep); err != nil { - return nil, err - } - - return result, nil -} diff --git a/src/sample-golang-echo-app/service/book_test.go b/src/sample-golang-echo-app/service/book_test.go deleted file mode 100644 index ba519eb8dc0b6b0ed81b935e378c13a856f92f76..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/service/book_test.go +++ /dev/null @@ -1,270 +0,0 @@ -package service - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/model" - "github.com/ybkuroki/go-webapp-sample/model/dto" - "github.com/ybkuroki/go-webapp-sample/test" -) - -func TestFindByID_Success(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - service := NewBookService(container) - result, err := service.FindByID("1") - - assert.Equal(t, uint(1), result.ID) - assert.NoError(t, err) - assert.NotEmpty(t, result) -} - -func TestFindByID_IdNotNumeric(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - service := NewBookService(container) - result, err := service.FindByID("ABCD") - - assert.Nil(t, result) - assert.Error(t, err, "failed to fetch data") -} - -func TestFindByID_EntityNotFound(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - service := NewBookService(container) - result, err := service.FindByID("9999") - - assert.Nil(t, result) - assert.Error(t, err, "failed to fetch data") -} - -func TestFindAllBooks_Success(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - service := NewBookService(container) - result, err := service.FindAllBooks() - - assert.Len(t, *result, 2) - assert.NoError(t, err) -} - -func TestFindAllBooksByPage_Success(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - service := NewBookService(container) - result, err := service.FindAllBooksByPage("0", "5") - - assert.Equal(t, 2, result.TotalElements) - assert.Equal(t, 1, result.TotalPages) - assert.Equal(t, 0, result.Page) - assert.Equal(t, 5, result.Size) - assert.Len(t, *result.Content, 2) - assert.NoError(t, err) -} - -func TestFindBooksByTitle_Success(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - service := NewBookService(container) - result, err := service.FindBooksByTitle("1", "0", "5") - - assert.Equal(t, 1, result.TotalElements) - assert.Equal(t, 1, result.TotalPages) - assert.Equal(t, 0, result.Page) - assert.Equal(t, 5, result.Size) - assert.Len(t, *result.Content, 1) - assert.NoError(t, err) -} - -func TestCreateBook_Success(t *testing.T) { - container := test.PrepareForServiceTest() - - service := NewBookService(container) - result, err := service.CreateBook(createBookForCreate()) - - entity := &model.Book{} - data, _ := entity.FindByID(container.GetRepository(), 1).Take() - - assert.Equal(t, data, result) - assert.Empty(t, err) -} - -func TestCreateBook_ValidationError(t *testing.T) { - container := test.PrepareForServiceTest() - - service := NewBookService(container) - result, err := service.CreateBook(createBookForValidationError()) - - assert.Nil(t, result) - assert.NotEmpty(t, err) -} - -func TestCreateBook_NotCategory(t *testing.T) { - container := test.PrepareForServiceTest() - - service := NewBookService(container) - result, err := service.CreateBook(createBookForNotCategory()) - - assert.Nil(t, result) - assert.Equal(t, "Failed to the registration", err["error"]) -} - -func TestCreateBook_NotFormat(t *testing.T) { - container := test.PrepareForServiceTest() - - service := NewBookService(container) - result, err := service.CreateBook(createBookForNotFormat()) - - assert.Nil(t, result) - assert.Equal(t, "Failed to the registration", err["error"]) -} - -func TestUpdateBook_Success(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - service := NewBookService(container) - result, err := service.UpdateBook(createBookForCreate(), "1") - - entity := &model.Book{} - data, _ := entity.FindByID(container.GetRepository(), 1).Take() - - assert.Equal(t, data, result) - assert.Empty(t, err) -} - -func TestUpdateBook_ValidationError(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - service := NewBookService(container) - result, err := service.UpdateBook(createBookForValidationError(), "1") - - assert.Nil(t, result) - assert.NotEmpty(t, err) -} - -func TestUpdateBook_NotEntity(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - service := NewBookService(container) - result, err := service.UpdateBook(createBookForNotCategory(), "99") - - assert.Nil(t, result) - assert.Equal(t, "Failed to the update", err["error"]) -} - -func TestUpdateBook_NotCategory(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - service := NewBookService(container) - result, err := service.UpdateBook(createBookForNotCategory(), "1") - - assert.Nil(t, result) - assert.Equal(t, "Failed to the update", err["error"]) -} - -func TestUpdateBook_NotFormat(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - service := NewBookService(container) - result, err := service.UpdateBook(createBookForNotFormat(), "1") - - assert.Nil(t, result) - assert.Equal(t, "Failed to the update", err["error"]) -} - -func TestDeleteBook_Success(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - entity := &model.Book{} - data, _ := entity.FindByID(container.GetRepository(), 1).Take() - - service := NewBookService(container) - result, err := service.DeleteBook("1") - - assert.Equal(t, data, result) - assert.Empty(t, err) -} - -func TestDeleteBook_Error(t *testing.T) { - container := test.PrepareForServiceTest() - - setUpTestData(container) - - service := NewBookService(container) - result, err := service.DeleteBook("99") - - assert.Nil(t, result) - assert.Equal(t, "Failed to the delete", err["error"]) -} - -func setUpTestData(container container.Container) { - entity := model.NewBook("Test1", "123-123-123-1", 1, 1) - repo := container.GetRepository() - _, _ = entity.Create(repo) - - entity = model.NewBook("Test2", "123-123-123-2", 2, 2) - _, _ = entity.Create(repo) -} - -func createBookForCreate() *dto.BookDto { - return &dto.BookDto{ - Title: "Test1", - Isbn: "123-123-123-1", - CategoryID: 1, - FormatID: 1, - } -} - -func createBookForValidationError() *dto.BookDto { - return &dto.BookDto{ - Title: "T", - Isbn: "1", - CategoryID: 1, - FormatID: 1, - } -} - -func createBookForNotCategory() *dto.BookDto { - return &dto.BookDto{ - Title: "Test1", - Isbn: "123-123-123-1", - CategoryID: 99, - FormatID: 1, - } -} - -func createBookForNotFormat() *dto.BookDto { - return &dto.BookDto{ - Title: "Test1", - Isbn: "123-123-123-1", - CategoryID: 1, - FormatID: 99, - } -} diff --git a/src/sample-golang-echo-app/service/category.go b/src/sample-golang-echo-app/service/category.go deleted file mode 100644 index 66e30236d4f6ae6d5363b8c512aec0d1ccadfb56..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/service/category.go +++ /dev/null @@ -1,32 +0,0 @@ -package service - -import ( - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/model" -) - -// CategoryService is a service for managing master data such as format and category. -type CategoryService interface { - FindAllCategories() *[]model.Category -} - -type categoryService struct { - container container.Container -} - -// NewCategoryService is constructor. -func NewCategoryService(container container.Container) CategoryService { - return &categoryService{container: container} -} - -// FindAllCategories returns the list of all categories. -func (m *categoryService) FindAllCategories() *[]model.Category { - rep := m.container.GetRepository() - category := model.Category{} - result, err := category.FindAll(rep) - if err != nil { - m.container.GetLogger().GetZapLogger().Errorf(err.Error()) - return nil - } - return result -} diff --git a/src/sample-golang-echo-app/service/category_test.go b/src/sample-golang-echo-app/service/category_test.go deleted file mode 100644 index dbb6645320f54d7679e17d8fb53b4a9db7843dd0..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/service/category_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package service - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/ybkuroki/go-webapp-sample/test" -) - -func TestFindAllCategories_Success(t *testing.T) { - container := test.PrepareForServiceTest() - - service := NewCategoryService(container) - result := service.FindAllCategories() - - assert.Len(t, *result, 3) -} diff --git a/src/sample-golang-echo-app/service/format.go b/src/sample-golang-echo-app/service/format.go deleted file mode 100644 index 1c31498467bab327a14db1dada5be373e3ed01c9..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/service/format.go +++ /dev/null @@ -1,32 +0,0 @@ -package service - -import ( - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/model" -) - -// FormatService is a service for managing master data such as format and category. -type FormatService interface { - FindAllFormats() *[]model.Format -} - -type formatService struct { - container container.Container -} - -// NewFormatService is constructor. -func NewFormatService(container container.Container) FormatService { - return &formatService{container: container} -} - -// FindAllFormats returns the list of all formats. -func (m *formatService) FindAllFormats() *[]model.Format { - rep := m.container.GetRepository() - format := model.Format{} - result, err := format.FindAll(rep) - if err != nil { - m.container.GetLogger().GetZapLogger().Errorf(err.Error()) - return nil - } - return result -} diff --git a/src/sample-golang-echo-app/service/format_test.go b/src/sample-golang-echo-app/service/format_test.go deleted file mode 100644 index 37110d705301d9ce1b9f47e3115173768f2dfd0c..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/service/format_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package service - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/ybkuroki/go-webapp-sample/test" -) - -func TestFindAllFormats_Success(t *testing.T) { - container := test.PrepareForServiceTest() - - service := NewFormatService(container) - result := service.FindAllFormats() - - assert.Len(t, *result, 2) -} diff --git a/src/sample-golang-echo-app/session/session.go b/src/sample-golang-echo-app/session/session.go deleted file mode 100644 index ec5a0f5ec9c501f4badd260107eb6b75318c49d8..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/session/session.go +++ /dev/null @@ -1,118 +0,0 @@ -package session - -import ( - "encoding/json" - "net/http" - - "github.com/gorilla/sessions" - echoSession "github.com/labstack/echo-contrib/session" - "github.com/labstack/echo/v4" - "github.com/ybkuroki/go-webapp-sample/model" -) - -const ( - // sessionStr represents a string of session key. - sessionStr = "GSESSION" - // Account is the key of account data in the session. - Account = "Account" -) - -type session struct { - context echo.Context -} - -// Session represents a interface for accessing the session on the application. -type Session interface { - SetContext(c echo.Context) - Get() *sessions.Session - Save() error - Delete() error - SetValue(key string, value interface{}) error - GetValue(key string) string - SetAccount(account *model.Account) error - GetAccount() *model.Account -} - -// NewSession is constructor. -func NewSession() Session { - return &session{context: nil} -} - -// SetContext sets the context of echo framework to the session. -func (s *session) SetContext(c echo.Context) { - s.context = c -} - -// Get returns a session for the current request. -func (s *session) Get() *sessions.Session { - sess, _ := echoSession.Get(sessionStr, s.context) - return sess -} - -// Save saves the current session. -func (s *session) Save() error { - sess := s.Get() - sess.Options = &sessions.Options{ - Path: "/", - HttpOnly: true, - } - return s.saveSession(sess) -} - -// Delete the current session. -func (s *session) Delete() error { - sess := s.Get() - sess.Options = &sessions.Options{ - Path: "/", - HttpOnly: true, - MaxAge: -1, - } - return s.saveSession(sess) -} - -func (s *session) saveSession(sess *sessions.Session) error { - if err := sess.Save(s.context.Request(), s.context.Response()); err != nil { - return s.context.NoContent(http.StatusInternalServerError) - } - return nil -} - -// SetValue sets a key and a value. -func (s *session) SetValue(key string, value interface{}) error { - sess := s.Get() - bytes, err := json.Marshal(value) - if err != nil { - return s.context.NoContent(http.StatusInternalServerError) - } - sess.Values[key] = string(bytes) - return nil -} - -// GetValue returns value of session. -func (s *session) GetValue(key string) string { - sess := s.Get() - if sess != nil { - if v, ok := sess.Values[key]; ok { - data, result := v.(string) - if result && data != "null" { - return data - } - } - } - return "" -} - -// SetAccount sets account data in session. -func (s *session) SetAccount(account *model.Account) error { - return s.SetValue(Account, account) -} - -// GetAccount returns account object of session. -func (s *session) GetAccount() *model.Account { - if v := s.GetValue(Account); v != "" { - a := &model.Account{} - _ = json.Unmarshal([]byte(v), a) - return a - } - return nil -} diff --git a/src/sample-golang-echo-app/test/unittest_util.go b/src/sample-golang-echo-app/test/unittest_util.go deleted file mode 100644 index b3eaa6e2a3343392f48173eb3009d804253ff42f..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/test/unittest_util.go +++ /dev/null @@ -1,158 +0,0 @@ -package test - -import ( - "encoding/json" - "fmt" - "net/http" - "net/http/httptest" - "strings" - - "github.com/labstack/echo/v4" - "github.com/ybkuroki/go-webapp-sample/config" - "github.com/ybkuroki/go-webapp-sample/container" - "github.com/ybkuroki/go-webapp-sample/logger" - "github.com/ybkuroki/go-webapp-sample/middleware" - "github.com/ybkuroki/go-webapp-sample/migration" - "github.com/ybkuroki/go-webapp-sample/repository" - "github.com/ybkuroki/go-webapp-sample/session" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - "go.uber.org/zap/zaptest/observer" -) - -// PrepareForControllerTest func prepares the controllers for testing. -func PrepareForControllerTest(isSecurity bool) (*echo.Echo, container.Container) { - e := echo.New() - - conf := createConfig(isSecurity) - logger := initTestLogger() - container := initContainer(conf, logger) - - middleware.InitLoggerMiddleware(e, container) - - migration.CreateDatabase(container) - migration.InitMasterData(container) - - middleware.InitSessionMiddleware(e, container) - return e, container -} - -// PrepareForServiceTest func prepares the services for testing. -func PrepareForServiceTest() container.Container { - conf := createConfig(false) - logger := initTestLogger() - container := initContainer(conf, logger) - - migration.CreateDatabase(container) - migration.InitMasterData(container) - - return container -} - -// PrepareForLoggerTest func prepares the loggers for testing. -func PrepareForLoggerTest() (*echo.Echo, container.Container, *observer.ObservedLogs) { - e := echo.New() - - conf := createConfig(false) - logger, observedLogs := initObservedLogger() - container := initContainer(conf, logger) - - migration.CreateDatabase(container) - migration.InitMasterData(container) - - middleware.InitSessionMiddleware(e, container) - middleware.InitLoggerMiddleware(e, container) - return e, container, observedLogs -} - -func createConfig(isSecurity bool) *config.Config { - conf := &config.Config{} - conf.Database.Dialect = "sqlite3" - conf.Database.Host = "file::memory:?cache=shared" - conf.Database.Migration = true - conf.Extension.MasterGenerator = true - conf.Extension.SecurityEnabled = isSecurity - conf.Log.RequestLogFormat = "${remote_ip} ${account_name} ${uri} ${method} ${status}" - return conf -} - -func initContainer(conf *config.Config, logger logger.Logger) container.Container { - rep := repository.NewBookRepository(logger, conf) - sess := session.NewSession() - messages := map[string]string{ - "ValidationErrMessageBookTitle": "Please enter the title with 3 to 50 characters.", - "ValidationErrMessageBookISBN": "Please enter the ISBN with 10 to 20 characters."} - container := container.NewContainer(rep, sess, conf, messages, logger, "test") - return container -} - -func initTestLogger() logger.Logger { - myConfig := createLoggerConfig() - zap, err := myConfig.Build() - if err != nil { - fmt.Printf("Error") - } - sugar := zap.Sugar() - // set package varriable logger. - logger := logger.NewLogger(sugar) - logger.GetZapLogger().Infof("Success to read zap logger configuration") - _ = zap.Sync() - return logger -} - -func initObservedLogger() (logger.Logger, *observer.ObservedLogs) { - observedZapCore, observedLogs := observer.New(zap.DebugLevel) - sugar := zap.New(observedZapCore).Sugar() - - // set package varriable logger. - logger := logger.NewLogger(sugar) - return logger, observedLogs -} - -func createLoggerConfig() zap.Config { - level := zap.NewAtomicLevel() - level.SetLevel(zapcore.DebugLevel) - - return zap.Config{ - Level: level, - Encoding: "console", - Development: true, - EncoderConfig: zapcore.EncoderConfig{ - TimeKey: "Time", - LevelKey: "Level", - NameKey: "Name", - CallerKey: "Caller", - MessageKey: "Msg", - StacktraceKey: "St", - EncodeLevel: zapcore.CapitalLevelEncoder, - EncodeTime: zapcore.ISO8601TimeEncoder, - EncodeDuration: zapcore.StringDurationEncoder, - EncodeCaller: zapcore.ShortCallerEncoder, - }, - OutputPaths: []string{"stdout"}, - ErrorOutputPaths: []string{"stderr"}, - } -} - -// ConvertToString func converts model to string. -func ConvertToString(model interface{}) string { - bytes, _ := json.Marshal(model) - return string(bytes) -} - -// NewJSONRequest func creates a new request using JSON format. -func NewJSONRequest(method string, target string, param interface{}) *http.Request { - req := httptest.NewRequest(method, target, strings.NewReader(ConvertToString(param))) - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Accept", "application/json") - return req -} - -// GetCookie func gets a cookie from a HTTP request. -func GetCookie(rec *httptest.ResponseRecorder, cookieName string) string { - parser := &http.Request{Header: http.Header{"Cookie": rec.Header()["Set-Cookie"]}} - if cookie, err := parser.Cookie(cookieName); cookie != nil && err == nil { - return cookie.Value - } - return "" -} diff --git a/src/sample-golang-echo-app/util/props.go b/src/sample-golang-echo-app/util/props.go deleted file mode 100644 index 70fb420d04eb39a458c701cdc78049f18d79bf3c..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/util/props.go +++ /dev/null @@ -1,60 +0,0 @@ -package util - -import ( - "bufio" - "embed" - "strings" -) - -const ( - // CommentChar represents that the line is the comment line. - CommentChar = "#" - // EqualsChar represents that the equals symbol. - EqualsChar = "=" -) - -// ReadPropertiesFile reads a properties file and it returns a map has the keys and values in the file. -func ReadPropertiesFile(fs embed.FS, fileName string) map[string]string { - config := make(map[string]string) - - file, err := fs.Open(fileName) - if err != nil { - return nil - } - defer file.Close() - - scanner := bufio.NewScanner(file) - for scanner.Scan() { - line := scanner.Text() - if !isCommentLine(line) && hasProperty(line) { - setPorperty(line, config) - } - } - if err := scanner.Err(); err != nil { - return nil - } - - return config -} - -// isCommentLine judge whether a given line is a comment line or not. -func isCommentLine(line string) bool { - return strings.HasPrefix(line, CommentChar) -} - -// hasProperty judge whether a given line has a property: a key and value or not. -func hasProperty(line string) bool { - return strings.Contains(line, EqualsChar) -} - -// setProperty sets the key and value in a properties file to the given map. -func setPorperty(line string, config map[string]string) { - equal := strings.Index(line, EqualsChar) - if key := strings.TrimSpace(line[:equal]); len(key) > 0 { - value := "" - if len(line) > equal { - value = strings.TrimSpace(line[equal+1:]) - } - config[key] = value - } -} diff --git a/src/sample-golang-echo-app/util/props_test.go b/src/sample-golang-echo-app/util/props_test.go deleted file mode 100644 index dc03424bd99fd75f9879bac728e44b84a802fa7d..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/util/props_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package util - -import ( - "embed" - "testing" - - "github.com/stretchr/testify/assert" -) - -//go:embed test.properties -var testPropsFile embed.FS - -func TestReadPropertiesFile_FileExists(t *testing.T) { - messages := ReadPropertiesFile(testPropsFile, "test.properties") - - assert.Equal(t, "testtest", messages["props1"]) - assert.Equal(t, "test test", messages["props2"]) - assert.Equal(t, "", messages["props3"]) - - _, ok := messages["props4"] - assert.Equal(t, false, ok) - - assert.Equal(t, "test #test", messages["props5"]) - - _, ok = messages["# comment line"] - assert.Equal(t, false, ok) -} - -func TestReadPropertiesFile_FileIsNil(t *testing.T) { - messages := ReadPropertiesFile(testPropsFile, "testnil.properties") - assert.Equal(t, map[string]string(nil), messages) -} diff --git a/src/sample-golang-echo-app/util/request_builder.go b/src/sample-golang-echo-app/util/request_builder.go deleted file mode 100644 index 2616307fe9ed2511f145ac228e93c5b711e175ab..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/util/request_builder.go +++ /dev/null @@ -1,90 +0,0 @@ -package util - -import "strings" - -// RequestBuilder builds request URL. -type RequestBuilder interface { - URL(url string) RequestBuilder - PathParams(value string) RequestBuilder - RequestParams(name string, value string) RequestBuilder - Build() RequestURL -} - -type requestBuilder struct { - url string - pathParams []string - requestParams map[string]string -} - -// NewRequestBuilder is constructor. -func NewRequestBuilder() RequestBuilder { - return &requestBuilder{url: "", pathParams: nil, requestParams: make(map[string]string)} -} - -// URL sets request base url. -func (b *requestBuilder) URL(url string) RequestBuilder { - b.url = url - return b -} - -// PathParams set a path parameter of the url. -func (b *requestBuilder) PathParams(value string) RequestBuilder { - b.pathParams = append(b.pathParams, value) - return b -} - -// RequestParams set a request parameter of the reqest. -func (b *requestBuilder) RequestParams(name string, value string) RequestBuilder { - b.requestParams[name] = value - return b -} - -// Build builds request url. -func (b *requestBuilder) Build() RequestURL { - return &requestURL{url: b.url, pathParams: b.pathParams, requestParams: b.requestParams} -} - -// RequestURL is the element to compose request url. -type RequestURL interface { - GetRequestURL() string -} - -type requestURL struct { - url string - pathParams []string - requestParams map[string]string -} - -// GetRequestURL returns request url builded by request builder. -func (r *requestURL) GetRequestURL() string { - result := r.url + r.getPathParams() - if r.getRequestParams() != "" { - result = result + "?" + r.getRequestParams() - } - return result -} - -func (r *requestURL) getPathParams() string { - result := "" - for i, value := range r.pathParams { - if i == 0 && strings.HasSuffix(r.url, "/") { - result += value - } else { - result += "/" + value - } - } - return result -} - -func (r *requestURL) getRequestParams() string { - count := 0 - result := "" - for key, value := range r.requestParams { - result += key + "=" + value - if count != len(r.requestParams)-1 { - result += "&" - count++ - } - } - return result -} diff --git a/src/sample-golang-echo-app/util/request_builder_test.go b/src/sample-golang-echo-app/util/request_builder_test.go deleted file mode 100644 index 7bed12e2428d4f9cb7e9884182e456e5fe5822d5..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/util/request_builder_test.go +++ /dev/null @@ -1,24 +0,0 @@ -package util - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestGetRequestURL_PathParam(t *testing.T) { - result := NewRequestBuilder().URL("https://www.test/").PathParams("1").PathParams("test").Build().GetRequestURL() - assert.Equal(t, "https://www.test/1/test", result) -} - -func TestGetRequestURL_RequestParam(t *testing.T) { - result := NewRequestBuilder().URL("https://www.test/").RequestParams("hoge", "123").RequestParams("huga", "abcd").Build().GetRequestURL() - assert.Condition(t, isValidURL(result)) -} - -func isValidURL(url string) func() bool { - base := "https://www.test/?" - req1 := "hoge=123" - req2 := "huga=abcd" - return func() bool { return url == base+req1+"&"+req2 || url == base+req2+"&"+req1 } -} diff --git a/src/sample-golang-echo-app/util/strings.go b/src/sample-golang-echo-app/util/strings.go deleted file mode 100644 index 8d87342a32408b760815e9c429bb649cd95bf1ec..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/util/strings.go +++ /dev/null @@ -1,23 +0,0 @@ -package util - -import "strconv" - -// IsNumeric judges whether given string is numeric or not. -func IsNumeric(number string) bool { - _, err := strconv.Atoi(number) - return err == nil -} - -// ConvertToInt converts given string to int. -func ConvertToInt(number string) int { - value, err := strconv.Atoi(number) - if err != nil { - return 0 - } - return value -} - -// ConvertToUint converts given string to uint. -func ConvertToUint(number string) uint { - return uint(ConvertToInt(number)) -} diff --git a/src/sample-golang-echo-app/util/strings_test.go b/src/sample-golang-echo-app/util/strings_test.go deleted file mode 100644 index e1aa440949556edfbc97a80934018a74d498b57b..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/util/strings_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package util - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestIsNumeric_True(t *testing.T) { - result := IsNumeric("123") - assert.True(t, result) -} - -func TestIsNumeric_False(t *testing.T) { - result := IsNumeric("abcde") - assert.False(t, result) -} - -func TestConvertToInt_Number(t *testing.T) { - result := ConvertToInt("123") - assert.Exactly(t, int(123), result) -} - -func TestConvertToInt_NotNumber(t *testing.T) { - result := ConvertToInt("abcde/:12@s#$%'()") - assert.Equal(t, 0, result) -} - -func TestConvertToUint_Number(t *testing.T) { - result := ConvertToUint("123") - assert.Exactly(t, uint(123), result) -} diff --git a/src/sample-golang-echo-app/util/test.properties b/src/sample-golang-echo-app/util/test.properties deleted file mode 100644 index 7f53d0c4f4095eee58276d7e2f27ca7a64b54362..0000000000000000000000000000000000000000 --- a/src/sample-golang-echo-app/util/test.properties +++ /dev/null @@ -1,7 +0,0 @@ -# comment line -props1=testtest -props2 = test test -props3= -# comment line -props4 -props5= test #test diff --git a/src/sample-node-remix-app/.dockerignore b/src/sample-node-remix-app/.dockerignore deleted file mode 100644 index 91077d0621d29eeb3c5de92f9a450d8f3216337a..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/.dockerignore +++ /dev/null @@ -1,7 +0,0 @@ -/node_modules -*.log -.DS_Store -.env -/.cache -/public/build -/build diff --git a/src/sample-node-remix-app/.env.example b/src/sample-node-remix-app/.env.example deleted file mode 100644 index 0d0e0d65e4b6e09c23bbfd1fa605a9907a1f83ed..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -DATABASE_URL="file:./data.db?connection_limit=1" -SESSION_SECRET="super-duper-s3cret" diff --git a/src/sample-node-remix-app/.eslintrc.js b/src/sample-node-remix-app/.eslintrc.js deleted file mode 100644 index 3693886ec47d30fedc2d3d4117a89e3f206de4d2..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/.eslintrc.js +++ /dev/null @@ -1,22 +0,0 @@ -/** @type {import('eslint').Linter.Config} */ -module.exports = { - root: true, - extends: [ - "@remix-run/eslint-config", - "@remix-run/eslint-config/node", - "@remix-run/eslint-config/jest-testing-library", - "prettier", - ], - env: { - "cypress/globals": true, - }, - plugins: ["cypress"], - // we're using vitest which has a very similar API to jest - // (so the linting plugins work nicely), but it means we have to explicitly - // set the jest version. - settings: { - jest: { - version: 28, - }, - }, -}; diff --git a/src/sample-node-remix-app/.github/workflows/deploy.yml b/src/sample-node-remix-app/.github/workflows/deploy.yml deleted file mode 100644 index 55f043e8bbf193e71048875c0ba3d0681f66d36d..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/.github/workflows/deploy.yml +++ /dev/null @@ -1,145 +0,0 @@ -name: 🚀 Deploy - -on: - push: - branches: - - main - - dev - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - actions: write - contents: read - -jobs: - lint: - name: ⬣ ESLint - runs-on: ubuntu-latest - steps: - - name: ⬇️ Checkout repo - uses: actions/checkout@v3 - - - name: ⎔ Setup node - uses: actions/setup-node@v3 - with: - cache: npm - cache-dependency-path: ./package.json - node-version: 18 - - - name: 📥 Install deps - run: npm install - - - name: 🔬 Lint - run: npm run lint - - typecheck: - name: ʦ TypeScript - runs-on: ubuntu-latest - steps: - - name: ⬇️ Checkout repo - uses: actions/checkout@v3 - - - name: ⎔ Setup node - uses: actions/setup-node@v3 - with: - cache: npm - cache-dependency-path: ./package.json - node-version: 18 - - - name: 📥 Install deps - run: npm install - - - name: 🔎 Type check - run: npm run typecheck --if-present - - vitest: - name: ⚡ Vitest - runs-on: ubuntu-latest - steps: - - name: ⬇️ Checkout repo - uses: actions/checkout@v3 - - - name: ⎔ Setup node - uses: actions/setup-node@v3 - with: - cache: npm - cache-dependency-path: ./package.json - node-version: 18 - - - name: 📥 Install deps - run: npm install - - - name: ⚡ Run vitest - run: npm run test -- --coverage - - cypress: - name: ⚫️ Cypress - runs-on: ubuntu-latest - steps: - - name: ⬇️ Checkout repo - uses: actions/checkout@v3 - - - name: 🏄 Copy test env vars - run: cp .env.example .env - - - name: ⎔ Setup node - uses: actions/setup-node@v3 - with: - cache: npm - cache-dependency-path: ./package.json - node-version: 18 - - - name: 📥 Install deps - run: npm install - - - name: 🛠 Setup Database - run: npx prisma migrate reset --force - - - name: ⚙️ Build - run: npm run build - - - name: 🌳 Cypress run - uses: cypress-io/github-action@v5 - with: - start: npm run start:mocks - wait-on: http://localhost:8811 - env: - PORT: 8811 - - deploy: - name: 🚀 Deploy - runs-on: ubuntu-latest - needs: [lint, typecheck, vitest, cypress] - # only build/deploy main branch on pushes - if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} - - steps: - - name: ⬇️ Checkout repo - uses: actions/checkout@v3 - - - name: 👀 Read app name - uses: SebRollen/toml-action@v1.0.2 - id: app_name - with: - file: fly.toml - field: app - - - name: 🚀 Deploy Staging - if: ${{ github.ref == 'refs/heads/dev' }} - uses: superfly/flyctl-actions@1.4 - with: - args: deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} --app ${{ steps.app_name.outputs.value }}-staging - env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} - - - name: 🚀 Deploy Production - if: ${{ github.ref == 'refs/heads/main' }} - uses: superfly/flyctl-actions@1.4 - with: - args: deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} --app ${{ steps.app_name.outputs.value }} - env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/src/sample-node-remix-app/.gitignore b/src/sample-node-remix-app/.gitignore deleted file mode 100644 index 38e246762fc605863ee27d8ba8246906f1ea2270..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -node_modules - -/build -/public/build -.env - -/cypress/screenshots -/cypress/videos -/prisma/data.db -/prisma/data.db-journal diff --git a/src/sample-node-remix-app/.gitpod.Dockerfile b/src/sample-node-remix-app/.gitpod.Dockerfile deleted file mode 100644 index e52ca2d64b6171afdb13501c939907a473087290..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/.gitpod.Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM gitpod/workspace-full - -# Install Fly -RUN curl -L https://fly.io/install.sh | sh -ENV FLYCTL_INSTALL="/home/gitpod/.fly" -ENV PATH="$FLYCTL_INSTALL/bin:$PATH" - -# Install GitHub CLI -RUN brew install gh diff --git a/src/sample-node-remix-app/.gitpod.yml b/src/sample-node-remix-app/.gitpod.yml deleted file mode 100644 index f07c56287f4d7eec8a15d9cae1ce8c38038d2e7f..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/.gitpod.yml +++ /dev/null @@ -1,48 +0,0 @@ -# https://www.gitpod.io/docs/config-gitpod-file - -image: - file: .gitpod.Dockerfile - -ports: - - port: 3000 - onOpen: notify - -tasks: - - name: Restore .env file - command: | - if [ -f .env ]; then - # If this workspace already has a .env, don't override it - # Local changes survive a workspace being opened and closed - # but they will not persist between separate workspaces for the same repo - - echo "Found .env in workspace" - else - # There is no .env - if [ ! -n "${ENV}" ]; then - # There is no $ENV from a previous workspace - # Default to the example .env - echo "Setting example .env" - - cp .env.example .env - else - # After making changes to .env, run this line to persist it to $ENV - # eval $(gp env -e ENV="$(base64 .env | tr -d '\n')") - # - # Environment variables set this way are shared between all your workspaces for this repo - # The lines below will read $ENV and print a .env file - - echo "Restoring .env from Gitpod" - - echo "${ENV}" | base64 -d | tee .env > /dev/null - fi - fi - - - init: npm install - command: npm run setup && npm run dev - -vscode: - extensions: - - ms-azuretools.vscode-docker - - esbenp.prettier-vscode - - dbaeumer.vscode-eslint - - bradlc.vscode-tailwindcss diff --git a/src/sample-node-remix-app/.npmrc b/src/sample-node-remix-app/.npmrc deleted file mode 100644 index 521a9f7c0773588848ad5fa8a074ceca964a6b41..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/.npmrc +++ /dev/null @@ -1 +0,0 @@ -legacy-peer-deps=true diff --git a/src/sample-node-remix-app/.prettierignore b/src/sample-node-remix-app/.prettierignore deleted file mode 100644 index 8cb6bcbdbb071b99fbcbce2efcf0454cbfeda174..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/.prettierignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules - -/build -/public/build -.env - -/app/styles/tailwind.css diff --git a/src/sample-node-remix-app/Dockerfile b/src/sample-node-remix-app/Dockerfile deleted file mode 100644 index e5abfe25c6a2a75fa0fe4484d09024c30880aade..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/Dockerfile +++ /dev/null @@ -1,61 +0,0 @@ -# base node image -FROM node:16-bullseye-slim as base - -# set for base and all layer that inherit from it -ENV NODE_ENV production - -# Install openssl for Prisma -RUN apt-get update && apt-get install -y openssl sqlite3 - -# Install all node_modules, including dev dependencies -FROM base as deps - -WORKDIR /myapp - -ADD package.json package-lock.json .npmrc ./ -RUN npm install --include=dev - -# Setup production node_modules -FROM base as production-deps - -WORKDIR /myapp - -COPY --from=deps /myapp/node_modules /myapp/node_modules -ADD package.json package-lock.json .npmrc ./ -RUN npm prune --omit=dev - -# Build the app -FROM base as build - -WORKDIR /myapp - -COPY --from=deps /myapp/node_modules /myapp/node_modules - -ADD prisma . -RUN npx prisma generate - -ADD . . -RUN npm run build - -# Finally, build the production image with minimal footprint -FROM base - -ENV DATABASE_URL=file:/data/sqlite.db -ENV PORT="8080" -ENV NODE_ENV="production" - -# add shortcut for connecting to database CLI -RUN echo "#!/bin/sh\nset -x\nsqlite3 \$DATABASE_URL" > /usr/local/bin/database-cli && chmod +x /usr/local/bin/database-cli - -WORKDIR /myapp - -COPY --from=production-deps /myapp/node_modules /myapp/node_modules -COPY --from=build /myapp/node_modules/.prisma /myapp/node_modules/.prisma - -COPY --from=build /myapp/build /myapp/build -COPY --from=build /myapp/public /myapp/public -COPY --from=build /myapp/package.json /myapp/package.json -COPY --from=build /myapp/start.sh /myapp/start.sh -COPY --from=build /myapp/prisma /myapp/prisma - -ENTRYPOINT [ "./start.sh" ] diff --git a/src/sample-node-remix-app/README.md b/src/sample-node-remix-app/README.md deleted file mode 100644 index ceab60d5f0847df424e2571a0d87045e7f048797..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/README.md +++ /dev/null @@ -1,174 +0,0 @@ -# Remix Indie Stack - -![The Remix Indie Stack](https://repository-images.githubusercontent.com/465928257/a241fa49-bd4d-485a-a2a5-5cb8e4ee0abf) - -Learn more about [Remix Stacks](https://remix.run/stacks). - -```sh -npx create-remix@latest --template remix-run/indie-stack -``` - -## What's in the stack - -- [Fly app deployment](https://fly.io) with [Docker](https://www.docker.com/) -- Production-ready [SQLite Database](https://sqlite.org) -- Healthcheck endpoint for [Fly backups region fallbacks](https://fly.io/docs/reference/configuration/#services-http_checks) -- [GitHub Actions](https://github.com/features/actions) for deploy on merge to production and staging environments -- Email/Password Authentication with [cookie-based sessions](https://remix.run/utils/sessions#md-createcookiesessionstorage) -- Database ORM with [Prisma](https://prisma.io) -- Styling with [Tailwind](https://tailwindcss.com/) -- End-to-end testing with [Cypress](https://cypress.io) -- Local third party request mocking with [MSW](https://mswjs.io) -- Unit testing with [Vitest](https://vitest.dev) and [Testing Library](https://testing-library.com) -- Code formatting with [Prettier](https://prettier.io) -- Linting with [ESLint](https://eslint.org) -- Static Types with [TypeScript](https://typescriptlang.org) - -Not a fan of bits of the stack? Fork it, change it, and use `npx create-remix --template your/repo`! Make it your own. - -## Quickstart - -Click this button to create a [Gitpod](https://gitpod.io) workspace with the project set up and Fly pre-installed - -[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/remix-run/indie-stack/tree/main) - -## Development - -- Initial setup: - - ```sh - npm run setup - ``` - -- Start dev server: - - ```sh - npm run dev - ``` - -This starts your app in development mode, rebuilding assets on file changes. - -The database seed script creates a new user with some data you can use to get started: - -- Email: `rachel@remix.run` -- Password: `racheliscool` - -### Relevant code: - -This is a pretty simple note-taking app, but it's a good example of how you can build a full stack app with Prisma and Remix. The main functionality is creating users, logging in and out, and creating and deleting notes. - -- creating users, and logging in and out [./app/models/user.server.ts](./app/models/user.server.ts) -- user sessions, and verifying them [./app/session.server.ts](./app/session.server.ts) -- creating, and deleting notes [./app/models/note.server.ts](./app/models/note.server.ts) - -## Deployment - -This Remix Stack comes with two GitHub Actions that handle automatically deploying your app to production and staging environments. - -Prior to your first deployment, you'll need to do a few things: - -- [Install Fly](https://fly.io/docs/getting-started/installing-flyctl/) - -- Sign up and log in to Fly - - ```sh - fly auth signup - ``` - - > **Note:** If you have more than one Fly account, ensure that you are signed into the same account in the Fly CLI as you are in the browser. In your terminal, run `fly auth whoami` and ensure the email matches the Fly account signed into the browser. - -- Create two apps on Fly, one for staging and one for production: - - ```sh - fly apps create node-remix-app-a5c6 - fly apps create node-remix-app-a5c6-staging - ``` - - > **Note:** Make sure this name matches the `app` set in your `fly.toml` file. Otherwise, you will not be able to deploy. - - - Initialize Git. - - ```sh - git init - ``` - -- Create a new [GitHub Repository](https://repo.new), and then add it as the remote for your project. **Do not push your app yet!** - - ```sh - git remote add origin - ``` - -- Add a `FLY_API_TOKEN` to your GitHub repo. To do this, go to your user settings on Fly and create a new [token](https://web.fly.io/user/personal_access_tokens/new), then add it to [your repo secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) with the name `FLY_API_TOKEN`. - -- Add a `SESSION_SECRET` to your fly app secrets, to do this you can run the following commands: - - ```sh - fly secrets set SESSION_SECRET=$(openssl rand -hex 32) --app node-remix-app-a5c6 - fly secrets set SESSION_SECRET=$(openssl rand -hex 32) --app node-remix-app-a5c6-staging - ``` - - If you don't have openssl installed, you can also use [1Password](https://1password.com/password-generator) to generate a random secret, just replace `$(openssl rand -hex 32)` with the generated secret. - -- Create a persistent volume for the sqlite database for both your staging and production environments. Run the following: - - ```sh - fly volumes create data --size 1 --app node-remix-app-a5c6 - fly volumes create data --size 1 --app node-remix-app-a5c6-staging - ``` - -Now that everything is set up you can commit and push your changes to your repo. Every commit to your `main` branch will trigger a deployment to your production environment, and every commit to your `dev` branch will trigger a deployment to your staging environment. - -### Connecting to your database - -The sqlite database lives at `/data/sqlite.db` in your deployed application. You can connect to the live database by running `fly ssh console -C database-cli`. - -### Getting Help with Deployment - -If you run into any issues deploying to Fly, make sure you've followed all of the steps above and if you have, then post as many details about your deployment (including your app name) to [the Fly support community](https://community.fly.io). They're normally pretty responsive over there and hopefully can help resolve any of your deployment issues and questions. - -## GitHub Actions - -We use GitHub Actions for continuous integration and deployment. Anything that gets into the `main` branch will be deployed to production after running tests/build/etc. Anything in the `dev` branch will be deployed to staging. - -## Testing - -### Cypress - -We use Cypress for our End-to-End tests in this project. You'll find those in the `cypress` directory. As you make changes, add to an existing file or create a new file in the `cypress/e2e` directory to test your changes. - -We use [`@testing-library/cypress`](https://testing-library.com/cypress) for selecting elements on the page semantically. - -To run these tests in development, run `npm run test:e2e:dev` which will start the dev server for the app as well as the Cypress client. Make sure the database is running in docker as described above. - -We have a utility for testing authenticated features without having to go through the login flow: - -```ts -cy.login(); -// you are now logged in as a new user -``` - -We also have a utility to auto-delete the user at the end of your test. Just make sure to add this in each test file: - -```ts -afterEach(() => { - cy.cleanupUser(); -}); -``` - -That way, we can keep your local db clean and keep your tests isolated from one another. - -### Vitest - -For lower level tests of utilities and individual components, we use `vitest`. We have DOM-specific assertion helpers via [`@testing-library/jest-dom`](https://testing-library.com/jest-dom). - -### Type Checking - -This project uses TypeScript. It's recommended to get TypeScript set up for your editor to get a really great in-editor experience with type checking and auto-complete. To run type checking across the whole project, run `npm run typecheck`. - -### Linting - -This project uses ESLint for linting. That is configured in `.eslintrc.js`. - -### Formatting - -We use [Prettier](https://prettier.io/) for auto-formatting in this project. It's recommended to install an editor plugin (like the [VSCode Prettier plugin](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)) to get auto-formatting on save. There's also a `npm run format` script you can run to format all files in the project. diff --git a/src/sample-node-remix-app/app/db.server.js b/src/sample-node-remix-app/app/db.server.js deleted file mode 100644 index a07e207121df6d92e62ea5b63eebe2bba9cf2ed1..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/db.server.js +++ /dev/null @@ -1,19 +0,0 @@ -import { PrismaClient } from "@prisma/client"; - -let prisma; - -// This is needed because in development we don't want to restart -// the server with every change, but we want to make sure we don't -// create a new connection to the DB with every change either. -// In production, we'll have a single connection to the DB. -if (process.env.NODE_ENV === "production") { - prisma = new PrismaClient(); -} else { - if (!global.__db__) { - global.__db__ = new PrismaClient(); - } - prisma = global.__db__; - prisma.$connect(); -} - -export { prisma }; diff --git a/src/sample-node-remix-app/app/entry.client.jsx b/src/sample-node-remix-app/app/entry.client.jsx deleted file mode 100644 index 36f2e51a73f30f6aaa9696c97ee019cb56cc6787..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/entry.client.jsx +++ /dev/null @@ -1,18 +0,0 @@ -/** - * By default, Remix will handle hydrating your app on the client for you. - * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ - * For more information, see https://remix.run/docs/en/main/file-conventions/entry.client - */ - -import { RemixBrowser } from "@remix-run/react"; -import { startTransition, StrictMode } from "react"; -import { hydrateRoot } from "react-dom/client"; - -startTransition(() => { - hydrateRoot( - document, - - - - ); -}); diff --git a/src/sample-node-remix-app/app/entry.server.jsx b/src/sample-node-remix-app/app/entry.server.jsx deleted file mode 100644 index 517864bc58e79d287e7b103c92cb9d20c75ccaee..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/entry.server.jsx +++ /dev/null @@ -1,121 +0,0 @@ -/** - * By default, Remix will handle generating the HTTP Response for you. - * You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ - * For more information, see https://remix.run/docs/en/main/file-conventions/entry.server - */ - -import { PassThrough } from "node:stream"; - -import { Response } from "@remix-run/node"; -import { RemixServer } from "@remix-run/react"; -import isbot from "isbot"; -import { renderToPipeableStream } from "react-dom/server"; - -const ABORT_DELAY = 5_000; - -export default function handleRequest( - request, - responseStatusCode, - responseHeaders, - remixContext -) { - return isbot(request.headers.get("user-agent")) - ? handleBotRequest( - request, - responseStatusCode, - responseHeaders, - remixContext - ) - : handleBrowserRequest( - request, - responseStatusCode, - responseHeaders, - remixContext - ); -} - -function handleBotRequest( - request, - responseStatusCode, - responseHeaders, - remixContext -) { - return new Promise((resolve, reject) => { - const { pipe, abort } = renderToPipeableStream( - , - - { - onAllReady() { - const body = new PassThrough(); - - responseHeaders.set("Content-Type", "text/html"); - - resolve( - new Response(body, { - headers: responseHeaders, - status: responseStatusCode, - }) - ); - - pipe(body); - }, - onShellError(error) { - reject(error); - }, - onError(error) { - responseStatusCode = 500; - console.error(error); - }, - } - ); - - setTimeout(abort, ABORT_DELAY); - }); -} - -function handleBrowserRequest( - request, - responseStatusCode, - responseHeaders, - remixContext -) { - return new Promise((resolve, reject) => { - const { pipe, abort } = renderToPipeableStream( - , - - { - onShellReady() { - const body = new PassThrough(); - - responseHeaders.set("Content-Type", "text/html"); - - resolve( - new Response(body, { - headers: responseHeaders, - status: responseStatusCode, - }) - ); - - pipe(body); - }, - onShellError(error) { - reject(error); - }, - onError(error) { - console.error(error); - responseStatusCode = 500; - }, - } - ); - - setTimeout(abort, ABORT_DELAY); - }); -} diff --git a/src/sample-node-remix-app/app/models/note.server.js b/src/sample-node-remix-app/app/models/note.server.js deleted file mode 100644 index fbf6bcf4a943c3c386c6868b6ec8b5905270ae0b..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/models/note.server.js +++ /dev/null @@ -1,36 +0,0 @@ -import { prisma } from "~/db.server"; - -export function getNote({ id, userId }) { - return prisma.note.findFirst({ - select: { id: true, body: true, title: true }, - where: { id, userId }, - }); -} - -export function getNoteListItems({ userId }) { - return prisma.note.findMany({ - where: { userId }, - select: { id: true, title: true }, - orderBy: { updatedAt: "desc" }, - }); -} - -export function createNote({ body, title, userId }) { - return prisma.note.create({ - data: { - title, - body, - user: { - connect: { - id: userId, - }, - }, - }, - }); -} - -export function deleteNote({ id, userId }) { - return prisma.note.deleteMany({ - where: { id, userId }, - }); -} diff --git a/src/sample-node-remix-app/app/models/user.server.js b/src/sample-node-remix-app/app/models/user.server.js deleted file mode 100644 index f01781a64e72789f22e90028a43ba028f5009243..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/models/user.server.js +++ /dev/null @@ -1,56 +0,0 @@ -import bcrypt from "bcryptjs"; - -import { prisma } from "~/db.server"; - -export async function getUserById(id) { - return prisma.user.findUnique({ where: { id } }); -} - -export async function getUserByEmail(email) { - return prisma.user.findUnique({ where: { email } }); -} - -export async function createUser(email, password) { - const hashedPassword = await bcrypt.hash(password, 10); - - return prisma.user.create({ - data: { - email, - password: { - create: { - hash: hashedPassword, - }, - }, - }, - }); -} - -export async function deleteUserByEmail(email) { - return prisma.user.delete({ where: { email } }); -} - -export async function verifyLogin(email, password) { - const userWithPassword = await prisma.user.findUnique({ - where: { email }, - include: { - password: true, - }, - }); - - if (!userWithPassword || !userWithPassword.password) { - return null; - } - - const isValid = await bcrypt.compare( - password, - userWithPassword.password.hash - ); - - if (!isValid) { - return null; - } - - const { password: _password, ...userWithoutPassword } = userWithPassword; - - return userWithoutPassword; -} diff --git a/src/sample-node-remix-app/app/root.jsx b/src/sample-node-remix-app/app/root.jsx deleted file mode 100644 index 11645bb9c59e7e50ee1897707f9fcde9864dfa5e..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/root.jsx +++ /dev/null @@ -1,42 +0,0 @@ -import { cssBundleHref } from "@remix-run/css-bundle"; - -import { json } from "@remix-run/node"; -import { - Links, - LiveReload, - Meta, - Outlet, - Scripts, - ScrollRestoration, -} from "@remix-run/react"; - -import { getUser } from "~/session.server"; -import stylesheet from "~/tailwind.css"; - -export const links = () => [ - { rel: "stylesheet", href: stylesheet }, - ...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []), -]; - -export const loader = async ({ request }) => { - return json({ user: await getUser(request) }); -}; - -export default function App() { - return ( - - - - - - - - - - - - - - - ); -} diff --git a/src/sample-node-remix-app/app/routes/_index.jsx b/src/sample-node-remix-app/app/routes/_index.jsx deleted file mode 100644 index 9b7f85bf83fde82ed4f836c8df9c658ae522dfa3..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/routes/_index.jsx +++ /dev/null @@ -1,141 +0,0 @@ -import { Link } from "@remix-run/react"; - -import { useOptionalUser } from "~/utils"; - -export const meta = () => [{ title: "Remix Notes" }]; - -export default function Index() { - const user = useOptionalUser(); - return ( -
-
-
-
- -
- -
-
- {[ - { - src: "https://user-images.githubusercontent.com/1500684/157764397-ccd8ea10-b8aa-4772-a99b-35de937319e1.svg", - alt: "Fly.io", - href: "https://fly.io", - }, - { - src: "https://user-images.githubusercontent.com/1500684/157764395-137ec949-382c-43bd-a3c0-0cb8cb22e22d.svg", - alt: "SQLite", - href: "https://sqlite.org", - }, - { - src: "https://user-images.githubusercontent.com/1500684/157764484-ad64a21a-d7fb-47e3-8669-ec046da20c1f.svg", - alt: "Prisma", - href: "https://prisma.io", - }, - { - src: "https://user-images.githubusercontent.com/1500684/157764276-a516a239-e377-4a20-b44a-0ac7b65c8c14.svg", - alt: "Tailwind", - href: "https://tailwindcss.com", - }, - { - src: "https://user-images.githubusercontent.com/1500684/157764454-48ac8c71-a2a9-4b5e-b19c-edef8b8953d6.svg", - alt: "Cypress", - href: "https://www.cypress.io", - }, - { - src: "https://user-images.githubusercontent.com/1500684/157772386-75444196-0604-4340-af28-53b236faa182.svg", - alt: "MSW", - href: "https://mswjs.io", - }, - { - src: "https://user-images.githubusercontent.com/1500684/157772447-00fccdce-9d12-46a3-8bb4-fac612cdc949.svg", - alt: "Vitest", - href: "https://vitest.dev", - }, - { - src: "https://user-images.githubusercontent.com/1500684/157772662-92b0dd3a-453f-4d18-b8be-9fa6efde52cf.png", - alt: "Testing Library", - href: "https://testing-library.com", - }, - { - src: "https://user-images.githubusercontent.com/1500684/157772934-ce0a943d-e9d0-40f8-97f3-f464c0811643.svg", - alt: "Prettier", - href: "https://prettier.io", - }, - { - src: "https://user-images.githubusercontent.com/1500684/157772990-3968ff7c-b551-4c55-a25c-046a32709a8e.svg", - alt: "ESLint", - href: "https://eslint.org", - }, - { - src: "https://user-images.githubusercontent.com/1500684/157773063-20a0ed64-b9f8-4e0b-9d1e-0b65a3d4a6db.svg", - alt: "TypeScript", - href: "https://typescriptlang.org", - }, - ].map((img) => ( - - {img.alt} - - ))} -
-
-
-
- ); -} diff --git a/src/sample-node-remix-app/app/routes/healthcheck.jsx b/src/sample-node-remix-app/app/routes/healthcheck.jsx deleted file mode 100644 index 9886b3d5fdc68a94baa11d7d61c45c9759f88a18..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/routes/healthcheck.jsx +++ /dev/null @@ -1,24 +0,0 @@ -// learn more: https://fly.io/docs/reference/configuration/#services-http_checks - -import { prisma } from "~/db.server"; - -export const loader = async ({ request }) => { - const host = - request.headers.get("X-Forwarded-Host") ?? request.headers.get("host"); - - try { - const url = new URL("/", `http://${host}`); - // if we can connect to the database and make a simple query - // and make a HEAD request to ourselves, then we're good. - await Promise.all([ - prisma.user.count(), - fetch(url.toString(), { method: "HEAD" }).then((r) => { - if (!r.ok) return Promise.reject(r); - }), - ]); - return new Response("OK"); - } catch (error) { - console.log("healthcheck ❌", { error }); - return new Response("ERROR", { status: 500 }); - } -}; diff --git a/src/sample-node-remix-app/app/routes/join.jsx b/src/sample-node-remix-app/app/routes/join.jsx deleted file mode 100644 index d187f131756e1e22f7f9e6af1393bdfb91c1d3d0..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/routes/join.jsx +++ /dev/null @@ -1,167 +0,0 @@ -import { json, redirect } from "@remix-run/node"; -import { Form, Link, useActionData, useSearchParams } from "@remix-run/react"; -import { useEffect, useRef } from "react"; - -import { createUser, getUserByEmail } from "~/models/user.server"; -import { createUserSession, getUserId } from "~/session.server"; -import { safeRedirect, validateEmail } from "~/utils"; - -export const loader = async ({ request }) => { - const userId = await getUserId(request); - if (userId) return redirect("/"); - return json({}); -}; - -export const action = async ({ request }) => { - const formData = await request.formData(); - const email = formData.get("email"); - const password = formData.get("password"); - const redirectTo = safeRedirect(formData.get("redirectTo"), "/"); - - if (!validateEmail(email)) { - return json( - { errors: { email: "Email is invalid", password: null } }, - { status: 400 } - ); - } - - if (typeof password !== "string" || password.length === 0) { - return json( - { errors: { email: null, password: "Password is required" } }, - { status: 400 } - ); - } - - if (password.length < 8) { - return json( - { errors: { email: null, password: "Password is too short" } }, - { status: 400 } - ); - } - - const existingUser = await getUserByEmail(email); - if (existingUser) { - return json( - { - errors: { - email: "A user already exists with this email", - password: null, - }, - }, - { status: 400 } - ); - } - - const user = await createUser(email, password); - - return createUserSession({ - redirectTo, - remember: false, - request, - userId: user.id, - }); -}; - -export const meta = () => [{ title: "Sign Up" }]; - -export default function Join() { - const [searchParams] = useSearchParams(); - const redirectTo = searchParams.get("redirectTo") ?? undefined; - const actionData = useActionData(); - const emailRef = useRef(null); - const passwordRef = useRef(null); - - useEffect(() => { - if (actionData?.errors?.email) { - emailRef.current?.focus(); - } else if (actionData?.errors?.password) { - passwordRef.current?.focus(); - } - }, [actionData]); - - return ( -
-
-
-
- -
- - - {actionData?.errors?.email ? ( -
- {actionData.errors.email} -
- ) : null} -
-
- -
- -
- - - {actionData?.errors?.password ? ( -
- {actionData.errors.password} -
- ) : null} -
-
- - - -
-
- Already have an account?{" "} - - Log in - -
-
-
-
-
- ); -} diff --git a/src/sample-node-remix-app/app/routes/login.jsx b/src/sample-node-remix-app/app/routes/login.jsx deleted file mode 100644 index 493dffb44cfa4c9e71ee5a90f09b7d7efa182d50..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/routes/login.jsx +++ /dev/null @@ -1,177 +0,0 @@ -import { json, redirect } from "@remix-run/node"; -import { Form, Link, useActionData, useSearchParams } from "@remix-run/react"; -import { useEffect, useRef } from "react"; - -import { verifyLogin } from "~/models/user.server"; -import { createUserSession, getUserId } from "~/session.server"; -import { safeRedirect, validateEmail } from "~/utils"; - -export const loader = async ({ request }) => { - const userId = await getUserId(request); - if (userId) return redirect("/"); - return json({}); -}; - -export const action = async ({ request }) => { - const formData = await request.formData(); - const email = formData.get("email"); - const password = formData.get("password"); - const redirectTo = safeRedirect(formData.get("redirectTo"), "/"); - const remember = formData.get("remember"); - - if (!validateEmail(email)) { - return json( - { errors: { email: "Email is invalid", password: null } }, - { status: 400 } - ); - } - - if (typeof password !== "string" || password.length === 0) { - return json( - { errors: { email: null, password: "Password is required" } }, - { status: 400 } - ); - } - - if (password.length < 8) { - return json( - { errors: { email: null, password: "Password is too short" } }, - { status: 400 } - ); - } - - const user = await verifyLogin(email, password); - - if (!user) { - return json( - { errors: { email: "Invalid email or password", password: null } }, - { status: 400 } - ); - } - - return createUserSession({ - redirectTo, - remember: remember === "on" ? true : false, - request, - userId: user.id, - }); -}; - -export const meta = () => [{ title: "Login" }]; - -export default function LoginPage() { - const [searchParams] = useSearchParams(); - const redirectTo = searchParams.get("redirectTo") || "/notes"; - const actionData = useActionData(); - const emailRef = useRef(null); - const passwordRef = useRef(null); - - useEffect(() => { - if (actionData?.errors?.email) { - emailRef.current?.focus(); - } else if (actionData?.errors?.password) { - passwordRef.current?.focus(); - } - }, [actionData]); - - return ( -
-
-
-
- -
- - - {actionData?.errors?.email ? ( -
- {actionData.errors.email} -
- ) : null} -
-
- -
- -
- - - {actionData?.errors?.password ? ( -
- {actionData.errors.password} -
- ) : null} -
-
- - - -
-
- - - -
-
- Don't have an account?{" "} - - Sign up - -
-
-
-
-
- ); -} diff --git a/src/sample-node-remix-app/app/routes/logout.jsx b/src/sample-node-remix-app/app/routes/logout.jsx deleted file mode 100644 index 32ef81a40973eeea30570e58971047f13a3ce6eb..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/routes/logout.jsx +++ /dev/null @@ -1,7 +0,0 @@ -import { redirect } from "@remix-run/node"; - -import { logout } from "~/session.server"; - -export const action = async ({ request }) => logout(request); - -export const loader = async () => redirect("/"); diff --git a/src/sample-node-remix-app/app/routes/notes.$noteId.jsx b/src/sample-node-remix-app/app/routes/notes.$noteId.jsx deleted file mode 100644 index b88cbb67aa7db9a7d62c04ff23e3a92cb7834517..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/routes/notes.$noteId.jsx +++ /dev/null @@ -1,69 +0,0 @@ -import { json, redirect } from "@remix-run/node"; -import { - Form, - isRouteErrorResponse, - useLoaderData, - useRouteError, -} from "@remix-run/react"; -import invariant from "tiny-invariant"; - -import { deleteNote, getNote } from "~/models/note.server"; -import { requireUserId } from "~/session.server"; - -export const loader = async ({ params, request }) => { - const userId = await requireUserId(request); - invariant(params.noteId, "noteId not found"); - - const note = await getNote({ id: params.noteId, userId }); - if (!note) { - throw new Response("Not Found", { status: 404 }); - } - return json({ note }); -}; - -export const action = async ({ params, request }) => { - const userId = await requireUserId(request); - invariant(params.noteId, "noteId not found"); - - await deleteNote({ id: params.noteId, userId }); - - return redirect("/notes"); -}; - -export default function NoteDetailsPage() { - const data = useLoaderData(); - - return ( -
-

{data.note.title}

-

{data.note.body}

-
-
- -
-
- ); -} - -export function ErrorBoundary() { - const error = useRouteError(); - - if (error instanceof Error) { - return
An unexpected error occurred: {error.message}
; - } - - if (!isRouteErrorResponse(error)) { - return

Unknown Error

; - } - - if (error.status === 404) { - return
Note not found
; - } - - return
An unexpected error occurred: {error.statusText}
; -} diff --git a/src/sample-node-remix-app/app/routes/notes._index.jsx b/src/sample-node-remix-app/app/routes/notes._index.jsx deleted file mode 100644 index aa858a994d73bf3417ae99dd0779c2ff82705cd0..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/routes/notes._index.jsx +++ /dev/null @@ -1,12 +0,0 @@ -import { Link } from "@remix-run/react"; - -export default function NoteIndexPage() { - return ( -

- No note selected. Select a note on the left, or{" "} - - create a new note. - -

- ); -} diff --git a/src/sample-node-remix-app/app/routes/notes.jsx b/src/sample-node-remix-app/app/routes/notes.jsx deleted file mode 100644 index 6714941ebc11bd7591657fc8add545bf2bc6c0b9..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/routes/notes.jsx +++ /dev/null @@ -1,69 +0,0 @@ -import { json } from "@remix-run/node"; -import { Form, Link, NavLink, Outlet, useLoaderData } from "@remix-run/react"; - -import { getNoteListItems } from "~/models/note.server"; -import { requireUserId } from "~/session.server"; -import { useUser } from "~/utils"; - -export const loader = async ({ request }) => { - const userId = await requireUserId(request); - const noteListItems = await getNoteListItems({ userId }); - return json({ noteListItems }); -}; - -export default function NotesPage() { - const data = useLoaderData(); - const user = useUser(); - - return ( -
-
-

- Notes -

-

{user.email}

-
- -
-
- -
-
- - + New Note - - -
- - {data.noteListItems.length === 0 ? ( -

No notes yet

- ) : ( -
    - {data.noteListItems.map((note) => ( -
  1. - - `block border-b p-4 text-xl ${isActive ? "bg-white" : ""}` - } - to={note.id} - > - 📝 {note.title} - -
  2. - ))} -
- )} -
- -
- -
-
-
- ); -} diff --git a/src/sample-node-remix-app/app/routes/notes.new.jsx b/src/sample-node-remix-app/app/routes/notes.new.jsx deleted file mode 100644 index 97cec0fab36e1592a117fc0b88f866a4e299b88b..0000000000000000000000000000000000000000 --- a/src/sample-node-remix-app/app/routes/notes.new.jsx +++ /dev/null @@ -1,108 +0,0 @@ -import { json, redirect } from "@remix-run/node"; -import { Form, useActionData } from "@remix-run/react"; -import { useEffect, useRef } from "react"; - -import { createNote } from "~/models/note.server"; -import { requireUserId } from "~/session.server"; - -export const action = async ({ request }) => { - const userId = await requireUserId(request); - - const formData = await request.formData(); - const title = formData.get("title"); - const body = formData.get("body"); - - if (typeof title !== "string" || title.length === 0) { - return json( - { errors: { body: null, title: "Title is required" } }, - { status: 400 } - ); - } - - if (typeof body !== "string" || body.length === 0) { - return json( - { errors: { body: "Body is required", title: null } }, - { status: 400 } - ); - } - - const note = await createNote({ body, title, userId }); - - return redirect(`/notes/${note.id}`); -}; - -export default function NewNotePage() { - const actionData = useActionData(); - const titleRef = useRef(null); - const bodyRef = useRef(null); - - useEffect(() => { - if (actionData?.errors?.title) { - titleRef.current?.focus(); - } else if (actionData?.errors?.body) { - bodyRef.current?.focus(); - } - }, [actionData]); - - return ( -
-
- - {actionData?.errors?.title ? ( -
- {actionData.errors.title} -
- ) : null} -
- -
-