diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..2a6c142a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,76 @@ +version: 2 +updates: + # Enable version updates for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + day: "monday" + time: "09:00" + timezone: "UTC" + # Allow both major and minor updates for actions + open-pull-requests-limit: 10 + # Group updates by action to reduce PR noise + groups: + github-actions: + patterns: + - "*" + # Auto-merge minor updates for trusted actions + commit-message: + prefix: "chore" + include: "scope" + # Reviewers for action updates + reviewers: + - "fraz3alpha" + # Labels for action updates + labels: + - "dependencies" + - "github-actions" + - "automated" + + # Enable version updates for pnpm workspace (extension, tests, ui-test) + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "weekly" + day: "monday" + time: "09:00" + timezone: "UTC" + open-pull-requests-limit: 10 + groups: + pnpm-dependencies: + patterns: + - "*" + commit-message: + prefix: "chore" + include: "scope" + reviewers: + - "fraz3alpha" + labels: + - "dependencies" + - "pnpm" + - "automated" + + # Enable version updates for Ruby/Bundler dependencies + - package-ecosystem: "bundler" + directory: "/website" + schedule: + interval: "weekly" + day: "monday" + time: "09:00" + timezone: "UTC" + open-pull-requests-limit: 5 + groups: + bundler-dependencies: + patterns: + - "*" + commit-message: + prefix: "chore" + include: "scope" + reviewers: + - "fraz3alpha" + labels: + - "dependencies" + - "ruby" + - "bundler" + - "automated" diff --git a/.github/workflows/build-extension.yml b/.github/workflows/build-extension.yml index 1f9ffa62..26320899 100644 --- a/.github/workflows/build-extension.yml +++ b/.github/workflows/build-extension.yml @@ -3,83 +3,74 @@ name: Extension Builder # Run this workflow every time a new commit pushed to your repository on: push: - branches: + branches: - master pull_request: jobs: - test-javascript-libraries: name: Test the Javascript libraries runs-on: ubuntu-latest - defaults: - run: - shell: bash - working-directory: browser-extensions/common/js/tests - steps: - # Checks out a copy of your repository on the ubuntu-latest machine - name: Checkout code uses: actions/checkout@v4 - - name: Configure node v20 - uses: actions/setup-node@v4 + - name: Install toolchain with mise + uses: jdx/mise-action@v3 with: - node-version: '20' + install: true - - name: Install test framework dependencies - run: npm install + - name: Install pnpm dependencies + run: pnpm install --frozen-lockfile + + - name: Install Playwright Browsers + run: pnpm --filter running-challenges-chrome-ui-testing exec playwright install --with-deps chromium - - name: Run tests - run: npm run test-with-coverage + - name: Run script/cibuild + run: ./script/cibuild + shell: bash - # Set the job key. The key is displayed as the job name - # when a job name is not provided build-extension: - # Name the Job name: Build the extension - # Set the type of machine to run on runs-on: ubuntu-latest - strategy: - matrix: - browser: ["chrome", "firefox"] steps: - # Checks out a copy of your repository on the ubuntu-latest machine - name: Checkout code uses: actions/checkout@v4 - - name: Configure node v20 - uses: actions/setup-node@v4 + - name: Install toolchain with mise + uses: jdx/mise-action@v3 with: - node-version: '20' + install: true - - name: Install web-ext tooling - run: npm install -g web-ext + - name: Install pnpm dependencies + run: pnpm install --frozen-lockfile - # Runs a script - - name: Build ${{ matrix.browser }} Extension + - name: Build extensions (Chrome and Firefox) run: | - echo "Building extension for ${{ matrix.browser }} at `date`" - # Make the build script executable - chmod +x ./build/extension-${{ matrix.browser }}/build.sh - # Build the extension - ./build/extension-${{ matrix.browser }}/build.sh - shell: bash + source build/version.sh + export EXTENSION_BUILD_VERSION EXTENSION_BUILD_ID + pnpm --filter running-challenges-extension run build:extension env: EXTENSION_BUILD_ID: ${{ github.run_number }} - - name: Upload build extension package + - name: Upload Chrome extension package + uses: actions/upload-artifact@v4 + with: + name: chrome-extension-package + path: browser-extensions/chrome/build/web-ext-artifacts/running_challenges-chrome-*.zip + + - name: Upload Firefox extension package uses: actions/upload-artifact@v4 with: - name: ${{ matrix.browser }}-extension-package - path: browser-extensions/${{ matrix.browser }}/build/web-ext-artifacts/running_challenges-*.zip + name: firefox-extension-package + path: browser-extensions/firefox/build/web-ext-artifacts/running_challenges-firefox-*.zip integration-test: name: UI Testing runs-on: ubuntu-latest - needs: + needs: - build-extension - test-javascript-libraries strategy: @@ -112,10 +103,9 @@ jobs: defaults: run: shell: bash - working-directory: browser-extensions/common/js/tests/ui-test + working-directory: browser-extensions/extension/src/js/tests/ui-test steps: - # Checks out a copy of the repository - name: Checkout code uses: actions/checkout@v4 @@ -124,54 +114,40 @@ jobs: - name: Download all built extension packages uses: actions/download-artifact@v4 with: - path: browser-extensions/common/js/tests/ui-test/extension-binaries + path: browser-extensions/extension/src/js/tests/ui-test/extension-binaries - name: Show built extension packages run: ls -lR extension-binaries - name: Configure node v20 - uses: actions/setup-node@v4 + uses: jdx/mise-action@v3 with: - node-version: '20' + install: true - name: Install Required OS packages run: | sudo apt-get update && \ sudo apt-get install -y xvfb unzip - - name: Start up the supporting nginx services - run: | - - echo "Creating a certificate" - cd ./supporting-data/nginx/cert/ - bash generate.sh - cd - - - echo "Starting up docker compose services" - docker compose -f "./supporting-data/docker-compose-gh-actions.yml" up --force-recreate -d - - # Give nginx a moment to have fully come up - sleep 1 - - # Make the changes to /etc/hosts so that the tests reference the above containers. - echo "Append to /etc/hosts to use this nginx" - sudo bash -c 'cat ./supporting-data/etc-hosts.txt >> /etc/hosts' - - name: Unpack extension run: | ls -lR extension-binaries cd extension-binaries/chrome-extension-package unzip *.zip - - name: Install Node dependencies - run: npm ci + - name: Install pnpm dependencies + working-directory: ${{ github.workspace }} + run: pnpm install --frozen-lockfile - name: Install Playwright Browsers - run: | - npx playwright install --with-deps chromium + working-directory: ${{ github.workspace }} + run: pnpm --filter running-challenges-chrome-ui-testing exec playwright install --with-deps chromium + # Full suite includes "Leaflet markers load with icons", which guards against + # regressions when moving Leaflet (or other third-party assets) to pnpm. - name: Run Playwright tests - run: xvfb-run npx playwright test + working-directory: ${{ github.workspace }} + run: xvfb-run pnpm --filter running-challenges-chrome-ui-testing run test env: COUNTRY_HOSTNAME: "${{ matrix.country_hostname }}" @@ -182,11 +158,24 @@ jobs: if: always() with: name: ui-tests-chrome-${{ matrix.country_hostname }} - path: | - browser-extensions/common/js/tests/ui-test/playwright-report/ - browser-extensions/common/js/tests/ui-test/screenshot.png + path: browser-extensions/extension/src/js/tests/ui-test/playwright-report/ retention-days: 30 + # Debug artefacts for inspecting UI test failures (screenshots + page HTML) + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: ui-tests-screenshots-${{ matrix.country_hostname }} + path: browser-extensions/extension/src/js/tests/ui-test/test-results/ + retention-days: 7 + + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: ui-tests-html-${{ matrix.country_hostname }} + path: browser-extensions/extension/src/js/tests/ui-test/playwright-debug/ + retention-days: 7 + # This stage will run once the extensions have been built, and should only run if they were successful. # Assuming they are successful, we will push them somewhere they can be used. @@ -194,7 +183,7 @@ jobs: publish-extension: name: Push the build extensions somewhere runs-on: ubuntu-latest - needs: + needs: - integration-test # if: startsWith(github.ref, 'refs/tags/v') @@ -246,7 +235,6 @@ jobs: }) */ # if: startsWith(github.ref, 'refs/tags/v') - # - id: get-branch-version-tag # uses: actions/github-script@v7 @@ -258,7 +246,6 @@ jobs: # } # core.setOutput('version_tag', version_tag) # if: startsWith(github.ref, 'refs/tags/v') - - run: echo "branch version tag is ${{steps.get-branch-version-tag.outputs.version_tag}}" # if: startsWith(github.ref, 'refs/tags/v') diff --git a/.github/workflows/build-staging-website.yml b/.github/workflows/build-staging-website.yml index 38ec5bbd..2acccdf0 100644 --- a/.github/workflows/build-staging-website.yml +++ b/.github/workflows/build-staging-website.yml @@ -4,7 +4,7 @@ name: Staging Website Builder concurrency: staging-website-build # Run this workflow every time a new commit is pushed to any branch apart from the production one (master) -on: +on: push: branches-ignore: - master @@ -28,10 +28,10 @@ jobs: - name: 📂 Checkout code uses: actions/checkout@v4 - - name: 💎 setup ruby - uses: ruby/setup-ruby@v1 + - name: 💎 setup ruby with mise + uses: jdx/mise-action@v3 with: - ruby-version: 3.1 + install: true - name: Sanitise branch name shell: bash @@ -41,6 +41,9 @@ jobs: echo "sanitised branch name: ${SANITISED_BRANCH_NAME}" echo "sanitised-branch-name=${SANITISED_BRANCH_NAME}" >> $GITHUB_OUTPUT + - name: Install pnpm dependencies + run: pnpm install --frozen-lockfile + # Prepare the website directory - name: Copy dependencies to Website directory run: | @@ -71,11 +74,12 @@ jobs: # Then we need to prune any directories that don't match to currently active branches + # Deploy steps only run on the canonical repo; forks build but do not deploy (no token). # Get the latest copy of the repo # We need to set a token here, otherwise it uses the default one that won't have permission to push - name: Checkout code uses: actions/checkout@v4 - if: ${{ github.actor != 'dependabot[bot]' }} + if: github.repository == 'fraz3alpha/running-challenges' && github.actor != 'dependabot[bot]' with: repository: fraz3alpha/running-challenges-staging ref: gh-pages @@ -84,7 +88,7 @@ jobs: - name: Reconcile branches id: reconcile-branches - if: ${{ github.actor != 'dependabot[bot]' }} + if: github.repository == 'fraz3alpha/running-challenges' && github.actor != 'dependabot[bot]' run: | git ls-remote --heads | awk '{print $2}' | awk -F 'refs/heads/' '{print $2}' | sort > running-challenges-branches.txt echo "All branches: $(cat running-challenges-branches.txt)" @@ -124,7 +128,7 @@ jobs: - name: Deploy uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.actor != 'dependabot[bot]' }} + if: github.repository == 'fraz3alpha/running-challenges' && github.actor != 'dependabot[bot]' with: personal_token: ${{ secrets.RUNNING_CHALLENGES_STAGING_GITHUB_API_TOKEN }} external_repository: fraz3alpha/running-challenges-staging diff --git a/.github/workflows/build-website.yml b/.github/workflows/build-website.yml index ba0524f4..ca580147 100644 --- a/.github/workflows/build-website.yml +++ b/.github/workflows/build-website.yml @@ -33,7 +33,7 @@ jobs: submodules: recursive # Use GitHub Actions' cache to shorten build times and decrease load on servers - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: vendor/bundle key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }} diff --git a/.gitignore b/.gitignore index 1804cb80..cbc6120a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ **/.DS_Store **/*~ .jekyll-cache/ -node_modules \ No newline at end of file +node_modules +package-lock.json +**/package-lock.json \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e0654706..00000000 --- a/.travis.yml +++ /dev/null @@ -1,74 +0,0 @@ - -# based on https://jekyllrb.com/docs/continuous-integration/travis-ci/ -language: ruby -rvm: 2.6.3 - -env: - - EXTENSION_BUILD_ID=$TRAVIS_BUILD_NUMBER EXTENSION_BUILD_VERSION=$TRAVIS_TAG - -before_script: - - chmod +x ./build/website/build.sh - - chmod +x ./build/website/build-staging.sh - - chmod +x ./build/extension-chrome/build.sh - - chmod +x ./build/extension-firefox/build.sh - - nvm install 10 - - npm install -g web-ext - - node --version - - bash -c "cd ./browser-extensions/common/js && npm install" -# - gem uninstall -i $(rvm gemdir)@global -ax bundler || true -# - gem install bundler -v 1.16.1 - -before_install: - - gem install bundler - -script: - # Only build the staging website if the github token is available, which means - # that it will only happen for PRs from our own repo, not forks. - - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then if [ "$RUNNING_CHALLENGES_GITHUB_TOKEN" != "" ]; then bash ./build/website/build-staging.sh; fi; fi' - - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./build/website/build.sh; fi' - - './build/extension-chrome/build.sh' - - './build/extension-firefox/build.sh' - # Moving the test until after the build to start with, so that I can defer having to work out how - # not to bundle the coverage data into the extension zip files. - # Perhaps we should actually be testing the bundled code, rather than that in the repo, not sure. - # Run the tests against the Javascript libraries we have written - - bash -c "cd ./browser-extensions/common/js && npm run test-with-coverage" - -# branch whitelist. -# For GitHub Pages - if we push code to master the built code goes to gh-pages -# Tags are the same as branches when it comes to Travis, so we need to include -# our release tag names here too so that tagged releases get built and pushed to -# GitHub releases -branches: - only: - - master - - /^v[0-9]/ - -before_deploy: - # Rename the output files to be suitable for uploading to the GitHub release - - sh -c 'cd ./browser-extensions/chrome/build/web-ext-artifacts && rename 's/^/chrome-/' *.zip' - - sh -c 'cd ./browser-extensions/firefox/build/web-ext-artifacts && rename 's/^/firefox-/' *.zip' - -deploy: - provider: releases - name: Running Challenges $TRAVIS_TAG - api_key: - secure: HSsDMbTOomaysTK7ZdLKGh73v475aBbXU5o08IXTg6Uk29pvypgIsbsyMm/cI5azFKVzlfb9L47bSlSUbX1ho/ad5XxAphDt3EQAVGv0H7NnYxjDo4U8/VxwxRHqmGrmb6FEqOzZKgpYxzQDE7kYFs0CT4u2yNH4+gsF4ZvnIHNbKRV4s3jwWJPhvHai+AneNX8SQehAnYcjQ4kLuDNNNaPp18ewfLBm0IwbEdwvDOOYzdV4Mjsn+iJaINFTipwikQKAilk4bjU+rn5jvu/sC4oshhfsdBcuDmxK0XlsfpTkKtgGGcLwOSzoHZY25RC+Q1ZFYmGPBPZDk643W59HqOjA86NoDutNhGpL9b1YJThAUhG0zLP9bxnTOOzksPBTd/2hZr2XMIFY+cxsLLvIpJdJ1pAYfGdXOsCRm/tQ79pV2BCnSXY45JERKcdbPUm4kXv8b9oGQb8pOEDn4ERiCgbXyvpSJNUK9CovDgkGf3Xi9wMIgapQ/DFPYlsT7dNgssPSHXp4Ppf/CeHA3gtPIlj9+dE29rpvGS0dsWIXYSIGhFWeRnKV/WHAF/IH1jmCs6DmhQil7BPr66o0wntSWDyk5+bwJm0oehIMMpALbwOCl16Vx1+f9Nlyjv0tJF1fZ1z8UY+RoNC/Egd+kfnPDL9OFPSWkIBKbG8K/kV6CZw= - file_glob: true - file: - - browser-extensions/chrome/build/web-ext-artifacts/chrome-running_challenges*.zip - - browser-extensions/firefox/build/web-ext-artifacts/firefox-running_challenges*.zip - skip_cleanup: true - on: - tags: true - condition: $TRAVIS_TAG =~ ^v - repo: fraz3alpha/running-challenges - -sudo: false # route your build to the container-based infrastructure for a faster build - -addons: - apt: - packages: - - libcurl4-openssl-dev - -cache: bundler # caching bundler gem packages will speed up build diff --git a/Dockerfile b/Dockerfile index 7938a5dc..ce96e030 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # docker build -t rc:latest . # docker run -v `pwd`:/rc rc:latest -FROM node:16-buster +FROM node:20 RUN apt update && apt install -y rsync diff --git a/README.md b/README.md index 5bda0790..928f9df2 100644 --- a/README.md +++ b/README.md @@ -16,26 +16,52 @@ locally for testing by running a bash script (Linux and Mac only). 1. From the root of the project, run the bash script: - `./build/website/build-local-and-run.sh` + `./build/website/build-local-and-run.sh` - If you have other Jekyll sites running in Docker containers, you can specify a port mapping - when you run the script (eg to expose port 4002 instead of the default 4000): + If you have other Jekyll sites running in Docker containers, you can specify a port mapping + when you run the script (eg to expose port 4002 instead of the default 4000): + + `JEKYLL_PORT=4002 ./build/website/build-local-and-run.sh` - `JEKYLL_PORT=4002 ./build/website/build-local-and-run.sh` 1. In a web browser, open the locally-hosted website: - `http://localhost:4002/` + `http://localhost:4002/` + + Any changes you make to pages of the website should automatically get picked up when you refresh (F5) the page. - Any changes you make to pages of the website should automatically get picked up when you refresh (F5) the page. 1. To stop the local website running, press CTRL+C in the terminal. You might find you need to update the Gemfile.lock file occasionally. -To do that I've run the following from within the `website` directory. + +## Updating Ruby Dependencies + +### Option 1: Using Dependabot (Recommended) + +Dependabot will automatically create pull requests for outdated Ruby dependencies. Check the [Dependencies tab](https://github.com/fraz3alpha/running-challenges/network/dependencies) or look for PRs labeled `dependencies` and `ruby`. + +### Option 2: Manual Update + +If you need to update manually, run from the `website` directory: + +```bash +cd website +bundle update +git add Gemfile.lock +git commit -m "chore: update Ruby dependencies" ``` + +### Option 3: Using Docker (Legacy) + +If you prefer the Docker approach: + +```bash +cd website docker run -it -v `pwd`:/tmp/website-data jekyll/jekyll bash ``` -and then inside the container run: -``` + +Then inside the container: + +```bash bundle update ``` @@ -58,7 +84,7 @@ docker run --rm -v `pwd`:/rc rc:latest ## Browser Extensions: non-Docker build The bulk of the code that is common to the Chrome and Firefox extensions lives -in the `browser-extensions/common` directory, and is supplemented by additional +in the `browser-extensions/extension/src` directory, and is supplemented by additional browser-specific files and libraries from either `browser-extensions/chrome` or `browser-extensions/firefox` when the extension is built. @@ -71,44 +97,132 @@ extension when a build occurs. Mozilla provide a small tool - [`web-ext` tool](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext), to package and lint check Firefox browser extensions, which is used for packaging both the Chrome and Firefox extensions. The lint -checking is of limited use for Chrome, but is still run for reference. It can be -installed with `npm install --global web-ext`. +checking is of limited use for Chrome, but is still run for reference. Install it +with `pnpm add -g web-ext` (or use the toolchain from `mise.toml` via `./script/bootstrap`). -### Chrome Extension +### Building the extensions + +Both the Chrome and Firefox extensions are built from a single source tree under +`browser-extensions/extension/src/`. The recommended way to build is: -The Chrome extension is the original version, and can be built by running the build -script from the root of the repository: ``` -bash ./build/extension-chrome/build.sh +./script/setup ``` -This will create an unpacked version of the extension in `browser-extensions/chrome/build`, -together with a packaged version in the `web-ext-artifacts` directory. -### Firefox Addon +or, after bootstrapping, `./script/update`. You can also build directly with: -The Firefox addon is built from largely the same code as the Chrome extension -with a few small tweaks (such as a different manifest file, and some `sed` -replacements). It uses a separate build script from the Chrome version, but is -built in an identical way: ``` -bash ./build/extension-firefox/build.sh +source build/version.sh && export EXTENSION_BUILD_VERSION EXTENSION_BUILD_ID +pnpm --filter running-challenges-extension run build:extension ``` -This will create an unpacked version of the extension in `browser-extensions/firefox/build`, -together with a packaged version in the `web-ext-artifacts` directory. + +Third-party libraries (jQuery, Leaflet, and plugins) are installed as pnpm +dependencies and copied into the build; the build script uses the extension +package’s `node_modules`. This produces unpacked and packaged builds in +`browser-extensions/chrome/build` and `browser-extensions/firefox/build` +(including `web-ext-artifacts` with the `.zip` packages). Your build of the extension is not signed, so Firefox does not allow you to install it directly from your built file. Instead, for testing purposes, you have to install it as a [temporary installation in Firefox](https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox/) (it automatically deletes itself when you quit Firefox). +## Development scripts + +This repository includes a `script/` directory that follows GitHub's [scripts-to-rule-them-all](https://github.com/github/scripts-to-rule-them-all) pattern. +These scripts are the preferred way to bootstrap the project, run tests, and quickly see changes in the browser extensions. + +- `./script/bootstrap` + Installs core tooling (via `mise` and `pnpm`) and JavaScript test dependencies; see `build/README.md` for build-time details. + +- `./script/setup` + Runs `script/bootstrap`, then builds both the Chrome and Firefox extensions via the Node build script. + +- `./script/update` + Rebuilds both extensions (after bootstrap), and is safe to run after pulling new changes. + +- `./script/server [PARKRUN_URL]` + Rebuilds the extensions via `script/update`, then runs `web-ext run` against the Firefox build so you can see changes in Firefox immediately. + - If `PARKRUN_URL` is provided as the first argument, that URL is opened. + - If no argument is given, the `PARKRUN_URL` environment variable is used if set. + - If neither is provided, it defaults to `https://www.parkrun.com.au/parkrunner/1001388/all`. + +- `./script/server-website [PORT]` + Builds the website assets and runs the local Jekyll site via Docker (`build/website/build-local-and-run.sh`). If `PORT` is provided, it overrides the `JEKYLL_PORT` environment variable for that run (default 4000). + +- `./script/test` + Runs the JavaScript unit tests with coverage via the `running-challenges-tests` pnpm workspace package (`browser-extensions/extension/src/js/tests`), then runs the Playwright UI tests in `browser-extensions/extension/src/js/tests/ui-test` (Chrome extension loaded via `@playwright/test`). + +- `./script/cibuild` + Wrapper suitable for CI servers; currently runs `script/test`. + +## Tool versions with mise + +To ensure consistent tool versions between local development and CI, this repository uses [`mise`](https://mise.jdx.dev/): + +- Tool versions are defined in `mise.toml` (for example, Node.js 20, pnpm 10, and Ruby 3.4). +- On a local machine: + - Install [mise](https://mise.jdx.dev/) if you do not have it, then from the repository root run `./script/bootstrap`. Bootstrap runs `mise install` to install the toolchain (Node.js, pnpm, Ruby) from `mise.toml`, then `pnpm install` for extension build dependencies (such as `web-ext`). +- In GitHub Actions, the [`jdx/mise-action`](https://github.com/jdx/mise-action) workflow step reads `mise.toml` and installs the same tool versions; extension jobs then run `pnpm install --frozen-lockfile`. +- To verify the Jekyll website builds and runs (e.g. after upgrading Ruby), run `./script/server-website`. + # Automated builds -This repository is integrated with TravisCI so that code pushed to the master -branch in GitHub is built. This will update the website, and if a suitable tag -is present, then a GitHub Release is created and a copy of the extension at that -level is uploaded for further submission to the Chrome and Firefox extension/addon -webstores. +This repository uses GitHub Actions for continuous integration and deployment. The following workflows are configured: + +## Production Website Build + +- **Trigger**: Push to `master` branch +- **Action**: Builds and deploys the main website to `gh-pages` branch +- **Workflow**: `.github/workflows/build-website.yml` + +## Staging Website Build + +- **Trigger**: Push to any branch except `master`, `gh-pages`, or `gh-pages-staging` +- **Action**: Builds and deploys a staging version to `staging.running-challenges.co.uk` +- **Workflow**: `.github/workflows/build-staging-website.yml` + +## Extension Build & Release + +- **Trigger**: Push to `master` branch or manual dispatch +- **Action**: Builds Chrome and Firefox extensions, creates GitHub releases on version tags +- **Workflow**: `.github/workflows/build-extension.yml` + +## Code Quality Analysis + +- **Trigger**: Push to `master` branch, pull requests, or manual dispatch +- **Action**: Runs CodeQL security analysis +- **Workflow**: `.github/workflows/codeql-analysis.yml` + +## Website screenshots + +- **Local**: Run `./script/update-screenshots` to capture screenshots from the live parkrun site with the Chrome extension loaded. Requires extension built (`./script/update`). Screenshots are defined in `browser-extensions/extension/src/js/tests/ui-test/screenshots.yml`. + +# Dependency Management + +This repository uses [Dependabot](https://docs.github.com/en/code-security/dependabot) to automatically keep dependencies up-to-date: + +## Automated Updates + +- **GitHub Actions**: All workflow actions are automatically updated weekly +- **pnpm (JavaScript)**: Extension, unit-test, and Playwright UI-test workspace packages are updated weekly (root `pnpm-lock.yaml`). Check the [Dependencies tab](https://github.com/fraz3alpha/running-challenges/network/dependencies) or look for PRs labelled `dependencies` and `pnpm`. +- **Ruby/Bundler**: Jekyll and other Ruby gems are updated weekly +- **Schedule**: Every Monday at 9:00 AM UTC + +## Configuration + +Dependabot is configured in `.github/dependabot.yml` and will: + +- Create pull requests for outdated dependencies +- Group related updates to reduce PR noise +- Assign appropriate labels (`dependencies`, `github-actions`, `pnpm`, `ruby`, `bundler`, `automated`) +- Use consistent commit message format (`chore:` prefix) + +## Manual Updates + +If you need to update dependencies manually: -Each PR created, and when additional commits are pushed to existing PR branches, -an additional build it run to build a copy of the website on staging.running-challenges.co.uk . +- **GitHub Actions**: Edit workflow files in `.github/workflows/` +- **pnpm**: Run `pnpm update` at the repo root (or `pnpm update --filter running-challenges-tests` for test deps only) +- **Ruby**: Run `bundle update` in the `website/` directory # Adding a new volunteer role @@ -116,10 +230,10 @@ Occasionally parkrun create a new volunteer role, for example the "Car Park Mars which needs to be added in. By default the extension won't pick up these unknown roles, and they will need adding in in a few places: -- Add the name of the role, and any known translations to `browser-extensions/common/js/lib/i18n.js`, +- Add the name of the role, and any known translations to `browser-extensions/extension/src/js/lib/i18n.js`, putting an entry in at least the `default` section. - Add the `name` and a suitable `shortname` to the `generate_volunteer_challenge_data()` - function in `browser-extensions/common/js/lib/challenges.js` + function in `browser-extensions/extension/src/js/lib/challenges.js` - Create the new badge as a layer in `images/badges/256x256/badges.xcf`, and export it as a `.png` file. - Follow the instructions in `images/badges/README.md` to generate the star badges. @@ -130,24 +244,24 @@ roles, and they will need adding in in a few places: It is impossible to add a new country until the new website is made live, and there are events on the map. - Find the website URLs for the 2 pages the extension modifies. They seem to follow the english spelling these days, and are only available through the 'parkrunner' URLS, that replaced the older 'athlete' based ones: - - "*://www.parkrun.org.uk/parkrunner/*/all/" - - "*://www.parkrun.org.uk/parkrunner/*/" - Each of these needs to be added to the `manifest.json` file for all the supported browsers. + - "_://www.parkrun.org.uk/parkrunner/_/all/" + - "_://www.parkrun.org.uk/parkrunner/_/" + Each of these needs to be added to the `manifest.json` file for all the supported browsers. - Look in the volunteer rosters and attempt to find the translations to add to the `i18n.js` (internationalisation) file - unless it has changed, look at https://www.parkrun.org.uk/parkrunner/88720/, as they have done nearly everything. - Add the ISO code for the country to the flag map in `challenges.js` - Add the ISO code to the list of flags for the website under the `flags.yml` data file. - Get the flag from https://emojipedia.org/twitter/twemoji-2.6/ as described in the flags README. - Add the country code and country name to `background.js` -- Update `browser-extensions/common/js/tests/ui-test/update.sh` with the new parkrun domain, and run the script to pull in new test files +- Update `browser-extensions/extension/src/js/tests/ui-test/update.sh` with the new parkrun domain, and run the script to pull in new test files - Add the new country to the Github actions test list: `.github/workflows/build-extension.yml` # Version numbers There hasn't been any real consistency in how the versions have been numbered, with the versions mostly going up -a point release when something was changed. The only thing that has been consistent is that the last number has -referred back to the Travis build that generated the release. +a point release when something was changed. The only thing that has been consistent is that the last number has +referred back to the GitHub Actions build that generated the release. -To make this more consistent, from January 2020 the numbering, which follows the format +To make this more consistent, from January 2020 the numbering, which follows the format `...` will refer to: ### Major version @@ -156,37 +270,49 @@ Something big has changed in the way the extension works. We may never go to ver ### Minor version -A new challenge, stat, or badge has been added - or there has been a significant addition to the way the data is +A new challenge, stat, or badge has been added - or there has been a significant addition to the way the data is displayed on the webpage. ### Patch version -Bug fixes or minor rendering changes +Bug fixes or minor rendering changes ### Build Number -This will remain as it always has, including the Travis build number. +This will remain as it always has, including the GitHub Actions build number. # Releasing a new version 1. When everything has been tested and merged into master, tag master with the -version in `build/version.sh`. This will trigger a Travis build to push the built -zips to a Github release. - ``` - git tag v0.7.5 - git push origin v0.7.5 - ``` -1. Watch the [Travis build](https://travis-ci.org/fraz3alpha/running-challenges) run. + version in `build/version.sh`. This will trigger a GitHub Actions workflow to build and create a GitHub release. + ` git tag v0.7.5 +git push origin v0.7.5` +1. Watch the [GitHub Actions workflow](https://github.com/fraz3alpha/running-challenges/actions) run. 1. Head over to the [releases](https://github.com/fraz3alpha/running-challenges/releases) -tab in Github and find the release for the [version you tagged](https://github.com/fraz3alpha/running-challenges/releases/tag/v0.7.5). + tab in Github and find the release for the [version you tagged](https://github.com/fraz3alpha/running-challenges/releases/tag/v0.7.5). 1. Edit the release with any information that you may want to include in release notes, or perhaps form the basis of the blog post. 1. Download the zips and test them in Chrome and Firefox to check they load and don't give any errors - load a couple of profiles and if you have added some new countries or badges, check those. - - In Firefox, go to `about:debugging` and load a temporary add-on - - In Chrome, go to `chrome://extensions` and load an unpacked extension + - In Firefox, go to `about:debugging` and load a temporary add-on + - In Chrome, go to `chrome://extensions` and load an unpacked extension 1. Go to the [Chrome webstore](https://chrome.google.com/webstore/developer/dashboard) and upload the new version. 1. Go to the [Mozilla Add-ons site](https://addons.mozilla.org/en-GB/firefox/) and upload the new version. Make sure to check that it is compatible with Android, this is unchecked by default. Add the release notes when asked. 1. Complete the release by creating a PR to include: - - Prepare for the next release by updating the version string in `build/version.sh` - to the next appropriate number (this can always be changed later) - - Add a blog post in `website/_posts` - just copy the last release and change - the pertinent bits. + - Prepare for the next release by updating the version string in `build/version.sh` + to the next appropriate number (this can always be changed later) + - Add a blog post in `website/_posts` - just copy the last release and change + the pertinent bits. + +## Further documentation + +Additional documentation lives in README files in subfolders: + +- [pnpm-migration.md](pnpm-migration.md) — plan for unifying the extension codebase and managing dependencies with pnpm. +- `build/README.md` — build-time dependencies. +- `browser-extensions/extension/src/README.md` — example parkrunner pages to help with manual testing. +- `browser-extensions/extension/src/js/README.md` — unit and automated browser testing for the extension. +- `browser-extensions/extension/src/js/tests/ui-test/README.md` — Playwright-based UI testing notes. +- `browser-extensions/extension/src/css/README.md` — notes on custom CSS for the extension. +- `images/README.md` — general image guidelines. +- `images/badges/README.md` — challenge badge image generation and star overlays. +- `images/flags/README.md` — adding and attributing new country flags. +- `js/lib/third-party/README.md` — overview of third-party JavaScript and CSS libraries used by the project. diff --git a/browser-extensions/chrome/manifest.json b/browser-extensions/chrome/manifest.json index 1cbb3c58..fa0b444f 100644 --- a/browser-extensions/chrome/manifest.json +++ b/browser-extensions/chrome/manifest.json @@ -47,7 +47,7 @@ "js/lib/third-party/leaflet-fullscreen/leaflet-fullscreen-1.0.1.js", "js/lib/third-party/leaflet-markercluster/leaflet-markercluster-1.3.0.js", "js/lib/third-party/leaflet-extramarkers/leaflet-extramarkers-1.0.5.js", - "js/lib/third-party/leaflet-canvasicon/leaflet-canvasicon-0.1.4.js", + "js/lib/third-party/leaflet-canvasicon/leaflet-canvasicon-0.1.6.js", "js/lib/third-party/leaflet-piechart/leaflet-piechart-0.1.2.js", "js/lib/third-party/d3-voronoi/d3-voronoi.js", "js/lib/cache.js", diff --git a/browser-extensions/common/js/content-scripts/content-script-parkrunner.js b/browser-extensions/common/js/content-scripts/content-script-parkrunner.js deleted file mode 100644 index 6522f879..00000000 --- a/browser-extensions/common/js/content-scripts/content-script-parkrunner.js +++ /dev/null @@ -1,659 +0,0 @@ - -function get_table(id, caption) { - - query_string = "table" - if (id !== undefined) { - query_string += "[id=" + id + "]" - } - - - return $(query_string).filter(function (index) { - - // If no caption is specified, return every result - if (caption === undefined) { - return true - } - - // Else, get the captions for these tables - table_captions = $("caption", this) - // Skip anything without exactly one caption - if (table_captions.length !== 1) { - return false - } - // Only include this table if the caption is correct - return table_captions[0].innerText.replace('–', '').trim() == caption - }) -} - -function get_badge_location() { - return $("div[id=content]").find("p:first") -} - -function parse_volunteer_table(result) { - - // Find all the results tables in this page - var completed_volunteer_roles = {} - $("table[id=results]", result).each(function (results_table_index) { - // Try and find the table that also has a

containing - // "Volunteer Summary" - var results_table = $(this) - parent = $(this).parent() - $("h3#volunteer-summary", parent).each(function (index) { - completed_volunteer_roles = {} - $("tbody>tr", results_table).each(function (role_index) { - table_cells = $("td", this) - volunteer_role = table_cells[0].innerText.replace(/^\s+|\s+$/g, ''); - volunteer_role_quantity = table_cells[1].innerText - - // Try and translate from whatever language it is in - normalised_volunteer_role = get_normalised_volunteer_role(volunteer_role) - - if (!(normalised_volunteer_role in completed_volunteer_roles)) { - completed_volunteer_roles[normalised_volunteer_role] = 0 - } - completed_volunteer_roles[normalised_volunteer_role] += parseInt(volunteer_role_quantity) - }) - // console.log(completed_volunteer_roles) - }) - - }) - return completed_volunteer_roles -} - -function set_complete_progress_message(errors) { - var messages = ['Additional badges provided by Running Challenges'] - $.each(errors, function (index, error_message) { - messages.push(error_message) - }) - if (errors.length > 0) { - messages.push('Refresh the page to try again') - } - set_progress_message(messages.join('

')) -} - -function set_progress_message(progress_message) { - console.log("Progress: " + progress_message) - // $("div[id=running_challenges_messages_div]").html($("div[id=running_challenges_messages_div]").html() + "
" + progress_message) - $("div[id=running_challenges_messages_div]").html(progress_message) -} - -function parsePageAthleteInfo() { - - // Parse out the information from the page relating to this parkrunner, including: - // The name, as shown - - // The HTML relating to the top of the page looks like this: - //
- //
- //
- // - // - // - // CONTRA December 2019 - // - // - //

Andrew TAYLOR - 202 runs at All Events
202 parkruns total - //

- - // It can look different in different languages, e.g. - // https://www.parkrun.ru/parkrunner/5481082/all/ - //

Максим МАХНО - 14 пробежек на All Events
14 забеги parkrun total

- // https://www.parkrun.jp/parkrunner/6460713/all/ - //

和輝 遠藤 - 10 参加 All Events
10 parkrun total

- - // In each case, however, it is the first

block, and everything before the dash is what we want. - // Find the first h2 tag in the appropriate div, and we can parse the name out of that. - var mainAthleteTag = $("div[id=main]>div[id=primary]>div[id=content]>h2").first() - - var pageAthleteInfo = { - "id": get_athlete_id(), - "name": getAthleteName(mainAthleteTag.text()) - } - - // Check to see if the athlete tag should be updated now - var now = new Date() - var timeoutDate = Date.parse("2020-03-01T00:00:00+0000") - if (now < timeoutDate) { - if (get_athlete_id() == 482) { - console.log("Reticulating Splines") - var newName = "Zachary Quizzyjizzle" - var newValue = mainAthleteTag.html().replace(/(.*?) -/, newName + " -") - mainAthleteTag.html(newValue) - pageAthleteInfo.name = newName - } - } - - return pageAthleteInfo - -} - -function getAthleteName(athleteSummaryText) { - // e.g. - // Andrew TAYLOR - 202 runs at All Events202 parkruns total - // - 0 runs at All Events... - // Максим МАХНО - 14 пробежек на All Events14 забеги parkrun total - // - 0 пробежек на All Events... - - var athleteName = undefined - - if (athleteSummaryText !== undefined) { - var parts = athleteSummaryText.split(" - ") - if (parts[0] != "") { - athleteName = parts[0] - } - } - - return athleteName - -} - -function parse_results_table() { - - parkruns_completed = [] - - get_table("results", get_localised_value('table_all_results')).each(function (results_table) { - // Gather the data for this table - - // Find all the table body rows - completed_parkrun_events = $("tbody>tr", this) - - completed_parkrun_events.each(function (index) { - // Only parse table rows with at least one cell, and look at the first one - table_cells = $("td", this) - if (table_cells.length > 0) { - // Find the name and other interesting bits of data for this parkrun - - parkrun_name = table_cells[0].innerText.trim() - parkrun_eventlink = table_cells[0].innerHTML.trim() - parkrun_date = table_cells[1].innerText.trim() - parkrun_datelink = table_cells[1].innerHTML.trim() - parkrun_event_number = table_cells[2].innerText.trim() - parkrun_position = table_cells[3].innerText.trim() - parkrun_time = table_cells[4].innerText.trim() - parkrun_pb = table_cells[6].innerText.trim() - - // Create a date object, useful for comparing - parkrun_date_obj = new Date() - date_parts = parkrun_date.split("/") - if (date_parts.length == 3) { - parkrun_date_obj = new Date(date_parts[2] + "-" + date_parts[1] + "-" + date_parts[0] + "T00:00:00Z") - } - - // Store this parkrun instance in our big data structure - parkrun_stats = { - "name": parkrun_name, - "eventlink": parkrun_eventlink, - "date": parkrun_date, - "datelink": parkrun_datelink, - "date_obj": parkrun_date_obj, - "event_number": parkrun_event_number, - "position": parkrun_position, - "time": parkrun_time, - "pb": parkrun_pb.length > 0 - } - parkruns_completed.push(parkrun_stats) - - } - }); - }); - - // Return the results in chronological order, which is the natural - // way to process it, as the older parkruns will be hit first when iterating - // over the list - - // The returned array should be ordered by date, oldest first, rather than assuming the order. We've had several reports of this - // causing issues, but at the time it appeared not to be consistent and some profiles were in one order, and others in the reverse. - var parkruns_completed_sorted = parkruns_completed.sort(function (a, b) { - return a.date_obj - b.date_obj - }) - - if (parkruns_completed_sorted.length > 0) { - console.log("Sorted parkruns, first: " + parkruns_completed_sorted[0].date + " last: " + parkruns_completed_sorted[parkruns_completed_sorted.length - 1].date) - } - - return parkruns_completed_sorted -} - - -function create_skeleton_elements(id_map) { - - top_of_the_page_anchor = $("div[id=content]").find("p:first") - - // The top sections are badges, flags, and messages. - // Initially the badges and flags are empty until the data is parsed and loaded, - // and the messsages displayed will indicate progress. - - // Spacer to separate the existing shirt icons from our badges - var running_challenges_top_spacer = $('
') - top_of_the_page_anchor.after(running_challenges_top_spacer) - - // Create badges element - var running_challenges_badges_div_container = $('

') - var running_challenges_badges_div = $('

').attr("id", id_map["badges"]) - running_challenges_badges_div_container.append(running_challenges_badges_div) - running_challenges_top_spacer.after(running_challenges_badges_div_container) - - // Create flags element - var running_challenges_flags_div = $('
').attr("id", id_map["flags"]) - running_challenges_badges_div_container.after(running_challenges_flags_div) - - var running_challenges_message_spacer = $('
') - running_challenges_flags_div.after(running_challenges_message_spacer) - - // Add a message div, with some initial contents - var running_challenges_messages_div = $('
').attr("id", id_map["messages"]) - running_challenges_message_spacer.after(running_challenges_messages_div) - // Use the progress message function to se interval - set_progress_message('Loading Running Challenges Badges') - - // Create main table element - var running_challenges_main_table_div = $('
').attr("id", id_map["main"]) - get_table('results', get_localised_value('table_all_results')).before(running_challenges_main_table_div) - - // Create stats element - var running_challenges_stats_div = $('
').attr("id", id_map["stats"]) - running_challenges_main_table_div.before(running_challenges_stats_div) - - // Add a spacer between the stats and the main table - running_challenges_main_table_div.before($('
')) - - // Add a spacer after the main table - running_challenges_main_table_div.after($('
')) - -} - -function add_stats(div_id, data) { - set_progress_message("Adding stats") - var stats_div = $("div[id=" + div_id + "]") - add_stats_table(stats_div, data) - set_progress_message("Added stats") -} - -function add_badges(div_id, data) { - set_progress_message("Adding badges") - // Find out which challenges we have been provided, and determine if they are - // complete, and if so, award the badge - var badges = [] - if (data.challenge_results) { - // Running badges - if (data.challenge_results.running_results) { - data.challenge_results.running_results.forEach(function (result) { - var badge = get_running_badge(result) - if (badge) { - if (Array.isArray(badge)) { - $.each(badge, function (index, badgeInstance) { - badges.push(badgeInstance) - }) - } else { - badges.push(badge) - } - } - }) - } - // Volunteer badges - if (data.challenge_results.volunteer_results) { - data.challenge_results.volunteer_results.forEach(function (result) { - var badge = get_volunteer_badge(result) - if (badge) { - badges.push(badge) - } - }) - } - } - - // Now insert all the badges into the page - badge_div = $("div[id=" + div_id + "]") - - var index_counter = 1 - badges.forEach(function (badge) { - var badge_awarded_div = $("") - badge_awarded_div.attr("id", "badge-awarded-" + badge.shortname) - var badge_link = $('') - badge_link.attr('href', badge.link) - - var img = $('') - img.attr('src', badge.icon) - img.attr('alt', badge.name) - img.attr('title', badge.name) - img.attr('width', 64) - img.attr('height', 64) - - modifyStyle(img) - - badge_awarded_div.append(badge_link) - badge_link.append(img) - badge_div.append(badge_awarded_div) - - if (index_counter > 0 && index_counter % 8 == 0) { - badge_div.append($('
')) - } - index_counter += 1 - }) - - // All done! - set_progress_message("Added badges") -} - -// Format the badge information specific to the running challenge data -function get_running_badge(result) { - var badge_info = undefined - // console.log(result) - - // If this challenge uses the badgesAwarded mechanism, then see if there are - // any - if (result.badgesAwarded !== undefined) { - if (result.badgesAwarded.length > 0) { - badge_info = [] - $.each(result.badgesAwarded, function (index, badge) { - badge_info.push({ - "name": badge.name, - "icon": browserAPI.runtime.getURL("/images/badges/" + badge.badge_icon + ".png"), - // The link just goes to the top of the main table for the challenge, not the specific row. - "link": "#" + result.shortname, - "shortname": badge.badge_icon - }) - }) - } - } else { - if (result.complete == true) { - badge_info = { - "name": result.name, - "icon": browserAPI.runtime.getURL("/images/badges/" + result.badge_icon + ".png"), - "link": "#" + result.shortname, - "shortname": result.badge_icon - } - } else if (result.partial_completion == true) { - badge_info = { - "name": result.partial_completion_name, - "icon": browserAPI.runtime.getURL("/images/badges/" + result.partial_completion_badge_icon + ".png"), - "link": "#" + result.shortname, - "shortname": result.partial_completion_badge_icon - } - } - } - return badge_info -} - -// Format the badge information specific to the volunteer challenge data - -// in particular, we award the stars based on how many times each has been done -function get_volunteer_badge(result) { - var badge_info = undefined - // console.log(result) - if (result.complete == true) { - badge_info = { - "name": result.name, - "icon": browserAPI.runtime.getURL("/images/badges/" + result.badge_icon + ".png"), - "link": "#" + result.shortname, - "shortname": result.badge_icon - } - if (result.subparts_completed_count >= 25) { - badge_info.icon = browserAPI.runtime.getURL("/images/badges/" + result.badge_icon + "-3-stars.png") - badge_info.name += " (25+ times)" - } else if (result.subparts_completed_count >= 10) { - badge_info.icon = browserAPI.runtime.getURL("/images/badges/" + result.badge_icon + "-2-stars.png") - badge_info.name += " (10+ times)" - } else if (result.subparts_completed_count >= 5) { - badge_info.icon = browserAPI.runtime.getURL("/images/badges/" + result.badge_icon + "-1-star.png") - badge_info.name += " (5+ times)" - } - } - return badge_info -} - -function add_flags(div_id, data) { - set_progress_message("Adding flags") - // console.log(data) - - if (data.parkrun_results && data.geo_data) { - - countryCompletionInfo = calculateCountryCompletionInfo(data) - console.log(countryCompletionInfo) - - // Generate a list of visited countries - countriesVisited = [] - $.each(countryCompletionInfo, function (countryName, countryInfo) { - if (countryInfo.visited) { - countriesVisited.push(countryInfo) - } - }) - console.log(countriesVisited) - - - // global_tourism_info = generate_global_tourism_data(data.parkrun_results, data.geo_data) - // console.log(global_tourism_info) - - flags_div = $("div[id=" + div_id + "]") - - var index_counter = 1 - countriesVisited.sort(function (o1, o2) { - // Equal - if (o1.firstRanOn === o2.firstRanOn) { - return 0 - } - // If either are null they should go to the back, although this shouldn't be the case - // as we have already pruned out those we haven't visited - if (o1.firstRanOn === null) { - return 1 - } - if (o2.firstRanOn === null) { - return -1 - } - return o1.firstRanOn - o2.firstRanOn - }).forEach(function (country) { - if (country.visited) { - // Find out when it was first run and make a nice string - var first_run = country.firstRanOn.toISOString().split("T")[0] - - var explorer_link = $("").attr("href", "#explorer") - - var img = $(''); - img.attr('src', get_flag_image_src(country.name)) - img.attr('alt', country.name) - img.attr('title', country.name + ": " + first_run) - img.attr('width', 48) - img.attr('height', 48) - // We need some padding so that the flags don't run into each other. - // This used to be 6px left and right, but that was not only huge, but squashed the flags - // for some reason, perhaps there was inherited top and bottom padding that disappeared - // at some point. So now lets make it 2px all round - img.attr('style', 'padding-left:2px; padding-right:2px; padding-bottom:2px; padding-top:2px') - - explorer_link.append(img) - flags_div.append(explorer_link) - - if (index_counter > 0 && index_counter % 8 == 0) { - flags_div.append($('
')) - } - index_counter += 1 - } - }) - } - - set_progress_message("Added flags") -} - -function updateSummaryInfo(data, athleteId) { - - data.info.has_athlete_id = (data.user_data.athlete_number !== undefined && data.user_data.athlete_number != '') - data.info.has_home_parkrun = (data.user_data.home_parkrun_info !== undefined && data.user_data.home_parkrun_info.name !== undefined) - data.info.is_our_page = (data.info.has_athlete_id && athleteId == data.user_data.athlete_number) - // Convenience properties for the main sources of data - // data.info.has_geo_data = (data.geo_data !== undefined) - data.info.has_parkrun_results = (data.parkrun_results !== undefined) - -} - -function add_challenge_results(div_id, data) { - set_progress_message("Adding challenge results") - // console.log(data) - results_div = $("div[id=" + div_id + "]") - results_table = generate_challenge_table() - results_div.append(results_table) - // Add the results if we have them - if (data.info.has_challenge_results) { - - // Add the explorer table on its own, before the challenges, always - generateExplorerTableEntry(results_table, data) - - if (data.info.has_challenge_running_results) { - add_challenges_to_table(results_table, 'running_results', data) - } - - if (data.info.has_challenge_volunteer_results) { - add_table_break_row(results_table, "Volunteer Challenges", "Get a purple badge when you've done a role once, get a star for doing the role 5+ times, two stars for 10+ times, three stars for 25+ times.") - add_challenges_to_table(results_table, 'volunteer_results', data) - } - } - set_progress_message("Added challenge results") -} - -function create_page() { - const id_map = create_skeleton(); - - let loaded_user_data = {}; - let loaded_geo_data; - let parsed_volunteer_data; - let parsed_results_data; - - parse_athlete_info(); - - parsed_results_data = parse_results(); - if (!parsed_results_data || parsed_results_data.length === 0) { - set_progress_message("No results detected, no challenge data will be compiled"); - return; - } - - load_data() - .then(data => { - loaded_user_data = data.loaded_user_data; - loaded_geo_data = data.loaded_geo_data; - return load_volunteer_data(); - }) - .then(volunteer_data => { - parsed_volunteer_data = volunteer_data; - process_data_and_update_ui(id_map, parsed_results_data, parsed_volunteer_data, loaded_geo_data, loaded_user_data); - }) - .catch(handle_error); -} - -function create_skeleton() { - const id_map = { - "messages": "running_challenges_messages_div", - "badges": "running_challenges_badges_div", - "flags": "running_challenges_flags_div", - "main": "running_challenges_main_div", - "stats": "running_challenges_stats_div" - }; - create_skeleton_elements(id_map); - return id_map; -} - -function parse_athlete_info() { - set_progress_message("Parsing Athlete Info"); - parsePageAthleteInfo(); - set_progress_message("Parsed Athlete Info"); -} - -function parse_results() { - set_progress_message("Parsing Results"); - const parsed_results_data = parse_results_table(); - set_progress_message("Parsed Results"); - return parsed_results_data; -} - -function load_volunteer_data() { - return fetch_volunteer_data(get_athlete_id()) - .then(results => { - set_progress_message("Loaded volunteer data"); - return parse_volunteer_table(results); - }); -} - -function process_data_and_update_ui(id_map, parsed_results_data, parsed_volunteer_data, loaded_geo_data, loaded_user_data) { - set_progress_message("All done"); - - const data = { - 'parkrun_results': parsed_results_data, - 'volunteer_data': parsed_volunteer_data, - 'geo_data': loaded_geo_data, - 'user_data': loaded_user_data, - 'info': {} - }; - - set_progress_message(JSON.stringify(data)); - updateSummaryInfo(data, get_athlete_id()); - - data.challenge_results = { - "running_results": generate_running_challenge_data(data, parsePageAthleteInfo()), - "volunteer_results": generate_volunteer_challenge_data(data) - }; - - data.info.has_challenge_results = !!data.challenge_results; - data.info.has_challenge_running_results = !!data.challenge_results.running_results; - data.info.has_challenge_volunteer_results = !!data.challenge_results.volunteer_results; - data.info.has_volunteer_data = !!data.volunteer_data; - - data.stats = generate_stats(data); - data.info.has_stats = !!data.stats; - - add_badges(id_map["badges"], data); - add_flags(id_map["flags"], data); - add_challenge_results(id_map["main"], data); - add_stats(id_map["stats"], data); - - const errors = []; - if (!has_geo_data(data)) { - errors.push('! Unable to fetch parkrun event location data: Stats, Challenges, and Maps requiring locations are not available !'); - } - - set_complete_progress_message(errors); -} - -function handle_error(error) { - console.error(`An error occurred: ${error}`); - set_progress_message(`Error: ${error}. Stack: ${error.stack}. Data is ${JSON.stringify(data ?? undefined)}`); -} - - -function fetch_volunteer_data(athleteId) { - const VOLUNTEER_DATA_URL = `https://${location.host}/parkrunner/${athleteId}/`; - const CACHE_KEY = `volunteer_data_${athleteId}`; - return fetch_with_cache(VOLUNTEER_DATA_URL, CACHE_KEY, 'text'); -} - -function get_athlete_id() { - const pathname = window.location.pathname; - const searchParams = new URLSearchParams(window.location.search); - - let athlete_id; - - if (pathname.startsWith('/parkrunner')) { - const match = pathname.match(/parkrunner\/(\d+)/); - if (match) { - athlete_id = match[1]; - } - } else if (searchParams.has('athleteNumber')) { - athlete_id = searchParams.get('athleteNumber'); - } - - console.log(`Athlete ID: ${athlete_id}`); - return athlete_id; -} - -function modifyStyle(img) { - // Shush, don't tell anyone and spoil the surprise - today = new Date(); - // getMonth is zero indexed. getDate is 1 indexed. - if (today.getMonth() == 3 && today.getDate() == 1) { - r = Math.floor(Math.random() * 4); - if (r > 0) { - img.attr('style', "transform:rotate(" + r * 90 + "deg);"); - } - } -} - -// Run our code and render the page -create_page(); - diff --git a/browser-extensions/common/js/lib/challenges_ui.js b/browser-extensions/common/js/lib/challenges_ui.js deleted file mode 100644 index d5e268d8..00000000 --- a/browser-extensions/common/js/lib/challenges_ui.js +++ /dev/null @@ -1,1330 +0,0 @@ -/* - * data object is of the form: - * [ - * alphabeteer: { - * "title_text": "Alphabeteer Challenge", - * "complete": false, - * "subparts": [ - * 'a', - * 'b', - * 'c' - * ], - * "subparts_completed": { - * "a": { - * "name": - * "position": - * ... - * }, - * ] - * If there are any recommendations about what to do for these parts, then - * they can be added to this object - * "subparts_remaining_recommendations": { - * "c": {'Congleton'} - * } - * }, - * ] - */ - -function generate_challenge_table() { - - // console.log('Generating Challenge Table') - var table = $('
') - // Set the ID so that we can easily find it again - // table.attr("id", "challenge-table") - // Use the 'results' id so that we pick up the standard styling - table.attr("id", "results") - // Optionally add a class with .addClass(this.tableClass) - table.append($('').text('Challenges')) - - // Add a set of links on the top row - help_link = $('
').attr("href", browserAPI.runtime.getURL("/html/help.html")).attr("target", '_blank').text('help') - options_link = $('').attr("href", browserAPI.runtime.getURL("/html/options.html")).attr("target", '_blank').text('options') - website_link = $('').attr("href", "https://running-challenges.co.uk").attr("target", '_blank').text('website') - help_td = $('').attr('colspan', 6).attr('align', 'right') - help_td.append(website_link) - help_td.append(" | ") - help_td.append(options_link) - help_td.append(" | ") - help_td.append(help_link) - help_td.append(" | ") - help_td.append("v" + extensionVersion) - - table.append($('').append(help_td)) - - return table - -} - -function add_table_break_row(table, title, help) { - var tbody = $('') - var gap_row = $('') - gap_row.append($('').attr('colspan', 6).append(' ')) - tbody.append(gap_row) - var main_row = $('') - var tooltip = '' - if (help !== undefined) { - tooltip = '[?]' - } - main_row.append($('').attr('colspan', 6).append(''+title+' '+tooltip)) - tbody.append(main_row) - table.append(tbody) -} - -function add_challenges_to_table(table, challenge_results_type, data) { - // console.log(data) - var ui_challenge_generation_duration = 0 - - data.challenge_results[challenge_results_type].forEach(function (challenge) { - // console.log("Generating table rows for " + challenge.shortname) - const start_time = new Date() - generate_standard_table_entry(challenge, table, data) - const duration = new Date() - start_time - ui_challenge_generation_duration += duration - // console.log("Completed generating table rows for " + challenge.shortname + " in " + duration + "ms") - }); - - // console.log("Completed generating challenge table rows in " + ui_challenge_generation_duration + "ms") - - return table -} - -function get_tbody_header(challenge) { - return $('').attr('id', get_tbody_header_id(challenge)) -} - -function get_tbody_content(challenge, userData) { - var content = $('').attr('id', get_tbody_content_id(challenge)) - // Find out whether this should be hidden by default when we initially draw the page - if (isChallengeHidden(challenge.shortname, userData)) { - content.hide() - } - return content -} - -function get_tbody_header_id(challenge) { - return "challenge_tbody_header_"+challenge['shortname'] -} - -function get_tbody_content_id(challenge) { - return "challenge_tbody_content_"+challenge['shortname'] -} - -function get_flag_icon(country, height, width) { - var flag_img = $(''); //Equivalent: $(document.createElement('img')) - flag_img.attr('src', browserAPI.runtime.getURL("/images/flags/png/"+country.flag_icon+".png")); - // badge_img.attr('alt', challenge.name) - // badge_img.attr('title', challenge.name) - flag_img.attr('height', height) - flag_img.attr('width', width) - - return flag_img -} - - -function get_challenge_icon(challenge, height, width) { - var badge_img = undefined - if (challenge.badge_icon !== undefined) { - badge_img = $(''); //Equivalent: $(document.createElement('img')) - badge_img.attr('src', browserAPI.runtime.getURL("/images/badges/"+challenge.badge_icon+".png")); - badge_img.attr('alt', challenge.name) - badge_img.attr('title', challenge.name) - badge_img.attr('height', height) - badge_img.attr('width', width) - } - return badge_img -} - -function get_challenge_header_row(challenge, data) { - - var main_row = $('') - var challengeShortname = challenge.shortname - - var badge_img = get_challenge_icon(challenge, 24, 24) - if (badge_img !== undefined) { - badge_img.click(function(){ - toggleVisibilityOfChallenge(challengeShortname) - }); - } else { - badge_img = '' - } - - var anchor_tag = $('') - anchor_tag.attr('name', challenge['shortname']) - anchor_tag.append(badge_img) - - main_row.append($('').append(anchor_tag)) - - // main_row.append($('').text(challenge.shortname)) - var help = '' - if (challenge.help !== undefined) { - help = '[?]' - } - var challenge_map_link_id = "challenge_"+challenge['shortname']+"_show_map" - var challenge_map_id = "challenge_"+challenge['shortname']+"_map" - var challenge_map_link = '' - if (has_geo_data(data) && challenge.has_map === true) { - challenge_map_link = $('').attr("id", challenge_map_link_id).html("show map").click(function() { - console.log(challenge_map_id) - console.log(challenge) - console.log(challenge.nearest_qualifying_events) - create_challenge_map(challenge_map_id, challenge, data) - }) - } - - main_row.append($('').append(challenge.name + ' ' + help)) - main_row.append($('').append(challenge_map_link)) - main_row.append($('').text(challenge.completed_on)) - if (challenge.summary_text !== undefined) { - main_row.append($('').text(challenge.summary_text)) - } else { - if (challenge.subparts_completed_count !== undefined && challenge.subparts_count !== undefined){ - var progress = challenge.subparts_completed_count - if (challenge.subparts_count > 0) { - progress +="/"+challenge.subparts_count - } - main_row.append($('').text(progress)) - } - } - if (challenge.complete) { - main_row.append($('').attr('src', browserAPI.runtime.getURL("/images/badges/tick.png")).attr('width',24).attr('height',24)) - } - - return main_row -} - -function generateExplorerTableEntry(table, data) { - const challenge = { - "name": "parkrun Explorer", - "shortname": "explorer" - } - - const challenge_tbody_header = get_tbody_header(challenge) - const challenge_tbody_detail = get_tbody_content(challenge, data.user_data) - - // Create the header row and add it to the tbody that exists to hold - // the title row - const main_row = get_challenge_header_row(challenge, data) - challenge_tbody_header.append(main_row) - - if (data.geo_data === undefined) { - // When there is no geo data, just put a row in saying there is nothing to go on. - var infoRow = $("").append($('No parkrun event location information, unable to generate explorer results')) - challenge_tbody_detail.append(infoRow) - - table.append(challenge_tbody_header) - table.append(challenge_tbody_detail) - } else { - // Create a row to hold a map - var explorerMapId = 'explorer_map' - var map_row = $("").append($('
')) - challenge_tbody_detail.append(map_row) - - drawExplorerDataTable(challenge_tbody_detail, data) - - table.append(challenge_tbody_header) - table.append(challenge_tbody_detail) - - drawExplorerMap(explorerMapId, data) - } -} - -function zoomLevelToScaleOptions(zoomLevel) { - options = { - "zoomLevel": zoomLevel, - "eventNameVisible": false, - "eventNameTextSize": 0, - "eventPointRadius": 1.5, - "pathLineWidth": 1 - } - - if (zoomLevel >= 8) { - options.eventPointRadius = 4 - } - if (zoomLevel >= 9) { - options.eventPointRadius = 6 - } - if (zoomLevel >= 10) { - options.eventPointRadius = 8 - - // From this point onwards the event name is visible - options.eventNameVisible = true - - options.eventNameTextSize = 12 - } - if (zoomLevel >= 11) { - - options.eventPointRadius = 10 - - // We need a small line width generally, but it gets lost - // when there are more features on the map, so increase it - // when we we have zoomed in a lot - pathLineWidth = 2 - } - if (zoomLevel >= 12) { - options.eventPointRadius = 12 - } - - return options - -} - -function createVoronoiMapPrototype() { - // http://usabilityetc.com/2016/06/how-to-create-leaflet-plugins/ has proved useful - L.VoronoiLayer = L.Layer.extend({ - - initialize: function(data, cellRenderer) { - console.log('Voronoi Layer - initialize()') - this._data = data - // We may have been passed a custom cell renderer - console.log(cellRenderer) - this._cellRenderer = cellRenderer - }, - - onAdd: function(map) { - console.log('Voronoi Layer - onAdd()') - // var nw_point = map.latLngToLayerPoint(bounds.getNorthWest()) - // Store the map - this._map = map - - var pane = map.getPane(this.options.pane); - this._pane = pane - - map.on('zoomend viewreset moveend', this._update, this); - this._update() - - // Force the map to recalculate its size. - // When it is first drawn, the remainder of the page hasn't, - // so it it is narrower, and subsequent challenges pad it out - - // so this makes it correct as soon as it is interacted with. - // This unfortunately means it's not right initially, but it - // fixes itself pretty quickly. - - setTimeout(function(){ - console.log("triggering a redraw") - map.invalidateSize() - }, 1000); - }, - - onRemove: function(map) { - console.log('Voronoi Layer - onRemove()') - L.DomUtil.remove(this._container); - map.off('zoomend viewreset', this._update, this); - }, - - _update: function() { - console.log('Voronoi Layer - _update()') - - // Empty the current pane - L.DomUtil.empty(this._pane) - - // Create a new SVG container, we will add everything to this - // before adding it to the DOM. - var this_container = L.DomUtil.create("svg", "leaflet-zoom-hide") - - var vmap = this._map - var bounds = vmap.getBounds() - var top_left = vmap.latLngToLayerPoint(bounds.getNorthWest()) - - var size = vmap.getSize() - - this_container.setAttribute('width', size.x); - this_container.setAttribute('height', size.y); - this_container.setAttribute("style", "margin-left: "+top_left.x + "px; margin-top: "+top_left.y+"px"); - - var filtered_points = this._cellRenderer(vmap, this._data) - - var voronoi = d3.voronoi() - .x(function(d) { return d.x; }) - .y(function(d) { return d.y; }); - - // As we are using the .polygons() we need to set an extent so that things - // don't go wrong at the edges. Ordinarily we should set an extent of - // the size of the canvas, but for those cases where the canvas includes - // +/-180degrees, we need to crop the diagram there otherwise it goes - // weird when the lines expand into the repeated map provided by openstreetmap - - // Find the left and right corners of the world :) - map_point_left_edge = vmap.latLngToLayerPoint([90,-180]); - map_point_right_edge = vmap.latLngToLayerPoint([-90,180]); - - // Default extents are the edges of the canvas, but if these take it over - // the edges of the world according to the calculations above, we box - // them in. - voronoi_extent_left = [Math.max(top_left.x, map_point_left_edge.x), Math.max(top_left.y, map_point_left_edge.y)] - voronoi_extent_right = [Math.min(top_left.x+size.x, map_point_right_edge.x), Math.min(top_left.y+size.y, map_point_right_edge.y)] - - voronoi.extent([voronoi_extent_left, voronoi_extent_right]); - - var voronoi_data = voronoi(filtered_points) - - // For reference: - // https://github.com/zetter/voronoi-maps/blob/master/lib/voronoi_map.js - - var cell_group = document.createElementNS('http://www.w3.org/2000/svg', "g") - cell_group.setAttribute("transform", "translate(" + (-top_left.x) + "," + (-top_left.y) + ")") - - var voronoi_polygons = voronoi_data.polygons() - - var zoomScaleOptions = zoomLevelToScaleOptions(vmap.getZoom()) - console.log(zoomScaleOptions) - - $.each(voronoi_polygons, function(index, cell) { - - // If there is no cell data, then keep looping - if (cell === undefined) { - // console.log("Undefined cell data at index "+index) - return true - } - - // Create an icon to represent the parkrun event - var item_circle = document.createElementNS('http://www.w3.org/2000/svg', "circle") - - item_circle.setAttribute("cx", cell.data.x) - item_circle.setAttribute("cy", cell.data.y) - item_circle.setAttribute("r", zoomScaleOptions.eventPointRadius) - item_circle.setAttribute("stroke", filtered_points[index].circleColourLine) - item_circle.setAttribute("stroke-width", "1") - item_circle.setAttribute("fill", filtered_points[index].circleColour) - - // If we are zoomed in enough, maybe add some text - var item_text = undefined - if (zoomScaleOptions.eventNameVisible) { - item_text = document.createElementNS('http://www.w3.org/2000/svg', "text") - item_text.setAttribute("x", cell.data.x) - item_text.setAttribute("y", cell.data.y + zoomScaleOptions.eventPointRadius + 8) // Move the text down below the point, plus some padding - item_text.setAttribute("text-anchor", "middle") - item_text.setAttribute("font-size", zoomScaleOptions.eventNameTextSize+"px") - item_text.setAttribute("font-weight", "bold") - item_text.setAttribute("dominant-baseline", "hanging") // Hang the text below - item_text.textContent = filtered_points[index].name - } - - // Create a shape to represent the voronoi area associated with this parkrun event - // It will be filled if the parkrun has been completed - - var item_path = document.createElementNS('http://www.w3.org/2000/svg', "path") - item_path.setAttribute("d", "M " + get_voronoi_poly(cell).join(" L ") + " Z") - item_path.setAttribute("stroke", "gray") - item_path.setAttribute("stroke-width", zoomScaleOptions.pathLineWidth) - item_path.setAttribute("fill", filtered_points[index].fill) - item_path.setAttribute("fill-opacity", filtered_points[index].opacity) - - // Add the parkrun event and the path object to a holding object - the path goes first so - // that the parkrun event marker is drawn on top afterwards - cell_group.appendChild(item_path) - cell_group.appendChild(item_circle) - if (item_text !== undefined) { - cell_group.appendChild(item_text) - } - - // Add this group to the main SVG container - this_container.appendChild(cell_group) - - }) - - // Store the SVG container in the object - this._container = this_container - // Add the SVG to the map - $(this._pane).append($(this_container).prop('outerHTML')) - - } - }); - - L.voronoiLayer = function(data, cellRenderer) { - return new L.VoronoiLayer(data, cellRenderer) - } - -} - -function drawExplorerMap(divId, data) { - - // Get a summary of the completion data - var countryCompletionInfo = calculateCountryCompletionInfo(data) - - // Find where to focus the map on to start with - var default_centre = [25,0] - if (data.info.has_home_parkrun && data.info.is_our_page) { - var home_parkrun = data.user_data.home_parkrun_info - if (event_has_valid_location(home_parkrun)) { - default_centre = [+home_parkrun.lat, +home_parkrun.lon] - } - } - - // Creating the Voronoi Map prototype on the L. object. - createVoronoiMapPrototype(); - - console.log("Initialising the explorer map container") - var r_map = L.map(divId).setView(default_centre, 2); - // Allow it to be fullscreen - r_map.addControl(new L.Control.Fullscreen()); - - var map_data = { - map: r_map, - countryCompletionInfo: countryCompletionInfo, - layers: { - events: [] - } - } - - // Set the openstreetmap tiles - var tilelayer_openstreetmap = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { - attribution: '©
OpenStreetMap contributors' - }) - tilelayer_openstreetmap.addTo(r_map) - - // Add the Voronoi layer - - const explorerCellRenderer = function(vmap, data) { - - var events = data.geo_data.data.events - var completed_events = {} - - $.each(data.parkrun_results, function(index, parkrun_event) { - completed_events[parkrun_event.name] = true - }) - - var filtered_points = [] - $.each(events, function(event_name, event_info) { - if (event_has_valid_location(event_info)) { - lat_lon = [+event_info.lat, +event_info.lon] - // Add the point to the array - var point = vmap.latLngToLayerPoint(lat_lon); - event_info.x = point.x - event_info.y = point.y - event_info.fill = "none" - event_info.opacity = 0.5 - event_info.circleColour = "black" - event_info.circleColourLine = "gray" - if (completed_events[event_info.name] == true) { - event_info.fill = "green" - event_info.circleColour = "#006000" - } - filtered_points.push(event_info) - // } - } - }) - return filtered_points - } - - console.log("Creating voronoi map with cell renderer = "+explorerCellRenderer) - var voronoi_layer = L.voronoiLayer(data, explorerCellRenderer) - voronoi_layer.addTo(r_map) - - // Icons - var FlagIcon = L.Icon.extend({ - options: { - shadowUrl: undefined, - iconSize: [40, 40], - // Centre the icon by default - iconAnchor: [20, 20] - } - }); - - // Iterate through the top level countries - // We are using our pre-scanned list here, so that we can take advantage of - // having removed 'world', and perhaps adjusted any sub-countries (Namibia, - // Swaziland spring to mind) - - map_data.layers.country_markers = new L.featureGroup(); - - var flag_icon_anchor_centred = [20,20] - var flag_icon_anchor_with_pie = [40,20] - - // Iterate over all the countries we know about - $.each(data.geo_data.data.countries, function (countryName, countryInfo) { - - // We have the total number of events and complete events in the following - var countryChildEventsCount = countryCompletionInfo[countryName].childEventsCount - var countryChildEventsCompletedCount = countryCompletionInfo[countryName].childEventsCompletedCount - - // Only bother displaying this country if it has any events - if (countryChildEventsCount > 0) { - if (event_has_valid_location(countryInfo)) { - - // Get the location of the country mid-point, according to parkrun - var lat_lon = [+countryInfo.lat, +countryInfo.lon] - // Get the current country id for later use by the on click callback function - var countryId = countryInfo.id - - // If we haven't run any events, we omit the pie chart, so centre the - // flag, else we shuffle it off to the left a bit so the combo is centred - var flag_anchor = flag_icon_anchor_centred - if (countryChildEventsCompletedCount > 0) { - flag_anchor = flag_icon_anchor_with_pie - } - - // Top level countries have a flag - var marker = L.marker(lat_lon, { - icon: new FlagIcon({ - iconUrl: get_flag_image_src(countryName), - iconAnchor: flag_anchor - }) - }) - // Add a tooltip showing the name of the country and a summary of the - // completion numbers - var marker_tooltip_text = countryName + ' ' + countryChildEventsCompletedCount + '/' + countryChildEventsCount - var marker_tooltip_options = { - offset: [0, -16], - direction: 'top' - } - marker.bindTooltip(marker_tooltip_text, marker_tooltip_options) - marker.on('click', function() { - // Instead of showing the events, lets just move the map to show the country - // showCountryEvents(map_data, data, countryId, 0) - zoomMapToCountryExtents(map_data, data, countryId) - }) - marker.addTo(map_data.layers.country_markers); - - // Only add the pie chart if we have completed any events at all - if (countryChildEventsCompletedCount > 0) { - var pie_marker = L.piechartMarker(lat_lon, { - radius: 16, - data: [ - { - name: 'Run', - value: countryChildEventsCompletedCount, - style: { - fillStyle: 'rgba(0,140,57,.95)', - strokeStyle: 'rgba(0,0,0,.75)', - lineWidth: 1 - } - }, - { - name: 'Not Run', - value: (countryChildEventsCount - countryChildEventsCompletedCount), - style: { - fillStyle: 'rgba(0,0,0,.15)', - strokeStyle: 'rgba(0,0,0,.75)', - lineWidth: 1 - } - } - ], - // Budge the pie chart over to the right a bit, so that the flag+chart are - // mostly centred on the original point, and not wildly off to one side - iconAnchor: [-4, 16] - }) - // Add the same tooltips and on click actions as for the flag - pie_marker.bindTooltip(marker_tooltip_text, marker_tooltip_options) - pie_marker.on('click', function() { - // showCountryEvents(map_data, data, countryId, 0) - zoomMapToCountryExtents(map_data, data, countryId) - }) - pie_marker.addTo(map_data.layers.country_markers); - } - - } - } - - }) - - map_data.layers.country_markers.addTo(map_data.map) -} - -function zoomMapToCountryExtents(map_data, data, countryId) { - console.log('Centering on countryId: '+countryId) - - $.each(data.geo_data.data.countries, function(index, countryInfo) { - if (countryInfo.id == countryId) { - // Fit the map to the coordinates provided by the country - console.log("Centering map on " + countryInfo.bounds) - - var bottomLeft = L.latLng(countryInfo.bounds[1],countryInfo.bounds[0]) - var topRight = L.latLng(countryInfo.bounds[3],countryInfo.bounds[2]) - map_data.map.fitBounds(L.latLngBounds(bottomLeft,topRight)) - - return - } - }) - - // We should only end up here if the country ID didn't match any countries - // we know about, we would normally have returned by now. - -} - -function showCountryEvents(map_data, data, countryId, depth) { - console.log('Click for countryId: '+countryId+' depth='+depth) - - // Remove any existing lower events ... - var events_layer_key = 'events' - if (events_layer_key in map_data.layers) { - while (map_data.layers[events_layer_key].length > depth) { - var layers = map_data.layers[events_layer_key].pop() - if ('done' in layers) { - - map_data.map.removeLayer(layers.done) - } - if ('notdone' in layers) { - map_data.map.removeLayer(layers.notdone) - } - // console.log('Removed '+layers) - } - } - // ... and pop a fresh layer onto the stack - map_data.layers[events_layer_key].push({ - 'done': new L.featureGroup(), - 'notdone': new L.featureGroup() - }); - - // Icon for an event we have run - - // Icon for an event we have not run - var event_not_run_icon = L.ExtraMarkers.icon({ - markerColor: 'cyan', - shape: 'square', - // These still add the div elements for the shadow, it would be better if it didn't. - // shadowUrl: null, - // shadowRetinaUrl: null, - // shadowSize: [0, 0], - }); - - $.each(data.geo_data.data.events, function (event_name, event_info) { - if (event_info.country_id == countryId) { - if (event_has_valid_location(event_info)) { - // Get the location of the country mid-point, according to parkrun - var lat_lon = [+event_info.lat, +event_info.lon] - // Default marker shows we have not run it - var marker = L.marker(lat_lon, {icon: event_not_run_icon}) - // if (event_name in map_data.events_completed_map) { - // marker = L.marker(lat_lon, {icon: event_run_icon}) - // } - // Add a tooltip showing the name of the event - var marker_tooltip_text = event_name - var marker_tooltip_options = { - offset: [0, -30], - direction: 'top' - } - marker.bindTooltip(marker_tooltip_text, marker_tooltip_options) - // Create a popup which includes a link to the event - marker.bindPopup(get_parkrun_popup(event_name, event_info, {distance: false, completed_info: map_data.events_completed_map})) - // Add it to the appropriate layer group - // if (event_name in map_data.events_completed_map) { - // marker.addTo(map_data.layers[events_layer_key][depth].done) - // } else { - marker.addTo(map_data.layers[events_layer_key][depth].notdone) - // } - } - } - }) - // Add the not-done icons first - map_data.layers[events_layer_key][depth].notdone.addTo(map_data.map) - map_data.layers[events_layer_key][depth].done.addTo(map_data.map) - -} - -var vmap - -function get_voronoi_poly(cell) { - var real_edges = [] - // console.log(cell) - // console.log(cell.length) - for (var i=0; iOpenStreetMap contributors' - }) - tilelayer_openstreetmap.addTo(r_map) - - // Add the Voronoi layer - var cellRenderer = function(vmap, data) { - - var filtered_points = [] - var geo_data = data.geo_data - var events = data.geo_data.data.events - var parkrun_results = data.parkrun_results - - var reference_parkrun_name = calculate_average_parkrun_event_name(parkrun_results, geo_data) - var reference_parkrun = geoData.data.events[reference_parkrun_name] - - var completed_events = {} - - $.each(data.parkrun_results, function(index, parkrun_event) { - completed_events[parkrun_event.name] = true - }) - - eventsByDistance = computeDistanceToParkrunsFromEvent(geo_data, reference_parkrun) - - $.each(events, function(event_name, event_info) { - if (event_has_valid_location(event_info)) { - lat_lon = [+event_info.lat, +event_info.lon] - // Add the point to the array - var point = vmap.latLngToLayerPoint(lat_lon); - event_info.x = point.x - event_info.y = point.y - if(eventsByDistance[event_info.name] < 78) { - event_info.fill = "none" - } else { - event_info.fill = "gray" - } - event_info.opacity = 0.5 - event_info.circleColour = "black" - event_info.circleColourLine = "gray" - if(eventsByDistance[event_info.name] < 78) { - // Events you have completed - if(event_info.name == reference_parkrun_name) { - event_info.fill = 'gold' - } else if(eventsByDistance[event_info.name] < 33) { - event_info.fill = "red" - } else if(eventsByDistance[event_info.name] < 45) { - event_info.fill = "orange" - } else if(eventsByDistance[event_info.name] < 78) { - event_info.fill = "blue" - } - if (completed_events[event_info.name] == true) { - event_info.opacity = 0.5 - } else { - event_info.opacity = 0.1 - } - event_info.circleColour = "#006000" - } - filtered_points.push(event_info) - // } - } - - }) - - return filtered_points - } - - console.log("Creating voronoi map with cell renderer = "+cellRenderer) - var voronoi_layer = L.voronoiLayer(data, cellRenderer) - voronoi_layer.addTo(r_map) -} - -function create_challenge_map_standard(map_id, challenge_data, data) { - - var home_parkrun_marker_colour = 'purple' - - // Create empty vector for each layer - // var home_parkrun = new L.featureGroup() - var events_complete = new L.featureGroup(); - // var events_complete_icon = new EventsIcon({iconUrl: browserAPI.runtime.getURL("/images/maps/markers/leaf-green.png")}) - var events_complete_icon = L.ExtraMarkers.icon({ - markerColor: 'green-light', - shape: 'circle' - }); - var events_complete_icon_home = L.ExtraMarkers.icon({ - markerColor: home_parkrun_marker_colour, - shape: 'circle' - }); - var events_nearest_incomplete = new L.featureGroup(); - // var events_nearest_incomplete_icon = new EventsIcon({iconUrl: browserAPI.runtime.getURL("/images/maps/markers/leaf-orange.png")}) - var events_nearest_incomplete_icon = L.ExtraMarkers.icon({ - markerColor: 'yellow', - shape: 'penta' - }); - var events_nearest_incomplete_icon_home = L.ExtraMarkers.icon({ - markerColor: home_parkrun_marker_colour, - shape: 'penta' - }); - var events_incomplete = new L.featureGroup(); - // var events_incomplete_icon = new EventsIcon({iconUrl: browserAPI.runtime.getURL("/images/maps/markers/leaf-red.png")}) - var events_incomplete_icon = L.ExtraMarkers.icon({ - markerColor: 'cyan', - shape: 'square' - }); - var events_incomplete_icon_home = L.ExtraMarkers.icon({ - markerColor: home_parkrun_marker_colour, - shape: 'square' - }); - - var events_ineligible_icon_home = L.ExtraMarkers.icon({ - markerColor: home_parkrun_marker_colour, - shape: 'star' - }); - - // // Add the home parkrun if it has been defined - // if (challenge_data.home_parkrun) { - // var lat_lon = [+challenge_data.home_parkrun.lat, +challenge_data.home_parkrun.lon] - // var popup = 'Home parkrun: ' + challenge_data.home_parkrun.name - // var marker = L.marker(lat_lon).bindPopup(popup); - // marker.addTo(home_parkrun) - // } - - // The ID of the element we are going to populate - var map_element_id = "challenge_map_"+challenge_data.shortname - // var map_element = document.getElementById(map_element_id) - // Empty and hide all of the existing map elements - $('div[id^="challenge_map_"]').each(function() { - $(this).empty().hide() - }) - // Make this map element visible - var map_element = $('div[id="'+map_element_id+'"]').first() - map_element.show() - map_element.height(400) - - // See if there are any existing maps, and remove them all - $.each(challenge_maps, function (id, map_data) { - map_data.map.remove() - }) - // Remove all references - challenge_maps = {} - - // Default to centring on Winchester - var map_centre_lat_lon = [51.0632, -1.308] - if (data.info.is_our_page && data.info.has_home_parkrun) { - var home_parkrun_info = data.user_data.home_parkrun_info - if (event_has_valid_location(home_parkrun_info)) { - map_centre_lat_lon = [+home_parkrun_info.lat, +home_parkrun_info.lon] - } - } - var mymap = L.map(map_element_id).setView(map_centre_lat_lon, 10); - - // Add the new map to our set of maps for future reference - challenge_maps[map_element_id] = { - "map": mymap, - "div_id": map_element_id - } - var tilelayer_openstreetmap = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { - attribution: '© OpenStreetMap contributors' - }) - tilelayer_openstreetmap.addTo(mymap) - - var events_on_the_map = [] - var added_home_parkrun = false - - // Add the completed events - $.each(challenge_data.completed_qualifying_events, function(event_name, event_info) { - if (!events_on_the_map.includes(event_name)) { - if (event_has_valid_location(event_info)) { - // Make sure they are numbers - var lat_lon = [+event_info.lat, +event_info.lon] - var popup = get_parkrun_popup(event_name, event_info, {distance: true}) - var marker = L.marker(lat_lon, {icon: events_complete_icon}).bindPopup(popup); - if (data.info.is_our_page && data.info.has_home_parkrun && (data.user_data.home_parkrun_info.name == event_name)) { - popup = get_parkrun_popup(event_name, event_info, {distance: false}) - marker = L.marker(lat_lon, {icon: events_complete_icon_home}).bindPopup(popup); - added_home_parkrun = true - } - marker.addTo(events_complete) - - events_on_the_map.push(event_name) - } - } - }) - // These markers should be on the top - events_complete.setZIndex(50) - // Add Those markers - events_complete.addTo(mymap) - - if (events_complete.getLayers().length > 0) { - mymap.fitBounds(events_complete.getBounds().pad(0.1)); - } - - if (data.info.is_our_page) { - $.each(challenge_data.nearest_qualifying_events, function(event_name, event_info) { - if (!events_on_the_map.includes(event_name)) { - if (event_has_valid_location(event_info)) { - // Make sure they are numbers - var lat_lon = [+event_info.lat, +event_info.lon] - var popup = get_parkrun_popup(event_name, event_info, {distance: true}) - var marker = L.marker(lat_lon, {icon: events_nearest_incomplete_icon}).bindPopup(popup); - if (data.info.is_our_page && data.info.has_home_parkrun && (data.user_data.home_parkrun_info.name == event_name)) { - popup = get_parkrun_popup(event_name, event_info, {distance: false}) - marker = L.marker(lat_lon, {icon: events_nearest_incomplete_icon_home}).bindPopup(popup); - added_home_parkrun = true - } - marker.addTo(events_nearest_incomplete) - - events_on_the_map.push(event_name) - } - } - }) - events_nearest_incomplete.setZIndex(25) - // Add Those markers - events_nearest_incomplete.addTo(mymap) - } - - $.each(challenge_data.all_qualifying_events, function(event_name, event_info) { - // console.log("all - " + event_name) - if (!events_on_the_map.includes(event_name)) { - if (event_has_valid_location(event_info)) { - // Make sure they are numbers - var lat_lon = [+event_info.lat, +event_info.lon] - var popup = get_parkrun_popup(event_name, event_info, {distance: true}) - var marker = L.marker(lat_lon, {icon: events_incomplete_icon}).bindPopup(popup); - if (data.info.is_our_page && data.info.has_home_parkrun && (data.user_data.home_parkrun_info.name == event_name)) { - popup = get_parkrun_popup(event_name, event_info, {distance: false}) - marker = L.marker(lat_lon, {icon: events_incomplete_icon_home}).bindPopup(popup); - added_home_parkrun = true - } - marker.addTo(events_incomplete) - - events_on_the_map.push(event_name) - } - } - }) - events_incomplete.setZIndex(10) - // Add Those markers - // events_incomplete.addTo(mymap) - - // If we have not added the home parkrun, this means that it is not eligible - // for this challenge, but it is still useful to add an icon for it - so lets - // add it straight to the map now - if (data.info.is_our_page && data.info.has_home_parkrun && (added_home_parkrun == false)) { - if (event_has_valid_location(data.user_data.home_parkrun_info)) { - var lat_lon = [+data.user_data.home_parkrun_info.lat, +data.user_data.home_parkrun_info.lon] - var marker = L.marker(lat_lon, {icon: events_ineligible_icon_home}); - marker.addTo(mymap) - } - } - - base_maps = { - "openstreetmap": tilelayer_openstreetmap - } - - overlay_markers = {} - - // Add the overlays in the order we want them to appear - - overlay_markers["Completed Events"] = events_complete - - if (challenge_data.complete == false) { - - if (data.info.is_our_page && data.info.has_home_parkrun && events_nearest_incomplete.getLayers().length > 0) { - overlay_markers['Nearest Qualifying Events'] = events_nearest_incomplete - } - - // overlay_markers['Other Qualifying Events'] = events_incomplete - // Only add it if there are any events in the list - if (events_incomplete.getLayers().length > 0) { - // I've override the css that creates the standard markers so they are all - // red, although we really need to do it in a more configurable way - var clustered_events_incomplete = L.markerClusterGroup({ - disableClusteringAtZoom: 9, - }); - clustered_events_incomplete.addLayers(events_incomplete.getLayers()) - - overlay_markers['Other Qualifying Events'] = clustered_events_incomplete - } - } - - layer_control_options = { - 'hideSingleBase': true - } - - // Add a control which will provide a way to optionally turn on the layers - // that we haven't added - L.control.layers(base_maps, overlay_markers, layer_control_options).addTo(mymap); - - mymap.addControl(new L.Control.Fullscreen()); - -} - -function event_has_valid_location(event_info) { - var valid_location = false - if (event_info.lat && event_info.lon) { - if (event_info.lat != '' && event_info.lon != '') { - valid_location = true - } - } - return valid_location -} - -function get_parkrun_popup(event_name, event_info, custom_options) { - - var options = { - distance: true - } - if (custom_options.distance !== undefined) { - options.distance = custom_options.distance - } - - var event_name_link = event_name + ' parkrun' - if (event_info.event_url) { - event_name_link = '' - } else if (event_info.local_url) { - event_name_link = '' - } - popup = event_name_link - if (event_info.distance !== undefined && options.distance) { - popup = popup+'
'+event_info.distance.toFixed(1)+" km away
" - } - - if (custom_options.completed_info && event_name in custom_options.completed_info) { - popup = popup+'
First attended: '+custom_options.completed_info[event_name][0].date+"
" - } - return popup -} - -function get_explorer_flag(country, visited) { - - var flag_icon = get_flag_image_src(country) - - var img = $(''); - img.attr('src', flag_icon); - img.attr('alt', country) - img.attr('title', country) - img.attr('width',16) - img.attr('height',16) - if (visited) { - img.attr('style', 'padding-left:2px; padding-right:2px; opacity:1.0') - } else { - img.attr('style', 'padding-left:2px; padding-right:2px; opacity:0.25') - } - - return img - -} - -function drawExplorerDataTable(table, data) { - // Use the common function to see what countries we have visited - const countryCompletionInfo = calculateCountryCompletionInfo(data) - console.log(countryCompletionInfo) - - // First of all, add a row with the world stats on, which is the top level - // Generate a total for the current completion - var worldEventsCount = 0 - var worldEventsCompletedCount = 0 - $.each(countryCompletionInfo, function (countryName, countryInfo) { - worldEventsCount += countryInfo.childEventsCount - worldEventsCompletedCount += countryInfo.childEventsCompletedCount - }) - - const worldCompletionFractionString = worldEventsCompletedCount + "/" + worldEventsCount - - var row = $("") - row.append($("").append(get_explorer_flag("World", true))) - row.append($("").append($("").text("World"))) - row.append($("")) - row.append($("").text(worldCompletionFractionString)) - table.append(row) - - const alphabeticallySortedCountries = Object.keys(countryCompletionInfo).sort() - console.log(alphabeticallySortedCountries) - - $.each(alphabeticallySortedCountries, function (idx, countryName) { - const countryInfo = countryCompletionInfo[countryName] - // Only show those countries with open events (we have to assume they're active) - if (countryInfo.childEventsCount > 0) { - // Determine how complete this country is... - console.log(`${countryInfo.childEventsCount} events for ${countryName}`) - var countryCompletionPercentage = countryInfo.childEventsCompletedCount / countryInfo.childEventsCount - var countryCompletionFractionString = countryInfo.childEventsCompletedCount + "/" + countryInfo.childEventsCount - - var row = $("") - // We fade out the explorer flag if it hasn't been visited, with - // get_explorer_flag's second argumemt being a true/false value of whether - // you have been. By stating whether the completion percentage is above zero - // we can calculate this on the fly - row.append($("").append(get_explorer_flag(countryName, countryCompletionPercentage > 0)).append($("").attr("name", countryName))) - row.append($("").append($("").text(countryName))) - row.append($("")) - row.append($("").text(countryCompletionFractionString)) - table.append(row) - } - }) -} - -function generate_standard_table_entry(challenge, table, data) { - - var challenge_tbody_header = get_tbody_header(challenge) - var challenge_tbody_detail = get_tbody_content(challenge, data.user_data) - - // Create the header row and add it to the tbody that exists to hold - // the title row - var main_row = get_challenge_header_row(challenge, data) - challenge_tbody_header.append(main_row) - - // Create a row to hold a map, and hide it - if (challenge.has_map === true) { - console.log("Creating map for " + challenge.shortname) - var map_row = $("").append($('
')) - challenge_tbody_detail.append(map_row) - } - - // Print the subparts - challenge.subparts_detail.forEach(function (subpart_detail) { - var subpart_row = $('') - if (subpart_detail["badge"] !== undefined) { - console.log("Adding a badge to the table - "+JSON.stringify(subpart_detail["badge"])) - subpart_row.append($('').append(get_challenge_icon(subpart_detail["badge"], 24, 24))) - } else { - subpart_row.append($('').text("-")) - } - - if (subpart_detail != null) { - - subpart_row.append($('').text(subpart_detail.subpart)) - subpart_row.append($('').html(subpart_detail.name)) - subpart_row.append($('').html(subpart_detail.info)) - - challenge_tbody_detail.append(subpart_row) - } else { - subpart_row.append($('').text('Missing')) - challenge_tbody_detail.append(subpart_row) - } - - }); - - table.append(challenge_tbody_header) - table.append(challenge_tbody_detail) - -} - -function add_stats_table(div, data) { - - if (data.info.has_stats) { - var table = $('') - // Use the 'results' id so that we pick up the standard styling, yuk - table.attr("id", "results") - // Optionally add a class with .addClass(this.tableClass) - table.append($('').html('') - table.append(header_row) - - $.each(data.stats, function(stat_shortname, stat_info) { - var row = $('') - var display_name = stat_info.display_name - var stat_value = stat_info.value - if (stat_info.help) { - display_name = ''+display_name+'' - stat_value = ''+stat_value+'' - } - row.append($('").text("Challenges")); + + // Add a set of links on the top row + help_link = $("") + .attr("href", browserAPI.runtime.getURL("/html/help.html")) + .attr("target", "_blank") + .text("help"); + options_link = $("") + .attr("href", browserAPI.runtime.getURL("/html/options.html")) + .attr("target", "_blank") + .text("options"); + website_link = $("") + .attr("href", "https://running-challenges.co.uk") + .attr("target", "_blank") + .text("website"); + help_td = $("").attr("colspan", 6).attr("align", "right"); + help_td.append(website_link); + help_td.append(" | "); + help_td.append(options_link); + help_td.append(" | "); + help_td.append(help_link); + help_td.append(" | "); + help_td.append("v" + extensionVersion); + + table.append($("").append(help_td)); + + return table; +} + +function add_table_break_row(table, title, help, id) { + var tbody = $(""); + if (id !== undefined) { + tbody.attr("id", id); + } + var gap_row = $(""); + gap_row.append($(""); + var tooltip = ""; + if (help !== undefined) { + tooltip = + '[?]'; + } + main_row.append( + $("").attr("id", get_tbody_header_id(challenge)); +} + +function get_tbody_content(challenge, userData) { + var content = $("").attr( + "id", + get_tbody_content_id(challenge), + ); + // Find out whether this should be hidden by default when we initially draw the page + if (isChallengeHidden(challenge.shortname, userData)) { + content.hide(); + } + return content; +} + +function get_tbody_header_id(challenge) { + return "challenge_tbody_header_" + challenge["shortname"]; +} + +function get_tbody_content_id(challenge) { + return "challenge_tbody_content_" + challenge["shortname"]; +} + +function get_flag_icon(country, height, width) { + var flag_img = $(""); //Equivalent: $(document.createElement('img')) + flag_img.attr( + "src", + browserAPI.runtime.getURL( + "/images/flags/png/" + country.flag_icon + ".png", + ), + ); + // badge_img.attr('alt', challenge.name) + // badge_img.attr('title', challenge.name) + flag_img.attr("height", height); + flag_img.attr("width", width); + + return flag_img; +} + +function get_challenge_icon(challenge, height, width) { + var badge_img = undefined; + if (challenge.badge_icon !== undefined) { + badge_img = $(""); //Equivalent: $(document.createElement('img')) + badge_img.attr( + "src", + browserAPI.runtime.getURL( + "/images/badges/" + challenge.badge_icon + ".png", + ), + ); + badge_img.attr("alt", challenge.name); + badge_img.attr("title", challenge.name); + badge_img.attr("height", height); + badge_img.attr("width", width); + } + return badge_img; +} + +function get_challenge_header_row(challenge, data) { + var main_row = $(""); + var challengeShortname = challenge.shortname; + + var badge_img = get_challenge_icon(challenge, 24, 24); + if (badge_img !== undefined) { + badge_img.click(function () { + toggleVisibilityOfChallenge(challengeShortname); + }); + } else { + badge_img = ""; + } + + var anchor_tag = $(""); + anchor_tag.attr("name", challenge["shortname"]); + anchor_tag.append(badge_img); + + main_row.append($("").append(anchor_tag)); + + // main_row.append($('').text(challenge.shortname)) + var help = ""; + if (challenge.help !== undefined) { + help = + '[?]'; + } + var challenge_map_link_id = + "challenge_" + challenge["shortname"] + "_show_map"; + var challenge_map_id = "challenge_" + challenge["shortname"] + "_map"; + var challenge_map_link = ""; + if (has_geo_data(data) && challenge.has_map === true) { + challenge_map_link = $("") + .attr("id", challenge_map_link_id) + .html('show map') + .click(function () { + console.log(challenge_map_id); + console.log(challenge); + console.log(challenge.nearest_qualifying_events); + create_challenge_map(challenge_map_id, challenge, data); + }); + } + + main_row.append($("").append(challenge.name + " " + help)); + main_row.append($("").append(challenge_map_link)); + main_row.append($("").text(challenge.completed_on)); + if (challenge.summary_text !== undefined) { + main_row.append($("").text(challenge.summary_text)); + } else { + if ( + challenge.subparts_completed_count !== undefined && + challenge.subparts_count !== undefined + ) { + var progress = challenge.subparts_completed_count; + if (challenge.subparts_count > 0) { + progress += "/" + challenge.subparts_count; + } + main_row.append($("").text(progress)); + } + } + if (challenge.complete) { + main_row.append( + $("") + .attr("src", browserAPI.runtime.getURL("/images/badges/tick.png")) + .attr("width", 24) + .attr("height", 24), + ); + } + + return main_row; +} + +function generateExplorerTableEntry(table, data) { + const challenge = { + name: "parkrun Explorer", + shortname: "explorer", + }; + + const challenge_tbody_header = get_tbody_header(challenge); + const challenge_tbody_detail = get_tbody_content(challenge, data.user_data); + + // Create the header row and add it to the tbody that exists to hold + // the title row + const main_row = get_challenge_header_row(challenge, data); + challenge_tbody_header.append(main_row); + + if (data.geo_data === undefined) { + // When there is no geo data, just put a row in saying there is nothing to go on. + var infoRow = $("").append( + $( + '', + ), + ); + challenge_tbody_detail.append(infoRow); + + table.append(challenge_tbody_header); + table.append(challenge_tbody_detail); + } else { + // Create a row to hold a map + var explorerMapId = "explorer_map"; + var map_row = $("").append( + $( + '', + ), + ); + challenge_tbody_detail.append(map_row); + + drawExplorerDataTable(challenge_tbody_detail, data); + + table.append(challenge_tbody_header); + table.append(challenge_tbody_detail); + + var mapDiv = document.getElementById(explorerMapId); + if (mapDiv) { + void mapDiv.offsetHeight; + } + drawExplorerMap(explorerMapId, data); + } +} + +function zoomLevelToScaleOptions(zoomLevel) { + options = { + zoomLevel: zoomLevel, + eventNameVisible: false, + eventNameTextSize: 0, + eventPointRadius: 1.5, + pathLineWidth: 1, + }; + + if (zoomLevel >= 8) { + options.eventPointRadius = 4; + } + if (zoomLevel >= 9) { + options.eventPointRadius = 6; + } + if (zoomLevel >= 10) { + options.eventPointRadius = 8; + + // From this point onwards the event name is visible + options.eventNameVisible = true; + + options.eventNameTextSize = 12; + } + if (zoomLevel >= 11) { + options.eventPointRadius = 10; + + // We need a small line width generally, but it gets lost + // when there are more features on the map, so increase it + // when we we have zoomed in a lot + pathLineWidth = 2; + } + if (zoomLevel >= 12) { + options.eventPointRadius = 12; + } + + return options; +} + +function createVoronoiMapPrototype() { + // http://usabilityetc.com/2016/06/how-to-create-leaflet-plugins/ has proved useful + L.VoronoiLayer = L.Layer.extend({ + initialize: function (data, cellRenderer) { + console.log("Voronoi Layer - initialize()"); + this._data = data; + // We may have been passed a custom cell renderer + console.log(cellRenderer); + this._cellRenderer = cellRenderer; + }, + + onAdd: function (map) { + console.log("Voronoi Layer - onAdd()"); + // var nw_point = map.latLngToLayerPoint(bounds.getNorthWest()) + // Store the map + this._map = map; + + var pane = map.getPane(this.options.pane); + this._pane = pane; + + map.on("zoomend viewreset moveend", this._update, this); + this._update(); + + // Force the map to recalculate its size. + // When it is first drawn, the remainder of the page hasn't, + // so it it is narrower, and subsequent challenges pad it out - + // so this makes it correct as soon as it is interacted with. + // This unfortunately means it's not right initially, but it + // fixes itself pretty quickly. + + setTimeout(function () { + console.log("triggering a redraw"); + map.invalidateSize(); + }, 1000); + }, + + onRemove: function (map) { + console.log("Voronoi Layer - onRemove()"); + L.DomUtil.remove(this._container); + map.off("zoomend viewreset", this._update, this); + }, + + _update: function () { + console.log("Voronoi Layer - _update()"); + + // Empty the current pane + L.DomUtil.empty(this._pane); + + // Create a new SVG container, we will add everything to this + // before adding it to the DOM. + var this_container = L.DomUtil.create("svg", "leaflet-zoom-hide"); + + var vmap = this._map; + var bounds = vmap.getBounds(); + var top_left = vmap.latLngToLayerPoint(bounds.getNorthWest()); + + var size = vmap.getSize(); + + this_container.setAttribute("width", size.x); + this_container.setAttribute("height", size.y); + this_container.setAttribute( + "style", + "margin-left: " + top_left.x + "px; margin-top: " + top_left.y + "px", + ); + + var filtered_points = this._cellRenderer(vmap, this._data); + + var voronoi = d3 + .voronoi() + .x(function (d) { + return d.x; + }) + .y(function (d) { + return d.y; + }); + + // As we are using the .polygons() we need to set an extent so that things + // don't go wrong at the edges. Ordinarily we should set an extent of + // the size of the canvas, but for those cases where the canvas includes + // +/-180degrees, we need to crop the diagram there otherwise it goes + // weird when the lines expand into the repeated map provided by openstreetmap + + // Find the left and right corners of the world :) + map_point_left_edge = vmap.latLngToLayerPoint([90, -180]); + map_point_right_edge = vmap.latLngToLayerPoint([-90, 180]); + + // Default extents are the edges of the canvas, but if these take it over + // the edges of the world according to the calculations above, we box + // them in. + voronoi_extent_left = [ + Math.max(top_left.x, map_point_left_edge.x), + Math.max(top_left.y, map_point_left_edge.y), + ]; + voronoi_extent_right = [ + Math.min(top_left.x + size.x, map_point_right_edge.x), + Math.min(top_left.y + size.y, map_point_right_edge.y), + ]; + + voronoi.extent([voronoi_extent_left, voronoi_extent_right]); + + var voronoi_data = voronoi(filtered_points); + + // For reference: + // https://github.com/zetter/voronoi-maps/blob/master/lib/voronoi_map.js + + var cell_group = document.createElementNS( + "http://www.w3.org/2000/svg", + "g", + ); + cell_group.setAttribute( + "transform", + "translate(" + -top_left.x + "," + -top_left.y + ")", + ); + + var voronoi_polygons = voronoi_data.polygons(); + + var zoomScaleOptions = zoomLevelToScaleOptions(vmap.getZoom()); + console.log(zoomScaleOptions); + + $.each(voronoi_polygons, function (index, cell) { + // If there is no cell data, then keep looping + if (cell === undefined) { + // console.log("Undefined cell data at index "+index) + return true; + } + + // Create an icon to represent the parkrun event + var item_circle = document.createElementNS( + "http://www.w3.org/2000/svg", + "circle", + ); + + item_circle.setAttribute("cx", cell.data.x); + item_circle.setAttribute("cy", cell.data.y); + item_circle.setAttribute("r", zoomScaleOptions.eventPointRadius); + item_circle.setAttribute( + "stroke", + filtered_points[index].circleColourLine, + ); + item_circle.setAttribute("stroke-width", "1"); + item_circle.setAttribute("fill", filtered_points[index].circleColour); + + // If we are zoomed in enough, maybe add some text + var item_text = undefined; + if (zoomScaleOptions.eventNameVisible) { + item_text = document.createElementNS( + "http://www.w3.org/2000/svg", + "text", + ); + item_text.setAttribute("x", cell.data.x); + item_text.setAttribute( + "y", + cell.data.y + zoomScaleOptions.eventPointRadius + 8, + ); // Move the text down below the point, plus some padding + item_text.setAttribute("text-anchor", "middle"); + item_text.setAttribute( + "font-size", + zoomScaleOptions.eventNameTextSize + "px", + ); + item_text.setAttribute("font-weight", "bold"); + item_text.setAttribute("dominant-baseline", "hanging"); // Hang the text below + item_text.textContent = filtered_points[index].name; + } + + // Create a shape to represent the voronoi area associated with this parkrun event + // It will be filled if the parkrun has been completed + + var item_path = document.createElementNS( + "http://www.w3.org/2000/svg", + "path", + ); + item_path.setAttribute( + "d", + "M " + get_voronoi_poly(cell).join(" L ") + " Z", + ); + item_path.setAttribute("stroke", "gray"); + item_path.setAttribute("stroke-width", zoomScaleOptions.pathLineWidth); + item_path.setAttribute("fill", filtered_points[index].fill); + item_path.setAttribute("fill-opacity", filtered_points[index].opacity); + + // Add the parkrun event and the path object to a holding object - the path goes first so + // that the parkrun event marker is drawn on top afterwards + cell_group.appendChild(item_path); + cell_group.appendChild(item_circle); + if (item_text !== undefined) { + cell_group.appendChild(item_text); + } + + // Add this group to the main SVG container + this_container.appendChild(cell_group); + }); + + // Store the SVG container in the object + this._container = this_container; + // Add the SVG to the map + $(this._pane).append($(this_container).prop("outerHTML")); + }, + }); + + L.voronoiLayer = function (data, cellRenderer) { + return new L.VoronoiLayer(data, cellRenderer); + }; +} + +function drawExplorerMap(divId, data) { + // Get a summary of the completion data + var countryCompletionInfo = calculateCountryCompletionInfo(data); + + // Find where to focus the map on to start with + var default_centre = [25, 0]; + if (data.info.has_home_parkrun && data.info.is_our_page) { + var home_parkrun = data.user_data.home_parkrun_info; + if (event_has_valid_location(home_parkrun)) { + default_centre = [+home_parkrun.lat, +home_parkrun.lon]; + } + } + + // Creating the Voronoi Map prototype on the L. object. + createVoronoiMapPrototype(); + + console.log("Initialising the explorer map container"); + var r_map = L.map(divId).setView(default_centre, 2); + // Allow it to be fullscreen + L.control.fullscreen().addTo(r_map); + + apply_fullscreen_icon_styles(); + + // Ensure Leaflet recalculates container size and repositions layers after layout (fixes tiles/markers outside bounds in table layouts). + r_map.whenReady(function () { + r_map.invalidateSize(); + if (typeof requestAnimationFrame !== "undefined") { + requestAnimationFrame(function () { + r_map.invalidateSize(); + }); + } + setTimeout(function () { + r_map.invalidateSize(); + }, 150); + }); + + var map_data = { + map: r_map, + countryCompletionInfo: countryCompletionInfo, + layers: { + events: [], + }, + }; + + // Set the openstreetmap tiles + var tilelayer_openstreetmap = L.tileLayer( + "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", + { + attribution: + '© OpenStreetMap contributors', + }, + ); + tilelayer_openstreetmap.addTo(r_map); + + // Add the Voronoi layer + + const explorerCellRenderer = function (vmap, data) { + var events = data.geo_data.data.events; + var completed_events = {}; + + $.each(data.parkrun_results, function (index, parkrun_event) { + completed_events[parkrun_event.name] = true; + }); + + var filtered_points = []; + $.each(events, function (event_name, event_info) { + if (event_has_valid_location(event_info)) { + lat_lon = [+event_info.lat, +event_info.lon]; + // Add the point to the array + var point = vmap.latLngToLayerPoint(lat_lon); + event_info.x = point.x; + event_info.y = point.y; + event_info.fill = "none"; + event_info.opacity = 0.5; + event_info.circleColour = "black"; + event_info.circleColourLine = "gray"; + if (completed_events[event_info.name] == true) { + event_info.fill = "green"; + event_info.circleColour = "#006000"; + } + filtered_points.push(event_info); + // } + } + }); + return filtered_points; + }; + + console.log( + "Creating voronoi map with cell renderer = " + explorerCellRenderer, + ); + var voronoi_layer = L.voronoiLayer(data, explorerCellRenderer); + voronoi_layer.addTo(r_map); + + // Icons + var FlagIcon = L.Icon.extend({ + options: { + shadowUrl: undefined, + iconSize: [40, 40], + // Centre the icon by default + iconAnchor: [20, 20], + }, + }); + + // Iterate through the top level countries + // We are using our pre-scanned list here, so that we can take advantage of + // having removed 'world', and perhaps adjusted any sub-countries (Namibia, + // Swaziland spring to mind) + + map_data.layers.country_markers = new L.featureGroup(); + + var flag_icon_anchor_centred = [20, 20]; + var flag_icon_anchor_with_pie = [40, 20]; + + // Iterate over all the countries we know about + $.each(data.geo_data.data.countries, function (countryName, countryInfo) { + // We have the total number of events and complete events in the following + var countryChildEventsCount = + countryCompletionInfo[countryName].childEventsCount; + var countryChildEventsCompletedCount = + countryCompletionInfo[countryName].childEventsCompletedCount; + + // Only bother displaying this country if it has any events + if (countryChildEventsCount > 0) { + if (event_has_valid_location(countryInfo)) { + // Get the location of the country mid-point, according to parkrun + var lat_lon = [+countryInfo.lat, +countryInfo.lon]; + // Get the current country id for later use by the on click callback function + var countryId = countryInfo.id; + + // If we haven't run any events, we omit the pie chart, so centre the + // flag, else we shuffle it off to the left a bit so the combo is centred + var flag_anchor = flag_icon_anchor_centred; + if (countryChildEventsCompletedCount > 0) { + flag_anchor = flag_icon_anchor_with_pie; + } + + // Top level countries have a flag + var marker = L.marker(lat_lon, { + icon: new FlagIcon({ + iconUrl: get_flag_image_src(countryName), + iconAnchor: flag_anchor, + }), + }); + // Add a tooltip showing the name of the country and a summary of the + // completion numbers + var marker_tooltip_text = + countryName + + " " + + countryChildEventsCompletedCount + + "/" + + countryChildEventsCount; + var marker_tooltip_options = { + offset: [0, -16], + direction: "top", + }; + marker.bindTooltip(marker_tooltip_text, marker_tooltip_options); + marker.on("click", function () { + // Instead of showing the events, lets just move the map to show the country + // showCountryEvents(map_data, data, countryId, 0) + zoomMapToCountryExtents(map_data, data, countryId); + }); + marker.addTo(map_data.layers.country_markers); + + // Only add the pie chart if we have completed any events at all + if (countryChildEventsCompletedCount > 0) { + var pie_marker = L.piechartMarker(lat_lon, { + radius: 16, + data: [ + { + name: "Run", + value: countryChildEventsCompletedCount, + style: { + fillStyle: "rgba(0,140,57,.95)", + strokeStyle: "rgba(0,0,0,.75)", + lineWidth: 1, + }, + }, + { + name: "Not Run", + value: + countryChildEventsCount - countryChildEventsCompletedCount, + style: { + fillStyle: "rgba(0,0,0,.15)", + strokeStyle: "rgba(0,0,0,.75)", + lineWidth: 1, + }, + }, + ], + // Budge the pie chart over to the right a bit, so that the flag+chart are + // mostly centred on the original point, and not wildly off to one side + iconAnchor: [-4, 16], + }); + // Add the same tooltips and on click actions as for the flag + pie_marker.bindTooltip(marker_tooltip_text, marker_tooltip_options); + pie_marker.on("click", function () { + // showCountryEvents(map_data, data, countryId, 0) + zoomMapToCountryExtents(map_data, data, countryId); + }); + pie_marker.addTo(map_data.layers.country_markers); + } + } + } + }); + + map_data.layers.country_markers.addTo(map_data.map); +} + +function zoomMapToCountryExtents(map_data, data, countryId) { + console.log("Centering on countryId: " + countryId); + + $.each(data.geo_data.data.countries, function (index, countryInfo) { + if (countryInfo.id == countryId) { + // Fit the map to the coordinates provided by the country + console.log("Centering map on " + countryInfo.bounds); + + var bottomLeft = L.latLng(countryInfo.bounds[1], countryInfo.bounds[0]); + var topRight = L.latLng(countryInfo.bounds[3], countryInfo.bounds[2]); + map_data.map.fitBounds(L.latLngBounds(bottomLeft, topRight)); + + return; + } + }); + + // We should only end up here if the country ID didn't match any countries + // we know about, we would normally have returned by now. +} + +function showCountryEvents(map_data, data, countryId, depth) { + console.log("Click for countryId: " + countryId + " depth=" + depth); + + // Remove any existing lower events ... + var events_layer_key = "events"; + if (events_layer_key in map_data.layers) { + while (map_data.layers[events_layer_key].length > depth) { + var layers = map_data.layers[events_layer_key].pop(); + if ("done" in layers) { + map_data.map.removeLayer(layers.done); + } + if ("notdone" in layers) { + map_data.map.removeLayer(layers.notdone); + } + // console.log('Removed '+layers) + } + } + // ... and pop a fresh layer onto the stack + map_data.layers[events_layer_key].push({ + done: new L.featureGroup(), + notdone: new L.featureGroup(), + }); + + // Icon for an event we have run + + // Icon for an event we have not run + var event_not_run_icon = L.ExtraMarkers.icon({ + markerColor: "cyan", + shape: "square", + // These still add the div elements for the shadow, it would be better if it didn't. + // shadowUrl: null, + // shadowRetinaUrl: null, + // shadowSize: [0, 0], + }); + + $.each(data.geo_data.data.events, function (event_name, event_info) { + if (event_info.country_id == countryId) { + if (event_has_valid_location(event_info)) { + // Get the location of the country mid-point, according to parkrun + var lat_lon = [+event_info.lat, +event_info.lon]; + // Default marker shows we have not run it + var marker = L.marker(lat_lon, { icon: event_not_run_icon }); + // if (event_name in map_data.events_completed_map) { + // marker = L.marker(lat_lon, {icon: event_run_icon}) + // } + // Add a tooltip showing the name of the event + var marker_tooltip_text = event_name; + var marker_tooltip_options = { + offset: [0, -30], + direction: "top", + }; + marker.bindTooltip(marker_tooltip_text, marker_tooltip_options); + // Create a popup which includes a link to the event + marker.bindPopup( + get_parkrun_popup(event_name, event_info, { + distance: false, + completed_info: map_data.events_completed_map, + }), + ); + // Add it to the appropriate layer group + // if (event_name in map_data.events_completed_map) { + // marker.addTo(map_data.layers[events_layer_key][depth].done) + // } else { + marker.addTo(map_data.layers[events_layer_key][depth].notdone); + // } + } + } + }); + // Add the not-done icons first + map_data.layers[events_layer_key][depth].notdone.addTo(map_data.map); + map_data.layers[events_layer_key][depth].done.addTo(map_data.map); +} + +var vmap; + +function get_voronoi_poly(cell) { + var real_edges = []; + // console.log(cell) + // console.log(cell.length) + for (var i = 0; i < cell.length; i++) { + if (cell[i] != null) { + var point = cell[i].join(" "); + real_edges.push(point); + } + } + + return real_edges; +} + +var challenge_maps = {}; + +function create_challenge_map(map_id, challenge_data, data) { + console.log(challenge_data); + + if (challenge_data.map_type == "standard") { + create_challenge_map_standard(map_id, challenge_data, data); + } else if (challenge_data.map_type == "voronoi") { + create_challenge_map_voronoi(map_id, challenge_data, data); + } else { + console.log("Unknown map type: " + challenge_data.map_type); + } +} + +function create_challenge_map_voronoi(_divId, challenge_data, data) { + // Get a summary of the completion data + + const map_element_id = "challenge_map_" + challenge_data.shortname; + + $('div[id^="challenge_map_"]').each(function () { + $(this).empty().hide(); + }); + // Make this map element visible + var map_element = $('div[id="' + map_element_id + '"]').first(); + map_element.show(); + map_element.height(400); + + // See if there are any existing maps, and remove them all + $.each(challenge_maps, function (id, map_data) { + map_data.map.remove(); + }); + // Remove all references + challenge_maps = {}; + + // Default to centring on Winchester + var map_centre_lat_lon = [51.0632, -1.308]; + if (data.info.is_our_page && data.info.has_home_parkrun) { + var home_parkrun_info = data.user_data.home_parkrun_info; + if (event_has_valid_location(home_parkrun_info)) { + map_centre_lat_lon = [+home_parkrun_info.lat, +home_parkrun_info.lon]; + } + } + + console.log("Centre: " + map_centre_lat_lon); + console.log( + "Initialising the challenge voronoi map container for id=" + map_element_id, + ); + var r_map = L.map(map_element_id).setView(map_centre_lat_lon, 2); + + // Add the new map to our set of maps for future reference + challenge_maps[map_element_id] = { + map: r_map, + div_id: map_element_id, + }; + + // Allow it to be fullscreen + r_map.addControl(new L.Control.Fullscreen()); + + // Set the openstreetmap tiles + var tilelayer_openstreetmap = L.tileLayer( + "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", + { + attribution: + '© OpenStreetMap contributors', + }, + ); + tilelayer_openstreetmap.addTo(r_map); + + // Add the Voronoi layer + var cellRenderer = function (vmap, data) { + var filtered_points = []; + var geo_data = data.geo_data; + var events = data.geo_data.data.events; + var parkrun_results = data.parkrun_results; + + var reference_parkrun_name = calculate_average_parkrun_event_name( + parkrun_results, + geo_data, + ); + var reference_parkrun = geoData.data.events[reference_parkrun_name]; + + var completed_events = {}; + + $.each(data.parkrun_results, function (index, parkrun_event) { + completed_events[parkrun_event.name] = true; + }); + + eventsByDistance = computeDistanceToParkrunsFromEvent( + geo_data, + reference_parkrun, + ); + + $.each(events, function (event_name, event_info) { + if (event_has_valid_location(event_info)) { + lat_lon = [+event_info.lat, +event_info.lon]; + // Add the point to the array + var point = vmap.latLngToLayerPoint(lat_lon); + event_info.x = point.x; + event_info.y = point.y; + if (eventsByDistance[event_info.name] < 78) { + event_info.fill = "none"; + } else { + event_info.fill = "gray"; + } + event_info.opacity = 0.5; + event_info.circleColour = "black"; + event_info.circleColourLine = "gray"; + if (eventsByDistance[event_info.name] < 78) { + // Events you have completed + if (event_info.name == reference_parkrun_name) { + event_info.fill = "gold"; + } else if (eventsByDistance[event_info.name] < 33) { + event_info.fill = "red"; + } else if (eventsByDistance[event_info.name] < 45) { + event_info.fill = "orange"; + } else if (eventsByDistance[event_info.name] < 78) { + event_info.fill = "blue"; + } + if (completed_events[event_info.name] == true) { + event_info.opacity = 0.5; + } else { + event_info.opacity = 0.1; + } + event_info.circleColour = "#006000"; + } + filtered_points.push(event_info); + // } + } + }); + + return filtered_points; + }; + + console.log("Creating voronoi map with cell renderer = " + cellRenderer); + var voronoi_layer = L.voronoiLayer(data, cellRenderer); + voronoi_layer.addTo(r_map); +} + +function create_challenge_map_standard(map_id, challenge_data, data) { + var home_parkrun_marker_colour = "purple"; + + // Create empty vector for each layer + // var home_parkrun = new L.featureGroup() + var events_complete = new L.featureGroup(); + // var events_complete_icon = new EventsIcon({iconUrl: browserAPI.runtime.getURL("/images/maps/markers/leaf-green.png")}) + var events_complete_icon = L.ExtraMarkers.icon({ + markerColor: "green-light", + shape: "circle", + }); + var events_complete_icon_home = L.ExtraMarkers.icon({ + markerColor: home_parkrun_marker_colour, + shape: "circle", + }); + var events_nearest_incomplete = new L.featureGroup(); + // var events_nearest_incomplete_icon = new EventsIcon({iconUrl: browserAPI.runtime.getURL("/images/maps/markers/leaf-orange.png")}) + var events_nearest_incomplete_icon = L.ExtraMarkers.icon({ + markerColor: "yellow", + shape: "penta", + }); + var events_nearest_incomplete_icon_home = L.ExtraMarkers.icon({ + markerColor: home_parkrun_marker_colour, + shape: "penta", + }); + var events_incomplete = new L.featureGroup(); + // var events_incomplete_icon = new EventsIcon({iconUrl: browserAPI.runtime.getURL("/images/maps/markers/leaf-red.png")}) + var events_incomplete_icon = L.ExtraMarkers.icon({ + markerColor: "cyan", + shape: "square", + }); + var events_incomplete_icon_home = L.ExtraMarkers.icon({ + markerColor: home_parkrun_marker_colour, + shape: "square", + }); + + var events_ineligible_icon_home = L.ExtraMarkers.icon({ + markerColor: home_parkrun_marker_colour, + shape: "star", + }); + + // // Add the home parkrun if it has been defined + // if (challenge_data.home_parkrun) { + // var lat_lon = [+challenge_data.home_parkrun.lat, +challenge_data.home_parkrun.lon] + // var popup = 'Home parkrun: ' + challenge_data.home_parkrun.name + // var marker = L.marker(lat_lon).bindPopup(popup); + // marker.addTo(home_parkrun) + // } + + // The ID of the element we are going to populate + var map_element_id = "challenge_map_" + challenge_data.shortname; + // var map_element = document.getElementById(map_element_id) + // Empty and hide all of the existing map elements + $('div[id^="challenge_map_"]').each(function () { + $(this).empty().hide(); + }); + // Make this map element visible + var map_element = $('div[id="' + map_element_id + '"]').first(); + map_element.show(); + map_element.height(400); + + // See if there are any existing maps, and remove them all + $.each(challenge_maps, function (id, map_data) { + map_data.map.remove(); + }); + // Remove all references + challenge_maps = {}; + + // Default to centring on Winchester + var map_centre_lat_lon = [51.0632, -1.308]; + if (data.info.is_our_page && data.info.has_home_parkrun) { + var home_parkrun_info = data.user_data.home_parkrun_info; + if (event_has_valid_location(home_parkrun_info)) { + map_centre_lat_lon = [+home_parkrun_info.lat, +home_parkrun_info.lon]; + } + } + var mymap = L.map(map_element_id).setView(map_centre_lat_lon, 10); + + // Add the new map to our set of maps for future reference + challenge_maps[map_element_id] = { + map: mymap, + div_id: map_element_id, + }; + var tilelayer_openstreetmap = L.tileLayer( + "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", + { + attribution: + '© OpenStreetMap contributors', + }, + ); + tilelayer_openstreetmap.addTo(mymap); + + var events_on_the_map = []; + var added_home_parkrun = false; + + // Add the completed events + $.each( + challenge_data.completed_qualifying_events, + function (event_name, event_info) { + if (!events_on_the_map.includes(event_name)) { + if (event_has_valid_location(event_info)) { + // Make sure they are numbers + var lat_lon = [+event_info.lat, +event_info.lon]; + var popup = get_parkrun_popup(event_name, event_info, { + distance: true, + }); + var marker = L.marker(lat_lon, { + icon: events_complete_icon, + }).bindPopup(popup); + if ( + data.info.is_our_page && + data.info.has_home_parkrun && + data.user_data.home_parkrun_info.name == event_name + ) { + popup = get_parkrun_popup(event_name, event_info, { + distance: false, + }); + marker = L.marker(lat_lon, { + icon: events_complete_icon_home, + }).bindPopup(popup); + added_home_parkrun = true; + } + marker.addTo(events_complete); + + events_on_the_map.push(event_name); + } + } + }, + ); + // These markers should be on the top + events_complete.setZIndex(50); + // Add Those markers + events_complete.addTo(mymap); + + if (events_complete.getLayers().length > 0) { + mymap.fitBounds(events_complete.getBounds().pad(0.1)); + } + + if (data.info.is_our_page) { + $.each( + challenge_data.nearest_qualifying_events, + function (event_name, event_info) { + if (!events_on_the_map.includes(event_name)) { + if (event_has_valid_location(event_info)) { + // Make sure they are numbers + var lat_lon = [+event_info.lat, +event_info.lon]; + var popup = get_parkrun_popup(event_name, event_info, { + distance: true, + }); + var marker = L.marker(lat_lon, { + icon: events_nearest_incomplete_icon, + }).bindPopup(popup); + if ( + data.info.is_our_page && + data.info.has_home_parkrun && + data.user_data.home_parkrun_info.name == event_name + ) { + popup = get_parkrun_popup(event_name, event_info, { + distance: false, + }); + marker = L.marker(lat_lon, { + icon: events_nearest_incomplete_icon_home, + }).bindPopup(popup); + added_home_parkrun = true; + } + marker.addTo(events_nearest_incomplete); + + events_on_the_map.push(event_name); + } + } + }, + ); + events_nearest_incomplete.setZIndex(25); + // Add Those markers + events_nearest_incomplete.addTo(mymap); + } + + $.each( + challenge_data.all_qualifying_events, + function (event_name, event_info) { + // console.log("all - " + event_name) + if (!events_on_the_map.includes(event_name)) { + if (event_has_valid_location(event_info)) { + // Make sure they are numbers + var lat_lon = [+event_info.lat, +event_info.lon]; + var popup = get_parkrun_popup(event_name, event_info, { + distance: true, + }); + var marker = L.marker(lat_lon, { + icon: events_incomplete_icon, + }).bindPopup(popup); + if ( + data.info.is_our_page && + data.info.has_home_parkrun && + data.user_data.home_parkrun_info.name == event_name + ) { + popup = get_parkrun_popup(event_name, event_info, { + distance: false, + }); + marker = L.marker(lat_lon, { + icon: events_incomplete_icon_home, + }).bindPopup(popup); + added_home_parkrun = true; + } + marker.addTo(events_incomplete); + + events_on_the_map.push(event_name); + } + } + }, + ); + events_incomplete.setZIndex(10); + // Add Those markers + // events_incomplete.addTo(mymap) + + // If we have not added the home parkrun, this means that it is not eligible + // for this challenge, but it is still useful to add an icon for it - so lets + // add it straight to the map now + if ( + data.info.is_our_page && + data.info.has_home_parkrun && + added_home_parkrun == false + ) { + if (event_has_valid_location(data.user_data.home_parkrun_info)) { + var lat_lon = [ + +data.user_data.home_parkrun_info.lat, + +data.user_data.home_parkrun_info.lon, + ]; + var marker = L.marker(lat_lon, { icon: events_ineligible_icon_home }); + marker.addTo(mymap); + } + } + + base_maps = { + openstreetmap: tilelayer_openstreetmap, + }; + + overlay_markers = {}; + + // Add the overlays in the order we want them to appear + + overlay_markers["Completed Events"] = events_complete; + + if (challenge_data.complete == false) { + if ( + data.info.is_our_page && + data.info.has_home_parkrun && + events_nearest_incomplete.getLayers().length > 0 + ) { + overlay_markers["Nearest Qualifying Events"] = events_nearest_incomplete; + } + + // overlay_markers['Other Qualifying Events'] = events_incomplete + // Only add it if there are any events in the list + if (events_incomplete.getLayers().length > 0) { + // I've override the css that creates the standard markers so they are all + // red, although we really need to do it in a more configurable way + var clustered_events_incomplete = L.markerClusterGroup({ + disableClusteringAtZoom: 9, + }); + clustered_events_incomplete.addLayers(events_incomplete.getLayers()); + + overlay_markers["Other Qualifying Events"] = clustered_events_incomplete; + } + } + + layer_control_options = { + hideSingleBase: true, + }; + + // Add a control which will provide a way to optionally turn on the layers + // that we haven't added + L.control + .layers(base_maps, overlay_markers, layer_control_options) + .addTo(mymap); + + L.control.fullscreen().addTo(mymap); + + apply_fullscreen_icon_styles(); +} + +function event_has_valid_location(event_info) { + var valid_location = false; + if (event_info.lat && event_info.lon) { + if (event_info.lat != "" && event_info.lon != "") { + valid_location = true; + } + } + return valid_location; +} + +function get_parkrun_popup(event_name, event_info, custom_options) { + var options = { + distance: true, + }; + if (custom_options.distance !== undefined) { + options.distance = custom_options.distance; + } + + var event_name_link = event_name + " parkrun"; + if (event_info.event_url) { + event_name_link = + '"; + } else if (event_info.local_url) { + event_name_link = + '"; + } + popup = event_name_link; + if (event_info.distance !== undefined && options.distance) { + popup = + popup + + '
' + + event_info.distance.toFixed(1) + + " km away
"; + } + + if ( + custom_options.completed_info && + event_name in custom_options.completed_info + ) { + popup = + popup + + '
First attended: ' + + custom_options.completed_info[event_name][0].date + + "
"; + } + return popup; +} + +function get_explorer_flag(country, visited) { + var flag_icon = get_flag_image_src(country); + + var img = $(""); + img.attr("src", flag_icon); + img.attr("alt", country); + img.attr("title", country); + img.attr("width", 16); + img.attr("height", 16); + if (visited) { + img.attr("style", "padding-left:2px; padding-right:2px; opacity:1.0"); + } else { + img.attr("style", "padding-left:2px; padding-right:2px; opacity:0.25"); + } + + return img; +} + +function drawExplorerDataTable(table, data) { + // Use the common function to see what countries we have visited + const countryCompletionInfo = calculateCountryCompletionInfo(data); + console.log(countryCompletionInfo); + + // First of all, add a row with the world stats on, which is the top level + // Generate a total for the current completion + var worldEventsCount = 0; + var worldEventsCompletedCount = 0; + $.each(countryCompletionInfo, function (countryName, countryInfo) { + worldEventsCount += countryInfo.childEventsCount; + worldEventsCompletedCount += countryInfo.childEventsCompletedCount; + }); + + const worldCompletionFractionString = + worldEventsCompletedCount + "/" + worldEventsCount; + + var row = $(""); + row.append($(""); + // We fade out the explorer flag if it hasn't been visited, with + // get_explorer_flag's second argumemt being a true/false value of whether + // you have been. By stating whether the completion percentage is above zero + // we can calculate this on the fly + row.append( + $("").append( + $( + '', + ), + ); + challenge_tbody_detail.append(map_row); + } + + // Print the subparts + challenge.subparts_detail.forEach(function (subpart_detail) { + var subpart_row = $(""); + if (subpart_detail["badge"] !== undefined) { + console.log( + "Adding a badge to the table - " + + JSON.stringify(subpart_detail["badge"]), + ); + subpart_row.append( + $("").append( + get_challenge_icon(subpart_detail["badge"], 24, 24), + ), + ); + } else { + subpart_row.append($("").text("-")); + } + + if (subpart_detail != null) { + subpart_row.append($("").text(subpart_detail.subpart)); + subpart_row.append($("").html(subpart_detail.name)); + subpart_row.append($("").html(subpart_detail.info)); + + challenge_tbody_detail.append(subpart_row); + } else { + subpart_row.append($("").text("Missing")); + challenge_tbody_detail.append(subpart_row); + } + }); + + table.append(challenge_tbody_header); + table.append(challenge_tbody_detail); +} + +function add_stats_table(div, data) { + if (data.info.has_stats) { + var table = $("
').text('Additional Athlete Stats')) - // Add header row - var header_row = $('
StatValue
').html(display_name)) - if (stat_info.url !== undefined) { - row.append($('').append($('', {href: stat_info.url, text: stat_info.value, target: "_blank", title: stat_info.help, rel: "noopener noreferrer"}))) - } else { - row.append($('').html(stat_value)) - } - table.append(row) - }) - - div.append(table) - } - - // Append a message noting that some information may be missing - // if there is no athlete_id or home parkrun set - if (data.info.has_athlete_id == false || data.info.has_home_parkrun == false) { - var options_message_container = $('
') - options_link = $('').attr("href", browserAPI.runtime.getURL("/html/options.html")).attr("target", '_blank').attr("rel", "noopener noreferrer").text('options.') - options_message_container.append('N.B. More stats and map features are available if you set your home parkrun and athlete id in the ') - options_message_container.append(options_link) - div.append($('
')) - div.append(options_message_container) - } - div.append('
Hover over the stats for a more detailed description') - -} - -function isChallengeHidden(challengeShortname, userData) { - var isHidden = false - console.log("userData: "+JSON.stringify(userData)) - if (userData !== undefined) { - if (userData["challengeMetadata"] !== undefined && challengeShortname in userData["challengeMetadata"]) { - if ("hidden" in userData.challengeMetadata[challengeShortname]) { - isHidden = userData.challengeMetadata[challengeShortname].hidden - console.log("isChallengeHidden found existing saved state: "+isHidden) - } - } - } - return isHidden -} - -function saveHiddenPreference(challengeName, isHidden) { - console.log("Challenge: "+challengeName+", Is Hidden: "+isHidden) - - browserAPI.storage.local.get({ - challengeMetadata: {} - }).then((items) => { - // Items contains the whole object, of which the key we asked for is a sub-item - console.log(items) - - // If the challenge already exists in the object, then set the hidden property - if (challengeName in items.challengeMetadata) { - items.challengeMetadata[challengeName]["hidden"] = isHidden - // Else, add a metadata object for this challenge and initialise it - } else { - var challengeMetadata = { - "hidden": isHidden - } - items.challengeMetadata[challengeName] = challengeMetadata - } - console.log(items.challengeMetadata) - - // Save the information back into the local storage - browserAPI.storage.local.set(items) - }) - -} - -function toggleVisibilityOfChallenge(challengeShortname) { - var challengeBodyId = "challenge_tbody_content_"+challengeShortname - // console.log(challengeBodyId) - var challengeBodyElement = $("tbody[id="+challengeBodyId+"]") - // console.log(challengeBodyElement) - var isCurrentlyHidden = challengeBodyElement.is(":hidden") - // console.log("isCurrentlyHidden: "+isCurrentlyHidden) - // Save the preference to retain the fact it is hidden next time - saveHiddenPreference(challengeShortname, !isCurrentlyHidden) - // Toggle the visibility of the challenge now - challengeBodyElement.toggle() -} \ No newline at end of file diff --git a/browser-extensions/common/js/tests/package-lock.json b/browser-extensions/common/js/tests/package-lock.json deleted file mode 100644 index f15d3a17..00000000 --- a/browser-extensions/common/js/tests/package-lock.json +++ /dev/null @@ -1,7140 +0,0 @@ -{ - "name": "tests", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "tests", - "version": "1.0.0", - "license": "MIT", - "devDependencies": { - "jsdom": "18.x.x", - "mocha": "9.x.x", - "nyc": "15.x.x", - "rewire": "5.x.x", - "selenium-webdriver": "^4.0.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", - "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.25.7", - "picocolors": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/core": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.4.tgz", - "integrity": "sha512-0LiLrB2PwrVI+a2/IEskBopDYSd8BCb3rOvH7D5tzoWd696TBEduBvuLVm4Nx6rltrLZqvI3MCalB2K2aVzQjA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.4", - "@babel/helpers": "^7.8.4", - "@babel/parser": "^7.8.4", - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.4", - "@babel/types": "^7.8.3", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.0", - "lodash": "^4.17.13", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/core/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@babel/generator": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz", - "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.25.7", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^3.0.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz", - "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", - "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz", - "integrity": "sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w==", - "dev": true, - "dependencies": { - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.4", - "@babel/types": "^7.8.3" - } - }, - "node_modules/@babel/highlight": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", - "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.25.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/parser": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.7.tgz", - "integrity": "sha512-aZn7ETtQsjjGG5HruveUK06cU3Hljuhd9Iojm4M8WWv3wLE6OkE5PWbDUkItmMgegmccaITudyuW5RPYrYlgWw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.25.7" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/template": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz", - "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/types": "^7.25.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.7.tgz", - "integrity": "sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.25.7", - "@babel/generator": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/template": "^7.25.7", - "@babel/types": "^7.25.7", - "debug": "^4.3.1", - "globals": "^11.1.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.7.tgz", - "integrity": "sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==", - "dev": true, - "dependencies": { - "@babel/helper-string-parser": "^7.25.7", - "@babel/helper-validator-identifier": "^7.25.7", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@istanbuljs/load-nyc-config": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz", - "integrity": "sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg==", - "dev": true, - "dependencies": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", - "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true - }, - "node_modules/abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", - "dev": true - }, - "node_modules/acorn": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", - "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", - "dev": true, - "dependencies": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" - } - }, - "node_modules/acorn-globals/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/aggregate-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", - "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", - "dev": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/append-transform": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", - "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", - "dev": true, - "dependencies": { - "default-require-extensions": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true - }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "node_modules/caching-transform": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", - "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", - "dev": true, - "dependencies": { - "hasha": "^5.0.0", - "make-dir": "^3.0.0", - "package-hash": "^4.0.0", - "write-file-atomic": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chalk/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "dependencies": { - "restore-cursor": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "node_modules/convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "engines": { - "node": ">=4.8" - } - }, - "node_modules/cross-spawn/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/cross-spawn/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/cssom": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", - "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", - "dev": true - }, - "node_modules/cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", - "dev": true, - "dependencies": { - "cssom": "~0.3.6" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true - }, - "node_modules/data-urls": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.1.tgz", - "integrity": "sha512-Ds554NeT5Gennfoo9KN50Vh6tpgtvYEwraYjejXnyTpu1C7oXKxdFk75REooENHE8ndTVOJuv+BEs4/J/xcozw==", - "dev": true, - "dependencies": { - "abab": "^2.0.3", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^10.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decimal.js": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", - "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", - "dev": true - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "node_modules/default-require-extensions": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", - "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", - "dev": true, - "dependencies": { - "strip-bom": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "dependencies": { - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", - "dev": true, - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=6.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", - "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "inquirer": "^7.0.0", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.14", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.3", - "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", - "table": "^5.2.3", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-scope/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/eslint/node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "dependencies": { - "type-fest": "^0.8.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/eslint/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/espree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", - "dev": true, - "dependencies": { - "acorn": "^7.1.1", - "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/espree/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/external-editor/node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", - "dev": true, - "dependencies": { - "flat-cache": "^2.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-cache-dir": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.2.0.tgz", - "integrity": "sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg==", - "dev": true, - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.0", - "pkg-dir": "^4.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, - "bin": { - "flat": "cli.js" - } - }, - "node_modules/flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", - "dev": true, - "dependencies": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", - "dev": true - }, - "node_modules/foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/foreground-child/node_modules/cross-spawn": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", - "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/foreground-child/node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/foreground-child/node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fromentries": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", - "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", - "dev": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "node_modules/gensync": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", - "dev": true - }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true, - "engines": { - "node": ">=4.x" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/hasha": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.1.0.tgz", - "integrity": "sha512-OFPDWmzPN1l7atOV1TgBVmNtBxaIysToK6Ve9DK+vT6pYuklw/nPNT+HJbZi0KDcI6vWB+9tgvZ5YD7fA3CXcA==", - "dev": true, - "dependencies": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "bin": { - "he": "bin/he" - } - }, - "node_modules/html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", - "dev": true, - "dependencies": { - "whatwg-encoding": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/html-escaper": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.0.tgz", - "integrity": "sha512-a4u9BeERWGu/S8JiWEAQcdrg9v4QArtP9keViQjGMdff20fBdd8waotXaNmODqBe6uZ3Nafi7K/ho4gCQHV3Ig==", - "dev": true - }, - "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "dev": true, - "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "dev": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=", - "dev": true - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/inquirer": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", - "dev": true, - "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.19", - "mute-stream": "0.0.8", - "run-async": "^2.4.0", - "rxjs": "^6.6.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/inquirer/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/inquirer/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/inquirer/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/inquirer/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/inquirer/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/inquirer/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-potential-custom-element-name": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true - }, - "node_modules/is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-hook": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", - "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", - "dev": true, - "dependencies": { - "append-transform": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-instrument": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz", - "integrity": "sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg==", - "dev": true, - "dependencies": { - "@babel/core": "^7.7.5", - "@babel/parser": "^7.7.5", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/istanbul-lib-processinfo": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", - "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", - "dev": true, - "dependencies": { - "archy": "^1.0.0", - "cross-spawn": "^7.0.0", - "istanbul-lib-coverage": "^3.0.0-alpha.1", - "make-dir": "^3.0.0", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "uuid": "^3.3.3" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-processinfo/node_modules/cross-spawn": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", - "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/istanbul-lib-processinfo/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/istanbul-lib-processinfo/node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-processinfo/node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", - "dev": true, - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report/node_modules/supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-source-maps": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", - "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-reports": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.0.tgz", - "integrity": "sha512-2osTcC8zcOSUkImzN2EWQta3Vdi4WjjKw99P2yWx5mLnigAM0Rd5uYFn1cf2i/Ois45GkNjaoTqc5CxgMSX80A==", - "dev": true, - "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsdom": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-18.0.0.tgz", - "integrity": "sha512-HVLuBcFmwdWulStv5U+J59b1AyzXhM92KXlM8HQ3ecYtRM2OQEUCPMa4oNuDeCBmtRcC7tJvb0Xz5OeFXMOKTA==", - "dev": true, - "dependencies": { - "abab": "^2.0.5", - "acorn": "^8.5.0", - "acorn-globals": "^6.0.0", - "cssom": "^0.5.0", - "cssstyle": "^2.3.0", - "data-urls": "^3.0.1", - "decimal.js": "^10.3.1", - "domexception": "^4.0.0", - "escodegen": "^2.0.0", - "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^3.0.0", - "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^10.0.0", - "ws": "^8.2.3", - "xml-name-validator": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "canvas": "^2.5.0" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } - } - }, - "node_modules/jsesc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", - "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/jszip": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", - "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", - "dev": true, - "dependencies": { - "lie": "~3.3.0", - "pako": "~1.0.2", - "readable-stream": "~2.3.6", - "setimmediate": "^1.0.5" - } - }, - "node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/lie": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", - "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", - "dev": true, - "dependencies": { - "immediate": "~3.0.5" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", - "dev": true - }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/log-symbols/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/log-symbols/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/log-symbols/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/log-symbols/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/make-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", - "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", - "dev": true, - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/mime-db": { - "version": "1.50.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz", - "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.33", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz", - "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==", - "dev": true, - "dependencies": { - "mime-db": "1.50.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, - "node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/mocha": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", - "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", - "dev": true, - "dependencies": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.3", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "4.2.1", - "ms": "2.1.3", - "nanoid": "3.3.1", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "which": "2.0.2", - "workerpool": "6.2.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" - } - }, - "node_modules/mocha/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/mocha/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/mocha/node_modules/minimatch": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", - "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true - }, - "node_modules/nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", - "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node_modules/node-preload": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", - "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", - "dev": true, - "dependencies": { - "process-on-spawn": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", - "dev": true - }, - "node_modules/nyc": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.0.tgz", - "integrity": "sha512-qcLBlNCKMDVuKb7d1fpxjPR8sHeMVX0CHarXAVzrVWoFrigCkYR8xcrjfXSPi5HXM7EU78L6ywO7w1c5rZNCNg==", - "dev": true, - "dependencies": { - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "caching-transform": "^4.0.0", - "convert-source-map": "^1.7.0", - "decamelize": "^1.2.0", - "find-cache-dir": "^3.2.0", - "find-up": "^4.1.0", - "foreground-child": "^2.0.0", - "glob": "^7.1.6", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-hook": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", - "istanbul-lib-processinfo": "^2.0.2", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.0", - "js-yaml": "^3.13.1", - "make-dir": "^3.0.0", - "node-preload": "^0.2.0", - "p-map": "^3.0.0", - "process-on-spawn": "^1.0.0", - "resolve-from": "^5.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "spawn-wrap": "^2.0.0", - "test-exclude": "^6.0.0", - "uuid": "^3.3.3", - "yargs": "^15.0.2" - }, - "bin": { - "nyc": "bin/nyc.js" - }, - "engines": { - "node": ">=8.9" - } - }, - "node_modules/nyc/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/nyc/node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "node_modules/nyc/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/nyc/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/nyc/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/nyc/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/p-limit": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", - "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", - "dev": true, - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/package-hash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", - "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.15", - "hasha": "^5.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "node_modules/process-on-spawn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", - "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", - "dev": true, - "dependencies": { - "fromentries": "^1.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "dev": true - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true, - "engines": { - "node": ">=6.5.0" - } - }, - "node_modules/release-zalgo": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", - "dev": true, - "dependencies": { - "es6-error": "^4.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true - }, - "node_modules/resolve": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", - "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", - "dev": true, - "dependencies": { - "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/rewire": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/rewire/-/rewire-5.0.0.tgz", - "integrity": "sha512-1zfitNyp9RH5UDyGGLe9/1N0bMlPQ0WrX0Tmg11kMHBpqwPJI4gfPpP7YngFyLbFmhXh19SToAG0sKKEFcOIJA==", - "dev": true, - "dependencies": { - "eslint": "^6.8.0" - } - }, - "node_modules/rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "npm": ">=2.0.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "node_modules/saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", - "dev": true, - "dependencies": { - "xmlchars": "^2.2.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/selenium-webdriver": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.0.0.tgz", - "integrity": "sha512-tOlu6FnTjPq2FKpd153pl8o2cB7H40Rvl/ogiD2sapMv4IDjQqpIxbd+swDJe9UDLdszeh5CDis6lgy4e9UG1w==", - "dev": true, - "dependencies": { - "jszip": "^3.6.0", - "rimraf": "^3.0.2", - "tmp": "^0.2.1", - "ws": ">=7.4.6" - }, - "engines": { - "node": ">= 10.15.0" - } - }, - "node_modules/selenium-webdriver/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/selenium-webdriver/node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, - "dependencies": { - "rimraf": "^3.0.0" - }, - "engines": { - "node": ">=8.17.0" - } - }, - "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", - "dev": true - }, - "node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "node_modules/slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/spawn-wrap": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", - "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", - "dev": true, - "dependencies": { - "foreground-child": "^2.0.0", - "is-windows": "^1.0.2", - "make-dir": "^3.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "which": "^2.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/spawn-wrap/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/supports-color/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true - }, - "node_modules/table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", - "dev": true, - "dependencies": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/table/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/table/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "node_modules/table/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/table/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/table/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tough-cookie": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", - "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", - "dev": true, - "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tr46": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", - "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", - "dev": true, - "dependencies": { - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, - "node_modules/universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "node_modules/w3c-hr-time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", - "deprecated": "Use your platform's native performance.now() and performance.timeOrigin.", - "dev": true, - "dependencies": { - "browser-process-hrtime": "^1.0.0" - } - }, - "node_modules/w3c-xmlserializer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-3.0.0.tgz", - "integrity": "sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg==", - "dev": true, - "dependencies": { - "xml-name-validator": "^4.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", - "dev": true, - "dependencies": { - "iconv-lite": "0.6.3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/whatwg-url": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-10.0.0.tgz", - "integrity": "sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w==", - "dev": true, - "dependencies": { - "tr46": "^3.0.0", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/workerpool": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", - "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", - "dev": true - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "dependencies": { - "mkdirp": "^0.5.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/write-file-atomic": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.1.tgz", - "integrity": "sha512-JPStrIyyVJ6oCSz/691fAjFtefZ6q+fP6tm+OS4Qw6o+TGQxNp1ziY2PgS+X/m0V8OWhZiO/m4xSj+Pr4RrZvw==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "node_modules/ws": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", - "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - }, - "node_modules/y18n": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", - "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", - "dev": true - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-unparser/node_modules/camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/yargs-unparser/node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/yargs/node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", - "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.25.7", - "picocolors": "^1.0.0" - } - }, - "@babel/core": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.8.4.tgz", - "integrity": "sha512-0LiLrB2PwrVI+a2/IEskBopDYSd8BCb3rOvH7D5tzoWd696TBEduBvuLVm4Nx6rltrLZqvI3MCalB2K2aVzQjA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.8.4", - "@babel/helpers": "^7.8.4", - "@babel/parser": "^7.8.4", - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.4", - "@babel/types": "^7.8.3", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.0", - "lodash": "^4.17.13", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "@babel/generator": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz", - "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==", - "dev": true, - "requires": { - "@babel/types": "^7.25.7", - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^3.0.2" - } - }, - "@babel/helper-string-parser": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz", - "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", - "dev": true - }, - "@babel/helper-validator-identifier": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", - "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", - "dev": true - }, - "@babel/helpers": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz", - "integrity": "sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w==", - "dev": true, - "requires": { - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.8.4", - "@babel/types": "^7.8.3" - } - }, - "@babel/highlight": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", - "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.25.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" - } - }, - "@babel/parser": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.7.tgz", - "integrity": "sha512-aZn7ETtQsjjGG5HruveUK06cU3Hljuhd9Iojm4M8WWv3wLE6OkE5PWbDUkItmMgegmccaITudyuW5RPYrYlgWw==", - "dev": true, - "requires": { - "@babel/types": "^7.25.7" - } - }, - "@babel/template": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz", - "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/types": "^7.25.7" - } - }, - "@babel/traverse": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.7.tgz", - "integrity": "sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.25.7", - "@babel/generator": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/template": "^7.25.7", - "@babel/types": "^7.25.7", - "debug": "^4.3.1", - "globals": "^11.1.0" - } - }, - "@babel/types": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.7.tgz", - "integrity": "sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==", - "dev": true, - "requires": { - "@babel/helper-string-parser": "^7.25.7", - "@babel/helper-validator-identifier": "^7.25.7", - "to-fast-properties": "^2.0.0" - } - }, - "@istanbuljs/load-nyc-config": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz", - "integrity": "sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg==", - "dev": true, - "requires": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - } - } - }, - "@istanbuljs/schema": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", - "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", - "dev": true - }, - "@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true - }, - "@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true - }, - "@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true - }, - "@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dev": true, - "requires": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "dev": true - }, - "@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true - }, - "abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", - "dev": true - }, - "acorn": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", - "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", - "dev": true - }, - "acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", - "dev": true, - "requires": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" - }, - "dependencies": { - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true - } - } - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "requires": {} - }, - "acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", - "dev": true - }, - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dev": true, - "requires": { - "debug": "4" - } - }, - "aggregate-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", - "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", - "dev": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "requires": { - "type-fest": "^0.21.3" - }, - "dependencies": { - "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true - } - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "append-transform": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", - "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", - "dev": true, - "requires": { - "default-require-extensions": "^3.0.0" - } - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "requires": { - "fill-range": "^7.1.1" - } - }, - "browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "caching-transform": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", - "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", - "dev": true, - "requires": { - "hasha": "^5.0.0", - "make-dir": "^3.0.0", - "package-hash": "^4.0.0", - "write-file-atomic": "^3.0.0" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true - }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "requires": { - "restore-cursor": "^3.1.0" - } - }, - "cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "dev": true - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "dependencies": { - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "cssom": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", - "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", - "dev": true - }, - "cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", - "dev": true, - "requires": { - "cssom": "~0.3.6" - }, - "dependencies": { - "cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true - } - } - }, - "data-urls": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.1.tgz", - "integrity": "sha512-Ds554NeT5Gennfoo9KN50Vh6tpgtvYEwraYjejXnyTpu1C7oXKxdFk75REooENHE8ndTVOJuv+BEs4/J/xcozw==", - "dev": true, - "requires": { - "abab": "^2.0.3", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^10.0.0" - } - }, - "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "dev": true, - "requires": { - "ms": "2.1.2" - }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decimal.js": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", - "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", - "dev": true - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "default-require-extensions": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", - "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", - "dev": true, - "requires": { - "strip-bom": "^4.0.0" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "dev": true - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "requires": { - "webidl-conversions": "^7.0.0" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", - "dev": true, - "requires": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - } - }, - "eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", - "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "inquirer": "^7.0.0", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.14", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.3", - "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", - "table": "^5.2.3", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true - }, - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "requires": { - "type-fest": "^0.8.1" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "dependencies": { - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - } - } - }, - "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - } - }, - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - }, - "espree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", - "dev": true, - "requires": { - "acorn": "^7.1.1", - "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "requires": { - "estraverse": "^5.1.0" - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - } - } - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", - "dev": true, - "requires": { - "flat-cache": "^2.0.1" - } - }, - "fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-cache-dir": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.2.0.tgz", - "integrity": "sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^3.0.0", - "pkg-dir": "^4.1.0" - } - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true - }, - "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", - "dev": true, - "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" - } - }, - "flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", - "dev": true - }, - "foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - }, - "dependencies": { - "cross-spawn": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", - "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - } - } - }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "fromentries": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", - "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "gensync": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", - "dev": true - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "hasha": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.1.0.tgz", - "integrity": "sha512-OFPDWmzPN1l7atOV1TgBVmNtBxaIysToK6Ve9DK+vT6pYuklw/nPNT+HJbZi0KDcI6vWB+9tgvZ5YD7fA3CXcA==", - "dev": true, - "requires": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" - } - }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, - "html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", - "dev": true, - "requires": { - "whatwg-encoding": "^2.0.0" - } - }, - "html-escaper": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.0.tgz", - "integrity": "sha512-a4u9BeERWGu/S8JiWEAQcdrg9v4QArtP9keViQjGMdff20fBdd8waotXaNmODqBe6uZ3Nafi7K/ho4gCQHV3Ig==", - "dev": true - }, - "http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", - "dev": true, - "requires": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" - } - }, - "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "dev": true, - "requires": { - "agent-base": "6", - "debug": "4" - } - }, - "iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "inquirer": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", - "dev": true, - "requires": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.19", - "mute-stream": "0.0.8", - "run-async": "^2.4.0", - "rxjs": "^6.6.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true - }, - "is-potential-custom-element-name": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true - }, - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", - "dev": true - }, - "istanbul-lib-hook": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", - "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", - "dev": true, - "requires": { - "append-transform": "^2.0.0" - } - }, - "istanbul-lib-instrument": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz", - "integrity": "sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg==", - "dev": true, - "requires": { - "@babel/core": "^7.7.5", - "@babel/parser": "^7.7.5", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "istanbul-lib-processinfo": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", - "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", - "dev": true, - "requires": { - "archy": "^1.0.0", - "cross-spawn": "^7.0.0", - "istanbul-lib-coverage": "^3.0.0-alpha.1", - "make-dir": "^3.0.0", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "uuid": "^3.3.3" - }, - "dependencies": { - "cross-spawn": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", - "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - } - } - }, - "istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", - "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - } - }, - "istanbul-reports": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.0.tgz", - "integrity": "sha512-2osTcC8zcOSUkImzN2EWQta3Vdi4WjjKw99P2yWx5mLnigAM0Rd5uYFn1cf2i/Ois45GkNjaoTqc5CxgMSX80A==", - "dev": true, - "requires": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "jsdom": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-18.0.0.tgz", - "integrity": "sha512-HVLuBcFmwdWulStv5U+J59b1AyzXhM92KXlM8HQ3ecYtRM2OQEUCPMa4oNuDeCBmtRcC7tJvb0Xz5OeFXMOKTA==", - "dev": true, - "requires": { - "abab": "^2.0.5", - "acorn": "^8.5.0", - "acorn-globals": "^6.0.0", - "cssom": "^0.5.0", - "cssstyle": "^2.3.0", - "data-urls": "^3.0.1", - "decimal.js": "^10.3.1", - "domexception": "^4.0.0", - "escodegen": "^2.0.0", - "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^3.0.0", - "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^10.0.0", - "ws": "^8.2.3", - "xml-name-validator": "^4.0.0" - } - }, - "jsesc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", - "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true - }, - "jszip": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", - "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", - "dev": true, - "requires": { - "lie": "~3.3.0", - "pako": "~1.0.2", - "readable-stream": "~2.3.6", - "setimmediate": "^1.0.5" - } - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "lie": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", - "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", - "dev": true, - "requires": { - "immediate": "~3.0.5" - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", - "dev": true - }, - "log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "make-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", - "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "mime-db": { - "version": "1.50.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz", - "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==", - "dev": true - }, - "mime-types": { - "version": "2.1.33", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz", - "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==", - "dev": true, - "requires": { - "mime-db": "1.50.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "mocha": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", - "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", - "dev": true, - "requires": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.3", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "4.2.1", - "ms": "2.1.3", - "nanoid": "3.3.1", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "which": "2.0.2", - "workerpool": "6.2.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "dependencies": { - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" - } - }, - "minimatch": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", - "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } - } - }, - "mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true - }, - "nanoid": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", - "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", - "dev": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node-preload": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", - "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", - "dev": true, - "requires": { - "process-on-spawn": "^1.0.0" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", - "dev": true - }, - "nyc": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.0.tgz", - "integrity": "sha512-qcLBlNCKMDVuKb7d1fpxjPR8sHeMVX0CHarXAVzrVWoFrigCkYR8xcrjfXSPi5HXM7EU78L6ywO7w1c5rZNCNg==", - "dev": true, - "requires": { - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "caching-transform": "^4.0.0", - "convert-source-map": "^1.7.0", - "decamelize": "^1.2.0", - "find-cache-dir": "^3.2.0", - "find-up": "^4.1.0", - "foreground-child": "^2.0.0", - "glob": "^7.1.6", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-hook": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", - "istanbul-lib-processinfo": "^2.0.2", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.0", - "js-yaml": "^3.13.1", - "make-dir": "^3.0.0", - "node-preload": "^0.2.0", - "p-map": "^3.0.0", - "process-on-spawn": "^1.0.0", - "resolve-from": "^5.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "spawn-wrap": "^2.0.0", - "test-exclude": "^6.0.0", - "uuid": "^3.3.3", - "yargs": "^15.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "p-limit": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", - "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - }, - "dependencies": { - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - } - } - }, - "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "package-hash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", - "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "hasha": "^5.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" - } - }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - } - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "process-on-spawn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", - "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", - "dev": true, - "requires": { - "fromentries": "^1.2.0" - } - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "dev": true - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true - }, - "release-zalgo": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", - "dev": true, - "requires": { - "es6-error": "^4.0.1" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true - }, - "resolve": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", - "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, - "rewire": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/rewire/-/rewire-5.0.0.tgz", - "integrity": "sha512-1zfitNyp9RH5UDyGGLe9/1N0bMlPQ0WrX0Tmg11kMHBpqwPJI4gfPpP7YngFyLbFmhXh19SToAG0sKKEFcOIJA==", - "dev": true, - "requires": { - "eslint": "^6.8.0" - } - }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "dev": true - }, - "rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", - "dev": true, - "requires": { - "xmlchars": "^2.2.0" - } - }, - "selenium-webdriver": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.0.0.tgz", - "integrity": "sha512-tOlu6FnTjPq2FKpd153pl8o2cB7H40Rvl/ogiD2sapMv4IDjQqpIxbd+swDJe9UDLdszeh5CDis6lgy4e9UG1w==", - "dev": true, - "requires": { - "jszip": "^3.6.0", - "rimraf": "^3.0.2", - "tmp": "^0.2.1", - "ws": ">=7.4.6" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, - "requires": { - "rimraf": "^3.0.0" - } - } - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - } - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "spawn-wrap": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", - "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", - "dev": true, - "requires": { - "foreground-child": "^2.0.0", - "is-windows": "^1.0.2", - "make-dir": "^3.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "which": "^2.0.1" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, - "supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - } - } - }, - "symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true - }, - "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", - "dev": true, - "requires": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "requires": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "tough-cookie": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", - "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", - "dev": true, - "requires": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" - } - }, - "tr46": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", - "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", - "dev": true, - "requires": { - "punycode": "^2.1.1" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, - "universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "dev": true - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, - "requires": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "w3c-hr-time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", - "dev": true, - "requires": { - "browser-process-hrtime": "^1.0.0" - } - }, - "w3c-xmlserializer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-3.0.0.tgz", - "integrity": "sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg==", - "dev": true, - "requires": { - "xml-name-validator": "^4.0.0" - } - }, - "webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "dev": true - }, - "whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", - "dev": true, - "requires": { - "iconv-lite": "0.6.3" - } - }, - "whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", - "dev": true - }, - "whatwg-url": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-10.0.0.tgz", - "integrity": "sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w==", - "dev": true, - "requires": { - "tr46": "^3.0.0", - "webidl-conversions": "^7.0.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true - }, - "workerpool": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", - "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", - "dev": true - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - } - }, - "write-file-atomic": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.1.tgz", - "integrity": "sha512-JPStrIyyVJ6oCSz/691fAjFtefZ6q+fP6tm+OS4Qw6o+TGQxNp1ziY2PgS+X/m0V8OWhZiO/m4xSj+Pr4RrZvw==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "ws": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", - "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", - "dev": true, - "requires": {} - }, - "xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", - "dev": true - }, - "xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - }, - "y18n": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", - "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", - "dev": true - }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "dependencies": { - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true - } - } - }, - "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true - }, - "yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "requires": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "dependencies": { - "camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true - }, - "decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true - } - } - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true - } - } -} diff --git a/browser-extensions/common/js/tests/test/test_challenges.js b/browser-extensions/common/js/tests/test/test_challenges.js deleted file mode 100644 index 35258ac1..00000000 --- a/browser-extensions/common/js/tests/test/test_challenges.js +++ /dev/null @@ -1,653 +0,0 @@ -// If we just imported the challenges library, it would be assumed to be a normal nodejs library, -// and have some functions exposed via exports. ... , however, we don't have any of this. -// If we did want to add it, we'd have to do something along the lines of: -// -// https://stackoverflow.com/questions/10204021/how-do-i-test-normal-non-node-specific-javascript-functions-with-mocha -// Export this as a library we're running under Node, -// if (typeof exports !== 'undefined') { -// exports.generate_stat_events_run = generate_stat_events_run; -// ... -// } -// -// ... for every function. -// -// However, there is a library called rewire that you could use to expose additional internal Javascript -// functions so that they can be tested, as described in : -// https://stackoverflow.com/questions/22097603/unit-testing-of-private-functions-with-mocha-and-node-js -// We can additionally use this to test all functions - and skip the hoop-jumping of exporting a function -// just for this testing framework. -// -// For this to work, we need to find each function we want to test, but that is just a one-liner in each -// section - -// Try and get jquery imported, as per https://gist.github.com/robballou/9ee108758dc5e0e2d028 -const { JSDOM } = require('jsdom'); -const jsdom = new JSDOM(''); - -const { window } = jsdom; -const { document } = window; -global.window = window; -global.document = document; - -const $ = global.jQuery = require('../../../../../js/lib/third-party/jquery/jquery-3.6.0.js'); -// It needs to be set globally, as per this solution: https://stackoverflow.com/a/57292683 -global.$ = $ - -var rewire = require('rewire') -var challenges = rewire('../../lib/challenges.js') - -var assert = require('assert'); - -// challenges.generate_stat_events_run() - -// Functions to add events - -function getGeoData() { - const data = { - "events": { - "Bushy Park": { - shortname: "bushy", - name: "Bushy Park", - country_id: 97, - country_name: "UK", - id: 1, - lat: 51.410992, - lon: -0.335791 - }, - "Winchester": { - shortname: "winchester", - name: "Winchester", - country_id: 97, - country_name: "UK", - id: 280, - lat: 51.069286, - lon: -1.310849 - }, - "Fell Foot": { - shortname: "fellfoot", - name: "Fell Foot", - country_id: 97, - country_name: "UK", - id: 1017, - lat: 54.274736, - lon: -2.952259 - } - }, - "countries": { - "UK": { - id: "97", - name: "UK", - lat: 54.672276, - lon: -2.9478825, - bounds: [-7.643103, 49.186471, 1.747338, 60.158081], - url: "www.parkrun.org.uk", - child_event_ids: [1, 280, 1017], - child_event_names: ["Bushy Park", "Winchester", "Fell Foot"] - } - }, - "event_status": {} - } - - return { - "data": data - } -} - -function filterGeoData(geoData, filters) { - // Possible Filters are: - // "countries": [] (list of countries to leave in) - // "events": [] (list of event names to leave in) - - // Create a deep copy of the input data - newGeoData = JSON.parse(JSON.stringify(geoData)) - - if (filters.countries !== undefined) { - // Remove countries that are not in the list provided - Object.keys(newGeoData.data.countries).forEach(function(countryName){ - if (!(filters.countries.includes(countryName))) { - delete newGeoData.data.countries[countryName] - } - }) - } - if (filters.events !== undefined) { - // Remove events that are not in the list provided - Object.keys(newGeoData.data.events).forEach(function(eventName){ - if (!(filters.events.includes(eventName))) { - delete newGeoData.data.events[eventName] - } - }) - } - - return newGeoData -} - -function getParkrunEventInfo(parkrunName) { - parkrunEventInfo = getGeoData().data.events[parkrunName] - return parkrunEventInfo -} - -// Functions to create dummy parkrun event results - -var lastDateUsed = undefined -function getNextParkrunDate() { - -} - -function createParkrunResult(specificData) { - return { - name: "Fell Foot", - eventlink: "
Fell Foot", - date: "22/11/2014", - datelink: "22/11/2014", - date_obj: new Date("Sat Nov 22 2014 00:00:00 GMT+0000"), - event_number: "6", - position: "44", - time: "26:19", - pb: false, - ...specificData - } -} - -var geoData = getGeoData() - -describe("challenges.js", function() { - - describe("stats", function() { - - describe("generate_stat_furthest_travelled", function() { - - // Use the special '__get__' accessor to get your private function. - var generate_stat_furthest_travelled = challenges.__get__('generate_stat_furthest_travelled'); - - it('should return "None" if no events have been run', function() { - var parkrunResults = [] - var homeParkrun = getParkrunEventInfo("Winchester") - var r = generate_stat_furthest_travelled(parkrunResults, geoData, homeParkrun) - assert.equal(r.value, "None") - assert.equal(r.url, undefined) - }) - - it('should return the only parkrun done if they have only done one, and it is their home run', function() { - var parkrunResults = [ - createParkrunResult({name: "Winchester"}) - ] - var homeParkrun = getParkrunEventInfo("Winchester") - var r = generate_stat_furthest_travelled(parkrunResults, geoData, homeParkrun) - assert.equal(r.value, "Winchester, UK") - assert.equal(r.url, "https://www.parkrun.org.uk/winchester") - }) - - it('should return the only parkrun done if they have only done one, and it is not their home run', function() { - var parkrunResults = [ - createParkrunResult({name: "Bushy Park"}) - ] - var homeParkrun = getParkrunEventInfo("Winchester") - var r = generate_stat_furthest_travelled(parkrunResults, geoData, homeParkrun) - assert.equal(r.value, "Bushy Park, UK") - assert.equal(r.url, "https://www.parkrun.org.uk/bushy") - }) - - it('should return "Unknown" if none of the parkruns they have done have a known location', function() { - var parkrunResults = [ - createParkrunResult({name: "A Closed Parkrun"}) - ] - var homeParkrun = getParkrunEventInfo("Winchester") - var r = generate_stat_furthest_travelled(parkrunResults, geoData, homeParkrun) - assert.equal(r.value, "Unknown") - assert.equal(r.url, undefined) - }) - - it('should return the only parkrun event done if they have only been to one place, but been there multiple times', function() { - var parkrunResults = [ - createParkrunResult({name: "Winchester"}), - createParkrunResult({name: "Winchester"}) - ] - var homeParkrun = getParkrunEventInfo("Bushy Park") - var r = generate_stat_furthest_travelled(parkrunResults, geoData, homeParkrun) - assert.equal(r.value, "Winchester, UK") - assert.equal(r.url, "https://www.parkrun.org.uk/winchester") - }) - - it('should return the correct parkrun event in a list of mixed events', function() { - var parkrunResults = [ - createParkrunResult({name: "Fell Foot"}), - createParkrunResult({name: "Winchester"}), - createParkrunResult({name: "Bushy Park"}) - ] - var homeParkrun = getParkrunEventInfo("Bushy Park") - var r = generate_stat_furthest_travelled(parkrunResults, geoData, homeParkrun) - assert.equal(r.value, "Fell Foot, UK") - assert.equal(r.url, "https://www.parkrun.org.uk/fellfoot") - }) - }) - - describe("generate_stat_nearest_event_not_done_yet", function() { - - // Use the special '__get__' accessor to get your private function. - var generate_stat_nearest_event_not_done_yet = challenges.__get__('generate_stat_nearest_event_not_done_yet'); - - it("should return the home parkrun if you haven't run any events", function() { - var parkrunResults = [] - var homeParkrun = getParkrunEventInfo("Winchester") - var r = generate_stat_nearest_event_not_done_yet(parkrunResults, geoData, homeParkrun) - assert.equal(r.value, "Winchester, UK - 0km away") - assert.equal(r.url, "https://www.parkrun.org.uk/winchester") - }) - - it("should return Bushy Park if the home run is Winchester, which has been run", function() { - var parkrunResults = [ - createParkrunResult({name: "Winchester"}) - ] - var homeParkrun = getParkrunEventInfo("Winchester") - var filteredGeoData = filterGeoData(geoData, {"events": ["Bushy Park", "Winchester"]}) - var r = generate_stat_nearest_event_not_done_yet(parkrunResults, filteredGeoData, homeParkrun) - assert.equal(r.value, "Bushy Park, UK - 78km away") - assert.equal(r.url, "https://www.parkrun.org.uk/bushy") - }) - - it("should say \"No more events available\" if you have done all events", function() { - var parkrunResults = [ - createParkrunResult({name: "Winchester"}), - createParkrunResult({name: "Bushy Park"}) - ] - var homeParkrun = getParkrunEventInfo("Winchester") - var filteredGeoData = filterGeoData(geoData, {"events": ["Bushy Park", "Winchester"]}) - var r = generate_stat_nearest_event_not_done_yet(parkrunResults, filteredGeoData, homeParkrun) - assert.equal(r.value, "No more events available") - assert.equal(r.url, undefined) - }) - - }) - - describe("generate_stat_average_parkrun_event", function () { - var generate_stat_average_parkrun_event = challenges.__get__('generate_stat_average_parkrun_event'); - const homeParkrun = getParkrunEventInfo("Winchester"); - - it("should return 'None' if no events have been run", function () { - var parkrunResults = []; - var r = generate_stat_average_parkrun_event(parkrunResults, geoData, homeParkrun); - assert.equal(r.value, "None"); - assert.equal(r.url, undefined); - assert.equal(r.help, "The nearest parkrun event to your home parkrun location") - }); - - it("should handle no home parkrun data at all", function () { - var parkrunResults = [createParkrunResult({ name: "Winchester" })]; - var r = generate_stat_average_parkrun_event(parkrunResults, geoData, undefined); - assert.equal(r.value, "Winchester"); - assert.equal(r.url, "https://www.parkrun.org.uk/winchester"); - assert.equal(r.help, "The nearest parkrun event to your average parkrun location (or Bushy if you're yet to start)") - }); - - it("should handle no home parkrun", function () { - var parkrunResults = [createParkrunResult({ name: "Winchester" })]; - var r = generate_stat_average_parkrun_event(parkrunResults, geoData, {}); - assert.equal(r.value, "Winchester"); - assert.equal(r.url, "https://www.parkrun.org.uk/winchester"); - assert.equal(r.help, "The nearest parkrun event to your average parkrun location (or Bushy if you're yet to start)") - }); - - it("should return 'Winchester' if only run there once", function () { - var parkrunResults = [createParkrunResult({ name: "Winchester" })]; - var r = generate_stat_average_parkrun_event(parkrunResults, geoData, homeParkrun); - assert.equal(r.value, "Winchester"); - assert.equal(r.url, "https://www.parkrun.org.uk/winchester"); - assert.equal(r.help, "The nearest parkrun event to your home parkrun location")}); - - it("should return 'Winchester' if run there multiple times", function () { - var parkrunResults = [ - createParkrunResult({ name: "Winchester" }), - createParkrunResult({ name: "Winchester" }), - createParkrunResult({ name: "Winchester" }) - ]; - var r = generate_stat_average_parkrun_event(parkrunResults, geoData, homeParkrun); - assert.equal(r.value, "Winchester"); - assert.equal(r.url, "https://www.parkrun.org.uk/winchester"); - assert.equal(r.help, "The nearest parkrun event to your home parkrun location") - }); - - it("should return 'Bushy Park' if run there most often", function () { - var parkrunResults = [ - createParkrunResult({name: "Bushy Park"}), - createParkrunResult({name: "Bushy Park"}), - createParkrunResult({name: "Winchester"}) - ] - // Filter the events to just Bushy Park and Winchester so that we definitely know which it will pick - var filteredGeoData = filterGeoData(geoData, {"events": ["Bushy Park", "Winchester"]}) - var r = generate_stat_average_parkrun_event(parkrunResults, filteredGeoData) - assert.equal(r.value, "Bushy Park") - assert.equal(r.url, "https://www.parkrun.org.uk/bushy") - }) - - }) - - describe("generate_stat_longest_tourism_streak", () => { - const generate_stat_longest_tourism_streak = challenges.__get__('generate_stat_longest_tourism_streak'); - - describe("given no results", () => { - const parkrunResults = []; - it("is expected to be zero", () => { - const r = generate_stat_longest_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "No parkruns: Yet to start (let's go!)") - }) - }) - - describe("given one result", () => { - const parkrunResults = [ - createParkrunResult({ name: "A", datelink: "date1", eventlink: "eventa" }) - ]; - it("is expected to be one", () => { - const r = generate_stat_longest_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "1 parkrun: eventa (date1)") - }) - }) - - describe("given two identical results", () => { - const parkrunResults = [ - createParkrunResult({ name: "A", datelink: "date1", eventlink: "eventa" }), - createParkrunResult({ name: "A", datelink: "date2", eventlink: "eventa" }) - ]; - it("is expected to be the latest one", () => { - const r = generate_stat_longest_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "1 parkrun: eventa (date2)") - }) - }) - - describe("given two different results", () => { - const parkrunResults = [ - createParkrunResult({ name: "A", datelink: "date1", eventlink: "eventa" }), - createParkrunResult({ name: "B", datelink: "date2", eventlink: "eventb" }) - ]; - it("is expected to be two", () => { - const r = generate_stat_longest_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "2 parkruns: eventa (date1) - eventb (date2)") - }) - }) - - describe("a third result the same as the first", () => { - const parkrunResults = [ - createParkrunResult({ name: "A", datelink: "date1", eventlink: "eventa" }), - createParkrunResult({ name: "B", datelink: "date2", eventlink: "eventb" }), - createParkrunResult({ name: "A", datelink: "date3", eventlink: "eventa" }) - ]; - it("is expected to remove the first event from the streak", () => { - const r = generate_stat_longest_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "2 parkruns: eventb (date2) - eventa (date3)") - }) - }) - - describe("a third result the same as the second", () => { - const parkrunResults = [ - createParkrunResult({ name: "A", datelink: "date1", eventlink: "eventa" }), - createParkrunResult({ name: "B", datelink: "date2", eventlink: "eventb" }), - createParkrunResult({ name: "B", datelink: "date3", eventlink: "eventb" }) - ]; - it("is expected to end the streak", () => { - const r = generate_stat_longest_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "2 parkruns: eventa (date1) - eventb (date2)") - }) - }) - - describe("a third unique result", () => { - const parkrunResults = [ - createParkrunResult({ name: "A", datelink: "date1", eventlink: "eventa" }), - createParkrunResult({ name: "B", datelink: "date2", eventlink: "eventb" }), - createParkrunResult({ name: "C", datelink: "date3", eventlink: "eventc" }) - ]; - it("is expected to extend the streak", () => { - const r = generate_stat_longest_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "3 parkruns: eventa (date1) - eventc (date3)") - }) - }) - - describe("two identical streaks", () => { - const parkrunResults = [ - createParkrunResult({ name: "A", datelink: "date1", eventlink: "eventa" }), - createParkrunResult({ name: "B", datelink: "date2", eventlink: "eventb" }), - createParkrunResult({ name: "A", datelink: "date3", eventlink: "eventa" }), - createParkrunResult({ name: "B", datelink: "date4", eventlink: "eventb" }), - ]; - it("is expected to be the second streak", () => { - const r = generate_stat_longest_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "2 parkruns: eventa (date3) - eventb (date4)") - }) - }) - - describe("overlapping streaks (ABC, BCAD, ADCE)", () => { - const parkrunResults = [ - createParkrunResult({ name: "A", datelink: "date1", eventlink: "eventa" }), - createParkrunResult({ name: "B", datelink: "date2", eventlink: "eventb" }), - createParkrunResult({ name: "C", datelink: "date3", eventlink: "eventc" }), - createParkrunResult({ name: "A", datelink: "date4", eventlink: "eventa" }), - createParkrunResult({ name: "D", datelink: "date5", eventlink: "eventd" }), - createParkrunResult({ name: "C", datelink: "date6", eventlink: "eventc" }), - createParkrunResult({ name: "E", datelink: "date7", eventlink: "evente" }) - ]; - it("is expected to be the latest, longest streak", () => { - const r = generate_stat_longest_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "4 parkruns: eventa (date4) - evente (date7)") - }) - }) - - describe("A long streak followed by a shorter one (ABCD, DC)", () => { - const parkrunResults = [ - createParkrunResult({ name: "A", datelink: "date1", eventlink: "eventA" }), - createParkrunResult({ name: "B", datelink: "date2", eventlink: "eventB" }), - createParkrunResult({ name: "C", datelink: "date3", eventlink: "eventC" }), - createParkrunResult({ name: "D", datelink: "date4", eventlink: "eventD" }), - createParkrunResult({ name: "C", datelink: "date5", eventlink: "eventC" }) - ]; - - it("is expected to be the longer streak", () => { - const r = generate_stat_longest_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "4 parkruns: eventA (date1) - eventD (date4)") - }) - }) - }) - - describe("generate_stat_current_tourism_streak", () => { - const generate_stat_current_tourism_streak = challenges.__get__('generate_stat_current_tourism_streak'); - - describe("given no results", () => { - const parkrunResults = []; - it("is expected to be zero", () => { - const r = generate_stat_current_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "No parkruns: Yet to start (let's go!)") - }) - }) - - describe("given one result", () => { - const parkrunResults = [ - createParkrunResult({ name: "A", datelink: "date1", eventlink: "eventa" }) - ]; - it("is expected to be one", () => { - const r = generate_stat_current_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "1 parkrun: eventa (date1)") - }) - }) - - describe("given two identical results", () => { - const parkrunResults = [ - createParkrunResult({ name: "A", datelink: "date1", eventlink: "eventa" }), - createParkrunResult({ name: "A", datelink: "date2", eventlink: "eventa" }) - ]; - it("is expected to be the latest one", () => { - const r = generate_stat_current_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "1 parkrun: eventa (date2)") - }) - }) - - describe("given two different results", () => { - const parkrunResults = [ - createParkrunResult({ name: "A", datelink: "date1", eventlink: "eventa" }), - createParkrunResult({ name: "B", datelink: "date2", eventlink: "eventb" }) - ]; - it("is expected to be two", () => { - const r = generate_stat_current_tourism_streak(parkrunResults) - assert.strictEqual(r.value, "2 parkruns: eventa (date1) - eventb (date2)") - }) - }) - }) - }) - - describe("challenges", function() { - - describe("challenge_name_badge", function() { - - // Use the special '__get__' accessor to get your private function. - var challenge_name_badge = challenges.__get__('challenge_name_badge'); - - // A simple testcase we can work with - var parkrunResults = [] - - var data = { - "parkrun_results": parkrunResults, - "geo_data": filterGeoData(geoData, {"events": ["Bushy Park", "Winchester"]}) - } - - // Seems a bit odd we have to call it like this, we should probably refactor it to - // only take the athlete name data - var r = challenge_name_badge(data, { - "shortname": "name-badge", - "name": "Name Badge", - "data": { - "name": "andrew TAYLOR" - } - }) - - it("shouldn't give the badge if no events have been run", function() { - // With the data above, we should not have completed this challenge as we haven't run any events - assert.equal(r.complete, false) - }) - - it("should set the number of subparts the the number of achieveable letters", function() { - // For ANDREW TAYLOR we have only got a reference to WINCHESTER that matches - assert.equal(r.subparts_count, 1) - }) - - it("should give the badge if all letters are available and have been run", function() { - // Call it again with a name that matches the events we have run - var r = challenge_name_badge( - { - "parkrun_results": [ - createParkrunResult({name: "Winchester"}), - createParkrunResult({name: "Bushy Park"}), - ], - "geo_data": filterGeoData(geoData, {"events": ["Bushy Park", "Winchester"]}) - }, { - "shortname": "name-badge", - "name": "Name Badge", - "data": { - "name": "b w" - } - }) - assert.equal(r.subparts_count, 2) - assert.equal(r.subparts_completed_count, 2) - assert.equal(r.complete, true) - - }) - it("should give the badge if not all letters are available, but those are have been run", function() { - // Call it again with a name that matches the events we have run - var r = challenge_name_badge( - { - "parkrun_results": [ - createParkrunResult({name: "Winchester"}), - createParkrunResult({name: "Bushy Park"}), - ], - "geo_data": filterGeoData(geoData, {"events": ["Bushy Park", "Winchester"]}) - }, { - "shortname": "name-badge", - "name": "Name Badge", - "data": { - "name": "b w-abcdefgh" - } - }) - assert.equal(r.subparts_count, 2) - assert.equal(r.subparts_completed_count, 2) - assert.equal(r.complete, true) - }) - - it("shouldn't give the badge if too few events have been run", function() { - // Call it again with a name that matches the events we have run - var r = challenge_name_badge( - { - "parkrun_results": [ - createParkrunResult({name: "Winchester"}), - ], - "geo_data": filterGeoData(geoData, {"events": ["Bushy Park", "Winchester"]}) - }, { - "shortname": "name-badge", - "name": "Name Badge", - "data": { - "name": "b wabcdefgh" - } - }) - assert.equal(r.subparts_count, 2) - assert.equal(r.subparts_completed_count, 1) - assert.equal(r.complete, false) - }) - - it("shouldn't give the badge if no letters in the name match parkrun events", function() { - // Call it again with a name that matches the events we have run - var r = challenge_name_badge( - { - "parkrun_results": [ - createParkrunResult({name: "Winchester"}), - ], - "geo_data": filterGeoData(geoData, {"events": ["Bushy Park", "Winchester"]}) - }, { - "shortname": "name-badge", - "name": "Name Badge", - "data": { - "name": "cde fgh" - } - }) - assert.equal(r.subparts_count, 0) - assert.equal(r.subparts_completed_count, 0) - assert.equal(r.complete, false) - }) - it("should handle being given names with hyphens in", function() { - // Call it again with a name that matches the events we have run - var r = challenge_name_badge( - { - "parkrun_results": [ - createParkrunResult({name: "Winchester"}), - createParkrunResult({name: "Bushy Park"}), - ], - "geo_data": filterGeoData(geoData, {"events": ["Bushy Park", "Winchester"]}) - }, { - "shortname": "name-badge", - "name": "Name Badge", - "data": { - "name": "b w-h" - } - }) - assert.equal(r.subparts_count, 2) - assert.equal(r.subparts_completed_count, 2) - assert.equal(r.complete, true) - }) - it("should handle Japanese names being passed in, but won't get the badge", function() { - var r = challenge_name_badge( - { - "parkrun_results": [ - createParkrunResult({name: "Winchester"}), - createParkrunResult({name: "Bushy Park"}), - ], - "geo_data": filterGeoData(geoData, {"events": ["Bushy Park", "Winchester"]}) - }, { - "shortname": "name-badge", - "name": "Name Badge", - "data": { - "name": "和輝 遠藤" - } - }) - assert.equal(r.subparts_count, 0) - assert.equal(r.subparts_completed_count, 0) - assert.equal(r.complete, false) - }) - - }) - - }) - -}) \ No newline at end of file diff --git a/browser-extensions/common/js/tests/ui-test/.gitignore b/browser-extensions/common/js/tests/ui-test/.gitignore deleted file mode 100644 index 75e854d8..00000000 --- a/browser-extensions/common/js/tests/ui-test/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -/test-results/ -/playwright-report/ -/playwright/.cache/ diff --git a/browser-extensions/common/js/tests/ui-test/README.md b/browser-extensions/common/js/tests/ui-test/README.md deleted file mode 100644 index b29eaaa2..00000000 --- a/browser-extensions/common/js/tests/ui-test/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# playwright-testing -Testing the playwright testing framework diff --git a/browser-extensions/common/js/tests/ui-test/package-lock.json b/browser-extensions/common/js/tests/ui-test/package-lock.json deleted file mode 100644 index a4959411..00000000 --- a/browser-extensions/common/js/tests/ui-test/package-lock.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "running-challenges-chrome-ui-testing", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "running-challenges-chrome-ui-testing", - "version": "1.0.0", - "license": "ISC", - "devDependencies": { - "@playwright/test": "^1.50.1" - } - }, - "node_modules/@playwright/test": { - "version": "1.50.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.50.1.tgz", - "integrity": "sha512-Jii3aBg+CEDpgnuDxEp/h7BimHcUTDlpEtce89xEumlJ5ef2hqepZ+PWp1DDpYC/VO9fmWVI1IlEaoI5fK9FXQ==", - "dev": true, - "dependencies": { - "playwright": "1.50.1" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@playwright/test/node_modules/playwright": { - "version": "1.50.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.50.1.tgz", - "integrity": "sha512-G8rwsOQJ63XG6BbKj2w5rHeavFjy5zynBA9zsJMMtBoe/Uf757oG12NXz6e6OirF7RCrTVAKFXbLmn1RbL7Qaw==", - "dev": true, - "dependencies": { - "playwright-core": "1.50.1" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "fsevents": "2.3.2" - } - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/playwright-core": { - "version": "1.50.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.50.1.tgz", - "integrity": "sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ==", - "dev": true, - "bin": { - "playwright-core": "cli.js" - }, - "engines": { - "node": ">=18" - } - } - } -} diff --git a/browser-extensions/common/js/tests/ui-test/screenshot.png b/browser-extensions/common/js/tests/ui-test/screenshot.png deleted file mode 100644 index 605988a8..00000000 Binary files a/browser-extensions/common/js/tests/ui-test/screenshot.png and /dev/null differ diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/docker-compose-gh-actions.yml b/browser-extensions/common/js/tests/ui-test/supporting-data/docker-compose-gh-actions.yml deleted file mode 100644 index d9ccb9b4..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/docker-compose-gh-actions.yml +++ /dev/null @@ -1,10 +0,0 @@ -services: - nginx: - image: nginx:1.20 - ports: - - 80:80 - - 443:443 - volumes: - - ./sites/:/usr/share/nginx/html/ - - ./nginx/conf.d/:/etc/nginx/conf.d/ - - ./nginx/cert/:/etc/nginx/cert/ diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/etc-hosts.txt b/browser-extensions/common/js/tests/ui-test/supporting-data/etc-hosts.txt deleted file mode 100644 index c802f77a..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/etc-hosts.txt +++ /dev/null @@ -1,26 +0,0 @@ - -# contents of /etc/hosts to make it reference the nginx container we start -127.0.0.1 www.parkrun.ca -127.0.0.1 www.parkrun.co.at -127.0.0.1 www.parkrun.co.nl -127.0.0.1 www.parkrun.co.nz -127.0.0.1 www.parkrun.co.za -127.0.0.1 www.parkrun.com.au -127.0.0.1 www.parkrun.com.de -127.0.0.1 www.parkrun.dk -127.0.0.1 www.parkrun.fi -127.0.0.1 www.parkrun.fr -127.0.0.1 www.parkrun.ie -127.0.0.1 www.parkrun.it -127.0.0.1 www.parkrun.lt -127.0.0.1 www.parkrun.jp -127.0.0.1 www.parkrun.my -127.0.0.1 www.parkrun.no -127.0.0.1 www.parkrun.org.uk -127.0.0.1 www.parkrun.pl -127.0.0.1 www.parkrun.ru -127.0.0.1 www.parkrun.se -127.0.0.1 www.parkrun.sg -127.0.0.1 www.parkrun.us -127.0.0.1 images.parkrun.com -# end of contents diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/cert/.gitignore b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/cert/.gitignore deleted file mode 100644 index 18b37eaa..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/cert/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -cert.pem -key.pem \ No newline at end of file diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/cert/generate.sh b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/cert/generate.sh deleted file mode 100644 index 66594c11..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/cert/generate.sh +++ /dev/null @@ -1 +0,0 @@ -openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes -subj '/CN=fake-parkrun-site' \ No newline at end of file diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/images.parkrun.com.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/images.parkrun.com.conf deleted file mode 100644 index eb4cba78..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/images.parkrun.com.conf +++ /dev/null @@ -1,19 +0,0 @@ -server { - listen 443 ssl; - server_name images.parkrun.com; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - # Attempt to serve the file correctly, so that it is accepted by the browser - types { } default_type "application/json"; - add_header access-control-allow-origin *; - add_header access-control-allow-methods GET; - # Add our own header to show it is the mock server responding - add_header X-Running-Challenges mock-server; - root /usr/share/nginx/html/images.parkrun.com/contents; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.ca.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.ca.conf deleted file mode 100644 index a6e403d3..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.ca.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.ca; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.ca/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.co.at.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.co.at.conf deleted file mode 100644 index 69ee7666..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.co.at.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.co.at; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.co.at/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.co.nl.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.co.nl.conf deleted file mode 100644 index 4019abe8..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.co.nl.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.co.nl; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.co.nl/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.co.nz.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.co.nz.conf deleted file mode 100644 index ecaae03d..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.co.nz.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.co.nz; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.co.nz/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.co.za.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.co.za.conf deleted file mode 100644 index 5e8c7c5e..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.co.za.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.co.za; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.co.za/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.com.au.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.com.au.conf deleted file mode 100644 index 025a74d8..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.com.au.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.com.au; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.com.au/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.com.de.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.com.de.conf deleted file mode 100644 index efbb7652..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.com.de.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.com.de; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.com.de/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.com.us.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.com.us.conf deleted file mode 100644 index c341d5b9..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.com.us.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.com.us; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.com.us/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.dk.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.dk.conf deleted file mode 100644 index e1dcafdc..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.dk.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.dk; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.dk/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.fi.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.fi.conf deleted file mode 100644 index 3f0c85d0..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.fi.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.fi; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.fi/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.fr.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.fr.conf deleted file mode 100644 index c97d3bb0..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.fr.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.fr; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.fr/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.ie.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.ie.conf deleted file mode 100644 index 8a2fc3c0..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.ie.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.ie; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.ie/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.it.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.it.conf deleted file mode 100644 index d6e1f64f..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.it.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.it; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.it/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.jp.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.jp.conf deleted file mode 100644 index 5d48f143..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.jp.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.jp; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.jp/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.lt.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.lt.conf deleted file mode 100644 index c40d7b8d..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.lt.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.lt; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.lt/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.my.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.my.conf deleted file mode 100644 index 85fede72..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.my.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.my; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.my/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.no.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.no.conf deleted file mode 100644 index 2f22d8a5..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.no.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.no; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.no/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.org.uk.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.org.uk.conf deleted file mode 100644 index d11d0edf..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.org.uk.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.org.uk; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.org.uk/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.pl.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.pl.conf deleted file mode 100644 index 42045305..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.pl.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.pl; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.pl/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.ru.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.ru.conf deleted file mode 100644 index eb2fb7da..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.ru.conf +++ /dev/null @@ -1,13 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.ru; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.ru/contents; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.se.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.se.conf deleted file mode 100644 index 465dadbd..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.se.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.se; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.se/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.sg.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.sg.conf deleted file mode 100644 index 6ec2fc8a..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.sg.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.sg; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.sg/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.us.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.us.conf deleted file mode 100644 index 8c8f112b..00000000 --- a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/conf.d/parkrun.us.conf +++ /dev/null @@ -1,14 +0,0 @@ -server { - listen 443 ssl; - server_name www.parkrun.us; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/parkrun.us/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/nginx.conf b/browser-extensions/common/js/tests/ui-test/supporting-data/nginx/nginx.conf deleted file mode 100644 index e69de29b..00000000 diff --git a/browser-extensions/common/js/tests/ui-test/tests/extension.spec.js b/browser-extensions/common/js/tests/ui-test/tests/extension.spec.js deleted file mode 100644 index 7e6c219b..00000000 --- a/browser-extensions/common/js/tests/ui-test/tests/extension.spec.js +++ /dev/null @@ -1,223 +0,0 @@ -// @ts-check -// const { test, expect } = require('@playwright/test'); - -// Some more help taken from https://www.petroskyriakou.com/how-to-load-a-chrome-extension-in-playwright -// https://playwright.dev/docs/chrome-extensions hasn't been particularly helpful - -const { test: base, expect, chromium } = require('@playwright/test') -const path = require('path') - -const countryDomain = process.env.COUNTRY_HOSTNAME ? process.env.COUNTRY_HOSTNAME : "parkrun.org.uk" - -const extensionPath = path.join(__dirname, '../extension-binaries/chrome-extension-package/') // make sure this is correct - -const test = base.extend({ - context: async ({ browserName }, use) => { - const browserTypes = { chromium } - const launchOptions = { - devtools: true, - headless: false, - args: [ - // `--headless=new`, - `--disable-extensions-except=${extensionPath}`, - `--load-extension=${extensionPath}` - ], - viewport: { - width: 1920, - height: 1080 - }, - // Is this how you accept self-signed certificates? - ignoreHTTPSErrors: true - } - - const context = await browserTypes[browserName].launchPersistentContext( - '', - launchOptions - ) - await use(context) - await context.close() - } -}) - -// await page.screenshot({ path: 'screenshot.png', fullPage: true }); - -test('Basic extension load test', async ({ page }) => { - - console.log(`Expecting the extension to have been loaded from ${extensionPath}`) - - await page.goto(`https://www.${countryDomain}/parkrunner/1309364/all/`); - - // Wait 3 seconds, this should be plenty as we are serving all the data locally and there shoudn't be - // any internet calls - await page.waitForTimeout(3000); - - // This takes a screenshot of the entire page, which is probably a good idea to do early on, - // but we should really wait until the extension has loaded. - await page.screenshot({ path: 'screenshot.png', fullPage: true }); - - let messagesDiv = page.locator("#running_challenges_messages_div") - - await expect(messagesDiv).toHaveText("Additional badges provided by Running Challenges", {timeout: 10000}) - -}); - -test('No results for parkrunner load test', async ({ page }) => { - - console.log(`Expecting the extension to have been loaded from ${extensionPath}`) - - await page.goto(`https://www.${countryDomain}/parkrunner/999999/all/`); - - // Wait 3 seconds, this should be plenty as we are serving all the data locally and there shoudn't be - // any internet calls - await page.waitForTimeout(3000); - - // Expect a title "to contain" a substring, this probably won't work on anything other than english language sites. - // await expect(page).toHaveTitle(/results/, { timeout: 1000 }); - - // This takes a screenshot of the entire page, which is probably a good idea to do early on, - // but we should really wait until the extension has loaded. - await page.screenshot({ path: 'screenshot.png', fullPage: true }); - - let messagesDiv = page.locator("#running_challenges_messages_div") - - await expect(messagesDiv).toHaveText("No results detected, no challenge data will be compiled", {timeout: 10000}) - -}); - -let badgesThatShouldExistMap = { - // Running badges - "runner-tourist": [ - "1309364", - "482" - ], - "runner-name-badge": [ - "482", - ], - // Volunteer badges - "volunteer-barcode-scanning": [ - "88720" - ], - "volunteer-car-park-marshal": [ - "88720" - ], - "volunteer-close-down": [ - "88720" - ], - "volunteer-comms-person": [ - "88720" - ], - "volunteer-equipment-storage": [ - "88720" - ], - "volunteer-event-day-course-check": [ - "88720" - ], - "volunteer-finish-tokens": [ - "88720" - ], - "volunteer-first-timers-welcome": [ - "88720" - ], - "volunteer-funnel-manager": [ - "88720" - ], - "volunteer-lead-bike": [ - ], - "volunteer-manual-entry": [ - "88720" - ], - "volunteer-marshal": [ - "88720" - ], - "volunteer-other": [ - "88720" - ], - "volunteer-pacer": [ - "88720" - ], - "volunteer-photographer": [ - "88720" - ], - "volunteer-report-writer": [ - "88720" - ], - "volunteer-results-processing": [ - "88720" - ], - "volunteer-run-director": [ - "88720" - ], - "volunteer-setup": [ - "88720" - ], - "volunteer-sign-language": [ - "88720" - ], - "volunteer-tail-walker": [ - "88720" - ], - "volunteer-timer": [ - "88720" - ], - "volunteer-token-sorting": [ - "88720" - ], - "volunteer-vi-guide": [ - "88720" - ], - "volunteer-volunteer-coordinator": [ - "88720" - ], - "volunteer-warm-up-leader": [ - "88720" - ], - "volunteer-parkwalker": [ - "88720" - ] -} - -let notApplicableBadgesPerDomain = { - "parkrun.co.at": [ - "volunteer-warm-up-leader" - ], - "parkrun.pl": [ - "volunteer-warm-up-leader" - ] -} - -Object.keys(badgesThatShouldExistMap).forEach(badgeShortname => { - - if (countryDomain in notApplicableBadgesPerDomain) { - if (notApplicableBadgesPerDomain[countryDomain].includes(badgeShortname)) { - console.log(`Skipping ${badgeShortname} for ${countryDomain}`) - return - } - } - - test(`Check for badge awarded: ${badgeShortname}`, async ({ page }) => { - - for (const parkrunnerId of badgesThatShouldExistMap[badgeShortname]) { - - await page.goto(`https://www.${countryDomain}/parkrunner/${parkrunnerId}/all/`); - - // Wait for the extension to load, and therefore all the badges to be displayed - await expect(page.locator("#running_challenges_messages_div")).toHaveText("Additional badges provided by Running Challenges", {timeout: 10000}) - - // Check for the specific badge: - await expect(page.locator(`#badge-awarded-${badgeShortname}`)).toBeVisible() - - } - - }); - -}); - -// test('get started link', async ({ page }) => { -// await page.goto('https://playwright.dev/'); - -// // Click the get started link. -// await page.getByRole('link', { name: 'Get started' }).click(); - -// // Expects the URL to contain intro. -// await expect(page).toHaveURL(/.*intro/); -// }); diff --git a/browser-extensions/extension/package.json b/browser-extensions/extension/package.json new file mode 100644 index 00000000..8d4612fb --- /dev/null +++ b/browser-extensions/extension/package.json @@ -0,0 +1,26 @@ +{ + "name": "running-challenges-extension", + "version": "1.0.0", + "private": true, + "description": "Build tooling for the Running Challenges browser extension", + "scripts": { + "build:extension": "node scripts/build-extension.mjs", + "build:userscript": "node scripts/build-userscript.mjs", + "lint:extension:chrome": "web-ext lint --self-hosted --source-dir ../chrome/build --ignore-files js/lib/third-party/**", + "lint:extension:firefox": "web-ext lint --self-hosted --source-dir ../firefox/build --ignore-files js/lib/third-party/**" + }, + "dependencies": { + "d3-voronoi": "1.1.4", + "jquery": "3.6.0", + "leaflet": "1.3.1", + "leaflet-canvasicon": "0.1.6", + "leaflet-extra-markers": "1.0.6", + "leaflet.fullscreen": "1.1.0", + "leaflet.markercluster": "1.3.0", + "leaflet-piechart": "git+https://github.com/sashakavun/leaflet-piechart.git#29fcbb6be4c5e303cf3d0b94ea95997549afffa9" + }, + "devDependencies": { + "esbuild": "^0.24.0", + "web-ext": "^9.3.0" + } +} diff --git a/browser-extensions/extension/scripts/build-extension.mjs b/browser-extensions/extension/scripts/build-extension.mjs new file mode 100644 index 00000000..392042e6 --- /dev/null +++ b/browser-extensions/extension/scripts/build-extension.mjs @@ -0,0 +1,229 @@ +#!/usr/bin/env node +/** + * Build Chrome and Firefox extensions from browser-extensions/extension/src. + * Expects EXTENSION_BUILD_VERSION and EXTENSION_BUILD_ID in env (set by caller from build/version.sh). + * Run from repo root so that paths resolve correctly; or from extension package dir (script resolves root). + */ + +import { execSync } from "child_process"; +import fs from "fs"; +import path from "path"; +import { fileURLToPath } from "url"; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +const extensionDir = path.resolve(__dirname, ".."); +const candidateRoot = path.resolve(extensionDir, "../.."); +const root = fs.existsSync(path.join(candidateRoot, "build/version.sh")) + ? candidateRoot + : process.cwd(); + +const EXTENSION_BUILD_VERSION = process.env.EXTENSION_BUILD_VERSION || "2.0.1"; +const EXTENSION_BUILD_ID = process.env.EXTENSION_BUILD_ID || "0"; + +const srcDir = path.join(extensionDir, "src"); +const manifestDir = path.join(srcDir, "manifest"); + +function deepMerge(base, override) { + const result = { ...base }; + for (const key of Object.keys(override)) { + if ( + key in result && + typeof result[key] === "object" && + result[key] !== null && + !Array.isArray(result[key]) && + typeof override[key] === "object" && + override[key] !== null && + !Array.isArray(override[key]) + ) { + result[key] = deepMerge(result[key], override[key]); + } else { + result[key] = override[key]; + } + } + return result; +} + +function run(cmd, opts = {}) { + execSync(cmd, { stdio: "inherit", cwd: root, ...opts }); +} + +function buildBrowser(browser) { + const buildDir = path.join(root, "browser-extensions", browser, "build"); + + console.log(`Building ${browser} extension...`); + + if (fs.existsSync(buildDir)) { + fs.rmSync(buildDir, { recursive: true }); + } + fs.mkdirSync(buildDir, { recursive: true }); + + const nm = path.join(extensionDir, "node_modules"); + + run( + `mkdir -p "${buildDir}/images/badges" "${buildDir}/images/flags" "${buildDir}/css/third-party" "${buildDir}/js/lib/third-party"`, + ); + run(`cp -r images/badges/256x256/*.png "${buildDir}/images/badges/"`); + run(`cp -r images/flags/twemoji/png/*.png "${buildDir}/images/flags/"`); + run(`cp -r images/logo "${buildDir}/images/"`); + + run( + `mkdir -p "${buildDir}/js/lib/third-party/jquery" "${buildDir}/js/lib/third-party/leaflet" "${buildDir}/js/lib/third-party/leaflet-fullscreen" "${buildDir}/js/lib/third-party/leaflet-markercluster" "${buildDir}/js/lib/third-party/leaflet-extramarkers" "${buildDir}/js/lib/third-party/leaflet-canvasicon" "${buildDir}/js/lib/third-party/leaflet-piechart" "${buildDir}/js/lib/third-party/d3-voronoi"`, + ); + run( + `cp "${nm}/jquery/dist/jquery.js" "${buildDir}/js/lib/third-party/jquery/jquery-3.6.0.js"`, + ); + run( + `cp "${nm}/leaflet/dist/leaflet.js" "${buildDir}/js/lib/third-party/leaflet/leaflet-1.3.1.js"`, + ); + run( + `cp "${nm}/leaflet.fullscreen/Control.FullScreen.js" "${buildDir}/js/lib/third-party/leaflet-fullscreen/leaflet-fullscreen-1.1.0.js"`, + ); + run( + `cp "${nm}/leaflet.markercluster/dist/leaflet.markercluster.js" "${buildDir}/js/lib/third-party/leaflet-markercluster/leaflet-markercluster-1.3.0.js"`, + ); + run( + `cp "${nm}/leaflet-extra-markers/dist/js/leaflet.extra-markers.min.js" "${buildDir}/js/lib/third-party/leaflet-extramarkers/leaflet-extramarkers-1.0.6.js"`, + ); + run( + `cp "${nm}/d3-voronoi/dist/d3-voronoi.js" "${buildDir}/js/lib/third-party/d3-voronoi/d3-voronoi.js"`, + ); + run( + `cp "${nm}/leaflet-canvasicon/leaflet-canvasicon.js" "${buildDir}/js/lib/third-party/leaflet-canvasicon/leaflet-canvasicon-0.1.6.js"`, + ); + run( + `cp "${nm}/leaflet-piechart/leaflet-piechart.js" "${buildDir}/js/lib/third-party/leaflet-piechart/leaflet-piechart-0.1.2.js"`, + ); + + run( + `mkdir -p "${buildDir}/css/third-party/leaflet" "${buildDir}/css/third-party/leaflet-fullscreen" "${buildDir}/css/third-party/leaflet-markercluster" "${buildDir}/css/third-party/leaflet-extramarkers"`, + ); + run( + `cp "${nm}/leaflet/dist/leaflet.css" "${buildDir}/css/third-party/leaflet/leaflet.css"`, + ); + run( + `cp -r "${nm}/leaflet/dist/images" "${buildDir}/css/third-party/leaflet/"`, + ); + const extramarkersCssDir = path.join( + nm, + "leaflet-extra-markers", + "dist", + "css", + ); + const extramarkersImgDir = path.join( + nm, + "leaflet-extra-markers", + "dist", + "img", + ); + const extramarkersDest = path.join( + buildDir, + "css", + "third-party", + "leaflet-extramarkers", + ); + run(`mkdir -p "${extramarkersDest}/images"`); + run( + `cp "${extramarkersCssDir}/leaflet.extra-markers.min.css" "${extramarkersDest}/leaflet.extra-markers.css"`, + ); + run(`cp ${extramarkersImgDir}/*.png "${extramarkersDest}/images/"`); + const extramarkersCssPath = path.join( + extramarkersDest, + "leaflet.extra-markers.css", + ); + const cssContent = fs.readFileSync(extramarkersCssPath, "utf8"); + const extensionUrlPrefix = + browser === "chrome" + ? "chrome-extension://__MSG_@@extension_id__" + : "moz-extension://__MSG_@@extension_id__"; + const basePath = `${extensionUrlPrefix}/css/third-party/leaflet-extramarkers/images`; + const rewrittenCss = cssContent.replace( + /url\("\.\.\/img\/([^"]+)"\)/g, + (_, file) => `url("${basePath}/${file}")`, + ); + fs.writeFileSync(extramarkersCssPath, rewrittenCss); + run( + `cp "${nm}/leaflet.fullscreen/Control.FullScreen.css" "${buildDir}/css/third-party/leaflet-fullscreen/Control.FullScreen.css"`, + ); + run( + `cp "${nm}/leaflet.fullscreen/icon-fullscreen.png" "${buildDir}/css/third-party/leaflet-fullscreen/icon-fullscreen.png"`, + ); + run( + `cp "${nm}/leaflet.fullscreen/icon-fullscreen-2x.png" "${buildDir}/css/third-party/leaflet-fullscreen/icon-fullscreen-2x.png"`, + ); + run( + `cp "${nm}/leaflet.markercluster/dist/MarkerCluster.css" "${buildDir}/css/third-party/leaflet-markercluster/"`, + ); + run( + `cp "${nm}/leaflet.markercluster/dist/MarkerCluster.Default.css" "${buildDir}/css/third-party/leaflet-markercluster/"`, + ); + run( + `rsync -av browser-extensions/extension/src/js "${buildDir}" --exclude tests`, + ); + run( + `cp -r browser-extensions/extension/src/html browser-extensions/extension/src/css "${buildDir}/"`, + ); + if (fs.existsSync(path.join(srcDir, "images"))) { + run( + `cp -r browser-extensions/extension/src/images/* "${buildDir}/images/"`, + ); + } + + fs.writeFileSync( + path.join(buildDir, "js/lib/version.js"), + `var extensionVersion = "${EXTENSION_BUILD_VERSION}"\n`, + ); + + const baseManifest = JSON.parse( + fs.readFileSync(path.join(manifestDir, "base.json"), "utf8"), + ); + const overrideManifest = JSON.parse( + fs.readFileSync(path.join(manifestDir, `${browser}.json`), "utf8"), + ); + const manifest = deepMerge(baseManifest, overrideManifest); + let manifestStr = JSON.stringify(manifest, null, 2); + manifestStr = manifestStr + .replace(/REPLACE_EXTENSION_BUILD_VERSION/g, EXTENSION_BUILD_VERSION) + .replace(/REPLACE_EXTENSION_BUILD_ID/g, EXTENSION_BUILD_ID); + fs.writeFileSync(path.join(buildDir, "manifest.json"), manifestStr + "\n"); + + const artifactsDir = path.join(buildDir, "web-ext-artifacts"); + run( + `pnpm exec web-ext build --source-dir "${buildDir}" --artifacts-dir "${artifactsDir}" --ignore-files js/lib/third-party/**`, + ); + if (browser === "firefox") { + try { + // Ignore third-party libraries in lint to avoid noise from their innerHTML usage. + run( + `pnpm exec web-ext lint --self-hosted --source-dir "${buildDir}" --ignore-files js/lib/third-party/**`, + ); + } catch (_) { + // lint can fail (e.g. Bus error on some platforms); build already ran + } + } + + const zips = fs + .readdirSync(artifactsDir) + .filter((f) => f.startsWith("running_challenges-") && f.endsWith(".zip")); + for (const zip of zips) { + if (!zip.includes(`running_challenges-${browser}`)) { + const newName = zip.replace( + "running_challenges-", + `running_challenges-${browser}-`, + ); + fs.renameSync( + path.join(artifactsDir, zip), + path.join(artifactsDir, newName), + ); + } + } + + const finalZips = fs + .readdirSync(artifactsDir) + .filter((f) => f.endsWith(".zip")); + finalZips.forEach((f) => console.log(path.join(artifactsDir, f))); +} + +buildBrowser("chrome"); +buildBrowser("firefox"); +console.log("Extension build complete."); diff --git a/browser-extensions/extension/scripts/build-userscript.mjs b/browser-extensions/extension/scripts/build-userscript.mjs new file mode 100644 index 00000000..08e25474 --- /dev/null +++ b/browser-extensions/extension/scripts/build-userscript.mjs @@ -0,0 +1,202 @@ +#!/usr/bin/env node + +import esbuild from "esbuild"; +import fs from "fs"; +import path from "path"; +import { fileURLToPath } from "url"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const extensionDir = path.resolve(__dirname, ".."); +const rootDir = path.resolve(extensionDir, "..", ".."); +const websiteJsDir = path.join(rootDir, "website", "assets", "js"); +const outfile = path.join(websiteJsDir, "running-challenges.user.js"); + +const leafletCssPath = path.join( + extensionDir, + "node_modules", + "leaflet", + "dist", + "leaflet.css", +); +const extramarkersCssPath = path.join( + extensionDir, + "node_modules", + "leaflet-extra-markers", + "dist", + "css", + "leaflet.extra-markers.min.css", +); +const EXTRAMARKERS_IMG_BASE = + "https://unpkg.com/leaflet-extra-markers@1.0.6/dist/img/"; + +let leafletCssEmbed = '""'; +if (fs.existsSync(leafletCssPath)) { + let combinedCss = + ".leaflet-container { position: relative; }\n" + + fs.readFileSync(leafletCssPath, "utf8"); + if (fs.existsSync(extramarkersCssPath)) { + const extramarkersCss = fs.readFileSync(extramarkersCssPath, "utf8"); + combinedCss += + "\n" + + extramarkersCss.replace(/url\s*\(\s*["']?\.\.\/img\//g, `url("${EXTRAMARKERS_IMG_BASE}`); + } + leafletCssEmbed = JSON.stringify(combinedCss); +} + +// Tampermonkey etc. expect @version in the form x.y.z (three parts) +const USCRIPT_VERSION = (process.env.EXTENSION_BUILD_VERSION || "2.0.1").replace( + /^v/, + "", +); + +const userscriptHeader = `// ==UserScript== +// @name Running Challenges +// @namespace https://running-challenges.co.uk/ +// @version ${USCRIPT_VERSION} +// @description Adds Running Challenges badges to your parkrun results page without installing a browser extension. +// @author Running Challenges +// @match https://www.parkrun.ca/parkrunner/*/all/ +// @match https://www.parkrun.co.at/parkrunner/*/all/ +// @match https://www.parkrun.co.nl/parkrunner/*/all/ +// @match https://www.parkrun.co.nz/parkrunner/*/all/ +// @match https://www.parkrun.co.za/parkrunner/*/all/ +// @match https://www.parkrun.com.au/parkrunner/*/all/ +// @match https://www.parkrun.com.de/parkrunner/*/all/ +// @match https://www.parkrun.dk/parkrunner/*/all/ +// @match https://www.parkrun.fi/parkrunner/*/all/ +// @match https://www.parkrun.fr/parkrunner/*/all/ +// @match https://www.parkrun.ie/parkrunner/*/all/ +// @match https://www.parkrun.it/parkrunner/*/all/ +// @match https://www.parkrun.jp/parkrunner/*/all/ +// @match https://www.parkrun.lt/parkrunner/*/all/ +// @match https://www.parkrun.my/parkrunner/*/all/ +// @match https://www.parkrun.no/parkrunner/*/all/ +// @match https://www.parkrun.org.uk/parkrunner/*/all/ +// @match https://www.parkrun.pl/parkrunner/*/all/ +// @match https://www.parkrun.ru/parkrunner/*/all/ +// @match https://www.parkrun.se/parkrunner/*/all/ +// @match https://www.parkrun.sg/parkrunner/*/all/ +// @match https://www.parkrun.us/parkrunner/*/all/ +// @run-at document-end +// @grant none +// ==/UserScript==`; + +const shim = ` +(function () { + if (typeof document !== "undefined" && document.head) { + var _s = document.createElement("style"); + _s.textContent = ${leafletCssEmbed}; + document.head.appendChild(_s); + } + // Provide a minimal chrome-style API so the extension code can run unchanged. + if (typeof window.chrome === "undefined") { + window.chrome = {}; + } + var chrome = window.chrome; + + if (!chrome.runtime) { + chrome.runtime = { + getURL: function (path) { + var p = path.charAt(0) === "/" ? path.slice(1) : path; + if (!p) return "https://running-challenges.co.uk/"; + var base = "https://running-challenges.co.uk/"; + if (p.indexOf("images/") === 0) { + return base + "img/" + p.slice(7); + } + if (p.indexOf("html/") === 0) { + if (p === "html/help.html" || p === "html/options.html") { + return base + "getstarted/"; + } + return base + p; + } + return base + p; + }, + }; + } + + // Always use our localStorage-backed shim so the script works without the extension. + chrome.storage = chrome.storage || {}; + var prefix = "rc_"; + chrome.storage.local = { + get: function (keysOrDefaults) { + return new Promise(function (resolve) { + var result = {}; + if (Array.isArray(keysOrDefaults)) { + keysOrDefaults.forEach(function (key) { + var raw = localStorage.getItem(prefix + key); + if (raw != null) { + try { + result[key] = JSON.parse(raw); + } catch (_) { + result[key] = raw; + } + } + }); + } else if (keysOrDefaults && typeof keysOrDefaults === "object") { + Object.keys(keysOrDefaults).forEach(function (key) { + var raw = localStorage.getItem(prefix + key); + if (raw != null) { + try { + result[key] = JSON.parse(raw); + } catch (_) { + result[key] = raw; + } + } else { + result[key] = keysOrDefaults[key]; + } + }); + } + resolve(result); + }); + }, + set: function (items) { + return new Promise(function (resolve) { + Object.keys(items).forEach(function (key) { + localStorage.setItem(prefix + key, JSON.stringify(items[key])); + }); + resolve(); + }); + }, + remove: function (keys) { + return new Promise(function (resolve) { + if (!Array.isArray(keys)) keys = [keys]; + keys.forEach(function (key) { + localStorage.removeItem(prefix + key); + }); + resolve(); + }); + }, + }; + + if (typeof window.browserAPI === "undefined") { + window.browserAPI = chrome; + } + if (typeof window.extensionVersion === "undefined") { + window.extensionVersion = "userscript"; + } +})();`; + +async function build() { + await esbuild.build({ + entryPoints: [path.join(extensionDir, "userscript", "entry.js")], + bundle: true, + minify: true, + format: "iife", + target: ["chrome100", "firefox100"], + outfile, + banner: { + js: `${userscriptHeader}\n\n${shim}\n`, + }, + }); + // eslint-disable-next-line no-console + console.log(`Built userscript to ${outfile}`); +} + +build().catch((err) => { + // eslint-disable-next-line no-console + console.error(err); + process.exit(1); +}); + diff --git a/browser-extensions/common/.gitignore b/browser-extensions/extension/src/.gitignore similarity index 64% rename from browser-extensions/common/.gitignore rename to browser-extensions/extension/src/.gitignore index 602dbf03..d7755bb8 100644 --- a/browser-extensions/common/.gitignore +++ b/browser-extensions/extension/src/.gitignore @@ -1,4 +1,4 @@ -# Allow copying built files into common for a faster development feedback +# Allow copying built files into this directory for a faster development feedback # cycle. /css/third-party/ /images/badges/ diff --git a/browser-extensions/common/README.md b/browser-extensions/extension/src/README.md similarity index 85% rename from browser-extensions/common/README.md rename to browser-extensions/extension/src/README.md index ccc56853..9a4568f2 100644 --- a/browser-extensions/common/README.md +++ b/browser-extensions/extension/src/README.md @@ -23,18 +23,21 @@ Laura: https://www.google.com/maps/search/?api=1&query=50.99635012087909,-4.6048 ## Automated Testing -We had added a Mocha test framework to test the Javascript libraries, and the testcases are found in the +We had added a Mocha test framework to test the Javascript libraries, and the testcases are found in the `js/test` directory. We might wish to publish our code coverage metrics like this: https://maximilianschmitt.me/posts/istanbul-code-coverage-badge-github/. -Currently they will just be printed to the Travis output +Currently they will just be printed to the GitHub Actions logs. + +Run the tests in the `js` directory with (from the repository root): -Run the tests in the `js` directory with: ``` -npm test +pnpm --filter running-challenges-tests run test ``` + Or, if you want the coverage report: + +``` +pnpm --filter running-challenges-tests run test-with-coverage ``` -npm run test-with-coverage -`` \ No newline at end of file diff --git a/browser-extensions/common/css/README.md b/browser-extensions/extension/src/css/README.md similarity index 100% rename from browser-extensions/common/css/README.md rename to browser-extensions/extension/src/css/README.md diff --git a/browser-extensions/common/css/styles.css b/browser-extensions/extension/src/css/styles.css similarity index 100% rename from browser-extensions/common/css/styles.css rename to browser-extensions/extension/src/css/styles.css diff --git a/browser-extensions/common/html/help.html b/browser-extensions/extension/src/html/help.html similarity index 100% rename from browser-extensions/common/html/help.html rename to browser-extensions/extension/src/html/help.html diff --git a/browser-extensions/common/html/options.html b/browser-extensions/extension/src/html/options.html similarity index 100% rename from browser-extensions/common/html/options.html rename to browser-extensions/extension/src/html/options.html diff --git a/browser-extensions/common/html/translations.html b/browser-extensions/extension/src/html/translations.html similarity index 84% rename from browser-extensions/common/html/translations.html rename to browser-extensions/extension/src/html/translations.html index 7b2e4fd5..5cbdc8c4 100644 --- a/browser-extensions/common/html/translations.html +++ b/browser-extensions/extension/src/html/translations.html @@ -10,7 +10,7 @@

Translations

We think we have a full set of translations for all of the volunteer roles, - and you can view them all in our GitHub repository. + and you can view them all in our GitHub repository.

diff --git a/browser-extensions/common/images/maps/markers/green-marker.png b/browser-extensions/extension/src/images/maps/markers/green-marker.png similarity index 100% rename from browser-extensions/common/images/maps/markers/green-marker.png rename to browser-extensions/extension/src/images/maps/markers/green-marker.png diff --git a/browser-extensions/common/js/README.md b/browser-extensions/extension/src/js/README.md similarity index 92% rename from browser-extensions/common/js/README.md rename to browser-extensions/extension/src/js/README.md index e16e8ae2..2966a048 100644 --- a/browser-extensions/common/js/README.md +++ b/browser-extensions/extension/src/js/README.md @@ -4,12 +4,11 @@ This project uses [Mocha] for unit testing. -To run the unit tests locally: +To run the unit tests locally (from the repository root): ```sh -cd browser-extensions/common/js/tests -npm install -npm run test-with-coverage +pnpm install +pnpm --filter running-challenges-tests run test-with-coverage ``` ## Automated browser testing @@ -48,6 +47,7 @@ $Env:SELENIUM_PORT="4445" ``` + [Extension Builder]: https://github.com/fraz3alpha/running-challenges/actions/workflows/build-extension.yml [GitHub Actions]: https://github.com/actions [Mocha]: https://mochajs.org diff --git a/browser-extensions/common/js/background.js b/browser-extensions/extension/src/js/background.js similarity index 100% rename from browser-extensions/common/js/background.js rename to browser-extensions/extension/src/js/background.js diff --git a/browser-extensions/common/js/content-scripts/content-script-parkrunner-summary.js b/browser-extensions/extension/src/js/content-scripts/content-script-parkrunner-summary.js similarity index 100% rename from browser-extensions/common/js/content-scripts/content-script-parkrunner-summary.js rename to browser-extensions/extension/src/js/content-scripts/content-script-parkrunner-summary.js diff --git a/browser-extensions/extension/src/js/content-scripts/content-script-parkrunner.js b/browser-extensions/extension/src/js/content-scripts/content-script-parkrunner.js new file mode 100644 index 00000000..8b444206 --- /dev/null +++ b/browser-extensions/extension/src/js/content-scripts/content-script-parkrunner.js @@ -0,0 +1,810 @@ +function get_table(id, caption) { + query_string = "table"; + if (id !== undefined) { + query_string += "[id=" + id + "]"; + } + + return $(query_string).filter(function (index) { + // If no caption is specified, return every result + if (caption === undefined) { + return true; + } + + // Else, get the captions for these tables + table_captions = $("caption", this); + // Skip anything without exactly one caption + if (table_captions.length !== 1) { + return false; + } + // Only include this table if the caption is correct (normalise whitespace for comparison) + const normalisedPageCaption = table_captions[0].innerText + .replace("–", "") + .trim() + .replace(/\s+/g, " "); + const normalisedExpectedCaption = (caption || "").trim().replace(/\s+/g, " "); + return normalisedPageCaption === normalisedExpectedCaption; + }); +} + +function get_badge_location() { + return $("div[id=content]").find("p:first"); +} + +function parse_volunteer_table(result) { + // Find all the results tables in this page + var completed_volunteer_roles = {}; + $("table[id=results]", result).each(function (results_table_index) { + // Try and find the table that also has a

containing + // "Volunteer Summary" + var results_table = $(this); + parent = $(this).parent(); + $("h3#volunteer-summary", parent).each(function (index) { + completed_volunteer_roles = {}; + $("tbody>tr", results_table).each(function (role_index) { + table_cells = $("td", this); + volunteer_role = table_cells[0].innerText.replace(/^\s+|\s+$/g, ""); + volunteer_role_quantity = table_cells[1].innerText; + + // Try and translate from whatever language it is in + normalised_volunteer_role = + get_normalised_volunteer_role(volunteer_role); + + if (!(normalised_volunteer_role in completed_volunteer_roles)) { + completed_volunteer_roles[normalised_volunteer_role] = 0; + } + completed_volunteer_roles[normalised_volunteer_role] += parseInt( + volunteer_role_quantity, + ); + }); + // console.log(completed_volunteer_roles) + }); + }); + return completed_volunteer_roles; +} + +function set_complete_progress_message(errors) { + var messages = [ + 'Additional badges provided by Running Challenges', + ]; + $.each(errors, function (index, error_message) { + messages.push(error_message); + }); + if (errors.length > 0) { + messages.push("Refresh the page to try again"); + } + set_progress_message(messages.join("

")); +} + +function set_progress_message(progress_message) { + console.log("Progress: " + progress_message); + // $("div[id=running_challenges_messages_div]").html($("div[id=running_challenges_messages_div]").html() + "
" + progress_message) + $("div[id=running_challenges_messages_div]").html(progress_message); +} + +function parsePageAthleteInfo() { + // Parse out the information from the page relating to this parkrunner, including: + // The name, as shown + + // The HTML relating to the top of the page looks like this: + //
+ //
+ //
+ // + // + // + // CONTRA December 2019 + // + // + //

Andrew TAYLOR - 202 runs at All Events
202 parkruns total + //

+ + // It can look different in different languages, e.g. + // https://www.parkrun.ru/parkrunner/5481082/all/ + //

Максим МАХНО - 14 пробежек на All Events
14 забеги parkrun total

+ // https://www.parkrun.jp/parkrunner/6460713/all/ + //

和輝 遠藤 - 10 参加 All Events
10 parkrun total

+ + // In each case, however, it is the first

block, and everything before the dash is what we want. + // Find the first h2 tag in the appropriate div, and we can parse the name out of that. + var mainAthleteTag = $( + "div[id=main]>div[id=primary]>div[id=content]>h2", + ).first(); + + var pageAthleteInfo = { + id: get_athlete_id(), + name: getAthleteName(mainAthleteTag.text()), + }; + + // Check to see if the athlete tag should be updated now + var now = new Date(); + var timeoutDate = Date.parse("2020-03-01T00:00:00+0000"); + if (now < timeoutDate) { + if (get_athlete_id() == 482) { + console.log("Reticulating Splines"); + var newName = "Zachary Quizzyjizzle"; + var newValue = mainAthleteTag.html().replace(/(.*?) -/, newName + " -"); + mainAthleteTag.html(newValue); + pageAthleteInfo.name = newName; + } + } + + return pageAthleteInfo; +} + +function getAthleteName(athleteSummaryText) { + // e.g. + // Andrew TAYLOR - 202 runs at All Events202 parkruns total + // - 0 runs at All Events... + // Максим МАХНО - 14 пробежек на All Events14 забеги parkrun total + // - 0 пробежек на All Events... + + var athleteName = undefined; + + if (athleteSummaryText !== undefined) { + var parts = athleteSummaryText.split(" - "); + if (parts[0] != "") { + athleteName = parts[0]; + } + } + + return athleteName; +} + +function parse_results_table() { + parkruns_completed = []; + + get_table("results", get_localised_value("table_all_results")).each( + function (results_table) { + // Gather the data for this table + + // Find all the table body rows + completed_parkrun_events = $("tbody>tr", this); + + completed_parkrun_events.each(function (index) { + // Only parse table rows with at least one cell, and look at the first one + table_cells = $("td", this); + if (table_cells.length > 0) { + // Find the name and other interesting bits of data for this parkrun + + parkrun_name = table_cells[0].innerText.trim(); + parkrun_eventlink = table_cells[0].innerHTML.trim(); + parkrun_date = table_cells[1].innerText.trim(); + parkrun_datelink = table_cells[1].innerHTML.trim(); + parkrun_event_number = table_cells[2].innerText.trim(); + parkrun_position = table_cells[3].innerText.trim(); + parkrun_time = table_cells[4].innerText.trim(); + parkrun_pb = table_cells[6].innerText.trim(); + + // Create a date object, useful for comparing + parkrun_date_obj = new Date(); + date_parts = parkrun_date.split("/"); + if (date_parts.length == 3) { + parkrun_date_obj = new Date( + date_parts[2] + + "-" + + date_parts[1] + + "-" + + date_parts[0] + + "T00:00:00Z", + ); + } + + // Store this parkrun instance in our big data structure + parkrun_stats = { + name: parkrun_name, + eventlink: parkrun_eventlink, + date: parkrun_date, + datelink: parkrun_datelink, + date_obj: parkrun_date_obj, + event_number: parkrun_event_number, + position: parkrun_position, + time: parkrun_time, + pb: parkrun_pb.length > 0, + }; + parkruns_completed.push(parkrun_stats); + } + }); + }, + ); + + // Return the results in chronological order, which is the natural + // way to process it, as the older parkruns will be hit first when iterating + // over the list + + // The returned array should be ordered by date, oldest first, rather than assuming the order. We've had several reports of this + // causing issues, but at the time it appeared not to be consistent and some profiles were in one order, and others in the reverse. + var parkruns_completed_sorted = parkruns_completed.sort(function (a, b) { + return a.date_obj - b.date_obj; + }); + + if (parkruns_completed_sorted.length > 0) { + console.log( + "Sorted parkruns, first: " + + parkruns_completed_sorted[0].date + + " last: " + + parkruns_completed_sorted[parkruns_completed_sorted.length - 1].date, + ); + } + + return parkruns_completed_sorted; +} + +function create_skeleton_elements(id_map) { + top_of_the_page_anchor = $("div[id=content]").find("p:first"); + + // The top sections are badges, flags, and messages. + // Initially the badges and flags are empty until the data is parsed and loaded, + // and the messsages displayed will indicate progress. + + // Spacer to separate the existing shirt icons from our badges + var running_challenges_top_spacer = $("
"); + top_of_the_page_anchor.after(running_challenges_top_spacer); + + // Create badges element + var running_challenges_badges_div_container = $("

"); + var running_challenges_badges_div = $("

").attr("id", id_map["badges"]); + running_challenges_badges_div_container.append(running_challenges_badges_div); + running_challenges_top_spacer.after(running_challenges_badges_div_container); + + // Create flags element + var running_challenges_flags_div = $("
").attr("id", id_map["flags"]); + running_challenges_badges_div_container.after(running_challenges_flags_div); + + var running_challenges_message_spacer = $("
"); + running_challenges_flags_div.after(running_challenges_message_spacer); + + // Add a message div, with some initial contents + var running_challenges_messages_div = $("
").attr( + "id", + id_map["messages"], + ); + running_challenges_message_spacer.after(running_challenges_messages_div); + // Use the progress message function to se interval + set_progress_message( + 'Loading Running Challenges Badges', + ); + + // Create main table element + var running_challenges_main_table_div = $("
").attr( + "id", + id_map["main"], + ); + get_table("results", get_localised_value("table_all_results")).before( + running_challenges_main_table_div, + ); + + // Create stats element + var running_challenges_stats_div = $("
").attr("id", id_map["stats"]); + running_challenges_main_table_div.before(running_challenges_stats_div); + + // Add a spacer between the stats and the main table + running_challenges_main_table_div.before($("
")); + + // Add a spacer after the main table + running_challenges_main_table_div.after($("
")); +} + +function add_stats(div_id, data) { + set_progress_message("Adding stats"); + var stats_div = $("div[id=" + div_id + "]"); + add_stats_table(stats_div, data); + set_progress_message("Added stats"); +} + +function add_badges(div_id, data) { + set_progress_message("Adding badges"); + // Find out which challenges we have been provided, and determine if they are + // complete, and if so, award the badge + var badges = []; + if (data.challenge_results) { + // Running badges + if (data.challenge_results.running_results) { + data.challenge_results.running_results.forEach(function (result) { + var badge = get_running_badge(result); + if (badge) { + if (Array.isArray(badge)) { + $.each(badge, function (index, badgeInstance) { + badges.push(badgeInstance); + }); + } else { + badges.push(badge); + } + } + }); + } + // Volunteer badges + if (data.challenge_results.volunteer_results) { + data.challenge_results.volunteer_results.forEach(function (result) { + var badge = get_volunteer_badge(result); + if (badge) { + badges.push(badge); + } + }); + } + } + + // Now insert all the badges into the page + badge_div = $("div[id=" + div_id + "]"); + + var index_counter = 1; + badges.forEach(function (badge) { + var badge_awarded_div = $(""); + badge_awarded_div.attr("id", "badge-awarded-" + badge.shortname); + var badge_link = $(""); + badge_link.attr("href", badge.link); + + var img = $(""); + img.attr("src", badge.icon); + img.attr("alt", badge.name); + img.attr("title", badge.name); + img.attr("width", 64); + img.attr("height", 64); + + modifyStyle(img); + + badge_awarded_div.append(badge_link); + badge_link.append(img); + badge_div.append(badge_awarded_div); + + if (index_counter > 0 && index_counter % 8 == 0) { + badge_div.append($("
")); + } + index_counter += 1; + }); + + // All done! + set_progress_message("Added badges"); +} + +// Format the badge information specific to the running challenge data +function get_running_badge(result) { + var badge_info = undefined; + // console.log(result) + + // If this challenge uses the badgesAwarded mechanism, then see if there are + // any + if (result.badgesAwarded !== undefined) { + if (result.badgesAwarded.length > 0) { + badge_info = []; + $.each(result.badgesAwarded, function (index, badge) { + badge_info.push({ + name: badge.name, + icon: browserAPI.runtime.getURL( + "/images/badges/" + badge.badge_icon + ".png", + ), + // The link just goes to the top of the main table for the challenge, not the specific row. + link: "#" + result.shortname, + shortname: badge.badge_icon, + }); + }); + } + } else { + if (result.complete == true) { + badge_info = { + name: result.name, + icon: browserAPI.runtime.getURL( + "/images/badges/" + result.badge_icon + ".png", + ), + link: "#" + result.shortname, + shortname: result.badge_icon, + }; + } else if (result.partial_completion == true) { + badge_info = { + name: result.partial_completion_name, + icon: browserAPI.runtime.getURL( + "/images/badges/" + result.partial_completion_badge_icon + ".png", + ), + link: "#" + result.shortname, + shortname: result.partial_completion_badge_icon, + }; + } + } + return badge_info; +} + +// Format the badge information specific to the volunteer challenge data - +// in particular, we award the stars based on how many times each has been done +function get_volunteer_badge(result) { + var badge_info = undefined; + // console.log(result) + if (result.complete == true) { + badge_info = { + name: result.name, + icon: browserAPI.runtime.getURL( + "/images/badges/" + result.badge_icon + ".png", + ), + link: "#" + result.shortname, + shortname: result.badge_icon, + }; + if (result.subparts_completed_count >= 25) { + badge_info.icon = browserAPI.runtime.getURL( + "/images/badges/" + result.badge_icon + "-3-stars.png", + ); + badge_info.name += " (25+ times)"; + } else if (result.subparts_completed_count >= 10) { + badge_info.icon = browserAPI.runtime.getURL( + "/images/badges/" + result.badge_icon + "-2-stars.png", + ); + badge_info.name += " (10+ times)"; + } else if (result.subparts_completed_count >= 5) { + badge_info.icon = browserAPI.runtime.getURL( + "/images/badges/" + result.badge_icon + "-1-star.png", + ); + badge_info.name += " (5+ times)"; + } + } + return badge_info; +} + +function add_flags(div_id, data) { + set_progress_message("Adding flags"); + // console.log(data) + + if (data.parkrun_results && data.geo_data) { + countryCompletionInfo = calculateCountryCompletionInfo(data); + console.log(countryCompletionInfo); + + // Generate a list of visited countries + countriesVisited = []; + $.each(countryCompletionInfo, function (countryName, countryInfo) { + if (countryInfo.visited) { + countriesVisited.push(countryInfo); + } + }); + console.log(countriesVisited); + + // global_tourism_info = generate_global_tourism_data(data.parkrun_results, data.geo_data) + // console.log(global_tourism_info) + + flags_div = $("div[id=" + div_id + "]"); + + var index_counter = 1; + countriesVisited + .sort(function (o1, o2) { + // Equal + if (o1.firstRanOn === o2.firstRanOn) { + return 0; + } + // If either are null they should go to the back, although this shouldn't be the case + // as we have already pruned out those we haven't visited + if (o1.firstRanOn === null) { + return 1; + } + if (o2.firstRanOn === null) { + return -1; + } + return o1.firstRanOn - o2.firstRanOn; + }) + .forEach(function (country) { + if (country.visited) { + // Find out when it was first run and make a nice string + var first_run = country.firstRanOn.toISOString().split("T")[0]; + + var explorer_link = $("").attr("href", "#explorer"); + + var img = $(""); + img.attr("src", get_flag_image_src(country.name)); + img.attr("alt", country.name); + img.attr("title", country.name + ": " + first_run); + img.attr("width", 48); + img.attr("height", 48); + // We need some padding so that the flags don't run into each other. + // This used to be 6px left and right, but that was not only huge, but squashed the flags + // for some reason, perhaps there was inherited top and bottom padding that disappeared + // at some point. So now lets make it 2px all round + img.attr( + "style", + "padding-left:2px; padding-right:2px; padding-bottom:2px; padding-top:2px", + ); + + explorer_link.append(img); + flags_div.append(explorer_link); + + if (index_counter > 0 && index_counter % 8 == 0) { + flags_div.append($("
")); + } + index_counter += 1; + } + }); + } + + set_progress_message("Added flags"); +} + +function deriveHomeParkrunInfoFromResults(data) { + if ( + !data.parkrun_results || + data.parkrun_results.length === 0 || + !data.geo_data || + !data.geo_data.data || + !data.geo_data.data.events + ) { + return undefined; + } + + const eventCounts = {}; + data.parkrun_results.forEach((result) => { + const eventName = result.name; + if (!eventName) { + return; + } + + if (eventCounts[eventName] === undefined) { + eventCounts[eventName] = 0; + } + eventCounts[eventName] += 1; + }); + + let mostFrequentEventName; + let mostFrequentCount = 0; + Object.keys(eventCounts).forEach((eventName) => { + const count = eventCounts[eventName]; + if (count > mostFrequentCount) { + mostFrequentCount = count; + mostFrequentEventName = eventName; + } else if (count === mostFrequentCount) { + // Tie-breaker: pick the event most recently visited. + const names = data.parkrun_results.map((r) => r.name); + const lastIndexCurrent = names.lastIndexOf(mostFrequentEventName); + const lastIndexCandidate = names.lastIndexOf(eventName); + if (lastIndexCandidate > lastIndexCurrent) { + mostFrequentEventName = eventName; + } + } + }); + + if (!mostFrequentEventName) { + return undefined; + } + + const eventInfo = data.geo_data.data.events[mostFrequentEventName]; + if (!eventInfo) { + return undefined; + } + + return { + ...eventInfo, + name: mostFrequentEventName, + }; +} + +function updateSummaryInfo(data, athleteId) { + // Derive athlete id if it has not been explicitly set in the options. + const storedAthleteNumber = data.user_data.athlete_number; + const hasStoredAthleteNumber = + storedAthleteNumber !== undefined && storedAthleteNumber !== ""; + + const effectiveAthleteNumber = hasStoredAthleteNumber + ? storedAthleteNumber + : athleteId; + + if (!hasStoredAthleteNumber && athleteId) { + data.user_data.athlete_number = athleteId; + } + + // Derive home parkrun (most frequently visited event) if it has not been + // explicitly set in the options. + const hasStoredHomeParkrun = + data.user_data.home_parkrun_info !== undefined && + data.user_data.home_parkrun_info.name !== undefined; + + if (!hasStoredHomeParkrun) { + const derivedHome = deriveHomeParkrunInfoFromResults(data); + if (derivedHome) { + data.user_data.home_parkrun_info = derivedHome; + } + } + + data.info.has_athlete_id = !!effectiveAthleteNumber; + data.info.has_home_parkrun = + data.user_data.home_parkrun_info !== undefined && + data.user_data.home_parkrun_info.name !== undefined; + + // Treat the page as "our page" when the visible athlete id matches the + // effective athlete id (explicit option when set, otherwise the page id). + data.info.is_our_page = + !!athleteId && effectiveAthleteNumber !== undefined + ? athleteId == effectiveAthleteNumber + : false; + + // Convenience properties for the main sources of data + // data.info.has_geo_data = (data.geo_data !== undefined) + data.info.has_parkrun_results = data.parkrun_results !== undefined; +} + +function add_challenge_results(div_id, data) { + set_progress_message("Adding challenge results"); + // console.log(data) + results_div = $("div[id=" + div_id + "]"); + results_table = generate_challenge_table(); + results_div.append(results_table); + // Add the results if we have them + if (data.info.has_challenge_results) { + // Add the explorer table on its own, before the challenges, always + generateExplorerTableEntry(results_table, data); + + if (data.info.has_challenge_running_results) { + add_challenges_to_table(results_table, "running_results", data); + } + + if (data.info.has_challenge_volunteer_results) { + add_table_break_row( + results_table, + "Volunteer Challenges", + "Get a purple badge when you've done a role once, get a star for doing the role 5+ times, two stars for 10+ times, three stars for 25+ times.", + "running_challenges_volunteer_challenges_heading", + ); + add_challenges_to_table(results_table, "volunteer_results", data); + } + } + set_progress_message("Added challenge results"); +} + +function create_page() { + const id_map = create_skeleton(); + + let loaded_user_data = {}; + let loaded_geo_data; + let parsed_volunteer_data; + let parsed_results_data; + + parse_athlete_info(); + + parsed_results_data = parse_results(); + if (!parsed_results_data || parsed_results_data.length === 0) { + set_progress_message( + "No results detected, no challenge data will be compiled", + ); + return; + } + + load_data() + .then((data) => { + loaded_user_data = data.loaded_user_data; + loaded_geo_data = data.loaded_geo_data; + return load_volunteer_data(); + }) + .then((volunteer_data) => { + parsed_volunteer_data = volunteer_data; + process_data_and_update_ui( + id_map, + parsed_results_data, + parsed_volunteer_data, + loaded_geo_data, + loaded_user_data, + ); + }) + .catch(handle_error); +} + +function create_skeleton() { + const id_map = { + messages: "running_challenges_messages_div", + badges: "running_challenges_badges_div", + flags: "running_challenges_flags_div", + main: "running_challenges_main_div", + stats: "running_challenges_stats_div", + }; + create_skeleton_elements(id_map); + return id_map; +} + +function parse_athlete_info() { + set_progress_message("Parsing Athlete Info"); + parsePageAthleteInfo(); + set_progress_message("Parsed Athlete Info"); +} + +function parse_results() { + set_progress_message("Parsing Results"); + const parsed_results_data = parse_results_table(); + set_progress_message("Parsed Results"); + return parsed_results_data; +} + +function load_volunteer_data() { + return fetch_volunteer_data(get_athlete_id()).then((results) => { + set_progress_message("Loaded volunteer data"); + return parse_volunteer_table(results); + }); +} + +function process_data_and_update_ui( + id_map, + parsed_results_data, + parsed_volunteer_data, + loaded_geo_data, + loaded_user_data, +) { + set_progress_message("All done"); + + const data = { + parkrun_results: parsed_results_data, + volunteer_data: parsed_volunteer_data, + geo_data: loaded_geo_data, + user_data: loaded_user_data, + info: {}, + }; + + set_progress_message(JSON.stringify(data)); + updateSummaryInfo(data, get_athlete_id()); + + data.challenge_results = { + running_results: generate_running_challenge_data( + data, + parsePageAthleteInfo(), + ), + volunteer_results: generate_volunteer_challenge_data(data), + }; + + data.info.has_challenge_results = !!data.challenge_results; + data.info.has_challenge_running_results = + !!data.challenge_results.running_results; + data.info.has_challenge_volunteer_results = + !!data.challenge_results.volunteer_results; + data.info.has_volunteer_data = !!data.volunteer_data; + + data.stats = generate_stats(data); + data.info.has_stats = !!data.stats; + + add_badges(id_map["badges"], data); + add_flags(id_map["flags"], data); + add_challenge_results(id_map["main"], data); + add_stats(id_map["stats"], data); + + const errors = []; + if (!has_geo_data(data)) { + errors.push( + "! Unable to fetch parkrun event location data: Stats, Challenges, and Maps requiring locations are not available !", + ); + } + + set_complete_progress_message(errors); +} + +function handle_error(error) { + console.error(`An error occurred: ${error}`); + set_progress_message(`Error: ${error}. Stack: ${error.stack}.`); +} + +function fetch_volunteer_data(athleteId) { + const VOLUNTEER_DATA_URL = `https://${location.host}/parkrunner/${athleteId}/`; + const CACHE_KEY = `volunteer_data_${athleteId}`; + return fetch_with_cache(VOLUNTEER_DATA_URL, CACHE_KEY, "text"); +} + +function get_athlete_id() { + const pathname = window.location.pathname; + const searchParams = new URLSearchParams(window.location.search); + + let athlete_id; + + if (pathname.startsWith("/parkrunner")) { + const match = pathname.match(/parkrunner\/(\d+)/); + if (match) { + athlete_id = match[1]; + } + } else if (searchParams.has("athleteNumber")) { + athlete_id = searchParams.get("athleteNumber"); + } + + console.log(`Athlete ID: ${athlete_id}`); + return athlete_id; +} + +function modifyStyle(img) { + // Shush, don't tell anyone and spoil the surprise + today = new Date(); + // getMonth is zero indexed. getDate is 1 indexed. + if (today.getMonth() == 3 && today.getDate() == 1) { + r = Math.floor(Math.random() * 4); + if (r > 0) { + img.attr("style", "transform:rotate(" + r * 90 + "deg);"); + } + } +} + +// Run our code and render the page +create_page(); diff --git a/browser-extensions/common/js/lib/cache.js b/browser-extensions/extension/src/js/lib/cache.js similarity index 98% rename from browser-extensions/common/js/lib/cache.js rename to browser-extensions/extension/src/js/lib/cache.js index 642c6f05..d175183f 100644 --- a/browser-extensions/common/js/lib/cache.js +++ b/browser-extensions/extension/src/js/lib/cache.js @@ -273,3 +273,8 @@ function update_cache_data(data_events) { return data } + +if (typeof window !== "undefined") { + window.load_data = load_data; + window.fetch_with_cache = fetch_with_cache; +} diff --git a/browser-extensions/common/js/lib/challenges.js b/browser-extensions/extension/src/js/lib/challenges.js similarity index 99% rename from browser-extensions/common/js/lib/challenges.js rename to browser-extensions/extension/src/js/lib/challenges.js index 69201577..3c1ecc44 100644 --- a/browser-extensions/common/js/lib/challenges.js +++ b/browser-extensions/extension/src/js/lib/challenges.js @@ -2810,3 +2810,12 @@ function calculateCountryCompletionInfo(data) { return countryCompletionInfo } + +if (typeof window !== "undefined") { + window.generate_running_challenge_data = generate_running_challenge_data; + window.generate_volunteer_challenge_data = generate_volunteer_challenge_data; + window.generate_stats = generate_stats; + window.calculateCountryCompletionInfo = calculateCountryCompletionInfo; + window.has_geo_data = has_geo_data; + window.get_flag_image_src = get_flag_image_src; +} diff --git a/browser-extensions/extension/src/js/lib/challenges_ui.js b/browser-extensions/extension/src/js/lib/challenges_ui.js new file mode 100644 index 00000000..2a4c830c --- /dev/null +++ b/browser-extensions/extension/src/js/lib/challenges_ui.js @@ -0,0 +1,1615 @@ +/* + * data object is of the form: + * [ + * alphabeteer: { + * "title_text": "Alphabeteer Challenge", + * "complete": false, + * "subparts": [ + * 'a', + * 'b', + * 'c' + * ], + * "subparts_completed": { + * "a": { + * "name": + * "position": + * ... + * }, + * ] + * If there are any recommendations about what to do for these parts, then + * they can be added to this object + * "subparts_remaining_recommendations": { + * "c": {'Congleton'} + * } + * }, + * ] + */ + +function get_extension_url(path) { + if ( + typeof browser !== "undefined" && + browser.runtime && + browser.runtime.getURL + ) { + return browser.runtime.getURL(path); + } + if ( + typeof chrome !== "undefined" && + chrome.runtime && + chrome.runtime.getURL + ) { + return chrome.runtime.getURL(path); + } + return path; +} + +function apply_fullscreen_icon_styles() { + try { + var control = document.querySelector(".leaflet-control-zoom-fullscreen"); + if (!control) return; + var iconPath = + window.devicePixelRatio && window.devicePixelRatio > 1 + ? "css/third-party/leaflet-fullscreen/icon-fullscreen-2x.png" + : "css/third-party/leaflet-fullscreen/icon-fullscreen.png"; + var url = get_extension_url(iconPath); + control.style.backgroundImage = 'url("' + url + '")'; + control.style.backgroundSize = "26px 26px"; + control.style.backgroundRepeat = "no-repeat"; + control.style.backgroundPosition = "0 0"; + } catch (e) { + // Intentionally ignore styling errors; map still works without icon. + } +} + +function generate_challenge_table() { + // console.log('Generating Challenge Table') + var table = $("
"); + // Set the ID so that we can easily find it again + // table.attr("id", "challenge-table") + // Use the 'results' id so that we pick up the standard styling + table.attr("id", "results"); + // Optionally add a class with .addClass(this.tableClass) + table.append($("

").attr("colspan", 6).append(" ")); + tbody.append(gap_row); + var main_row = $("
") + .attr("colspan", 6) + .append("" + title + " " + tooltip), + ); + tbody.append(main_row); + table.append(tbody); +} + +function add_challenges_to_table(table, challenge_results_type, data) { + // console.log(data) + var ui_challenge_generation_duration = 0; + + data.challenge_results[challenge_results_type].forEach(function (challenge) { + // console.log("Generating table rows for " + challenge.shortname) + const start_time = new Date(); + generate_standard_table_entry(challenge, table, data); + const duration = new Date() - start_time; + ui_challenge_generation_duration += duration; + // console.log("Completed generating table rows for " + challenge.shortname + " in " + duration + "ms") + }); + + // console.log("Completed generating challenge table rows in " + ui_challenge_generation_duration + "ms") + + return table; +} + +function get_tbody_header(challenge) { + return $("
No parkrun event location information, unable to generate explorer results
").append(get_explorer_flag("World", true))); + row.append($("").append($("").text("World"))); + row.append($("")); + row.append($("").text(worldCompletionFractionString)); + table.append(row); + + const alphabeticallySortedCountries = Object.keys( + countryCompletionInfo, + ).sort(); + console.log(alphabeticallySortedCountries); + + $.each(alphabeticallySortedCountries, function (idx, countryName) { + const countryInfo = countryCompletionInfo[countryName]; + // Only show those countries with open events (we have to assume they're active) + if (countryInfo.childEventsCount > 0) { + // Determine how complete this country is... + console.log(`${countryInfo.childEventsCount} events for ${countryName}`); + var countryCompletionPercentage = + countryInfo.childEventsCompletedCount / countryInfo.childEventsCount; + var countryCompletionFractionString = + countryInfo.childEventsCompletedCount + + "/" + + countryInfo.childEventsCount; + + var row = $("
") + .append( + get_explorer_flag(countryName, countryCompletionPercentage > 0), + ) + .append($("").attr("name", countryName)), + ); + row.append($("").append($("").text(countryName))); + row.append($("")); + row.append($("").text(countryCompletionFractionString)); + table.append(row); + } + }); +} + +function generate_standard_table_entry(challenge, table, data) { + var challenge_tbody_header = get_tbody_header(challenge); + var challenge_tbody_detail = get_tbody_content(challenge, data.user_data); + + // Create the header row and add it to the tbody that exists to hold + // the title row + var main_row = get_challenge_header_row(challenge, data); + challenge_tbody_header.append(main_row); + + // Create a row to hold a map; div has no height until the map is displayed + if (challenge.has_map === true) { + console.log("Creating map for " + challenge.shortname); + var map_row = $("
"); + // Use the 'results' id so that we pick up the standard styling, yuk + table.attr("id", "results"); + // Optionally add a class with .addClass(this.tableClass) + table.append($("").html(""); + table.append(header_row); + + $.each(data.stats, function (stat_shortname, stat_info) { + var row = $(""); + var display_name = stat_info.display_name; + var stat_value = stat_info.value; + if (stat_info.help) { + display_name = + '' + + display_name + + ""; + stat_value = + '' + + stat_value + + ""; + } + row.append($(" or other required elements. - thead: [ 1, "
").text("Additional Athlete Stats")); + // Add header row + var header_row = $("
StatValue
").html(display_name)); + if (stat_info.url !== undefined) { + row.append( + $("").append( + $("", { + href: stat_info.url, + text: stat_info.value, + target: "_blank", + title: stat_info.help, + rel: "noopener noreferrer", + }), + ), + ); + } else { + row.append($("").html(stat_value)); + } + table.append(row); + }); + + div.append(table); + } + + div.append("
Hover over the stats for a more detailed description"); +} + +function isChallengeHidden(challengeShortname, userData) { + var isHidden = false; + console.log("userData: " + JSON.stringify(userData)); + if (userData !== undefined) { + if ( + userData["challengeMetadata"] !== undefined && + challengeShortname in userData["challengeMetadata"] + ) { + if ("hidden" in userData.challengeMetadata[challengeShortname]) { + isHidden = userData.challengeMetadata[challengeShortname].hidden; + console.log( + "isChallengeHidden found existing saved state: " + isHidden, + ); + } + } + } + return isHidden; +} + +function saveHiddenPreference(challengeName, isHidden) { + console.log("Challenge: " + challengeName + ", Is Hidden: " + isHidden); + + browserAPI.storage.local + .get({ + challengeMetadata: {}, + }) + .then((items) => { + // Items contains the whole object, of which the key we asked for is a sub-item + console.log(items); + + // If the challenge already exists in the object, then set the hidden property + if (challengeName in items.challengeMetadata) { + items.challengeMetadata[challengeName]["hidden"] = isHidden; + // Else, add a metadata object for this challenge and initialise it + } else { + var challengeMetadata = { + hidden: isHidden, + }; + items.challengeMetadata[challengeName] = challengeMetadata; + } + console.log(items.challengeMetadata); + + // Save the information back into the local storage + browserAPI.storage.local.set(items); + }); +} + +function toggleVisibilityOfChallenge(challengeShortname) { + var challengeBodyId = "challenge_tbody_content_" + challengeShortname; + // console.log(challengeBodyId) + var challengeBodyElement = $("tbody[id=" + challengeBodyId + "]"); + // console.log(challengeBodyElement) + var isCurrentlyHidden = challengeBodyElement.is(":hidden"); + // console.log("isCurrentlyHidden: "+isCurrentlyHidden) + // Save the preference to retain the fact it is hidden next time + saveHiddenPreference(challengeShortname, !isCurrentlyHidden); + // Toggle the visibility of the challenge now + challengeBodyElement.toggle(); +} + +if (typeof window !== "undefined") { + window.generate_challenge_table = generate_challenge_table; + window.generateExplorerTableEntry = generateExplorerTableEntry; + window.add_challenges_to_table = add_challenges_to_table; + window.add_table_break_row = add_table_break_row; + window.generate_standard_table_entry = generate_standard_table_entry; + window.add_stats_table = add_stats_table; +} diff --git a/browser-extensions/common/js/lib/i18n.js b/browser-extensions/extension/src/js/lib/i18n.js similarity index 99% rename from browser-extensions/common/js/lib/i18n.js rename to browser-extensions/extension/src/js/lib/i18n.js index 677be2d9..0c3196b8 100644 --- a/browser-extensions/common/js/lib/i18n.js +++ b/browser-extensions/extension/src/js/lib/i18n.js @@ -658,3 +658,9 @@ function get_normalised_volunteer_role(role) { } return mapped_role } + +if (typeof window !== "undefined") { + window.get_localised_value = get_localised_value; + window.get_localised_default_value = get_localised_default_value; + window.get_normalised_volunteer_role = get_normalised_volunteer_role; +} diff --git a/browser-extensions/common/js/options.js b/browser-extensions/extension/src/js/options.js similarity index 100% rename from browser-extensions/common/js/options.js rename to browser-extensions/extension/src/js/options.js diff --git a/browser-extensions/common/js/tests/.gitignore b/browser-extensions/extension/src/js/tests/.gitignore similarity index 100% rename from browser-extensions/common/js/tests/.gitignore rename to browser-extensions/extension/src/js/tests/.gitignore diff --git a/browser-extensions/common/js/tests/package.json b/browser-extensions/extension/src/js/tests/package.json similarity index 83% rename from browser-extensions/common/js/tests/package.json rename to browser-extensions/extension/src/js/tests/package.json index bc68f7ea..6776bde0 100644 --- a/browser-extensions/common/js/tests/package.json +++ b/browser-extensions/extension/src/js/tests/package.json @@ -1,5 +1,5 @@ { - "name": "tests", + "name": "running-challenges-tests", "version": "1.0.0", "description": "", "main": "dummy-app.js", @@ -10,6 +10,9 @@ }, "author": "", "license": "MIT", + "dependencies": { + "jquery": "3.6.0" + }, "devDependencies": { "jsdom": "18.x.x", "mocha": "9.x.x", diff --git a/browser-extensions/extension/src/js/tests/test/test_challenges.js b/browser-extensions/extension/src/js/tests/test/test_challenges.js new file mode 100644 index 00000000..7dccfaa7 --- /dev/null +++ b/browser-extensions/extension/src/js/tests/test/test_challenges.js @@ -0,0 +1,949 @@ +// If we just imported the challenges library, it would be assumed to be a normal nodejs library, +// and have some functions exposed via exports. ... , however, we don't have any of this. +// If we did want to add it, we'd have to do something along the lines of: +// +// https://stackoverflow.com/questions/10204021/how-do-i-test-normal-non-node-specific-javascript-functions-with-mocha +// Export this as a library we're running under Node, +// if (typeof exports !== 'undefined') { +// exports.generate_stat_events_run = generate_stat_events_run; +// ... +// } +// +// ... for every function. +// +// However, there is a library called rewire that you could use to expose additional internal Javascript +// functions so that they can be tested, as described in : +// https://stackoverflow.com/questions/22097603/unit-testing-of-private-functions-with-mocha-and-node-js +// We can additionally use this to test all functions - and skip the hoop-jumping of exporting a function +// just for this testing framework. +// +// For this to work, we need to find each function we want to test, but that is just a one-liner in each +// section + +// Try and get jquery imported, as per https://gist.github.com/robballou/9ee108758dc5e0e2d028 +const { JSDOM } = require("jsdom"); +const jsdom = new JSDOM(""); + +const { window } = jsdom; +const { document } = window; +global.window = window; +global.document = document; + +const $ = (global.jQuery = require("jquery")); +// It needs to be set globally, as per this solution: https://stackoverflow.com/a/57292683 +global.$ = $; + +var rewire = require("rewire"); +var challenges = rewire("../../lib/challenges.js"); +// NOTE: contentScript is only used in the disabled "home parkrun inference" +// tests at the bottom of this file. Those tests are currently skipped because +// the content script depends on a full browser/localisation environment. +// var contentScript = rewire( +// "../../content-scripts/content-script-parkrunner.js", +// ); + +var assert = require("assert"); + +// challenges.generate_stat_events_run() + +// Functions to add events + +function getGeoData() { + const data = { + events: { + "Bushy Park": { + shortname: "bushy", + name: "Bushy Park", + country_id: 97, + country_name: "UK", + id: 1, + lat: 51.410992, + lon: -0.335791, + }, + Winchester: { + shortname: "winchester", + name: "Winchester", + country_id: 97, + country_name: "UK", + id: 280, + lat: 51.069286, + lon: -1.310849, + }, + "Fell Foot": { + shortname: "fellfoot", + name: "Fell Foot", + country_id: 97, + country_name: "UK", + id: 1017, + lat: 54.274736, + lon: -2.952259, + }, + }, + countries: { + UK: { + id: "97", + name: "UK", + lat: 54.672276, + lon: -2.9478825, + bounds: [-7.643103, 49.186471, 1.747338, 60.158081], + url: "www.parkrun.org.uk", + child_event_ids: [1, 280, 1017], + child_event_names: ["Bushy Park", "Winchester", "Fell Foot"], + }, + }, + event_status: {}, + }; + + return { + data: data, + }; +} + +function filterGeoData(geoData, filters) { + // Possible Filters are: + // "countries": [] (list of countries to leave in) + // "events": [] (list of event names to leave in) + + // Create a deep copy of the input data + newGeoData = JSON.parse(JSON.stringify(geoData)); + + if (filters.countries !== undefined) { + // Remove countries that are not in the list provided + Object.keys(newGeoData.data.countries).forEach(function (countryName) { + if (!filters.countries.includes(countryName)) { + delete newGeoData.data.countries[countryName]; + } + }); + } + if (filters.events !== undefined) { + // Remove events that are not in the list provided + Object.keys(newGeoData.data.events).forEach(function (eventName) { + if (!filters.events.includes(eventName)) { + delete newGeoData.data.events[eventName]; + } + }); + } + + return newGeoData; +} + +function getParkrunEventInfo(parkrunName) { + parkrunEventInfo = getGeoData().data.events[parkrunName]; + return parkrunEventInfo; +} + +// Functions to create dummy parkrun event results + +var lastDateUsed = undefined; +function getNextParkrunDate() {} + +function createParkrunResult(specificData) { + return { + name: "Fell Foot", + eventlink: + 'Fell Foot', + date: "22/11/2014", + datelink: + '22/11/2014', + date_obj: new Date("Sat Nov 22 2014 00:00:00 GMT+0000"), + event_number: "6", + position: "44", + time: "26:19", + pb: false, + ...specificData, + }; +} + +var geoData = getGeoData(); + +describe("challenges.js", function () { + describe("stats", function () { + describe("generate_stat_furthest_travelled", function () { + // Use the special '__get__' accessor to get your private function. + var generate_stat_furthest_travelled = challenges.__get__( + "generate_stat_furthest_travelled", + ); + + it('should return "None" if no events have been run', function () { + var parkrunResults = []; + var homeParkrun = getParkrunEventInfo("Winchester"); + var r = generate_stat_furthest_travelled( + parkrunResults, + geoData, + homeParkrun, + ); + assert.equal(r.value, "None"); + assert.equal(r.url, undefined); + }); + + it("should return the only parkrun done if they have only done one, and it is their home run", function () { + var parkrunResults = [createParkrunResult({ name: "Winchester" })]; + var homeParkrun = getParkrunEventInfo("Winchester"); + var r = generate_stat_furthest_travelled( + parkrunResults, + geoData, + homeParkrun, + ); + assert.equal(r.value, "Winchester, UK"); + assert.equal(r.url, "https://www.parkrun.org.uk/winchester"); + }); + + it("should return the only parkrun done if they have only done one, and it is not their home run", function () { + var parkrunResults = [createParkrunResult({ name: "Bushy Park" })]; + var homeParkrun = getParkrunEventInfo("Winchester"); + var r = generate_stat_furthest_travelled( + parkrunResults, + geoData, + homeParkrun, + ); + assert.equal(r.value, "Bushy Park, UK"); + assert.equal(r.url, "https://www.parkrun.org.uk/bushy"); + }); + + it('should return "Unknown" if none of the parkruns they have done have a known location', function () { + var parkrunResults = [ + createParkrunResult({ name: "A Closed Parkrun" }), + ]; + var homeParkrun = getParkrunEventInfo("Winchester"); + var r = generate_stat_furthest_travelled( + parkrunResults, + geoData, + homeParkrun, + ); + assert.equal(r.value, "Unknown"); + assert.equal(r.url, undefined); + }); + + it("should return the only parkrun event done if they have only been to one place, but been there multiple times", function () { + var parkrunResults = [ + createParkrunResult({ name: "Winchester" }), + createParkrunResult({ name: "Winchester" }), + ]; + var homeParkrun = getParkrunEventInfo("Bushy Park"); + var r = generate_stat_furthest_travelled( + parkrunResults, + geoData, + homeParkrun, + ); + assert.equal(r.value, "Winchester, UK"); + assert.equal(r.url, "https://www.parkrun.org.uk/winchester"); + }); + + it("should return the correct parkrun event in a list of mixed events", function () { + var parkrunResults = [ + createParkrunResult({ name: "Fell Foot" }), + createParkrunResult({ name: "Winchester" }), + createParkrunResult({ name: "Bushy Park" }), + ]; + var homeParkrun = getParkrunEventInfo("Bushy Park"); + var r = generate_stat_furthest_travelled( + parkrunResults, + geoData, + homeParkrun, + ); + assert.equal(r.value, "Fell Foot, UK"); + assert.equal(r.url, "https://www.parkrun.org.uk/fellfoot"); + }); + }); + + describe("generate_stat_nearest_event_not_done_yet", function () { + // Use the special '__get__' accessor to get your private function. + var generate_stat_nearest_event_not_done_yet = challenges.__get__( + "generate_stat_nearest_event_not_done_yet", + ); + + it("should return the home parkrun if you haven't run any events", function () { + var parkrunResults = []; + var homeParkrun = getParkrunEventInfo("Winchester"); + var r = generate_stat_nearest_event_not_done_yet( + parkrunResults, + geoData, + homeParkrun, + ); + assert.equal(r.value, "Winchester, UK - 0km away"); + assert.equal(r.url, "https://www.parkrun.org.uk/winchester"); + }); + + it("should return Bushy Park if the home run is Winchester, which has been run", function () { + var parkrunResults = [createParkrunResult({ name: "Winchester" })]; + var homeParkrun = getParkrunEventInfo("Winchester"); + var filteredGeoData = filterGeoData(geoData, { + events: ["Bushy Park", "Winchester"], + }); + var r = generate_stat_nearest_event_not_done_yet( + parkrunResults, + filteredGeoData, + homeParkrun, + ); + assert.equal(r.value, "Bushy Park, UK - 78km away"); + assert.equal(r.url, "https://www.parkrun.org.uk/bushy"); + }); + + it('should say "No more events available" if you have done all events', function () { + var parkrunResults = [ + createParkrunResult({ name: "Winchester" }), + createParkrunResult({ name: "Bushy Park" }), + ]; + var homeParkrun = getParkrunEventInfo("Winchester"); + var filteredGeoData = filterGeoData(geoData, { + events: ["Bushy Park", "Winchester"], + }); + var r = generate_stat_nearest_event_not_done_yet( + parkrunResults, + filteredGeoData, + homeParkrun, + ); + assert.equal(r.value, "No more events available"); + assert.equal(r.url, undefined); + }); + }); + + describe("generate_stat_average_parkrun_event", function () { + var generate_stat_average_parkrun_event = challenges.__get__( + "generate_stat_average_parkrun_event", + ); + const homeParkrun = getParkrunEventInfo("Winchester"); + + it("should return 'None' if no events have been run", function () { + var parkrunResults = []; + var r = generate_stat_average_parkrun_event( + parkrunResults, + geoData, + homeParkrun, + ); + assert.equal(r.value, "None"); + assert.equal(r.url, undefined); + assert.equal( + r.help, + "The nearest parkrun event to your home parkrun location", + ); + }); + + it("should handle no home parkrun data at all", function () { + var parkrunResults = [createParkrunResult({ name: "Winchester" })]; + var r = generate_stat_average_parkrun_event( + parkrunResults, + geoData, + undefined, + ); + assert.equal(r.value, "Winchester"); + assert.equal(r.url, "https://www.parkrun.org.uk/winchester"); + assert.equal( + r.help, + "The nearest parkrun event to your average parkrun location (or Bushy if you're yet to start)", + ); + }); + + it("should handle no home parkrun", function () { + var parkrunResults = [createParkrunResult({ name: "Winchester" })]; + var r = generate_stat_average_parkrun_event( + parkrunResults, + geoData, + {}, + ); + assert.equal(r.value, "Winchester"); + assert.equal(r.url, "https://www.parkrun.org.uk/winchester"); + assert.equal( + r.help, + "The nearest parkrun event to your average parkrun location (or Bushy if you're yet to start)", + ); + }); + + it("should return 'Winchester' if only run there once", function () { + var parkrunResults = [createParkrunResult({ name: "Winchester" })]; + var r = generate_stat_average_parkrun_event( + parkrunResults, + geoData, + homeParkrun, + ); + assert.equal(r.value, "Winchester"); + assert.equal(r.url, "https://www.parkrun.org.uk/winchester"); + assert.equal( + r.help, + "The nearest parkrun event to your home parkrun location", + ); + }); + + it("should return 'Winchester' if run there multiple times", function () { + var parkrunResults = [ + createParkrunResult({ name: "Winchester" }), + createParkrunResult({ name: "Winchester" }), + createParkrunResult({ name: "Winchester" }), + ]; + var r = generate_stat_average_parkrun_event( + parkrunResults, + geoData, + homeParkrun, + ); + assert.equal(r.value, "Winchester"); + assert.equal(r.url, "https://www.parkrun.org.uk/winchester"); + assert.equal( + r.help, + "The nearest parkrun event to your home parkrun location", + ); + }); + + it("should return 'Bushy Park' if run there most often", function () { + var parkrunResults = [ + createParkrunResult({ name: "Bushy Park" }), + createParkrunResult({ name: "Bushy Park" }), + createParkrunResult({ name: "Winchester" }), + ]; + // Filter the events to just Bushy Park and Winchester so that we definitely know which it will pick + var filteredGeoData = filterGeoData(geoData, { + events: ["Bushy Park", "Winchester"], + }); + var r = generate_stat_average_parkrun_event( + parkrunResults, + filteredGeoData, + ); + assert.equal(r.value, "Bushy Park"); + assert.equal(r.url, "https://www.parkrun.org.uk/bushy"); + }); + }); + describe("calculateCountryCompletionInfo", function () { + const calculateCountryCompletionInfo = challenges.__get__( + "calculateCountryCompletionInfo", + ); + + it("should compute completed and total events per country", function () { + const geoData = getGeoData(); + const parkrunResults = [ + createParkrunResult({ name: "Bushy Park" }), + createParkrunResult({ name: "Winchester" }), + createParkrunResult({ name: "Bushy Park" }), + ]; + const data = { + parkrun_results: parkrunResults, + geo_data: geoData, + }; + + const info = calculateCountryCompletionInfo(data); + const uk = info["UK"]; + + assert.strictEqual(uk.childEventsCount, 3); + assert.deepStrictEqual(uk.childEventsCompleted.sort(), [ + "Bushy Park", + "Winchester", + ]); + assert.strictEqual(uk.childEventsCompletedCount, 2); + }); + }); + + describe("generate_stat_longest_tourism_streak", () => { + const generate_stat_longest_tourism_streak = challenges.__get__( + "generate_stat_longest_tourism_streak", + ); + + describe("given no results", () => { + const parkrunResults = []; + it("is expected to be zero", () => { + const r = generate_stat_longest_tourism_streak(parkrunResults); + assert.strictEqual(r.value, "No parkruns: Yet to start (let's go!)"); + }); + }); + + describe("given one result", () => { + const parkrunResults = [ + createParkrunResult({ + name: "A", + datelink: "date1", + eventlink: "eventa", + }), + ]; + it("is expected to be one", () => { + const r = generate_stat_longest_tourism_streak(parkrunResults); + assert.strictEqual(r.value, "1 parkrun: eventa (date1)"); + }); + }); + + describe("given two identical results", () => { + const parkrunResults = [ + createParkrunResult({ + name: "A", + datelink: "date1", + eventlink: "eventa", + }), + createParkrunResult({ + name: "A", + datelink: "date2", + eventlink: "eventa", + }), + ]; + it("is expected to be the latest one", () => { + const r = generate_stat_longest_tourism_streak(parkrunResults); + assert.strictEqual(r.value, "1 parkrun: eventa (date2)"); + }); + }); + + describe("given two different results", () => { + const parkrunResults = [ + createParkrunResult({ + name: "A", + datelink: "date1", + eventlink: "eventa", + }), + createParkrunResult({ + name: "B", + datelink: "date2", + eventlink: "eventb", + }), + ]; + it("is expected to be two", () => { + const r = generate_stat_longest_tourism_streak(parkrunResults); + assert.strictEqual( + r.value, + "2 parkruns: eventa (date1) - eventb (date2)", + ); + }); + }); + + describe("a third result the same as the first", () => { + const parkrunResults = [ + createParkrunResult({ + name: "A", + datelink: "date1", + eventlink: "eventa", + }), + createParkrunResult({ + name: "B", + datelink: "date2", + eventlink: "eventb", + }), + createParkrunResult({ + name: "A", + datelink: "date3", + eventlink: "eventa", + }), + ]; + it("is expected to remove the first event from the streak", () => { + const r = generate_stat_longest_tourism_streak(parkrunResults); + assert.strictEqual( + r.value, + "2 parkruns: eventb (date2) - eventa (date3)", + ); + }); + }); + + describe("a third result the same as the second", () => { + const parkrunResults = [ + createParkrunResult({ + name: "A", + datelink: "date1", + eventlink: "eventa", + }), + createParkrunResult({ + name: "B", + datelink: "date2", + eventlink: "eventb", + }), + createParkrunResult({ + name: "B", + datelink: "date3", + eventlink: "eventb", + }), + ]; + it("is expected to end the streak", () => { + const r = generate_stat_longest_tourism_streak(parkrunResults); + assert.strictEqual( + r.value, + "2 parkruns: eventa (date1) - eventb (date2)", + ); + }); + }); + + describe("a third unique result", () => { + const parkrunResults = [ + createParkrunResult({ + name: "A", + datelink: "date1", + eventlink: "eventa", + }), + createParkrunResult({ + name: "B", + datelink: "date2", + eventlink: "eventb", + }), + createParkrunResult({ + name: "C", + datelink: "date3", + eventlink: "eventc", + }), + ]; + it("is expected to extend the streak", () => { + const r = generate_stat_longest_tourism_streak(parkrunResults); + assert.strictEqual( + r.value, + "3 parkruns: eventa (date1) - eventc (date3)", + ); + }); + }); + + describe("two identical streaks", () => { + const parkrunResults = [ + createParkrunResult({ + name: "A", + datelink: "date1", + eventlink: "eventa", + }), + createParkrunResult({ + name: "B", + datelink: "date2", + eventlink: "eventb", + }), + createParkrunResult({ + name: "A", + datelink: "date3", + eventlink: "eventa", + }), + createParkrunResult({ + name: "B", + datelink: "date4", + eventlink: "eventb", + }), + ]; + it("is expected to be the second streak", () => { + const r = generate_stat_longest_tourism_streak(parkrunResults); + assert.strictEqual( + r.value, + "2 parkruns: eventa (date3) - eventb (date4)", + ); + }); + }); + + describe("overlapping streaks (ABC, BCAD, ADCE)", () => { + const parkrunResults = [ + createParkrunResult({ + name: "A", + datelink: "date1", + eventlink: "eventa", + }), + createParkrunResult({ + name: "B", + datelink: "date2", + eventlink: "eventb", + }), + createParkrunResult({ + name: "C", + datelink: "date3", + eventlink: "eventc", + }), + createParkrunResult({ + name: "A", + datelink: "date4", + eventlink: "eventa", + }), + createParkrunResult({ + name: "D", + datelink: "date5", + eventlink: "eventd", + }), + createParkrunResult({ + name: "C", + datelink: "date6", + eventlink: "eventc", + }), + createParkrunResult({ + name: "E", + datelink: "date7", + eventlink: "evente", + }), + ]; + it("is expected to be the latest, longest streak", () => { + const r = generate_stat_longest_tourism_streak(parkrunResults); + assert.strictEqual( + r.value, + "4 parkruns: eventa (date4) - evente (date7)", + ); + }); + }); + + describe("A long streak followed by a shorter one (ABCD, DC)", () => { + const parkrunResults = [ + createParkrunResult({ + name: "A", + datelink: "date1", + eventlink: "eventA", + }), + createParkrunResult({ + name: "B", + datelink: "date2", + eventlink: "eventB", + }), + createParkrunResult({ + name: "C", + datelink: "date3", + eventlink: "eventC", + }), + createParkrunResult({ + name: "D", + datelink: "date4", + eventlink: "eventD", + }), + createParkrunResult({ + name: "C", + datelink: "date5", + eventlink: "eventC", + }), + ]; + + it("is expected to be the longer streak", () => { + const r = generate_stat_longest_tourism_streak(parkrunResults); + assert.strictEqual( + r.value, + "4 parkruns: eventA (date1) - eventD (date4)", + ); + }); + }); + }); + + describe("generate_stat_current_tourism_streak", () => { + const generate_stat_current_tourism_streak = challenges.__get__( + "generate_stat_current_tourism_streak", + ); + + describe("given no results", () => { + const parkrunResults = []; + it("is expected to be zero", () => { + const r = generate_stat_current_tourism_streak(parkrunResults); + assert.strictEqual(r.value, "No parkruns: Yet to start (let's go!)"); + }); + }); + + describe("given one result", () => { + const parkrunResults = [ + createParkrunResult({ + name: "A", + datelink: "date1", + eventlink: "eventa", + }), + ]; + it("is expected to be one", () => { + const r = generate_stat_current_tourism_streak(parkrunResults); + assert.strictEqual(r.value, "1 parkrun: eventa (date1)"); + }); + }); + + describe("given two identical results", () => { + const parkrunResults = [ + createParkrunResult({ + name: "A", + datelink: "date1", + eventlink: "eventa", + }), + createParkrunResult({ + name: "A", + datelink: "date2", + eventlink: "eventa", + }), + ]; + it("is expected to be the latest one", () => { + const r = generate_stat_current_tourism_streak(parkrunResults); + assert.strictEqual(r.value, "1 parkrun: eventa (date2)"); + }); + }); + + describe("given two different results", () => { + const parkrunResults = [ + createParkrunResult({ + name: "A", + datelink: "date1", + eventlink: "eventa", + }), + createParkrunResult({ + name: "B", + datelink: "date2", + eventlink: "eventb", + }), + ]; + it("is expected to be two", () => { + const r = generate_stat_current_tourism_streak(parkrunResults); + assert.strictEqual( + r.value, + "2 parkruns: eventa (date1) - eventb (date2)", + ); + }); + }); + }); + }); + + describe("challenges", function () { + describe("challenge_name_badge", function () { + // Use the special '__get__' accessor to get your private function. + var challenge_name_badge = challenges.__get__("challenge_name_badge"); + + // A simple testcase we can work with + var parkrunResults = []; + + var data = { + parkrun_results: parkrunResults, + geo_data: filterGeoData(geoData, { + events: ["Bushy Park", "Winchester"], + }), + }; + + // Seems a bit odd we have to call it like this, we should probably refactor it to + // only take the athlete name data + var r = challenge_name_badge(data, { + shortname: "name-badge", + name: "Name Badge", + data: { + name: "andrew TAYLOR", + }, + }); + + it("shouldn't give the badge if no events have been run", function () { + // With the data above, we should not have completed this challenge as we haven't run any events + assert.equal(r.complete, false); + }); + + it("should set the number of subparts the the number of achieveable letters", function () { + // For ANDREW TAYLOR we have only got a reference to WINCHESTER that matches + assert.equal(r.subparts_count, 1); + }); + + it("should give the badge if all letters are available and have been run", function () { + // Call it again with a name that matches the events we have run + var r = challenge_name_badge( + { + parkrun_results: [ + createParkrunResult({ name: "Winchester" }), + createParkrunResult({ name: "Bushy Park" }), + ], + geo_data: filterGeoData(geoData, { + events: ["Bushy Park", "Winchester"], + }), + }, + { + shortname: "name-badge", + name: "Name Badge", + data: { + name: "b w", + }, + }, + ); + assert.equal(r.subparts_count, 2); + assert.equal(r.subparts_completed_count, 2); + assert.equal(r.complete, true); + }); + it("should give the badge if not all letters are available, but those are have been run", function () { + // Call it again with a name that matches the events we have run + var r = challenge_name_badge( + { + parkrun_results: [ + createParkrunResult({ name: "Winchester" }), + createParkrunResult({ name: "Bushy Park" }), + ], + geo_data: filterGeoData(geoData, { + events: ["Bushy Park", "Winchester"], + }), + }, + { + shortname: "name-badge", + name: "Name Badge", + data: { + name: "b w-abcdefgh", + }, + }, + ); + assert.equal(r.subparts_count, 2); + assert.equal(r.subparts_completed_count, 2); + assert.equal(r.complete, true); + }); + + it("shouldn't give the badge if too few events have been run", function () { + // Call it again with a name that matches the events we have run + var r = challenge_name_badge( + { + parkrun_results: [createParkrunResult({ name: "Winchester" })], + geo_data: filterGeoData(geoData, { + events: ["Bushy Park", "Winchester"], + }), + }, + { + shortname: "name-badge", + name: "Name Badge", + data: { + name: "b wabcdefgh", + }, + }, + ); + assert.equal(r.subparts_count, 2); + assert.equal(r.subparts_completed_count, 1); + assert.equal(r.complete, false); + }); + + it("shouldn't give the badge if no letters in the name match parkrun events", function () { + // Call it again with a name that matches the events we have run + var r = challenge_name_badge( + { + parkrun_results: [createParkrunResult({ name: "Winchester" })], + geo_data: filterGeoData(geoData, { + events: ["Bushy Park", "Winchester"], + }), + }, + { + shortname: "name-badge", + name: "Name Badge", + data: { + name: "cde fgh", + }, + }, + ); + assert.equal(r.subparts_count, 0); + assert.equal(r.subparts_completed_count, 0); + assert.equal(r.complete, false); + }); + it("should handle being given names with hyphens in", function () { + // Call it again with a name that matches the events we have run + var r = challenge_name_badge( + { + parkrun_results: [ + createParkrunResult({ name: "Winchester" }), + createParkrunResult({ name: "Bushy Park" }), + ], + geo_data: filterGeoData(geoData, { + events: ["Bushy Park", "Winchester"], + }), + }, + { + shortname: "name-badge", + name: "Name Badge", + data: { + name: "b w-h", + }, + }, + ); + assert.equal(r.subparts_count, 2); + assert.equal(r.subparts_completed_count, 2); + assert.equal(r.complete, true); + }); + it("should handle Japanese names being passed in, but won't get the badge", function () { + var r = challenge_name_badge( + { + parkrun_results: [ + createParkrunResult({ name: "Winchester" }), + createParkrunResult({ name: "Bushy Park" }), + ], + geo_data: filterGeoData(geoData, { + events: ["Bushy Park", "Winchester"], + }), + }, + { + shortname: "name-badge", + name: "Name Badge", + data: { + name: "和輝 遠藤", + }, + }, + ); + assert.equal(r.subparts_count, 0); + assert.equal(r.subparts_completed_count, 0); + assert.equal(r.complete, false); + }); + }); + }); + + // Content-script specific functions depend on the full browser environment, + // so their behaviour is covered indirectly via higher-level tests. +}); diff --git a/browser-extensions/extension/src/js/tests/ui-test/.gitignore b/browser-extensions/extension/src/js/tests/ui-test/.gitignore new file mode 100644 index 00000000..b8f4bbaa --- /dev/null +++ b/browser-extensions/extension/src/js/tests/ui-test/.gitignore @@ -0,0 +1,8 @@ +node_modules/ +/test-results/ +/playwright-report/ +/playwright-debug/ +/playwright/.cache/ +/extension-binaries/ +/test-artifacts/ +screenshot*.png diff --git a/browser-extensions/extension/src/js/tests/ui-test/README.md b/browser-extensions/extension/src/js/tests/ui-test/README.md new file mode 100644 index 00000000..55f3f3cc --- /dev/null +++ b/browser-extensions/extension/src/js/tests/ui-test/README.md @@ -0,0 +1,11 @@ +# playwright-testing +Testing the playwright testing framework + +## When a UI test fails (headless) + +On failure, Playwright writes debugging artifacts (all gitignored): + +- **Screenshots**: `test-results/` — one screenshot per failed test. +- **Page HTML**: `playwright-debug/` — one `.html` file per failed test (sanitised test title as filename). + +In CI, the same artifacts are uploaded as `ui-tests-screenshots-*` and `ui-tests-html-*` when the Playwright job fails. diff --git a/browser-extensions/common/js/tests/ui-test/package.json b/browser-extensions/extension/src/js/tests/ui-test/package.json similarity index 82% rename from browser-extensions/common/js/tests/ui-test/package.json rename to browser-extensions/extension/src/js/tests/ui-test/package.json index fbb22960..bf4d4bc3 100644 --- a/browser-extensions/common/js/tests/ui-test/package.json +++ b/browser-extensions/extension/src/js/tests/ui-test/package.json @@ -3,7 +3,9 @@ "version": "1.0.0", "description": "Testing the playwright testing framework", "main": "index.js", - "scripts": {}, + "scripts": { + "test": "playwright test" + }, "repository": { "type": "git", "url": "git+https://github.com/fraz3alpha/playwright-testing.git" @@ -16,6 +18,7 @@ }, "homepage": "https://github.com/fraz3alpha/playwright-testing#readme", "devDependencies": { - "@playwright/test": "^1.50.1" + "@playwright/test": "^1.50.1", + "yaml": "^2.7.0" } } diff --git a/browser-extensions/common/js/tests/ui-test/playwright.config.js b/browser-extensions/extension/src/js/tests/ui-test/playwright.config.js similarity index 81% rename from browser-extensions/common/js/tests/ui-test/playwright.config.js rename to browser-extensions/extension/src/js/tests/ui-test/playwright.config.js index 4d9fbb76..b47ad76e 100644 --- a/browser-extensions/common/js/tests/ui-test/playwright.config.js +++ b/browser-extensions/extension/src/js/tests/ui-test/playwright.config.js @@ -1,5 +1,5 @@ // @ts-check -const { defineConfig, devices } = require('@playwright/test'); +const { defineConfig, devices } = require("@playwright/test"); /** * Read environment variables from file. @@ -11,7 +11,7 @@ const { defineConfig, devices } = require('@playwright/test'); * @see https://playwright.dev/docs/test-configuration */ module.exports = defineConfig({ - testDir: './tests', + testDir: "./tests", /* Run tests in files in parallel */ fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ @@ -21,21 +21,26 @@ module.exports = defineConfig({ /* Opt out of parallel tests on CI. */ workers: process.env.CI ? 1 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', + reporter: "html", /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ // baseURL: 'http://127.0.0.1:3000', /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', + trace: "on-first-retry", + /* Capture screenshot on failure for headless debugging */ + screenshot: "only-on-failure", }, + /* Where to put test artifacts (screenshots, etc.). Gitignored. */ + outputDir: "test-results", + /* Configure projects for major browsers */ projects: [ { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, + name: "chromium", + use: { ...devices["Desktop Chrome"] }, }, // { @@ -71,9 +76,8 @@ module.exports = defineConfig({ /* Run your local dev server before starting the tests */ // webServer: { - // command: 'npm run start', + // command: 'pnpm run start', // url: 'http://127.0.0.1:3000', // reuseExistingServer: !process.env.CI, // }, }); - diff --git a/browser-extensions/extension/src/js/tests/ui-test/screenshots.yml b/browser-extensions/extension/src/js/tests/ui-test/screenshots.yml new file mode 100644 index 00000000..4fc66495 --- /dev/null +++ b/browser-extensions/extension/src/js/tests/ui-test/screenshots.yml @@ -0,0 +1,44 @@ +# Website screenshots to capture. Each entry loads the URL (live parkrun site) +# with the Chrome extension loaded, then captures the area between top and bottom. +# +# filename: path from repo root (e.g. images/screenshots/name.png) +# url: full parkrun parkrunner "all" page URL +# top: CSS selector for the top of the capture area +# bottom: CSS selector for the bottom of the capture area + +screenshots: + - filename: images/screenshots/runner_page.png + url: https://www.parkrun.org.uk/parkrunner/1386351/all/ + top: "#content > h2" + bottom: "#results" + + - filename: images/screenshots/screenshot-01-badges.png + url: https://www.parkrun.org.uk/parkrunner/1309364/all/ + top: "#content > h2" + bottom: "#running_challenges_flags_div" + + - filename: images/screenshots/screenshot-02-table.png + url: https://www.parkrun.org.uk/parkrunner/1309364/all/ + top: "#challenge_tbody_header_compass-club" + bottom: "#challenge_tbody_header_full-ponty" + + - filename: images/screenshots/screenshot-03-badges-inc-volunteer.png + url: https://www.parkrun.org.uk/parkrunner/1309364/all/ + top: "#content > h2" + bottom: "#results" + + - filename: images/screenshots/screenshot-04-volunteer-challenges.png + url: https://www.parkrun.org.uk/parkrunner/1309364/all/ + top: "#running_challenges_volunteer_challenges_heading" + bottom: "#challenge_tbody_header_warm-up-leader" + + - filename: images/screenshots/screenshot-06-badges-inc-flags.png + url: https://www.parkrun.org.uk/parkrunner/1309364/all/ + top: "#running_challenges_flags_div" + bottom: "#running_challenges_messages_div" + + - filename: images/screenshots/screenshot-08-badges-including-flags-v2.png + url: https://www.parkrun.org.uk/parkrunner/1309364/all/ + top: "#content > h2" + bottom: "#results" + diff --git a/browser-extensions/extension/src/js/tests/ui-test/scripts/capture-website-screenshots.cjs b/browser-extensions/extension/src/js/tests/ui-test/scripts/capture-website-screenshots.cjs new file mode 100644 index 00000000..f335f1c3 --- /dev/null +++ b/browser-extensions/extension/src/js/tests/ui-test/scripts/capture-website-screenshots.cjs @@ -0,0 +1,160 @@ +/** + * Captures website screenshots from screenshots.yml by loading real parkrun pages + * with the Chrome extension. Run from repo root: ./script/update-screenshots + * Or from ui-test: node scripts/capture-website-screenshots.cjs + */ +const { chromium } = require("@playwright/test"); +const path = require("path"); +const fs = require("fs"); +const os = require("os"); +const yaml = require("yaml"); + +const UI_TEST_DIR = path.join(__dirname, ".."); +const REPO_ROOT = path.join(UI_TEST_DIR, "..", "..", "..", "..", "..", ".."); +const CHROME_EXTENSION_PATH = path.join(REPO_ROOT, "browser-extensions", "chrome", "build"); +const SCREENSHOTS_DIR = path.join(REPO_ROOT, "images", "screenshots"); +const SCREENSHOTS_CONFIG_PATH = path.join(UI_TEST_DIR, "screenshots.yml"); +const BOTTOM_SELECTOR_TIMEOUT_MS = 60000; +const FALLBACK_BOTTOM_SELECTOR = "#content"; + +function clipFromTopAndBottom(topBox, bottomBox) { + if (!topBox || !bottomBox) return null; + const y = topBox.y; + const bottomEdge = bottomBox.y + bottomBox.height; + const height = bottomEdge - y; + if (height <= 0) return null; + const left = Math.min(topBox.x, bottomBox.x); + const right = Math.max(topBox.x + topBox.width, bottomBox.x + bottomBox.width); + return { + x: left, + y, + width: right - left, + height, + }; +} + +function groupEntriesByUrl(screenshots) { + const byUrl = new Map(); + for (const entry of screenshots) { + const url = entry.url; + if (!byUrl.has(url)) byUrl.set(url, []); + byUrl.get(url).push(entry); + } + return byUrl; +} + +async function waitForBottomWithFallback(page, bottomSelector) { + let bottomEl = page.locator(bottomSelector).first(); + try { + await bottomEl.waitFor({ state: "visible", timeout: BOTTOM_SELECTOR_TIMEOUT_MS }); + return bottomEl; + } catch { + const fallbackEl = page.locator(FALLBACK_BOTTOM_SELECTOR).first(); + await fallbackEl.waitFor({ state: "visible", timeout: 5000 }); + console.warn( + `Warning: ${bottomSelector} did not appear (extension may not have injected). Using ${FALLBACK_BOTTOM_SELECTOR} as bottom.`, + ); + return fallbackEl; + } +} + +async function loadPage(page, url, firstEntry) { + await page.goto(url, { waitUntil: "domcontentloaded" }); + await page.waitForLoadState("networkidle"); + const topEl = page.locator(firstEntry.top).first(); + await topEl.waitFor({ state: "visible", timeout: 10000 }); + await waitForBottomWithFallback(page, firstEntry.bottom); + await page.waitForLoadState("networkidle"); +} + +async function captureRegion(page, entry) { + const { filename, top: topSelector, bottom: bottomSelector } = entry; + const topEl = page.locator(topSelector).first(); + const bottomEl = page.locator(bottomSelector).first(); + await topEl.waitFor({ state: "visible", timeout: 5000 }); + await bottomEl.waitFor({ state: "visible", timeout: 5000 }); + await topEl.scrollIntoViewIfNeeded(); + const topBox = await topEl.boundingBox(); + const bottomBox = await bottomEl.boundingBox(); + const viewportClip = clipFromTopAndBottom(topBox, bottomBox); + const outPath = path.join(REPO_ROOT, filename); + fs.mkdirSync(path.dirname(outPath), { recursive: true }); + if (!viewportClip) { + await page.screenshot({ path: outPath, fullPage: true }); + return outPath; + } + const scroll = await page.evaluate(() => ({ x: window.scrollX, y: window.scrollY })); + const pageClip = { + x: viewportClip.x + scroll.x, + y: viewportClip.y + scroll.y, + width: viewportClip.width, + height: viewportClip.height, + }; + await page.screenshot({ path: outPath, fullPage: true, clip: pageClip }); + return outPath; +} + +async function main() { + if ( + !fs.existsSync(CHROME_EXTENSION_PATH) || + !fs.existsSync(path.join(CHROME_EXTENSION_PATH, "manifest.json")) + ) { + throw new Error( + `Chrome extension not found at ${CHROME_EXTENSION_PATH}. Run ./script/update from repo root.`, + ); + } + + if (!fs.existsSync(SCREENSHOTS_CONFIG_PATH)) { + throw new Error(`Screenshots config not found: ${SCREENSHOTS_CONFIG_PATH}`); + } + + const configContent = fs.readFileSync(SCREENSHOTS_CONFIG_PATH, "utf8"); + const config = yaml.parse(configContent); + const screenshots = config.screenshots; + if (!Array.isArray(screenshots) || screenshots.length === 0) { + throw new Error("screenshots.yml must contain a non-empty 'screenshots' array."); + } + + fs.mkdirSync(SCREENSHOTS_DIR, { recursive: true }); + + const userDataDir = fs.mkdtempSync(path.join(os.tmpdir(), "rc-screenshot-")); + const extensionPathAbsolute = path.resolve(CHROME_EXTENSION_PATH); + + const context = await chromium.launchPersistentContext(userDataDir, { + channel: "chromium", + headless: true, + args: [ + "--headless=new", + `--disable-extensions-except=${extensionPathAbsolute}`, + `--load-extension=${extensionPathAbsolute}`, + ], + viewport: { width: 1200, height: 900 }, + userAgent: + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", + }); + + try { + const byUrl = groupEntriesByUrl(screenshots); + for (const [url, entries] of byUrl) { + const page = await context.newPage(); + page.on("console", (msg) => { + if (msg.type() === "error") { + console.warn("Page console error:", msg.text()); + } + }); + await loadPage(page, url, entries[0]); + for (const entry of entries) { + const outPath = await captureRegion(page, entry); + console.log("Screenshot written to", outPath); + } + await page.close(); + } + } finally { + await context.close(); + } +} + +main().catch((err) => { + console.error(err); + process.exit(1); +}); diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/images.parkrun.com/contents/events.json b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/images.parkrun.com/contents/events.json similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/images.parkrun.com/contents/events.json rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/images.parkrun.com/contents/events.json diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ca/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.at/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nl/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.nz/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.co.za/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.au/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.com.de/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.dk/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fi/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.fr/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.ie/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.it/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.jp/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.lt/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.my/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.no/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.org.uk/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.pl/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.se/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.sg/contents/parkrunner/999999/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1309364/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1309364/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1309364/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1309364/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1309364/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1309364/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1309364/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1309364/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1731148/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1731148/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1731148/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1731148/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1731148/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1731148/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1731148/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/1731148/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/2705084/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/2705084/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/2705084/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/2705084/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/2705084/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/2705084/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/2705084/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/2705084/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/482/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/482/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/482/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/482/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/482/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/482/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/482/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/482/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/88720/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/88720/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/88720/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/88720/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/88720/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/88720/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/88720/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/88720/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/999999/all/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/999999/all/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/999999/all/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/999999/all/index.html diff --git a/browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/999999/index.html b/browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/999999/index.html similarity index 100% rename from browser-extensions/common/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/999999/index.html rename to browser-extensions/extension/src/js/tests/ui-test/supporting-data/sites/parkrun.us/contents/parkrunner/999999/index.html diff --git a/browser-extensions/extension/src/js/tests/ui-test/tests/extension.spec.js b/browser-extensions/extension/src/js/tests/ui-test/tests/extension.spec.js new file mode 100644 index 00000000..9f51b7a0 --- /dev/null +++ b/browser-extensions/extension/src/js/tests/ui-test/tests/extension.spec.js @@ -0,0 +1,320 @@ +// @ts-check +const { test: base, expect, chromium } = require("@playwright/test"); +const path = require("path"); +const fs = require("fs"); + +const PLAYWRIGHT_DEBUG_DIR = path.join(__dirname, "..", "playwright-debug"); + +function safeDebugFilename(title) { + return title.replace(/[^a-zA-Z0-9-]/g, "_").slice(0, 80); +} + +async function saveDebugArtifactsOnFailure(page, testInfo) { + if (testInfo.status !== "failed") return; + try { + fs.mkdirSync(PLAYWRIGHT_DEBUG_DIR, { recursive: true }); + const baseName = safeDebugFilename(testInfo.title); + const htmlPath = path.join(PLAYWRIGHT_DEBUG_DIR, `${baseName}.html`); + const html = await page.content(); + fs.writeFileSync(htmlPath, html, "utf8"); + } catch (_) { + // Ignore (e.g. page closed or no page) + } +} + +const countryDomain = process.env.COUNTRY_HOSTNAME + ? process.env.COUNTRY_HOSTNAME + : "parkrun.org.uk"; + +const extensionPath = path.join( + __dirname, + "../extension-binaries/chrome-extension-package", +); + +if ( + !fs.existsSync(extensionPath) || + !fs.existsSync(path.join(extensionPath, "manifest.json")) +) { + throw new Error( + `Chrome extension not found at ${extensionPath}. Build the extension and unzip the Chrome zip into extension-binaries/chrome-extension-package/. Run from repo root: pnpm --filter running-challenges-extension run build:extension, then unzip browser-extensions/chrome/build/web-ext-artifacts/running_challenges-chrome-*.zip into that directory.`, + ); +} + +function getFixturePath(hostname, athleteId, suffix) { + return path.join( + __dirname, + "..", + "supporting-data", + "sites", + hostname, + "contents", + "parkrunner", + athleteId, + suffix, + "index.html", + ); +} + +const ONE_PX_TRANSPARENT_PNG = Buffer.from( + "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==", + "base64", +); + +function getVolunteerFixturePath(hostname, athleteId) { + return path.join( + __dirname, + "..", + "supporting-data", + "sites", + hostname, + "contents", + "parkrunner", + athleteId, + "index.html", + ); +} + +/** + * Install route mocks so tests need no network: main doc, volunteer fetch, + * events.json, and OSM tiles are fulfilled from fixtures; all other requests + * are aborted. Call before page.goto(). + */ +async function installNetworkFreeMocks(page, hostname, athleteId) { + const mainUrl = `https://www.${hostname}/parkrunner/${athleteId}/all/`; + const volunteerUrl = `https://www.${hostname}/parkrunner/${athleteId}/`; + const mainPath = getFixturePath(hostname, athleteId, "all"); + const volunteerPath = getVolunteerFixturePath(hostname, athleteId); + const eventsPath = path.join( + __dirname, + "..", + "supporting-data", + "sites", + "images.parkrun.com", + "contents", + "events.json", + ); + + if (!fs.existsSync(mainPath)) { + throw new Error( + `Fixture not found: ${mainUrl} (${mainPath}). Run ui-test/update.sh to refresh.`, + ); + } + if (!fs.existsSync(volunteerPath)) { + throw new Error( + `Volunteer fixture not found: ${volunteerUrl} (${volunteerPath}). Run ui-test/update.sh to refresh.`, + ); + } + if (!fs.existsSync(eventsPath)) { + throw new Error(`Fixture not found: ${eventsPath}`); + } + + const mainHtml = fs.readFileSync(mainPath, "utf8"); + const volunteerHtml = fs.readFileSync(volunteerPath, "utf8"); + const eventsJson = fs.readFileSync(eventsPath, "utf8"); + + await page.route("**/*", (route) => { + const url = route.request().url(); + if (url === mainUrl) { + return route.fulfill({ + status: 200, + contentType: "text/html", + body: mainHtml, + }); + } + if (url === volunteerUrl) { + return route.fulfill({ + status: 200, + contentType: "text/html", + body: volunteerHtml, + }); + } + if (url === "https://images.parkrun.com/events.json") { + return route.fulfill({ + status: 200, + contentType: "application/json", + body: eventsJson, + }); + } + if (url.includes("tile.openstreetmap.org")) { + return route.fulfill({ + status: 200, + contentType: "image/png", + body: ONE_PX_TRANSPARENT_PNG, + }); + } + return route.abort(); + }); +} + +const test = base.extend({ + context: async ({ browserName }, use) => { + const browserTypes = { chromium }; + const launchOptions = { + channel: "chromium", + devtools: false, + headless: true, + args: [ + `--headless=new`, + `--disable-extensions-except=${extensionPath}`, + `--load-extension=${extensionPath}`, + ], + viewport: { + width: 1920, + height: 1080, + }, + ignoreHTTPSErrors: true, + }; + + const context = await browserTypes[browserName].launchPersistentContext( + "", + launchOptions, + ); + await use(context); + await context.close(); + }, +}); + +test.afterEach(async ({ page }, testInfo) => { + await saveDebugArtifactsOnFailure(page, testInfo); +}); + +test("Basic extension load test", async ({ page }) => { + await installNetworkFreeMocks(page, countryDomain, "1309364"); + await page.goto(`https://www.${countryDomain}/parkrunner/1309364/all/`, { + waitUntil: "domcontentloaded", + }); + + const messagesDiv = page.locator("#running_challenges_messages_div"); + await expect(messagesDiv).toHaveText( + "Additional badges provided by Running Challenges", + { timeout: 15000 }, + ); +}); + +test("No results for parkrunner load test", async ({ page }) => { + await installNetworkFreeMocks(page, countryDomain, "999999"); + await page.goto(`https://www.${countryDomain}/parkrunner/999999/all/`, { + waitUntil: "domcontentloaded", + }); + + const messagesDiv = page.locator("#running_challenges_messages_div"); + await expect(messagesDiv).toHaveText( + "No results detected, no challenge data will be compiled", + { timeout: 15000 }, + ); +}); + +test("Leaflet markers load with icons (no network)", async ({ page }) => { + await installNetworkFreeMocks(page, countryDomain, "1309364"); + await page.goto(`https://www.${countryDomain}/parkrunner/1309364/all/`, { + waitUntil: "domcontentloaded", + }); + + const messagesDiv = page.locator("#running_challenges_messages_div"); + await expect(messagesDiv).toHaveText( + "Additional badges provided by Running Challenges", + { timeout: 15000 }, + ); + + const explorerMap = page.locator("#explorer_map"); + await expect(explorerMap).toHaveCount(1); + + const markers = explorerMap.locator(".leaflet-marker-icon"); + await expect(markers.first()).toBeVisible({ timeout: 10000 }); + expect(await markers.count()).toBeGreaterThan(0); +}); + +test("Explorer map shows country completion pie charts", async ({ page }) => { + // Danny NORMAN (A482) has significant UK tourism (e.g. 474/868 UK events). + await installNetworkFreeMocks(page, countryDomain, "482"); + await page.goto(`https://www.${countryDomain}/parkrunner/482/all/`, { + waitUntil: "domcontentloaded", + }); + + const messagesDiv = page.locator("#running_challenges_messages_div"); + await expect(messagesDiv).toHaveText( + "Additional badges provided by Running Challenges", + { timeout: 15000 }, + ); + + const explorerMap = page.locator("#explorer_map"); + await expect(explorerMap).toHaveCount(1); + + // Assert that at least one pie chart canvas is present on the explorer map. + const pieCharts = explorerMap.locator("canvas.leaflet-piechart-icon"); + await page.waitForFunction( + () => + document.querySelectorAll("canvas.leaflet-piechart-icon").length > 0, + null, + { timeout: 15000 }, + ); + expect(await pieCharts.count()).toBeGreaterThan(0); +}); + +const badgesThatShouldExistMap = { + // Running badges + "runner-tourist": ["1309364", "482"], + "runner-name-badge": ["482"], + // Volunteer badges + "volunteer-barcode-scanning": ["88720"], + "volunteer-car-park-marshal": ["88720"], + "volunteer-close-down": ["88720"], + "volunteer-comms-person": ["88720"], + "volunteer-equipment-storage": ["88720"], + "volunteer-event-day-course-check": ["88720"], + "volunteer-finish-tokens": ["88720"], + "volunteer-first-timers-welcome": ["88720"], + "volunteer-funnel-manager": ["88720"], + "volunteer-lead-bike": [], + "volunteer-manual-entry": ["88720"], + "volunteer-marshal": ["88720"], + "volunteer-other": ["88720"], + "volunteer-pacer": ["88720"], + "volunteer-photographer": ["88720"], + "volunteer-report-writer": ["88720"], + "volunteer-results-processing": ["88720"], + "volunteer-run-director": ["88720"], + "volunteer-setup": ["88720"], + "volunteer-sign-language": ["88720"], + "volunteer-tail-walker": ["88720"], + "volunteer-timer": ["88720"], + "volunteer-token-sorting": ["88720"], + "volunteer-vi-guide": ["88720"], + "volunteer-volunteer-coordinator": ["88720"], + "volunteer-warm-up-leader": ["88720"], + "volunteer-parkwalker": ["88720"], +}; + +const notApplicableBadgesPerDomain = { + "parkrun.co.at": ["volunteer-warm-up-leader"], + "parkrun.pl": ["volunteer-warm-up-leader"], +}; + +Object.keys(badgesThatShouldExistMap).forEach((badgeShortname) => { + if (countryDomain in notApplicableBadgesPerDomain) { + if (notApplicableBadgesPerDomain[countryDomain].includes(badgeShortname)) { + console.log(`Skipping ${badgeShortname} for ${countryDomain}`); + return; + } + } + + test(`Check for badge awarded: ${badgeShortname}`, async ({ page }) => { + for (const parkrunnerId of badgesThatShouldExistMap[badgeShortname]) { + await page.unroute("**/*"); + await installNetworkFreeMocks(page, countryDomain, parkrunnerId); + await page.goto( + `https://www.${countryDomain}/parkrunner/${parkrunnerId}/all/`, + { waitUntil: "domcontentloaded" }, + ); + + await expect(page.locator("#running_challenges_messages_div")).toHaveText( + "Additional badges provided by Running Challenges", + { timeout: 15000 }, + ); + + await expect( + page.locator(`#badge-awarded-${badgeShortname}`), + ).toBeVisible(); + } + }); +}); diff --git a/browser-extensions/extension/src/js/tests/ui-test/tests/userscript.spec.js b/browser-extensions/extension/src/js/tests/ui-test/tests/userscript.spec.js new file mode 100644 index 00000000..4b085982 --- /dev/null +++ b/browser-extensions/extension/src/js/tests/ui-test/tests/userscript.spec.js @@ -0,0 +1,407 @@ +// @ts-check +const { test, expect } = require("@playwright/test"); +const path = require("path"); +const fs = require("fs"); + +const PLAYWRIGHT_DEBUG_DIR = path.join(__dirname, "..", "playwright-debug"); + +const countryDomain = process.env.COUNTRY_HOSTNAME + ? process.env.COUNTRY_HOSTNAME + : "parkrun.org.uk"; + +function safeDebugFilename(title) { + return title.replace(/[^a-zA-Z0-9-]/g, "_").slice(0, 80); +} + +async function saveDebugArtifactsOnFailure(page, testInfo) { + if (testInfo.status !== "failed") return; + try { + fs.mkdirSync(PLAYWRIGHT_DEBUG_DIR, { recursive: true }); + const baseName = safeDebugFilename(testInfo.title); + const htmlPath = path.join(PLAYWRIGHT_DEBUG_DIR, `${baseName}.html`); + const html = await page.content(); + fs.writeFileSync(htmlPath, html, "utf8"); + } catch (_) { + // Ignore (e.g. page closed or no page) + } +} + +function getFixturePath(hostname, athleteId, suffix) { + return path.join( + __dirname, + "..", + "supporting-data", + "sites", + hostname, + "contents", + "parkrunner", + athleteId, + suffix, + "index.html", + ); +} + +const ONE_PX_TRANSPARENT_PNG = Buffer.from( + "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==", + "base64", +); + +function getVolunteerFixturePath(hostname, athleteId) { + return path.join( + __dirname, + "..", + "supporting-data", + "sites", + hostname, + "contents", + "parkrunner", + athleteId, + "index.html", + ); +} + +/** + * Install route mocks so tests need no network: main doc, volunteer fetch, + * events.json, and OSM tiles are fulfilled from fixtures; all other requests + * are aborted. Call before page.goto(). + */ +async function installNetworkFreeMocks(page, hostname, athleteId) { + const mainUrl = `https://www.${hostname}/parkrunner/${athleteId}/all/`; + const volunteerUrl = `https://www.${hostname}/parkrunner/${athleteId}/`; + const mainPath = getFixturePath(hostname, athleteId, "all"); + const volunteerPath = getVolunteerFixturePath(hostname, athleteId); + const eventsPath = path.join( + __dirname, + "..", + "supporting-data", + "sites", + "images.parkrun.com", + "contents", + "events.json", + ); + + if (!fs.existsSync(mainPath)) { + throw new Error( + `Fixture not found: ${mainUrl} (${mainPath}). Run ui-test/update.sh to refresh.`, + ); + } + if (!fs.existsSync(volunteerPath)) { + throw new Error( + `Volunteer fixture not found: ${volunteerUrl} (${volunteerPath}). Run ui-test/update.sh to refresh.`, + ); + } + if (!fs.existsSync(eventsPath)) { + throw new Error(`Fixture not found: ${eventsPath}`); + } + + const mainHtml = fs.readFileSync(mainPath, "utf8"); + const volunteerHtml = fs.readFileSync(volunteerPath, "utf8"); + const eventsJson = fs.readFileSync(eventsPath, "utf8"); + + await page.route("**/*", (route) => { + const url = route.request().url(); + if (url === mainUrl) { + return route.fulfill({ + status: 200, + contentType: "text/html", + body: mainHtml, + }); + } + if (url === volunteerUrl) { + return route.fulfill({ + status: 200, + contentType: "text/html", + body: volunteerHtml, + }); + } + if (url.startsWith("https://images.parkrun.com/") && url.includes("events.json")) { + return route.fulfill({ + status: 200, + contentType: "application/json", + body: eventsJson, + }); + } + if (url.includes("tile.openstreetmap.org")) { + return route.fulfill({ + status: 200, + contentType: "image/png", + body: ONE_PX_TRANSPARENT_PNG, + }); + } + if ( + url.includes("images/badges/") || + url.includes("images/flags/") || + url.includes("running-challenges.co.uk/img/badges/") || + url.includes("running-challenges.co.uk/img/flags/") + ) { + return route.fulfill({ + status: 200, + contentType: "image/png", + body: ONE_PX_TRANSPARENT_PNG, + }); + } + const extramarkersImgMatch = url.match( + /unpkg\.com\/leaflet-extra-markers@[\d.]+\/dist\/img\/([^/?#]+\.png)/, + ); + if (extramarkersImgMatch) { + const extramarkersImgPath = path.join( + __dirname, + "..", + "..", + "..", + "..", + "node_modules", + "leaflet-extra-markers", + "dist", + "img", + extramarkersImgMatch[1], + ); + if (fs.existsSync(extramarkersImgPath)) { + return route.fulfill({ + status: 200, + contentType: "image/png", + body: fs.readFileSync(extramarkersImgPath), + }); + } + } + return route.abort(); + }); +} + +test.afterEach(async ({ page }, testInfo) => { + await saveDebugArtifactsOnFailure(page, testInfo); +}); + +test( + "Userscript renders explorer map and badges on a parkrun results page", + async ({ page }, testInfo) => { + // Load the built userscript bundle from the website assets. + const userscriptPath = path.join( + __dirname, + "..", + "..", + "..", + "..", + "..", + "..", + "..", + "website", + "assets", + "js", + "running-challenges.user.js", + ); + + if (!fs.existsSync(userscriptPath)) { + throw new Error( + `Userscript bundle not found at ${userscriptPath}. Run ./script/update from the repo root to build it.`, + ); + } + + // Capture console output and page errors for debugging the userscript behaviour. + const consoleEvents = []; + page.on("console", (msg) => { + consoleEvents.push({ type: msg.type(), text: msg.text() }); + }); + page.on("pageerror", (err) => { + consoleEvents.push({ type: "pageerror", text: err.message }); + }); + + const saveConsoleAndRethrow = async (err) => { + await testInfo.attach("userscript-console-and-errors.json", { + body: JSON.stringify(consoleEvents, null, 2), + contentType: "application/json", + }); + fs.mkdirSync(PLAYWRIGHT_DEBUG_DIR, { recursive: true }); + fs.writeFileSync( + path.join(PLAYWRIGHT_DEBUG_DIR, "userscript-console-and-errors.json"), + JSON.stringify(consoleEvents, null, 2), + "utf8", + ); + throw err; + }; + + try { + // Use the same fixture parkrunner as the basic extension test: 1309364 (Andy Taylor). + await installNetworkFreeMocks(page, countryDomain, "1309364"); + + // Listen for events.json before navigation so we never miss the response. + const eventsJsonPromise = page.waitForResponse( + (resp) => + resp.url().includes("events.json") && resp.status() === 200, + { timeout: 15000 }, + ); + + await page.goto( + `https://www.${countryDomain}/parkrunner/1309364/all/`, + { + waitUntil: "domcontentloaded", + }, + ); + + // Inject the userscript after the page has loaded (matches Tampermonkey @run-at document-end). + // addInitScript runs before the document exists and causes "Cannot read properties of undefined (reading 'createElement')". + const userscriptSource = fs.readFileSync(userscriptPath, "utf8"); + await page.addScriptTag({ content: userscriptSource }); + await eventsJsonPromise; + + const messagesDiv = page.locator("#running_challenges_messages_div"); + await expect(messagesDiv).toHaveText( + "Additional badges provided by Running Challenges", + { timeout: 20000 }, + ); + const explorerMap = page.locator("#explorer_map"); + await expect(explorerMap).toHaveCount(1); + + // Badges: athlete 1309364 has runner-tourist; badge images must load (correct URLs so they can be fulfilled by our route). + const badgesDiv = page.locator("#running_challenges_badges_div"); + await expect(badgesDiv).toHaveCount(1); + await expect(page.locator("#badge-awarded-runner-tourist")).toBeVisible({ + timeout: 5000, + }); + const badgeImages = badgesDiv.locator("img"); + await expect(badgeImages.first()).toBeVisible({ timeout: 1000 }); + const atLeastOneBadgeLoaded = await page.evaluate(() => { + const imgs = document.querySelectorAll("#running_challenges_badges_div img"); + return Array.from(imgs).some((img) => img.naturalWidth > 0); + }); + expect(atLeastOneBadgeLoaded).toBe(true); + + // Flags: at least one country flag (e.g. UK) must be present and its image must load. + const flagsDiv = page.locator("#running_challenges_flags_div"); + await expect(flagsDiv).toHaveCount(1); + const flagImages = flagsDiv.locator("img"); + await expect(flagImages.first()).toBeVisible({ timeout: 5000 }); + const atLeastOneFlagLoaded = await page.evaluate(() => { + const imgs = document.querySelectorAll("#running_challenges_flags_div img"); + return Array.from(imgs).some((img) => img.naturalWidth > 0); + }); + expect(atLeastOneFlagLoaded).toBe(true); + + // Map: tiles must be contained (not scattered). Map fills container width (100%) and has fixed height. + const mapContainer = page.locator("#explorer_map"); + await expect(mapContainer).toHaveCSS("height", "400px"); + await expect(mapContainer).toHaveCSS("width", /^\d+(\.\d+)?px$/); + const tilesInsideMap = mapContainer.locator(".leaflet-tile-pane img, .leaflet-tile"); + await expect(tilesInsideMap.first()).toBeVisible({ timeout: 5000 }); + const allTiles = page.locator(".leaflet-tile-pane img, .leaflet-tile"); + const tilesWithinMap = mapContainer.locator(".leaflet-tile-pane img, .leaflet-tile"); + const totalTiles = await allTiles.count(); + const tilesInMap = await tilesWithinMap.count(); + expect(tilesInMap).toBe(totalTiles); + + // All Leaflet tiles and markers must be inside the explorer map in the DOM and the map must clip (overflow:hidden) so nothing is visibly scattered. + const mapStructureCheck = await page.evaluate(() => { + const mapEl = document.getElementById("explorer_map"); + if (!mapEl) return { ok: false, reason: "no map" }; + const overflow = window.getComputedStyle(mapEl).overflow; + const allTilesInPage = document.querySelectorAll(".leaflet-tile-pane img, .leaflet-tile"); + const allTilesInMap = mapEl.querySelectorAll(".leaflet-tile-pane img, .leaflet-tile"); + const allMarkersInPage = document.querySelectorAll( + ".leaflet-marker-icon, .leaflet-piechart-icon" + ); + const allMarkersInMap = mapEl.querySelectorAll( + ".leaflet-marker-icon, .leaflet-piechart-icon" + ); + const tilesContained = allTilesInPage.length === allTilesInMap.length; + const markersContained = allMarkersInPage.length === allMarkersInMap.length; + const clips = overflow === "hidden" || overflow === "auto"; + return { + ok: tilesContained && markersContained && clips, + tilesContained, + markersContained, + clips, + overflow, + tileCount: allTilesInPage.length, + markerCount: allMarkersInPage.length, + }; + }); + expect( + mapStructureCheck.ok, + mapStructureCheck.reason || + `Map structure: tilesContained=${mapStructureCheck.tilesContained} markersContained=${mapStructureCheck.markersContained} clips=${mapStructureCheck.clips} overflow=${mapStructureCheck.overflow}`, + ).toBe(true); + } catch (err) { + await saveConsoleAndRethrow(err); + } +}); + +test( + "Userscript challenge map (Pirates) shows eight event markers for athlete 482", + async ({ page }, testInfo) => { + const userscriptPath = path.join( + __dirname, + "..", + "..", + "..", + "..", + "..", + "..", + "..", + "website", + "assets", + "js", + "running-challenges.user.js", + ); + if (!fs.existsSync(userscriptPath)) { + throw new Error( + `Userscript bundle not found at ${userscriptPath}. Run ./script/update from the repo root to build it.`, + ); + } + + const consoleEvents = []; + page.on("console", (msg) => { + consoleEvents.push({ type: msg.type(), text: msg.text() }); + }); + page.on("pageerror", (err) => { + consoleEvents.push({ type: "pageerror", text: err.message }); + }); + const saveConsoleAndRethrow = async (err) => { + await testInfo.attach("userscript-console-and-errors.json", { + body: JSON.stringify(consoleEvents, null, 2), + contentType: "application/json", + }); + fs.mkdirSync(PLAYWRIGHT_DEBUG_DIR, { recursive: true }); + fs.writeFileSync( + path.join(PLAYWRIGHT_DEBUG_DIR, "userscript-console-and-errors.json"), + JSON.stringify(consoleEvents, null, 2), + "utf8", + ); + throw err; + }; + + try { + await installNetworkFreeMocks(page, countryDomain, "482"); + const eventsJsonPromise = page.waitForResponse( + (resp) => + resp.url().includes("events.json") && resp.status() === 200, + { timeout: 15000 }, + ); + await page.goto( + `https://www.${countryDomain}/parkrunner/482/all/`, + { waitUntil: "domcontentloaded" }, + ); + const userscriptSource = fs.readFileSync(userscriptPath, "utf8"); + await page.addScriptTag({ content: userscriptSource }); + await eventsJsonPromise; + + await expect( + page.locator("#running_challenges_messages_div"), + ).toHaveText("Additional badges provided by Running Challenges", { + timeout: 20000, + }); + + await page.locator("#challenge_pirates_show_map").click(); + const piratesMap = page.locator("#challenge_map_pirates"); + await expect(piratesMap).toBeVisible({ timeout: 10000 }); + const markerCount = await piratesMap + .locator(".leaflet-marker-icon") + .count(); + expect( + markerCount, + `Pirates challenge map should have at least 8 event markers (8 qualifying events; extension shows 8), got ${markerCount}`, + ).toBeGreaterThanOrEqual(8); + } catch (err) { + await saveConsoleAndRethrow(err); + } + }, +); diff --git a/browser-extensions/common/js/tests/ui-test/update.sh b/browser-extensions/extension/src/js/tests/ui-test/update.sh similarity index 81% rename from browser-extensions/common/js/tests/ui-test/update.sh rename to browser-extensions/extension/src/js/tests/ui-test/update.sh index a9da7bb8..68dd2aa6 100644 --- a/browser-extensions/common/js/tests/ui-test/update.sh +++ b/browser-extensions/extension/src/js/tests/ui-test/update.sh @@ -1,6 +1,5 @@ export USER_AGENT='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36' export TARGET_ROOT_DIR="`pwd`/supporting-data/sites" -export NGINX_CONF_D_ROOT_DIR="`pwd`/supporting-data/nginx/conf.d" # This script will start getting 405 errors when running curl if we get the AWS "Are you human" check, # so we'll keep track of how far we've got @@ -46,28 +45,7 @@ do done - # Write out the Nginx configuration file for this server - CONF_FILE="${NGINX_CONF_D_ROOT_DIR}/${PARKRUN_HOSTNAME}.conf" - echo "Writing out Nginx conf file to ${CONF_FILE}" - - cat > "${CONF_FILE}" << EOL -server { - listen 443 ssl; - server_name www.${PARKRUN_HOSTNAME}; - - ssl_certificate /etc/nginx/cert/cert.pem; - ssl_certificate_key /etc/nginx/cert/key.pem; - - location / { - root /usr/share/nginx/html/${PARKRUN_HOSTNAME}/contents; - add_header X-Running-Challenges mock-server; - index index.html; - } -} - -EOL - -# Do a bit of an extra sleep between countries -sleep 10 + # Do a bit of an extra sleep between countries + sleep 10 done diff --git a/browser-extensions/extension/src/manifest/base.json b/browser-extensions/extension/src/manifest/base.json new file mode 100644 index 00000000..bda5138b --- /dev/null +++ b/browser-extensions/extension/src/manifest/base.json @@ -0,0 +1,175 @@ +{ + "manifest_version": 3, + + "name": "Running Challenges", + "description": "Adds challenge progress information to your parkrun results page.", + "version": "REPLACE_EXTENSION_BUILD_VERSION.REPLACE_EXTENSION_BUILD_ID", + + "content_security_policy": { + "extension_pages": "default-src 'self'; connect-src https://www.parkrun.org.uk https://running-challenges.co.uk https://images.parkrun.com" + }, + "action": { + "default_icon": "images/logo/logo-128x128.png" + }, + "icons": { + "128": "images/logo/logo-128x128.png" + }, + "content_scripts": [ + { + "matches": [ + "*://www.parkrun.ca/parkrunner/*/all/", + "*://www.parkrun.co.at/parkrunner/*/all/", + "*://www.parkrun.co.nl/parkrunner/*/all/", + "*://www.parkrun.co.nz/parkrunner/*/all/", + "*://www.parkrun.co.za/parkrunner/*/all/", + "*://www.parkrun.com.au/parkrunner/*/all/", + "*://www.parkrun.com.de/parkrunner/*/all/", + "*://www.parkrun.dk/parkrunner/*/all/", + "*://www.parkrun.fi/parkrunner/*/all/", + "*://www.parkrun.fr/parkrunner/*/all/", + "*://www.parkrun.ie/parkrunner/*/all/", + "*://www.parkrun.it/parkrunner/*/all/", + "*://www.parkrun.jp/parkrunner/*/all/", + "*://www.parkrun.lt/parkrunner/*/all/", + "*://www.parkrun.my/parkrunner/*/all/", + "*://www.parkrun.no/parkrunner/*/all/", + "*://www.parkrun.org.uk/parkrunner/*/all/", + "*://www.parkrun.pl/parkrunner/*/all/", + "*://www.parkrun.ru/parkrunner/*/all/", + "*://www.parkrun.se/parkrunner/*/all/", + "*://www.parkrun.sg/parkrunner/*/all/", + "*://www.parkrun.us/parkrunner/*/all/" + ], + "js": [ + "js/lib/version.js", + "js/lib/third-party/jquery/jquery-3.6.0.js", + "js/lib/third-party/leaflet/leaflet-1.3.1.js", + "js/lib/third-party/leaflet-fullscreen/leaflet-fullscreen-1.1.0.js", + "js/lib/third-party/leaflet-markercluster/leaflet-markercluster-1.3.0.js", + "js/lib/third-party/leaflet-extramarkers/leaflet-extramarkers-1.0.6.js", + "js/lib/third-party/leaflet-canvasicon/leaflet-canvasicon-0.1.6.js", + "js/lib/third-party/leaflet-piechart/leaflet-piechart-0.1.2.js", + "js/lib/third-party/d3-voronoi/d3-voronoi.js", + "js/lib/cache.js", + "js/lib/i18n.js", + "js/lib/challenges.js", + "js/lib/challenges_ui.js", + "js/content-scripts/content-script-parkrunner.js" + ], + "css": [ + "css/third-party/leaflet/leaflet.css", + "css/third-party/leaflet-fullscreen/Control.FullScreen.css", + "css/third-party/leaflet-markercluster/MarkerCluster.css", + "css/third-party/leaflet-markercluster/MarkerCluster.Default.css", + "css/third-party/leaflet-extramarkers/leaflet.extra-markers.css" + ], + "run_at": "document_end" + }, + { + "matches": [ + "*://www.parkrun.ca/parkrunner/*", + "*://www.parkrun.co.at/parkrunner/*", + "*://www.parkrun.co.nl/parkrunner/*", + "*://www.parkrun.co.nz/parkrunner/*", + "*://www.parkrun.co.za/parkrunner/*", + "*://www.parkrun.com.au/parkrunner/*", + "*://www.parkrun.com.de/parkrunner/*", + "*://www.parkrun.dk/parkrunner/*", + "*://www.parkrun.fi/parkrunner/*", + "*://www.parkrun.fr/parkrunner/*", + "*://www.parkrun.ie/parkrunner/*", + "*://www.parkrun.it/parkrunner/*", + "*://www.parkrun.jp/parkrunner/*", + "*://www.parkrun.lt/parkrunner/*", + "*://www.parkrun.my/parkrunner/*", + "*://www.parkrun.no/parkrunner/*", + "*://www.parkrun.org.uk/parkrunner/*", + "*://www.parkrun.pl/parkrunner/*", + "*://www.parkrun.ru/parkrunner/*", + "*://www.parkrun.se/parkrunner/*", + "*://www.parkrun.sg/parkrunner/*", + "*://www.parkrun.us/parkrunner/*" + ], + "exclude_matches": [ + "*://www.parkrun.ca/parkrunner/*/all/", + "*://www.parkrun.co.at/parkrunner/*/all/", + "*://www.parkrun.co.nl/parkrunner/*/all/", + "*://www.parkrun.co.nz/parkrunner/*/all/", + "*://www.parkrun.co.za/parkrunner/*/all/", + "*://www.parkrun.com.au/parkrunner/*/all/", + "*://www.parkrun.com.de/parkrunner/*/all/", + "*://www.parkrun.dk/parkrunner/*/all/", + "*://www.parkrun.fi/parkrunner/*/all/", + "*://www.parkrun.fr/parkrunner/*/all/", + "*://www.parkrun.ie/parkrunner/*/all/", + "*://www.parkrun.it/parkrunner/*/all/", + "*://www.parkrun.jp/parkrunner/*/all/", + "*://www.parkrun.lt/parkrunner/*/all/", + "*://www.parkrun.my/parkrunner/*/all/", + "*://www.parkrun.no/parkrunner/*/all/", + "*://www.parkrun.org.uk/parkrunner/*/all/", + "*://www.parkrun.pl/parkrunner/*/all/", + "*://www.parkrun.ru/parkrunner/*/all/", + "*://www.parkrun.se/parkrunner/*/all/", + "*://www.parkrun.sg/parkrunner/*/all/", + "*://www.parkrun.us/parkrunner/*/all/" + ], + "js": [ + "js/lib/third-party/jquery/jquery-3.6.0.js", + "js/lib/cache.js", + "js/lib/i18n.js", + "js/content-scripts/content-script-parkrunner-summary.js" + ], + "run_at": "document_end" + } + ], + "web_accessible_resources": [ + { + "matches": [ + "https://www.parkrun.ca/*", + "https://www.parkrun.co.at/*", + "https://www.parkrun.co.nl/*", + "https://www.parkrun.co.nz/*", + "https://www.parkrun.co.za/*", + "https://www.parkrun.com.au/*", + "https://www.parkrun.com.de/*", + "https://www.parkrun.dk/*", + "https://www.parkrun.fi/*", + "https://www.parkrun.fr/*", + "https://www.parkrun.ie/*", + "https://www.parkrun.it/*", + "https://www.parkrun.jp/*", + "https://www.parkrun.lt/*", + "https://www.parkrun.my/*", + "https://www.parkrun.no/*", + "https://www.parkrun.org.uk/*", + "https://www.parkrun.pl/*", + "https://www.parkrun.ru/*", + "https://www.parkrun.se/*", + "https://www.parkrun.sg/*", + "https://www.parkrun.us/*" + ], + "resources": [ + "/images/badges/*.png", + "/images/logo/*.png", + "/images/maps/markers/*.png", + "/images/flags/*.png", + "/html/*.html", + "/css/*" + ], + "use_dynamic_url": false + } + ], + "permissions": ["storage"], + "options_ui": { + "page": "html/options.html" + }, + "background": { + "scripts": ["js/background.js"] + }, + "browser_specific_settings": { + "gecko": { + "id": "{70afe5fd-82a7-4300-9b3e-06ac0bd1c92d}" + } + } +} diff --git a/browser-extensions/extension/src/manifest/chrome.json b/browser-extensions/extension/src/manifest/chrome.json new file mode 100644 index 00000000..a7d922a0 --- /dev/null +++ b/browser-extensions/extension/src/manifest/chrome.json @@ -0,0 +1,5 @@ +{ + "background": { + "service_worker": "js/background.js" + } +} diff --git a/browser-extensions/extension/src/manifest/firefox.json b/browser-extensions/extension/src/manifest/firefox.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/browser-extensions/extension/src/manifest/firefox.json @@ -0,0 +1 @@ +{} diff --git a/browser-extensions/extension/userscript/bootstrap.js b/browser-extensions/extension/userscript/bootstrap.js new file mode 100644 index 00000000..33b8cce4 --- /dev/null +++ b/browser-extensions/extension/userscript/bootstrap.js @@ -0,0 +1,9 @@ +/** + * Run before any other userscript code so that extension code (which expects + * globals $ and L) can run. Must be the first import in entry.js. + */ +import $ from "../node_modules/jquery/dist/jquery.js"; +import L from "../node_modules/leaflet/dist/leaflet.js"; + +window.$ = window.jQuery = $; +window.L = L; diff --git a/browser-extensions/extension/userscript/d3-bootstrap.js b/browser-extensions/extension/userscript/d3-bootstrap.js new file mode 100644 index 00000000..8514e52f --- /dev/null +++ b/browser-extensions/extension/userscript/d3-bootstrap.js @@ -0,0 +1,6 @@ +// Expose d3.voronoi on window for code that expects global d3 (e.g. challenges_ui.js). +import * as d3Voronoi from "../node_modules/d3-voronoi/dist/d3-voronoi.js"; + +if (typeof window !== "undefined") { + window.d3 = Object.assign(window.d3 || {}, d3Voronoi); +} diff --git a/browser-extensions/extension/userscript/entry.js b/browser-extensions/extension/userscript/entry.js new file mode 100644 index 00000000..ccb46d58 --- /dev/null +++ b/browser-extensions/extension/userscript/entry.js @@ -0,0 +1,37 @@ +// Entry point for the Running Challenges userscript bundle. +// This file is bundled and minified by scripts/build-userscript.mjs. +// Bootstrap must run first so window.$ and window.L exist before any extension code. +import "./bootstrap.js"; + +import "../node_modules/leaflet.fullscreen/Control.FullScreen.js"; +import "../node_modules/leaflet.markercluster/dist/leaflet.markercluster.js"; +import "../node_modules/leaflet-extra-markers/dist/js/leaflet.extra-markers.min.js"; +import "../node_modules/leaflet-canvasicon/leaflet-canvasicon.js"; +import "../node_modules/leaflet-piechart/leaflet-piechart.js"; +import "./d3-bootstrap.js"; + +// Core extension logic, loaded in the same order as the browser extension. +import "../src/js/lib/cache.js"; +import "../src/js/lib/i18n.js"; +import "../src/js/lib/challenges.js"; +import "../src/js/lib/challenges_ui.js"; +import "../src/js/content-scripts/content-script-parkrunner.js"; + +// Ensure the main page initialiser runs once the DOM is ready. +if (typeof document !== "undefined") { + const start = function () { + if (typeof create_page === "function") { + create_page(); + } + }; + + if ( + document.readyState === "complete" || + document.readyState === "interactive" + ) { + start(); + } else { + window.addEventListener("DOMContentLoaded", start, { once: true }); + } +} + diff --git a/browser-extensions/firefox/manifest.json b/browser-extensions/firefox/manifest.json index 94d58fcc..4d16ce26 100644 --- a/browser-extensions/firefox/manifest.json +++ b/browser-extensions/firefox/manifest.json @@ -52,7 +52,7 @@ "js/lib/third-party/leaflet-fullscreen/leaflet-fullscreen-1.0.1.js", "js/lib/third-party/leaflet-markercluster/leaflet-markercluster-1.3.0.js", "js/lib/third-party/leaflet-extramarkers/leaflet-extramarkers-1.0.5.js", - "js/lib/third-party/leaflet-canvasicon/leaflet-canvasicon-0.1.4.js", + "js/lib/third-party/leaflet-canvasicon/leaflet-canvasicon-0.1.6.js", "js/lib/third-party/leaflet-piechart/leaflet-piechart-0.1.2.js", "js/lib/third-party/d3-voronoi/d3-voronoi.js", "js/lib/cache.js", diff --git a/build/README.md b/build/README.md index 283ebe70..2bb3e590 100644 --- a/build/README.md +++ b/build/README.md @@ -1,9 +1,3 @@ - # Required build dependencies -- `gnu-sed` - - If running on a Mac, you need to install `gnu-sed`, e.g. with `brew install gnu-sed`, - otherwise the `-i` command does not work as expected. - The build scripts will automatically alias to this version if it detects you - are on a Mac. +The build scripts are written to use standard Unix tools (`bash`, `sed`, etc.) and should work on both macOS and Linux without additional packages. If you run into portability issues with your sed implementation, please open an issue with details of your platform and error message. diff --git a/build/extension-chrome/build.sh b/build/extension-chrome/build.sh deleted file mode 100755 index 2023403a..00000000 --- a/build/extension-chrome/build.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -xe - -# Set up version variables -source build/version.sh -# Set up tools variables -source build/tools.sh - -# Create empty build directory -export TMP_BUILD_DIR=browser-extensions/chrome/build -rm -rf ${TMP_BUILD_DIR} && mkdir -p ${TMP_BUILD_DIR} - -# Copy the images that need to be bundled -mkdir -p ${TMP_BUILD_DIR}/images - -mkdir ${TMP_BUILD_DIR}/images/badges -cp -r images/badges/256x256/*.png ${TMP_BUILD_DIR}/images/badges/ - -mkdir ${TMP_BUILD_DIR}/images/flags -cp -r images/flags/twemoji/png/*.png ${TMP_BUILD_DIR}/images/flags/ - -cp -r images/logo ${TMP_BUILD_DIR}/images/ - -# Copy the required third party CSS libraries from the top level shared project dir -mkdir -p ${TMP_BUILD_DIR}/css/third-party/ -cp -r css/third-party/leaflet ${TMP_BUILD_DIR}/css/third-party/ -cp -r css/third-party/leaflet-extramarkers ${TMP_BUILD_DIR}/css/third-party/ -cp -r css/third-party/leaflet-fullscreen ${TMP_BUILD_DIR}/css/third-party/ -cp -r css/third-party/leaflet-markercluster ${TMP_BUILD_DIR}/css/third-party/ - -# Copy the required third party Javascript libraries from the top level shared project dir -mkdir -p ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/jquery ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/leaflet ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-canvasicon ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-extramarkers ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-fullscreen ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-markercluster ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-piechart ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/d3-voronoi ${TMP_BUILD_DIR}/js/lib/third-party/ - -# Copy the common code, but don't include the tests -rsync -av browser-extensions/common/js ${TMP_BUILD_DIR} --exclude tests -cp -r browser-extensions/common/html ${TMP_BUILD_DIR}/ -cp -r browser-extensions/common/css ${TMP_BUILD_DIR}/ - -# Write out the version file -echo "var extensionVersion = \"${EXTENSION_BUILD_VERSION}\"" > ${TMP_BUILD_DIR}/js/lib/version.js - -# Copy the metadata -cp browser-extensions/chrome/manifest.json ${TMP_BUILD_DIR}/ - -# Replace placeholders in the manifest file -${SED} -i "s/REPLACE_EXTENSION_BUILD_ID/$EXTENSION_BUILD_ID/" ${TMP_BUILD_DIR}/manifest.json -${SED} -i "s/REPLACE_EXTENSION_BUILD_VERSION/$EXTENSION_BUILD_VERSION/" ${TMP_BUILD_DIR}/manifest.json - -# Apply the custom patches -for i in patches/chrome/*.patch; do patch -p0 --directory "${TMP_BUILD_DIR}" < $i; done - -# Move into the build directory and package everything up -cd ${TMP_BUILD_DIR} -# zip -r extension.zip js/ html/ images/ css/ manifest.json -# web-ext lint # Firefox won't verify a Chrome-compatible MV3 file :( -web-ext build - -# Rename built package with the browser in the name -find web-ext-artifacts -type f -name "running_challenges-*.zip" -exec bash -c 'x="{}"; mv $x "`echo $x | sed s/running_challenges/running_challenges-chrome/`"' \; - -# Print the size of the built extension -ls -l web-ext-artifacts/running_challenges-*.zip diff --git a/build/extension-firefox/build.sh b/build/extension-firefox/build.sh deleted file mode 100755 index 6eb9a5df..00000000 --- a/build/extension-firefox/build.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -xe - -if ! type -p web-ext &>/dev/null; then - npm install --global web-ext -fi - -# Set up version variables -source build/version.sh -# Set up tools variables -source build/tools.sh - -# Create empty build directory -export TMP_BUILD_DIR=browser-extensions/firefox/build -rm -rf ${TMP_BUILD_DIR} && mkdir -p ${TMP_BUILD_DIR} - -# Copy the images that need to be bundled -mkdir -p ${TMP_BUILD_DIR}/images - -mkdir ${TMP_BUILD_DIR}/images/badges -cp -r images/badges/256x256/*.png ${TMP_BUILD_DIR}/images/badges/ - -mkdir ${TMP_BUILD_DIR}/images/flags -cp -r images/flags/twemoji/png/*.png ${TMP_BUILD_DIR}/images/flags/ - -cp -r images/logo ${TMP_BUILD_DIR}/images/ - -# Copy the required third party CSS libraries from the top level shared project dir -mkdir -p ${TMP_BUILD_DIR}/css/third-party/ -cp -r css/third-party/leaflet ${TMP_BUILD_DIR}/css/third-party/ -cp -r css/third-party/leaflet-extramarkers ${TMP_BUILD_DIR}/css/third-party/ -cp -r css/third-party/leaflet-fullscreen ${TMP_BUILD_DIR}/css/third-party/ -cp -r css/third-party/leaflet-markercluster ${TMP_BUILD_DIR}/css/third-party/ - -# Copy the required third party Javascript libraries from the top level shared project dir -mkdir -p ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/jquery ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/leaflet ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-canvasicon ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-extramarkers ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-fullscreen ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-markercluster ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-piechart ${TMP_BUILD_DIR}/js/lib/third-party/ -cp -r js/lib/third-party/d3-voronoi ${TMP_BUILD_DIR}/js/lib/third-party/ - -# Copy the common code, but don't include the tests -rsync -av browser-extensions/common/js ${TMP_BUILD_DIR} --exclude tests -cp -r browser-extensions/common/html ${TMP_BUILD_DIR}/ -cp -r browser-extensions/common/css ${TMP_BUILD_DIR}/ - -# Write out the version file -echo "var extensionVersion = \"${EXTENSION_BUILD_VERSION}\"" > ${TMP_BUILD_DIR}/js/lib/version.js - -# Copy the extras libraries and code for Firefox -# None at the moment - -# Replace all instances of "chrome-extension://" with "moz-extension://" for -# Firefox compatibility in css files -# Deprecated in preference of using .patch files -# find ${TMP_BUILD_DIR}/ -type f -name "*.css" -exec ${SED} -i "s/chrome-extension/moz-extension/g" {} \; - -# Copy the metadata -cp browser-extensions/firefox/manifest.json ${TMP_BUILD_DIR}/manifest.json - -# Replace placeholders in the manifest file -${SED} -i "s/REPLACE_EXTENSION_BUILD_ID/$EXTENSION_BUILD_ID/" ${TMP_BUILD_DIR}/manifest.json -${SED} -i "s/REPLACE_EXTENSION_BUILD_VERSION/$EXTENSION_BUILD_VERSION/" ${TMP_BUILD_DIR}/manifest.json - -# Apply the custom patches -for i in patches/firefox/*.patch; do patch -p0 --directory "${TMP_BUILD_DIR}" < $i; done - -# Move into the build directory and package everything up -cd ${TMP_BUILD_DIR} -web-ext lint -web-ext build - -# Rename built package with the browser in the name -find web-ext-artifacts -type f -name "running_challenges-*.zip" -exec bash -c 'x="{}"; mv $x "`echo $x | sed s/running_challenges/running_challenges-firefox/`"' \; - -# Print the size of the built extension -ls -l web-ext-artifacts/running_challenges-*.zip diff --git a/build/tools.sh b/build/tools.sh deleted file mode 100644 index 7c7ddfbb..00000000 --- a/build/tools.sh +++ /dev/null @@ -1,9 +0,0 @@ - -echo "Current OS is: ${OSTYPE}" -if [[ "${OSTYPE}" == darwin* ]] - then - echo "Switching to using gsed" - export SED=gsed -fi - -export SED=${SED:-sed} diff --git a/build/version.sh b/build/version.sh index b8a59c20..7473722d 100644 --- a/build/version.sh +++ b/build/version.sh @@ -1,6 +1,6 @@ #!/bin/bash -xe -export VERSION=2.0.0 +export VERSION=2.0.1 # Strip any 'v' characters from the version string, as exist in the git tag export EXTENSION_BUILD_VERSION=`echo ${EXTENSION_BUILD_VERSION:-$VERSION} | sed -e s/v//` # Default the build id variable to zero if not set - The CI system should set this to diff --git a/build/website/build-local-and-run.sh b/build/website/build-local-and-run.sh index 969b369a..312280fc 100755 --- a/build/website/build-local-and-run.sh +++ b/build/website/build-local-and-run.sh @@ -1,65 +1,10 @@ #!/usr/bin/env bash - -# Set up tools variables -source build/tools.sh - -# This script pushing the built copy of the this site to a staging repository - -JEKYLL_PORT=${JEKYLL_PORT:-4000} - -# Use this to make a file that won't be cached if we changed the contents. -# RUNNING_CHALLENGES_DATA_COMMIT=`cd running-challenges-data && git rev-parse HEAD` - -# Enable exit on failure set -e -echo "Copying shared resources to the website folder" - -echo "Copying badges to website img/badges directory" -mkdir -p website/img/badges -cp -r images/badges/256x256/*.png website/img/badges/ - -echo "Copying flags to website img/flags directory" -mkdir -p website/img/flags -cp -r images/flags/twemoji/png/*.png website/img/flags/ - -echo "Copying logos to website img/logo directory" -mkdir -p website/img/logo -cp -r images/logo/*.png website/img/logo/ - -echo "Copying screenshots to website img/screenshots directory" -mkdir -p website/img/screenshots -cp -r images/screenshots/*.png website/img/screenshots/ - -echo "Copying third party Javascript libraries into the assets directory" -# Copy the required third party libraries from the top level shared project dir -mkdir -p website/assets/js/lib/third-party/ -cp -r js/lib/third-party/jquery website/assets/js/lib/third-party/ -cp -r js/lib/third-party/d3-voronoi website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-canvasicon website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-extramarkers website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-fullscreen website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-markercluster website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-piechart website/assets/js/lib/third-party/ - -echo "Copying third party CSS libraries into the assets directory" -# Copy the required third party libraries from the top level shared project dir -mkdir -p website/assets/css/third-party/ -cp -r css/third-party/leaflet website/assets/css/third-party/ -cp -r css/third-party/leaflet-extramarkers website/assets/css/third-party/ -cp -r css/third-party/leaflet-fullscreen website/assets/css/third-party/ -cp -r css/third-party/leaflet-markercluster website/assets/css/third-party/ - -# echo "Copying data to website" -# mkdir -p website/assets/js/lib/data -# export DATA_GEO_JS="website/assets/js/lib/data/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_geo = " > "${DATA_GEO_JS}" && cat running-challenges-data/data/parkrun-geo/parsed/geo.json >> "${DATA_GEO_JS}" -# export DATA_SPECIAL_EVENTS_JS="website/assets/js/lib/data/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_special_events = " > "${DATA_SPECIAL_EVENTS_JS}" && cat running-challenges-data/data/parkrun-special-events/2019-20/parsed/all.json >> "${DATA_SPECIAL_EVENTS_JS}" +JEKYLL_PORT=${JEKYLL_PORT:-4000} -# Replace the placeholders in the map includes, there is probably a better way to do this -# ${SED} -i "s/data\/geo-.*.js/data\/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md -# ${SED} -i "s/data\/special-events-.*.js/data\/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md -# based on https://jekyllrb.com/docs/continuous-integration/travis-ci/ +BUILD_WEBSITE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +bash "$BUILD_WEBSITE_DIR/copy-assets.sh" # Move into the website directory cd website @@ -69,11 +14,9 @@ SITE_DIR=_site # Clear out the build directory rm -rf ${SITE_DIR} && mkdir ${SITE_DIR} -docker run --rm --name jekyll \ --p ${JEKYLL_PORT}:4000 \ --v `pwd`:/srv/jekyll \ --v `pwd`/vendor/bundle:/usr/local/bundle \ -jekyll/jekyll jekyll serve --future --trace +# Install Ruby gems (once) and run the local Jekyll server +bundle install +bundle exec jekyll serve --future --trace --port "${JEKYLL_PORT}" --host 0.0.0.0 # Print summary echo "Built site, total size: `du -sh ${SITE_DIR}`" diff --git a/build/website/build-local.sh b/build/website/build-local.sh index 68949521..678f03b8 100755 --- a/build/website/build-local.sh +++ b/build/website/build-local.sh @@ -1,63 +1,8 @@ #!/usr/bin/env bash - -# Set up tools variables -source build/tools.sh - -# This script pushing the built copy of the this site to a staging repository - -# Use this to make a file that won't be cached if we changed the contents. -# RUNNING_CHALLENGES_DATA_COMMIT=`cd running-challenges-data && git rev-parse HEAD` - -# Enable exit on failure set -e -echo "Copying shared resources to the website folder" - -echo "Copying badges to website img/badges directory" -mkdir -p website/img/badges -cp -r images/badges/256x256/*.png website/img/badges/ - -echo "Copying flags to website img/flags directory" -mkdir -p website/img/flags -cp -r images/flags/twemoji/png/*.png website/img/flags/ - -echo "Copying logos to website img/logo directory" -mkdir -p website/img/logo -cp -r images/logo/*.png website/img/logo/ - -echo "Copying screenshots to website img/screenshots directory" -mkdir -p website/img/screenshots -cp -r images/screenshots/*.png website/img/screenshots/ - -echo "Copying third party Javascript libraries into the assets directory" -# Copy the required third party libraries from the top level shared project dir -mkdir -p website/assets/js/lib/third-party/ -cp -r js/lib/third-party/jquery website/assets/js/lib/third-party/ -cp -r js/lib/third-party/d3-voronoi website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-canvasicon website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-extramarkers website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-fullscreen website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-markercluster website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-piechart website/assets/js/lib/third-party/ - -echo "Copying third party CSS libraries into the assets directory" -# Copy the required third party libraries from the top level shared project dir -mkdir -p website/assets/css/third-party/ -cp -r css/third-party/leaflet website/assets/css/third-party/ -cp -r css/third-party/leaflet-extramarkers website/assets/css/third-party/ -cp -r css/third-party/leaflet-fullscreen website/assets/css/third-party/ -cp -r css/third-party/leaflet-markercluster website/assets/css/third-party/ - -# echo "Copying data to website" -# mkdir -p website/assets/js/lib/data -# export DATA_GEO_JS="website/assets/js/lib/data/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_geo = " > "${DATA_GEO_JS}" && cat running-challenges-data/data/parkrun-geo/parsed/geo.json >> "${DATA_GEO_JS}" -# export DATA_SPECIAL_EVENTS_JS="website/assets/js/lib/data/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_special_events = " > "${DATA_SPECIAL_EVENTS_JS}" && cat running-challenges-data/data/parkrun-special-events/2019-20/parsed/all.json >> "${DATA_SPECIAL_EVENTS_JS}" - -# Replace the placeholders in the map includes, there is probably a better way to do this -# ${SED} -i "s/data\/geo-.*.js/data\/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md -# ${SED} -i "s/data\/special-events-.*.js/data\/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md -# based on https://jekyllrb.com/docs/continuous-integration/travis-ci/ +BUILD_WEBSITE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +bash "$BUILD_WEBSITE_DIR/copy-assets.sh" # Move into the website directory cd website @@ -67,10 +12,9 @@ SITE_DIR=_site # Clear out the build directory rm -rf ${SITE_DIR} && mkdir ${SITE_DIR} -docker run --rm --name jekyll \ --v `pwd`:/srv/jekyll \ --v `pwd`/vendor/bundle:/usr/local/bundle \ -jekyll/jekyll jekyll build --trace +# Install Ruby gems (once) and build the site locally +bundle install +bundle exec jekyll build --trace # Print summary echo "Built site, total size: `du -sh ${SITE_DIR}`" diff --git a/build/website/build-staging.sh b/build/website/build-staging.sh index d9cc3f1f..5583d5aa 100755 --- a/build/website/build-staging.sh +++ b/build/website/build-staging.sh @@ -1,63 +1,8 @@ #!/usr/bin/env bash - -# Set up tools variables -source build/tools.sh - -# This script pushing the built copy of the this site to a staging repository - -# Use this to make a file that won't be cached if we changed the contents. -# RUNNING_CHALLENGES_DATA_COMMIT=`cd running-challenges-data && git rev-parse HEAD` - -# Enable exit on failure set -e -echo "Copying shared resources to the website folder" - -echo "Copying badges to website img/badges directory" -mkdir -p website/img/badges -cp -r images/badges/256x256/*.png website/img/badges/ - -echo "Copying flags to website img/flags directory" -mkdir -p website/img/flags -cp -r images/flags/twemoji/png/*.png website/img/flags/ - -echo "Copying logos to website img/logo directory" -mkdir -p website/img/logo -cp -r images/logo/*.png website/img/logo/ - -echo "Copying screenshots to website img/screenshots directory" -mkdir -p website/img/screenshots -cp -r images/screenshots/*.png website/img/screenshots/ - -echo "Copying third party Javascript libraries into the assets directory" -# Copy the required third party libraries from the top level shared project dir -mkdir -p website/assets/js/lib/third-party/ -cp -r js/lib/third-party/jquery website/assets/js/lib/third-party/ -cp -r js/lib/third-party/d3-voronoi website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-canvasicon website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-extramarkers website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-fullscreen website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-markercluster website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-piechart website/assets/js/lib/third-party/ - -echo "Copying third party CSS libraries into the assets directory" -# Copy the required third party libraries from the top level shared project dir -mkdir -p website/assets/css/third-party/ -cp -r css/third-party/leaflet website/assets/css/third-party/ -cp -r css/third-party/leaflet-extramarkers website/assets/css/third-party/ -cp -r css/third-party/leaflet-fullscreen website/assets/css/third-party/ -cp -r css/third-party/leaflet-markercluster website/assets/css/third-party/ - -# echo "Copying data to website" -# mkdir -p website/assets/js/lib/data -# export DATA_GEO_JS="website/assets/js/lib/data/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_geo = " > "${DATA_GEO_JS}" && cat running-challenges-data/data/parkrun-geo/parsed/geo.json >> "${DATA_GEO_JS}" -# export DATA_SPECIAL_EVENTS_JS="website/assets/js/lib/data/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_special_events = " > "${DATA_SPECIAL_EVENTS_JS}" && cat running-challenges-data/data/parkrun-special-events/2019-20/parsed/all.json >> "${DATA_SPECIAL_EVENTS_JS}" - -# Replace the placeholders in the map includes, there is probably a better way to do this -# ${SED} -i "s/data\/geo-.*.js/data\/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md -# ${SED} -i "s/data\/special-events-.*.js/data\/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md -# based on https://jekyllrb.com/docs/continuous-integration/travis-ci/ +BUILD_WEBSITE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +bash "$BUILD_WEBSITE_DIR/copy-assets.sh" # Move into the website directory cd website @@ -67,14 +12,14 @@ SITE_DIR=_site # Clear out the build directory rm -rf ${SITE_DIR} && mkdir ${SITE_DIR} -# Fiddle around with some files so that it works for the staging environment -# Overwrite the CNAME file +# Staging-specific config echo "staging.running-challenges.co.uk" > CNAME -# Don't set this for now -# rm -f CNAME -# Adjust the url file -sed -i -e 's/https:\/\/www.running-challenges.co.uk/https:\/\/staging.running-challenges.co.uk/' _config.yml -sed -i -e 's/Running Challenges/Running Challenges - Staging/' _config.yml +tmp_cfg="$(mktemp _config.yml.XXXXXX)" +sed 's|https://www.running-challenges.co.uk|https://staging.running-challenges.co.uk|g' _config.yml > "$tmp_cfg" +mv "$tmp_cfg" _config.yml +tmp_cfg="$(mktemp _config.yml.XXXXXX)" +sed 's|Running Challenges|Running Challenges - Staging|g' _config.yml > "$tmp_cfg" +mv "$tmp_cfg" _config.yml # Build the site bundle install @@ -95,6 +40,6 @@ git remote add staging https://${RUNNING_CHALLENGES_GITHUB_TOKEN}@github.com/fra # Create a new branch, and commit all the code git checkout -b gh-pages git add -A -git commit -m 'Travis build for staging' +git commit -m 'CI build for staging' git log -1 git push --force staging gh-pages diff --git a/build/website/build.sh b/build/website/build.sh index af1f4c69..0c8bdbc0 100755 --- a/build/website/build.sh +++ b/build/website/build.sh @@ -1,63 +1,8 @@ #!/usr/bin/env bash - -# Set up tools variables -source build/tools.sh - -# This script pushing the built copy of the this site to a staging repository - -# Use this to make a file that won't be cached if we changed the contents. -# RUNNING_CHALLENGES_DATA_COMMIT=`cd running-challenges-data && git rev-parse HEAD` - -# Enable exit on failure set -e -echo "Copying shared resources to the website folder" - -echo "Copying badges to website img/badges directory" -mkdir -p website/img/badges -cp -r images/badges/256x256/*.png website/img/badges/ - -echo "Copying flags to website img/flags directory" -mkdir -p website/img/flags -cp -r images/flags/twemoji/png/*.png website/img/flags/ - -echo "Copying logos to website img/logo directory" -mkdir -p website/img/logo -cp -r images/logo/*.png website/img/logo/ - -echo "Copying screenshots to website img/screenshots directory" -mkdir -p website/img/screenshots -cp -r images/screenshots/*.png website/img/screenshots/ - -echo "Copying third party Javascript libraries into the assets directory" -# Copy the required third party libraries from the top level shared project dir -mkdir -p website/assets/js/lib/third-party/ -cp -r js/lib/third-party/jquery website/assets/js/lib/third-party/ -cp -r js/lib/third-party/d3-voronoi website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-canvasicon website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-extramarkers website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-fullscreen website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-markercluster website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-piechart website/assets/js/lib/third-party/ - -echo "Copying third party CSS libraries into the assets directory" -# Copy the required third party libraries from the top level shared project dir -mkdir -p website/assets/css/third-party/ -cp -r css/third-party/leaflet website/assets/css/third-party/ -cp -r css/third-party/leaflet-extramarkers website/assets/css/third-party/ -cp -r css/third-party/leaflet-fullscreen website/assets/css/third-party/ -cp -r css/third-party/leaflet-markercluster website/assets/css/third-party/ - -# echo "Copying data to website" -# mkdir -p website/assets/js/lib/data -# export DATA_GEO_JS="website/assets/js/lib/data/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_geo = " > "${DATA_GEO_JS}" && cat running-challenges-data/data/parkrun-geo/parsed/geo.json >> "${DATA_GEO_JS}" -# export DATA_SPECIAL_EVENTS_JS="website/assets/js/lib/data/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_special_events = " > "${DATA_SPECIAL_EVENTS_JS}" && cat running-challenges-data/data/parkrun-special-events/2019-20/parsed/all.json >> "${DATA_SPECIAL_EVENTS_JS}" - -# Replace the placeholders in the map includes, there is probably a better way to do this -# ${SED} -i "s/data\/geo-.*.js/data\/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md -# ${SED} -i "s/data\/special-events-.*.js/data\/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md -# based on https://jekyllrb.com/docs/continuous-integration/travis-ci/ +BUILD_WEBSITE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +bash "$BUILD_WEBSITE_DIR/copy-assets.sh" # Move into the website directory cd website @@ -89,6 +34,6 @@ git remote add production https://${RUNNING_CHALLENGES_GITHUB_TOKEN}@github.com/ # Create a new branch, and commit all the code git checkout -b gh-pages git add -A -git commit -m 'Travis build for production' +git commit -m 'CI build for production' git log -1 git push --force production gh-pages diff --git a/build/website/copy-assets.sh b/build/website/copy-assets.sh index c2e888d8..8db87c8d 100644 --- a/build/website/copy-assets.sh +++ b/build/website/copy-assets.sh @@ -1,8 +1,10 @@ #!/usr/bin/env bash - -# Enable exit on failure set -e +# Run from repo root so paths (website/, images/, js/, etc.) resolve +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +cd "$ROOT_DIR" + echo "Copying shared resources to the website folder" echo "Copying badges to website img/badges directory" @@ -22,21 +24,43 @@ mkdir -p website/img/screenshots cp -r images/screenshots/*.png website/img/screenshots/ echo "Copying third party Javascript libraries into the assets directory" -# Copy the required third party libraries from the top level shared project dir mkdir -p website/assets/js/lib/third-party/ -cp -r js/lib/third-party/jquery website/assets/js/lib/third-party/ -cp -r js/lib/third-party/d3-voronoi website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-canvasicon website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-extramarkers website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-fullscreen website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-markercluster website/assets/js/lib/third-party/ -cp -r js/lib/third-party/leaflet-piechart website/assets/js/lib/third-party/ +JQ_NM="browser-extensions/extension/node_modules/jquery/dist" +mkdir -p website/assets/js/lib/third-party/jquery +cp "$JQ_NM/jquery.min.js" website/assets/js/lib/third-party/jquery/jquery-3.6.0.js +L_NM="browser-extensions/extension/node_modules/leaflet/dist" +mkdir -p website/assets/js/lib/third-party/leaflet +cp "$L_NM/leaflet.js" website/assets/js/lib/third-party/leaflet/leaflet-1.3.1.js +D3_NM="browser-extensions/extension/node_modules/d3-voronoi/dist" +mkdir -p website/assets/js/lib/third-party/d3-voronoi +cp "$D3_NM/d3-voronoi.js" website/assets/js/lib/third-party/d3-voronoi/d3-voronoi.js +LEM_DIST="browser-extensions/extension/node_modules/leaflet-extra-markers/dist" +mkdir -p website/assets/js/lib/third-party/leaflet-extramarkers +cp "$LEM_DIST/js/leaflet.extra-markers.min.js" website/assets/js/lib/third-party/leaflet-extramarkers/leaflet-extramarkers-1.0.6.js +LFS_NM="browser-extensions/extension/node_modules/leaflet.fullscreen" +mkdir -p website/assets/js/lib/third-party/leaflet-fullscreen +cp "$LFS_NM/Control.FullScreen.js" website/assets/js/lib/third-party/leaflet-fullscreen/leaflet-fullscreen-1.1.0.js +LM_NM="browser-extensions/extension/node_modules/leaflet.markercluster/dist" +mkdir -p website/assets/js/lib/third-party/leaflet-markercluster +cp "$LM_NM/leaflet.markercluster.js" website/assets/js/lib/third-party/leaflet-markercluster/leaflet-markercluster-1.3.0.js +LCI_NM="browser-extensions/extension/node_modules/leaflet-canvasicon" +mkdir -p website/assets/js/lib/third-party/leaflet-canvasicon +cp "$LCI_NM/leaflet-canvasicon.js" website/assets/js/lib/third-party/leaflet-canvasicon/leaflet-canvasicon-0.1.6.js +LPC_NM="browser-extensions/extension/node_modules/leaflet-piechart" +mkdir -p website/assets/js/lib/third-party/leaflet-piechart +cp "$LPC_NM/leaflet-piechart.js" website/assets/js/lib/third-party/leaflet-piechart/leaflet-piechart-0.1.2.js echo "Copying third party CSS libraries into the assets directory" -# Copy the required third party libraries from the top level shared project dir mkdir -p website/assets/css/third-party/ -cp -r css/third-party/leaflet website/assets/css/third-party/ -cp -r css/third-party/leaflet-extramarkers website/assets/css/third-party/ -cp -r css/third-party/leaflet-fullscreen website/assets/css/third-party/ -cp -r css/third-party/leaflet-markercluster website/assets/css/third-party/ +mkdir -p website/assets/css/third-party/leaflet +cp "$L_NM/leaflet.css" website/assets/css/third-party/leaflet/ +cp -r "$L_NM/images" website/assets/css/third-party/leaflet/ +mkdir -p website/assets/css/third-party/leaflet-extramarkers/images +cp "$LEM_DIST/css/leaflet.extra-markers.min.css" website/assets/css/third-party/leaflet-extramarkers/leaflet.extra-markers.css +sed 's|url("../img/|url("images/|g' website/assets/css/third-party/leaflet-extramarkers/leaflet.extra-markers.css > website/assets/css/third-party/leaflet-extramarkers/leaflet.extra-markers.css.tmp && mv website/assets/css/third-party/leaflet-extramarkers/leaflet.extra-markers.css.tmp website/assets/css/third-party/leaflet-extramarkers/leaflet.extra-markers.css +cp "$LEM_DIST/img/"*.png website/assets/css/third-party/leaflet-extramarkers/images/ +mkdir -p website/assets/css/third-party/leaflet-fullscreen +cp "$LFS_NM/Control.FullScreen.css" website/assets/css/third-party/leaflet-fullscreen/leaflet-fullscreen.css +cp "$LFS_NM/icon-fullscreen.png" "$LFS_NM/icon-fullscreen-2x.png" website/assets/css/third-party/leaflet-fullscreen/ +mkdir -p website/assets/css/third-party/leaflet-markercluster +cp "$LM_NM/MarkerCluster.css" "$LM_NM/MarkerCluster.Default.css" website/assets/css/third-party/leaflet-markercluster/ diff --git a/build_all.sh b/build_all.sh index 7596021a..17ad8ce5 100755 --- a/build_all.sh +++ b/build_all.sh @@ -1,7 +1,11 @@ -#!/bin/bash -xe +#!/usr/bin/env bash +set -euo pipefail -# Build Firefox add-on -./build/extension-firefox/build.sh +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "$ROOT_DIR" -# Build Chrome extension -./build/extension-chrome/build.sh +# shellcheck source=build/version.sh +source build/version.sh +export EXTENSION_BUILD_VERSION EXTENSION_BUILD_ID + +pnpm --filter running-challenges-extension run build:extension diff --git a/css/third-party/leaflet-extramarkers/images/markers_default.png b/css/third-party/leaflet-extramarkers/images/markers_default.png deleted file mode 100755 index 2c81d15b..00000000 Binary files a/css/third-party/leaflet-extramarkers/images/markers_default.png and /dev/null differ diff --git a/css/third-party/leaflet-extramarkers/images/markers_default@2x.png b/css/third-party/leaflet-extramarkers/images/markers_default@2x.png deleted file mode 100755 index 35ff61b5..00000000 Binary files a/css/third-party/leaflet-extramarkers/images/markers_default@2x.png and /dev/null differ diff --git a/css/third-party/leaflet-extramarkers/images/markers_shadow.png b/css/third-party/leaflet-extramarkers/images/markers_shadow.png deleted file mode 100755 index 33cf9550..00000000 Binary files a/css/third-party/leaflet-extramarkers/images/markers_shadow.png and /dev/null differ diff --git a/css/third-party/leaflet-extramarkers/images/markers_shadow@2x.png b/css/third-party/leaflet-extramarkers/images/markers_shadow@2x.png deleted file mode 100755 index 1116503f..00000000 Binary files a/css/third-party/leaflet-extramarkers/images/markers_shadow@2x.png and /dev/null differ diff --git a/css/third-party/leaflet-extramarkers/leaflet.extra-markers.css b/css/third-party/leaflet-extramarkers/leaflet.extra-markers.css deleted file mode 100644 index 72e7e71c..00000000 --- a/css/third-party/leaflet-extramarkers/leaflet.extra-markers.css +++ /dev/null @@ -1,231 +0,0 @@ -/*! - * Leaflet.extra-markers - * Custom Markers for Leaflet JS based on Awesome Markers - * Leaflet ExtraMarkers - * https://github.com/coryasilva/Leaflet.ExtraMarkers/ - * @author coryasilva - * @version 1.0.6 - */ -/* Marker setup */ -.extra-marker { - background: url('images/markers_default.png') no-repeat 0 0; - width: 35px; - height: 46px; - position: absolute; - left: 0; - top: 0; - display: block; - text-align: center; -} -.extra-marker-shadow { - background: url('images/markers_shadow.png') no-repeat 0 0; - width: 36px; - height: 16px; -} -/* Retina displays */ -@media (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (-webkit-min-device-pixel-ratio: 1.5), (min-device-pixel-ratio: 1.5), (min-resolution: 1.5dppx) { - .extra-marker { - background-image: url('images/markers_default@2x.png'); - background-size: 540px 184px; - } - .extra-marker-shadow { - background-image: url('images/markers_shadow@2x.png'); - background-size: 35px 16px; - } -} -/* Icons */ -.extra-marker i { - color: #fff; - margin-top: 10px; - display: inline-block; - font-size: 14px; -} -/* Semantic UI Fix */ -.extra-marker i.icon { - margin-right: 0; - opacity: 1; -} -/* Sprites setup */ -.extra-marker-circle-red { - background-position: 0 0; -} -.extra-marker-circle-orange-dark { - background-position: -36px 0; -} -.extra-marker-circle-orange { - background-position: -72px 0; -} -.extra-marker-circle-yellow { - background-position: -108px 0; -} -.extra-marker-circle-blue-dark { - background-position: -144px 0; -} -.extra-marker-circle-blue { - background-position: -180px 0; -} -.extra-marker-circle-cyan { - background-position: -216px 0; -} -.extra-marker-circle-purple { - background-position: -252px 0; -} -.extra-marker-circle-violet { - background-position: -288px 0; -} -.extra-marker-circle-pink { - background-position: -324px 0; -} -.extra-marker-circle-green-dark { - background-position: -360px 0; -} -.extra-marker-circle-green { - background-position: -396px 0; -} -.extra-marker-circle-green-light { - background-position: -432px 0; -} -.extra-marker-circle-black { - background-position: -468px 0; -} -.extra-marker-circle-white { - background-position: -504px 0; -} -.extra-marker-square-red { - background-position: 0 -46px; -} -.extra-marker-square-orange-dark { - background-position: -36px -46px; -} -.extra-marker-square-orange { - background-position: -72px -46px; -} -.extra-marker-square-yellow { - background-position: -108px -46px; -} -.extra-marker-square-blue-dark { - background-position: -144px -46px; -} -.extra-marker-square-blue { - background-position: -180px -46px; -} -.extra-marker-square-cyan { - background-position: -216px -46px; -} -.extra-marker-square-purple { - background-position: -252px -46px; -} -.extra-marker-square-violet { - background-position: -288px -46px; -} -.extra-marker-square-pink { - background-position: -324px -46px; -} -.extra-marker-square-green-dark { - background-position: -360px -46px; -} -.extra-marker-square-green { - background-position: -396px -46px; -} -.extra-marker-square-green-light { - background-position: -432px -46px; -} -.extra-marker-square-black { - background-position: -468px -46px; -} -.extra-marker-square-white { - background-position: -504px -46px; -} -.extra-marker-star-red { - background-position: 0 -92px; -} -.extra-marker-star-orange-dark { - background-position: -36px -92px; -} -.extra-marker-star-orange { - background-position: -72px -92px; -} -.extra-marker-star-yellow { - background-position: -108px -92px; -} -.extra-marker-star-blue-dark { - background-position: -144px -92px; -} -.extra-marker-star-blue { - background-position: -180px -92px; -} -.extra-marker-star-cyan { - background-position: -216px -92px; -} -.extra-marker-star-purple { - background-position: -252px -92px; -} -.extra-marker-star-violet { - background-position: -288px -92px; -} -.extra-marker-star-pink { - background-position: -324px -92px; -} -.extra-marker-star-green-dark { - background-position: -360px -92px; -} -.extra-marker-star-green { - background-position: -396px -92px; -} -.extra-marker-star-green-light { - background-position: -432px -92px; -} -.extra-marker-star-black { - background-position: -468px -92px; -} -.extra-marker-star-white { - background-position: -504px -92px; -} -.extra-marker-penta-red { - background-position: 0 -138px; -} -.extra-marker-penta-orange-dark { - background-position: -36px -138px; -} -.extra-marker-penta-orange { - background-position: -72px -138px; -} -.extra-marker-penta-yellow { - background-position: -108px -138px; -} -.extra-marker-penta-blue-dark { - background-position: -144px -138px; -} -.extra-marker-penta-blue { - background-position: -180px -138px; -} -.extra-marker-penta-cyan { - background-position: -216px -138px; -} -.extra-marker-penta-purple { - background-position: -252px -138px; -} -.extra-marker-penta-violet { - background-position: -288px -138px; -} -.extra-marker-penta-pink { - background-position: -324px -138px; -} -.extra-marker-penta-green-dark { - background-position: -360px -138px; -} -.extra-marker-penta-green { - background-position: -396px -138px; -} -.extra-marker-penta-green-light { - background-position: -432px -138px; -} -.extra-marker-penta-black { - background-position: -468px -138px; -} -.extra-marker-penta-white { - background-position: -504px -138px; -} -.extra-marker .fa-number:before { - content: attr(number); -} diff --git a/css/third-party/leaflet-fullscreen/images/fullscreen.png b/css/third-party/leaflet-fullscreen/images/fullscreen.png deleted file mode 100644 index 7384960a..00000000 Binary files a/css/third-party/leaflet-fullscreen/images/fullscreen.png and /dev/null differ diff --git a/css/third-party/leaflet-fullscreen/images/fullscreen@2x.png b/css/third-party/leaflet-fullscreen/images/fullscreen@2x.png deleted file mode 100644 index 9fca7f87..00000000 Binary files a/css/third-party/leaflet-fullscreen/images/fullscreen@2x.png and /dev/null differ diff --git a/css/third-party/leaflet-fullscreen/leaflet-fullscreen.css b/css/third-party/leaflet-fullscreen/leaflet-fullscreen.css deleted file mode 100644 index 059d83ef..00000000 --- a/css/third-party/leaflet-fullscreen/leaflet-fullscreen.css +++ /dev/null @@ -1,40 +0,0 @@ -.leaflet-control-fullscreen a { - background:#fff url('images/fullscreen.png') no-repeat 0 0; - background-size:26px 52px; - } - .leaflet-touch .leaflet-control-fullscreen a { - background-position: 2px 2px; - } - .leaflet-fullscreen-on .leaflet-control-fullscreen a { - background-position:0 -26px; - } - .leaflet-touch.leaflet-fullscreen-on .leaflet-control-fullscreen a { - background-position: 2px -24px; - } - -/* Do not combine these two rules; IE will break. */ -.leaflet-container:-webkit-full-screen { - width:100%!important; - height:100%!important; - } -.leaflet-container.leaflet-fullscreen-on { - width:100%!important; - height:100%!important; - } - -.leaflet-pseudo-fullscreen { - position:fixed!important; - width:100%!important; - height:100%!important; - top:0!important; - left:0!important; - z-index:99999; - } - -@media - (-webkit-min-device-pixel-ratio:2), - (min-resolution:192dpi) { - .leaflet-control-fullscreen a { - background-image: url('images/fullscreen@2x.png'); - } - } diff --git a/css/third-party/leaflet-markercluster/MarkerCluster.Default.css b/css/third-party/leaflet-markercluster/MarkerCluster.Default.css deleted file mode 100755 index c9a1465f..00000000 --- a/css/third-party/leaflet-markercluster/MarkerCluster.Default.css +++ /dev/null @@ -1,86 +0,0 @@ -/* .marker-cluster-small { - background-color: rgba(181, 226, 140, 0.6); - } -.marker-cluster-small div { - background-color: rgba(110, 204, 57, 0.6); - } - -.marker-cluster-medium { - background-color: rgba(241, 211, 87, 0.6); - } -.marker-cluster-medium div { - background-color: rgba(240, 194, 12, 0.6); - } -*/ -.marker-cluster-small { - background-color: rgba(30, 131, 206, 0.6); - } -.marker-cluster-small div { - background-color: rgba(50, 169, 221, 0.6); - } - -.marker-cluster-medium { - background-color: rgba(30, 131, 206, 0.6); - } -.marker-cluster-medium div { - background-color: rgba(50, 169, 221, 0.6); - } - -.marker-cluster-large { - background-color: rgba(30, 131, 206, 0.6); - } -.marker-cluster-large div { - background-color: rgba(50, 169, 221, 0.6); - } -/* .marker-cluster-large { - background-color: rgba(253, 156, 115, 0.6); - } -.marker-cluster-large div { - background-color: rgba(241, 128, 23, 0.6); - } */ -.running-challenges-incomplete-cluster { - background-color: rgba(253, 156, 115, 0.6); - } -.running-challenges-incomplete-cluster div { - background-color: rgba(241, 128, 23, 0.6); - } - - /* IE 6-8 fallback colors */ -.leaflet-oldie .marker-cluster-small { - background-color: rgb(181, 226, 140); - } -.leaflet-oldie .marker-cluster-small div { - background-color: rgb(110, 204, 57); - } - -.leaflet-oldie .marker-cluster-medium { - background-color: rgb(241, 211, 87); - } -.leaflet-oldie .marker-cluster-medium div { - background-color: rgb(240, 194, 12); - } - -.leaflet-oldie .marker-cluster-large { - background-color: rgb(253, 156, 115); - } -.leaflet-oldie .marker-cluster-large div { - background-color: rgb(241, 128, 23); -} - -.marker-cluster { - background-clip: padding-box; - border-radius: 20px; - } -.marker-cluster div { - width: 30px; - height: 30px; - margin-left: 5px; - margin-top: 5px; - - text-align: center; - border-radius: 15px; - font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif; - } -.marker-cluster span { - line-height: 30px; - } diff --git a/css/third-party/leaflet-markercluster/MarkerCluster.css b/css/third-party/leaflet-markercluster/MarkerCluster.css deleted file mode 100755 index c60d71b7..00000000 --- a/css/third-party/leaflet-markercluster/MarkerCluster.css +++ /dev/null @@ -1,14 +0,0 @@ -.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow { - -webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in; - -moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in; - -o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in; - transition: transform 0.3s ease-out, opacity 0.3s ease-in; -} - -.leaflet-cluster-spider-leg { - /* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */ - -webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in; - -moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in; - -o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in; - transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in; -} diff --git a/css/third-party/leaflet/images/layers-2x.png b/css/third-party/leaflet/images/layers-2x.png deleted file mode 100644 index 200c333d..00000000 Binary files a/css/third-party/leaflet/images/layers-2x.png and /dev/null differ diff --git a/css/third-party/leaflet/images/layers.png b/css/third-party/leaflet/images/layers.png deleted file mode 100644 index 1a72e578..00000000 Binary files a/css/third-party/leaflet/images/layers.png and /dev/null differ diff --git a/css/third-party/leaflet/images/marker-icon-2x.png b/css/third-party/leaflet/images/marker-icon-2x.png deleted file mode 100644 index 88f9e501..00000000 Binary files a/css/third-party/leaflet/images/marker-icon-2x.png and /dev/null differ diff --git a/css/third-party/leaflet/images/marker-icon.png b/css/third-party/leaflet/images/marker-icon.png deleted file mode 100644 index 950edf24..00000000 Binary files a/css/third-party/leaflet/images/marker-icon.png and /dev/null differ diff --git a/css/third-party/leaflet/images/marker-shadow.png b/css/third-party/leaflet/images/marker-shadow.png deleted file mode 100644 index 9fd29795..00000000 Binary files a/css/third-party/leaflet/images/marker-shadow.png and /dev/null differ diff --git a/css/third-party/leaflet/leaflet.css b/css/third-party/leaflet/leaflet.css deleted file mode 100644 index 8704e8ef..00000000 --- a/css/third-party/leaflet/leaflet.css +++ /dev/null @@ -1,636 +0,0 @@ -/* required styles */ - -.leaflet-pane, -.leaflet-tile, -.leaflet-marker-icon, -.leaflet-marker-shadow, -.leaflet-tile-container, -.leaflet-pane > svg, -.leaflet-pane > canvas, -.leaflet-zoom-box, -.leaflet-image-layer, -.leaflet-layer { - position: absolute; - left: 0; - top: 0; - } -.leaflet-container { - overflow: hidden; - } -.leaflet-tile, -.leaflet-marker-icon, -.leaflet-marker-shadow { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - -webkit-user-drag: none; - } -/* Safari renders non-retina tile on retina better with this, but Chrome is worse */ -.leaflet-safari .leaflet-tile { - image-rendering: -webkit-optimize-contrast; - } -/* hack that prevents hw layers "stretching" when loading new tiles */ -.leaflet-safari .leaflet-tile-container { - width: 1600px; - height: 1600px; - -webkit-transform-origin: 0 0; - } -.leaflet-marker-icon, -.leaflet-marker-shadow { - display: block; - } -/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */ -/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */ -.leaflet-container .leaflet-overlay-pane svg, -.leaflet-container .leaflet-marker-pane img, -.leaflet-container .leaflet-shadow-pane img, -.leaflet-container .leaflet-tile-pane img, -.leaflet-container img.leaflet-image-layer { - max-width: none !important; - max-height: none !important; - } - -.leaflet-container.leaflet-touch-zoom { - -ms-touch-action: pan-x pan-y; - touch-action: pan-x pan-y; - } -.leaflet-container.leaflet-touch-drag { - -ms-touch-action: pinch-zoom; - /* Fallback for FF which doesn't support pinch-zoom */ - touch-action: none; - touch-action: pinch-zoom; -} -.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { - -ms-touch-action: none; - touch-action: none; -} -.leaflet-container { - -webkit-tap-highlight-color: transparent; -} -.leaflet-container a { - -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4); -} -.leaflet-tile { - filter: inherit; - visibility: hidden; - } -.leaflet-tile-loaded { - visibility: inherit; - } -.leaflet-zoom-box { - width: 0; - height: 0; - -moz-box-sizing: border-box; - box-sizing: border-box; - z-index: 800; - } -/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */ -.leaflet-overlay-pane svg { - -moz-user-select: none; - } - -.leaflet-pane { z-index: 400; } - -.leaflet-tile-pane { z-index: 200; } -.leaflet-overlay-pane { z-index: 400; } -.leaflet-shadow-pane { z-index: 500; } -.leaflet-marker-pane { z-index: 600; } -.leaflet-tooltip-pane { z-index: 650; } -.leaflet-popup-pane { z-index: 700; } - -.leaflet-map-pane canvas { z-index: 100; } -.leaflet-map-pane svg { z-index: 200; } - -.leaflet-vml-shape { - width: 1px; - height: 1px; - } -.lvml { - behavior: url(#default#VML); - display: inline-block; - position: absolute; - } - - -/* control positioning */ - -.leaflet-control { - position: relative; - z-index: 800; - pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ - pointer-events: auto; - } -.leaflet-top, -.leaflet-bottom { - position: absolute; - z-index: 1000; - pointer-events: none; - } -.leaflet-top { - top: 0; - } -.leaflet-right { - right: 0; - } -.leaflet-bottom { - bottom: 0; - } -.leaflet-left { - left: 0; - } -.leaflet-control { - float: left; - clear: both; - } -.leaflet-right .leaflet-control { - float: right; - } -.leaflet-top .leaflet-control { - margin-top: 10px; - } -.leaflet-bottom .leaflet-control { - margin-bottom: 10px; - } -.leaflet-left .leaflet-control { - margin-left: 10px; - } -.leaflet-right .leaflet-control { - margin-right: 10px; - } - - -/* zoom and fade animations */ - -.leaflet-fade-anim .leaflet-tile { - will-change: opacity; - } -.leaflet-fade-anim .leaflet-popup { - opacity: 0; - -webkit-transition: opacity 0.2s linear; - -moz-transition: opacity 0.2s linear; - -o-transition: opacity 0.2s linear; - transition: opacity 0.2s linear; - } -.leaflet-fade-anim .leaflet-map-pane .leaflet-popup { - opacity: 1; - } -.leaflet-zoom-animated { - -webkit-transform-origin: 0 0; - -ms-transform-origin: 0 0; - transform-origin: 0 0; - } -.leaflet-zoom-anim .leaflet-zoom-animated { - will-change: transform; - } -.leaflet-zoom-anim .leaflet-zoom-animated { - -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); - -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1); - -o-transition: -o-transform 0.25s cubic-bezier(0,0,0.25,1); - transition: transform 0.25s cubic-bezier(0,0,0.25,1); - } -.leaflet-zoom-anim .leaflet-tile, -.leaflet-pan-anim .leaflet-tile { - -webkit-transition: none; - -moz-transition: none; - -o-transition: none; - transition: none; - } - -.leaflet-zoom-anim .leaflet-zoom-hide { - visibility: hidden; - } - - -/* cursors */ - -.leaflet-interactive { - cursor: pointer; - } -.leaflet-grab { - cursor: -webkit-grab; - cursor: -moz-grab; - } -.leaflet-crosshair, -.leaflet-crosshair .leaflet-interactive { - cursor: crosshair; - } -.leaflet-popup-pane, -.leaflet-control { - cursor: auto; - } -.leaflet-dragging .leaflet-grab, -.leaflet-dragging .leaflet-grab .leaflet-interactive, -.leaflet-dragging .leaflet-marker-draggable { - cursor: move; - cursor: -webkit-grabbing; - cursor: -moz-grabbing; - } - -/* marker & overlays interactivity */ -.leaflet-marker-icon, -.leaflet-marker-shadow, -.leaflet-image-layer, -.leaflet-pane > svg path, -.leaflet-tile-container { - pointer-events: none; - } - -.leaflet-marker-icon.leaflet-interactive, -.leaflet-image-layer.leaflet-interactive, -.leaflet-pane > svg path.leaflet-interactive { - pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ - pointer-events: auto; - } - -/* visual tweaks */ - -.leaflet-container { - background: #ddd; - outline: 0; - } -.leaflet-container a { - color: #0078A8; - } -.leaflet-container a.leaflet-active { - outline: 2px solid orange; - } -.leaflet-zoom-box { - border: 2px dotted #38f; - background: rgba(255,255,255,0.5); - } - - -/* general typography */ -.leaflet-container { - font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif; - } - - -/* general toolbar styles */ - -.leaflet-bar { - box-shadow: 0 1px 5px rgba(0,0,0,0.65); - border-radius: 4px; - } -.leaflet-bar a, -.leaflet-bar a:hover { - background-color: #fff; - border-bottom: 1px solid #ccc; - width: 26px; - height: 26px; - line-height: 26px; - display: block; - text-align: center; - text-decoration: none; - color: black; - } -.leaflet-bar a, -.leaflet-control-layers-toggle { - background-position: 50% 50%; - background-repeat: no-repeat; - display: block; - } -.leaflet-bar a:hover { - background-color: #f4f4f4; - } -.leaflet-bar a:first-child { - border-top-left-radius: 4px; - border-top-right-radius: 4px; - } -.leaflet-bar a:last-child { - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - border-bottom: none; - } -.leaflet-bar a.leaflet-disabled { - cursor: default; - background-color: #f4f4f4; - color: #bbb; - } - -.leaflet-touch .leaflet-bar a { - width: 30px; - height: 30px; - line-height: 30px; - } -.leaflet-touch .leaflet-bar a:first-child { - border-top-left-radius: 2px; - border-top-right-radius: 2px; - } -.leaflet-touch .leaflet-bar a:last-child { - border-bottom-left-radius: 2px; - border-bottom-right-radius: 2px; - } - -/* zoom control */ - -.leaflet-control-zoom-in, -.leaflet-control-zoom-out { - font: bold 18px 'Lucida Console', Monaco, monospace; - text-indent: 1px; - } - -.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out { - font-size: 22px; - } - - -/* layers control */ - -.leaflet-control-layers { - box-shadow: 0 1px 5px rgba(0,0,0,0.4); - background: #fff; - border-radius: 5px; - } -.leaflet-control-layers-toggle { - background-image: url('images/layers.png'); - width: 36px; - height: 36px; - } -.leaflet-retina .leaflet-control-layers-toggle { - background-image: url('images/layers-2x.png'); - background-size: 26px 26px; - } -.leaflet-touch .leaflet-control-layers-toggle { - width: 44px; - height: 44px; - } -.leaflet-control-layers .leaflet-control-layers-list, -.leaflet-control-layers-expanded .leaflet-control-layers-toggle { - display: none; - } -.leaflet-control-layers-expanded .leaflet-control-layers-list { - display: block; - position: relative; - } -.leaflet-control-layers-expanded { - padding: 6px 10px 6px 6px; - color: #333; - background: #fff; - } -.leaflet-control-layers-scrollbar { - overflow-y: scroll; - overflow-x: hidden; - padding-right: 5px; - } -.leaflet-control-layers-selector { - margin-top: 2px; - position: relative; - top: 1px; - } -.leaflet-control-layers label { - display: block; - } -.leaflet-control-layers-separator { - height: 0; - border-top: 1px solid #ddd; - margin: 5px -10px 5px -6px; - } - -/* Default icon URLs */ -.leaflet-default-icon-path { - background-image: url('images/marker-icon.png'); - } - - -/* attribution and scale controls */ - -.leaflet-container .leaflet-control-attribution { - background: #fff; - background: rgba(255, 255, 255, 0.7); - margin: 0; - } -.leaflet-control-attribution, -.leaflet-control-scale-line { - padding: 0 5px; - color: #333; - } -.leaflet-control-attribution a { - text-decoration: none; - } -.leaflet-control-attribution a:hover { - text-decoration: underline; - } -.leaflet-container .leaflet-control-attribution, -.leaflet-container .leaflet-control-scale { - font-size: 11px; - } -.leaflet-left .leaflet-control-scale { - margin-left: 5px; - } -.leaflet-bottom .leaflet-control-scale { - margin-bottom: 5px; - } -.leaflet-control-scale-line { - border: 2px solid #777; - border-top: none; - line-height: 1.1; - padding: 2px 5px 1px; - font-size: 11px; - white-space: nowrap; - overflow: hidden; - -moz-box-sizing: border-box; - box-sizing: border-box; - - background: #fff; - background: rgba(255, 255, 255, 0.5); - } -.leaflet-control-scale-line:not(:first-child) { - border-top: 2px solid #777; - border-bottom: none; - margin-top: -2px; - } -.leaflet-control-scale-line:not(:first-child):not(:last-child) { - border-bottom: 2px solid #777; - } - -.leaflet-touch .leaflet-control-attribution, -.leaflet-touch .leaflet-control-layers, -.leaflet-touch .leaflet-bar { - box-shadow: none; - } -.leaflet-touch .leaflet-control-layers, -.leaflet-touch .leaflet-bar { - border: 2px solid rgba(0,0,0,0.2); - background-clip: padding-box; - } - - -/* popup */ - -.leaflet-popup { - position: absolute; - text-align: center; - margin-bottom: 20px; - } -.leaflet-popup-content-wrapper { - padding: 1px; - text-align: left; - border-radius: 12px; - } -.leaflet-popup-content { - margin: 13px 19px; - line-height: 1.4; - } -.leaflet-popup-content p { - margin: 18px 0; - } -.leaflet-popup-tip-container { - width: 40px; - height: 20px; - position: absolute; - left: 50%; - margin-left: -20px; - overflow: hidden; - pointer-events: none; - } -.leaflet-popup-tip { - width: 17px; - height: 17px; - padding: 1px; - - margin: -10px auto 0; - - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -ms-transform: rotate(45deg); - -o-transform: rotate(45deg); - transform: rotate(45deg); - } -.leaflet-popup-content-wrapper, -.leaflet-popup-tip { - background: white; - color: #333; - box-shadow: 0 3px 14px rgba(0,0,0,0.4); - } -.leaflet-container a.leaflet-popup-close-button { - position: absolute; - top: 0; - right: 0; - padding: 4px 4px 0 0; - border: none; - text-align: center; - width: 18px; - height: 14px; - font: 16px/14px Tahoma, Verdana, sans-serif; - color: #c3c3c3; - text-decoration: none; - font-weight: bold; - background: transparent; - } -.leaflet-container a.leaflet-popup-close-button:hover { - color: #999; - } -.leaflet-popup-scrolled { - overflow: auto; - border-bottom: 1px solid #ddd; - border-top: 1px solid #ddd; - } - -.leaflet-oldie .leaflet-popup-content-wrapper { - zoom: 1; - } -.leaflet-oldie .leaflet-popup-tip { - width: 24px; - margin: 0 auto; - - -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; - filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); - } -.leaflet-oldie .leaflet-popup-tip-container { - margin-top: -1px; - } - -.leaflet-oldie .leaflet-control-zoom, -.leaflet-oldie .leaflet-control-layers, -.leaflet-oldie .leaflet-popup-content-wrapper, -.leaflet-oldie .leaflet-popup-tip { - border: 1px solid #999; - } - - -/* div icon */ - -.leaflet-div-icon { - background: #fff; - border: 1px solid #666; - } - - -/* Tooltip */ -/* Base styles for the element that has a tooltip */ -.leaflet-tooltip { - position: absolute; - padding: 6px; - background-color: #fff; - border: 1px solid #fff; - border-radius: 3px; - color: #222; - white-space: nowrap; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - pointer-events: none; - box-shadow: 0 1px 3px rgba(0,0,0,0.4); - } -.leaflet-tooltip.leaflet-clickable { - cursor: pointer; - pointer-events: auto; - } -.leaflet-tooltip-top:before, -.leaflet-tooltip-bottom:before, -.leaflet-tooltip-left:before, -.leaflet-tooltip-right:before { - position: absolute; - pointer-events: none; - border: 6px solid transparent; - background: transparent; - content: ""; - } - -/* Directions */ - -.leaflet-tooltip-bottom { - margin-top: 6px; -} -.leaflet-tooltip-top { - margin-top: -6px; -} -.leaflet-tooltip-bottom:before, -.leaflet-tooltip-top:before { - left: 50%; - margin-left: -6px; - } -.leaflet-tooltip-top:before { - bottom: 0; - margin-bottom: -12px; - border-top-color: #fff; - } -.leaflet-tooltip-bottom:before { - top: 0; - margin-top: -12px; - margin-left: -6px; - border-bottom-color: #fff; - } -.leaflet-tooltip-left { - margin-left: -6px; -} -.leaflet-tooltip-right { - margin-left: 6px; -} -.leaflet-tooltip-left:before, -.leaflet-tooltip-right:before { - top: 50%; - margin-top: -6px; - } -.leaflet-tooltip-left:before { - right: 0; - margin-right: -12px; - border-left-color: #fff; - } -.leaflet-tooltip-right:before { - left: 0; - margin-left: -12px; - border-right-color: #fff; - } diff --git a/docs/plan-third-party-css.md b/docs/plan-third-party-css.md new file mode 100644 index 00000000..1acdd1e9 --- /dev/null +++ b/docs/plan-third-party-css.md @@ -0,0 +1,53 @@ +# Plan: Finish third-party CSS (source from npm) + +## Current state (after implementation) + +- **Leaflet core**: CSS and images come from npm in the build (`leaflet/dist/leaflet.css`, `leaflet/dist/images`). +- **leaflet.fullscreen**: CSS and icons from npm (`Control.FullScreen.css`, `icon-fullscreen*.png`). +- **leaflet.markercluster**: CSS from npm (`MarkerCluster.css`, `MarkerCluster.Default.css`). +- **leaflet-extramarkers**: **Done.** CSS and images are sourced from the `leaflet-extra-markers` npm package in the build script; extension URL rewriting is done in-script. The vendored `css/third-party/leaflet-extramarkers` directory has been removed. + +The only remaining “third-party CSS” to finish was **leaflet-extramarkers**; it is now sourced from npm with in-build URL rewriting. + +## Goal + +1. Source leaflet-extramarkers **CSS and images** from `node_modules/leaflet-extra-markers` (e.g. `dist/` or equivalent) in the build, same as we do for JS. +2. Keep extension URL rewriting (Chrome vs Firefox) so marker images load correctly in the extension context. +3. Remove the vendored `css/third-party/leaflet-extramarkers` from the repo. + +## Steps + +### 1. Confirm npm package layout + +- From repo root (or `browser-extensions/extension` where `nm` points): inspect `node_modules/leaflet-extra-markers` (or the pnpm-linked path). +- Find: + - CSS file (e.g. `dist/leaflet.extra-markers.css` or `dist/css/...`). + - Image directory and filenames (e.g. `images/markers_default.png`, `markers_shadow.png`, `*@2x.png`). The package uses `img/`; we copy to `images/` and rewrite URLs in the build script. + +### 2. Change the build script + +- **Current:** `cp -r css/third-party/leaflet-extramarkers "${buildDir}/css/third-party/"` (from repo root). +- **New:** + - Copy leaflet-extramarkers **CSS** from npm into `"${buildDir}/css/third-party/leaflet-extramarkers/"` (e.g. to `leaflet.extra-markers.css`). + - Copy leaflet-extramarkers **images** from npm into `"${buildDir}/css/third-party/leaflet-extramarkers/images/"` (same path the CSS expects after rewriting). +- After copying, read the CSS in Node, replace `url("../img/...")` with the appropriate `chrome-extension://` or `moz-extension://` URL, and write the result. + +### 3. Verify and remove vendored CSS + +- Run the full extension build and load in Chrome and Firefox; confirm marker icons (e.g. on the explorer map) render. +- Run the Playwright UI tests (including “Leaflet markers load with icons (no network)”) to guard regressions. +- Remove the vendored directory at repo root: `css/third-party/leaflet-extramarkers/`. + +### 4. Update docs + +- **pnpm-migration.md**: State that leaflet-extramarkers (and other third-party) CSS/images are sourced from npm with in-build URL rewriting. + +## Risks / notes + +- **Image path mismatch**: If the npm package uses `img/` instead of `images/`, copy or symlink into `images/` in the build so the rewritten CSS still matches. +- **No other vendored CSS**: After this, there are no remaining vendored third-party assets in the plan; leaflet-piechart is sourced from GitHub via pnpm. No further “third-party CSS” to migrate for the current plan. + +## Out of scope (unchanged) + +- leaflet-canvasicon and leaflet-piechart are from npm / GitHub (pnpm); no vendored JS remains. +- No new bundler or build tool; we only change where leaflet-extramarkers CSS/images come from and how extension URLs are applied. diff --git a/images/screenshots/runner_page.png b/images/screenshots/runner_page.png index e477876d..65fd7e26 100644 Binary files a/images/screenshots/runner_page.png and b/images/screenshots/runner_page.png differ diff --git a/images/screenshots/screenshot-01-badges.png b/images/screenshots/screenshot-01-badges.png index 5d460beb..342a91f5 100644 Binary files a/images/screenshots/screenshot-01-badges.png and b/images/screenshots/screenshot-01-badges.png differ diff --git a/images/screenshots/screenshot-02-table.png b/images/screenshots/screenshot-02-table.png index bab33c3a..c8468439 100644 Binary files a/images/screenshots/screenshot-02-table.png and b/images/screenshots/screenshot-02-table.png differ diff --git a/images/screenshots/screenshot-03-badges-inc-volunteer.png b/images/screenshots/screenshot-03-badges-inc-volunteer.png index 31fe6de2..769098d5 100644 Binary files a/images/screenshots/screenshot-03-badges-inc-volunteer.png and b/images/screenshots/screenshot-03-badges-inc-volunteer.png differ diff --git a/images/screenshots/screenshot-04-volunteer-challenges.png b/images/screenshots/screenshot-04-volunteer-challenges.png index f0cde06d..33a4a059 100644 Binary files a/images/screenshots/screenshot-04-volunteer-challenges.png and b/images/screenshots/screenshot-04-volunteer-challenges.png differ diff --git a/images/screenshots/screenshot-05-table.png b/images/screenshots/screenshot-05-table.png deleted file mode 100644 index c2f5b593..00000000 Binary files a/images/screenshots/screenshot-05-table.png and /dev/null differ diff --git a/images/screenshots/screenshot-06-badges-inc-flags.png b/images/screenshots/screenshot-06-badges-inc-flags.png index 413a6a28..bcea2c5e 100644 Binary files a/images/screenshots/screenshot-06-badges-inc-flags.png and b/images/screenshots/screenshot-06-badges-inc-flags.png differ diff --git a/images/screenshots/screenshot-07-regionnaire-map.png b/images/screenshots/screenshot-07-regionnaire-map.png deleted file mode 100644 index 1865b1a8..00000000 Binary files a/images/screenshots/screenshot-07-regionnaire-map.png and /dev/null differ diff --git a/images/screenshots/screenshot-08-badges-including-flags-v2.png b/images/screenshots/screenshot-08-badges-including-flags-v2.png index 66272c66..551c83fb 100644 Binary files a/images/screenshots/screenshot-08-badges-including-flags-v2.png and b/images/screenshots/screenshot-08-badges-including-flags-v2.png differ diff --git a/js/lib/third-party/README.md b/js/lib/third-party/README.md index 60f95c74..87fad10f 100644 --- a/js/lib/third-party/README.md +++ b/js/lib/third-party/README.md @@ -4,23 +4,18 @@ The following third-party libraries have been used in this extension (this information exists in under each [third-party library folder](https://github.com/fraz3alpha/running-challenges/tree/master/js/lib/third-party), but is summarised here for ease of use): -- jquery v3.3.1 - https://github.com/jquery/jquery/archive/3.3.1.zip -- leaflet v1.3.1 - https://github.com/Leaflet/Leaflet/archive/v1.3.1.zip -- d3-voronoi v1.1.2 - https://github.com/d3/d3-voronoi/releases/download/v1.1.2/d3-voronoi.zip +- jquery v3.6.0 — from pnpm (`browser-extensions/extension`); extension and website build copy from `node_modules/jquery/dist` (no vendored copy). +- leaflet v1.3.1 — from pnpm (`browser-extensions/extension`); extension and website build copy from `node_modules/leaflet/dist` (JS, CSS, images; no vendored copy). +- d3-voronoi v1.1.4 — from pnpm (`browser-extensions/extension`); extension and website build copy from `node_modules/d3-voronoi/dist` (no vendored copy). -The LeafletJS library is extensible, and the following additional libraries have been used: +The LeafletJS library is extensible. The following are from pnpm (`browser-extensions/extension`); extension and website build copy from `node_modules` (no vendored copy): -- canvasicon v0.1.4 - https://github.com/sashakavun/leaflet-canvasicon/archive/0.1.4.zip -- extramarkers v1.0.5 - https://github.com/coryasilva/Leaflet.ExtraMarkers/archive/v1.0.5.zip -- fullscreen v1.0.1 - https://github.com/Leaflet/Leaflet.fullscreen/archive/v1.0.2.zip -- markercluster v1.3.0 - https://github.com/Leaflet/Leaflet.markercluster/archive/v1.3.0.zip -- piechart v0.1.2 - https://github.com/Leaflet/Leaflet.markercluster/archive/v1.3.0.zip +- leaflet-extra-markers v1.0.6 (JS + CSS/images; CSS URL rewrite in extension build) +- leaflet.fullscreen v1.1.0 (JS + CSS + icons) +- leaflet.markercluster v1.3.0 (JS + CSS) -The following libraries require CSS patches to fix the image paths in order to -work under the extension/addon packaging system. The patch files can be found -under the [patches](https://github.com/fraz3alpha/running-challenges/tree/master/patches) -directory: +- leaflet-canvasicon v0.1.6 — from pnpm; extension and website build copy from `node_modules/leaflet-canvasicon`. +- leaflet-piechart v0.1.3 — from pnpm (GitHub: sashakavun/leaflet-piechart#29fcbb6be4c5e303cf3d0b94ea95997549afffa9); extension and website build copy from `node_modules/leaflet-piechart`. -- leaflet -- leaflet / extramarkers -- leaflet / fullscreen +Third-party CSS (Leaflet, leaflet-extramarkers, etc.) is copied from pnpm in the +extension build; extension URL rewriting for assets is done in the build script. diff --git a/js/lib/third-party/d3-voronoi/LICENSE b/js/lib/third-party/d3-voronoi/LICENSE deleted file mode 100644 index 9e0af43e..00000000 --- a/js/lib/third-party/d3-voronoi/LICENSE +++ /dev/null @@ -1,50 +0,0 @@ -Copyright 2010-2016 Mike Bostock -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of contributors may be used to - endorse or promote products derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Copyright (C) 2010-2013 Raymond Hill -https://github.com/gorhill/Javascript-Voronoi - -Licensed under The MIT License -http://en.wikipedia.org/wiki/MIT_License - -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/js/lib/third-party/d3-voronoi/README.md b/js/lib/third-party/d3-voronoi/README.md deleted file mode 100644 index dfb78232..00000000 --- a/js/lib/third-party/d3-voronoi/README.md +++ /dev/null @@ -1,6 +0,0 @@ - -Project website: https://github.com/d3/d3-voronoi - -Downloaded from: https://github.com/d3/d3-voronoi/releases - -2019-12-24: Version 1.1.2 - https://github.com/d3/d3-voronoi/releases/download/v1.1.2/d3-voronoi.zip diff --git a/js/lib/third-party/d3-voronoi/d3-voronoi.js b/js/lib/third-party/d3-voronoi/d3-voronoi.js deleted file mode 100644 index 0ae79335..00000000 --- a/js/lib/third-party/d3-voronoi/d3-voronoi.js +++ /dev/null @@ -1,999 +0,0 @@ -// https://d3js.org/d3-voronoi/ Version 1.1.2. Copyright 2017 Mike Bostock. -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.d3 = global.d3 || {}))); -}(this, (function (exports) { 'use strict'; - -var constant = function(x) { - return function() { - return x; - }; -}; - -function x(d) { - return d[0]; -} - -function y(d) { - return d[1]; -} - -function RedBlackTree() { - this._ = null; // root node -} - -function RedBlackNode(node) { - node.U = // parent node - node.C = // color - true for red, false for black - node.L = // left node - node.R = // right node - node.P = // previous node - node.N = null; // next node -} - -RedBlackTree.prototype = { - constructor: RedBlackTree, - - insert: function(after, node) { - var parent, grandpa, uncle; - - if (after) { - node.P = after; - node.N = after.N; - if (after.N) after.N.P = node; - after.N = node; - if (after.R) { - after = after.R; - while (after.L) after = after.L; - after.L = node; - } else { - after.R = node; - } - parent = after; - } else if (this._) { - after = RedBlackFirst(this._); - node.P = null; - node.N = after; - after.P = after.L = node; - parent = after; - } else { - node.P = node.N = null; - this._ = node; - parent = null; - } - node.L = node.R = null; - node.U = parent; - node.C = true; - - after = node; - while (parent && parent.C) { - grandpa = parent.U; - if (parent === grandpa.L) { - uncle = grandpa.R; - if (uncle && uncle.C) { - parent.C = uncle.C = false; - grandpa.C = true; - after = grandpa; - } else { - if (after === parent.R) { - RedBlackRotateLeft(this, parent); - after = parent; - parent = after.U; - } - parent.C = false; - grandpa.C = true; - RedBlackRotateRight(this, grandpa); - } - } else { - uncle = grandpa.L; - if (uncle && uncle.C) { - parent.C = uncle.C = false; - grandpa.C = true; - after = grandpa; - } else { - if (after === parent.L) { - RedBlackRotateRight(this, parent); - after = parent; - parent = after.U; - } - parent.C = false; - grandpa.C = true; - RedBlackRotateLeft(this, grandpa); - } - } - parent = after.U; - } - this._.C = false; - }, - - remove: function(node) { - if (node.N) node.N.P = node.P; - if (node.P) node.P.N = node.N; - node.N = node.P = null; - - var parent = node.U, - sibling, - left = node.L, - right = node.R, - next, - red; - - if (!left) next = right; - else if (!right) next = left; - else next = RedBlackFirst(right); - - if (parent) { - if (parent.L === node) parent.L = next; - else parent.R = next; - } else { - this._ = next; - } - - if (left && right) { - red = next.C; - next.C = node.C; - next.L = left; - left.U = next; - if (next !== right) { - parent = next.U; - next.U = node.U; - node = next.R; - parent.L = node; - next.R = right; - right.U = next; - } else { - next.U = parent; - parent = next; - node = next.R; - } - } else { - red = node.C; - node = next; - } - - if (node) node.U = parent; - if (red) return; - if (node && node.C) { node.C = false; return; } - - do { - if (node === this._) break; - if (node === parent.L) { - sibling = parent.R; - if (sibling.C) { - sibling.C = false; - parent.C = true; - RedBlackRotateLeft(this, parent); - sibling = parent.R; - } - if ((sibling.L && sibling.L.C) - || (sibling.R && sibling.R.C)) { - if (!sibling.R || !sibling.R.C) { - sibling.L.C = false; - sibling.C = true; - RedBlackRotateRight(this, sibling); - sibling = parent.R; - } - sibling.C = parent.C; - parent.C = sibling.R.C = false; - RedBlackRotateLeft(this, parent); - node = this._; - break; - } - } else { - sibling = parent.L; - if (sibling.C) { - sibling.C = false; - parent.C = true; - RedBlackRotateRight(this, parent); - sibling = parent.L; - } - if ((sibling.L && sibling.L.C) - || (sibling.R && sibling.R.C)) { - if (!sibling.L || !sibling.L.C) { - sibling.R.C = false; - sibling.C = true; - RedBlackRotateLeft(this, sibling); - sibling = parent.L; - } - sibling.C = parent.C; - parent.C = sibling.L.C = false; - RedBlackRotateRight(this, parent); - node = this._; - break; - } - } - sibling.C = true; - node = parent; - parent = parent.U; - } while (!node.C); - - if (node) node.C = false; - } -}; - -function RedBlackRotateLeft(tree, node) { - var p = node, - q = node.R, - parent = p.U; - - if (parent) { - if (parent.L === p) parent.L = q; - else parent.R = q; - } else { - tree._ = q; - } - - q.U = parent; - p.U = q; - p.R = q.L; - if (p.R) p.R.U = p; - q.L = p; -} - -function RedBlackRotateRight(tree, node) { - var p = node, - q = node.L, - parent = p.U; - - if (parent) { - if (parent.L === p) parent.L = q; - else parent.R = q; - } else { - tree._ = q; - } - - q.U = parent; - p.U = q; - p.L = q.R; - if (p.L) p.L.U = p; - q.R = p; -} - -function RedBlackFirst(node) { - while (node.L) node = node.L; - return node; -} - -function createEdge(left, right, v0, v1) { - var edge = [null, null], - index = edges.push(edge) - 1; - edge.left = left; - edge.right = right; - if (v0) setEdgeEnd(edge, left, right, v0); - if (v1) setEdgeEnd(edge, right, left, v1); - cells[left.index].halfedges.push(index); - cells[right.index].halfedges.push(index); - return edge; -} - -function createBorderEdge(left, v0, v1) { - var edge = [v0, v1]; - edge.left = left; - return edge; -} - -function setEdgeEnd(edge, left, right, vertex) { - if (!edge[0] && !edge[1]) { - edge[0] = vertex; - edge.left = left; - edge.right = right; - } else if (edge.left === right) { - edge[1] = vertex; - } else { - edge[0] = vertex; - } -} - -// Liang–Barsky line clipping. -function clipEdge(edge, x0, y0, x1, y1) { - var a = edge[0], - b = edge[1], - ax = a[0], - ay = a[1], - bx = b[0], - by = b[1], - t0 = 0, - t1 = 1, - dx = bx - ax, - dy = by - ay, - r; - - r = x0 - ax; - if (!dx && r > 0) return; - r /= dx; - if (dx < 0) { - if (r < t0) return; - if (r < t1) t1 = r; - } else if (dx > 0) { - if (r > t1) return; - if (r > t0) t0 = r; - } - - r = x1 - ax; - if (!dx && r < 0) return; - r /= dx; - if (dx < 0) { - if (r > t1) return; - if (r > t0) t0 = r; - } else if (dx > 0) { - if (r < t0) return; - if (r < t1) t1 = r; - } - - r = y0 - ay; - if (!dy && r > 0) return; - r /= dy; - if (dy < 0) { - if (r < t0) return; - if (r < t1) t1 = r; - } else if (dy > 0) { - if (r > t1) return; - if (r > t0) t0 = r; - } - - r = y1 - ay; - if (!dy && r < 0) return; - r /= dy; - if (dy < 0) { - if (r > t1) return; - if (r > t0) t0 = r; - } else if (dy > 0) { - if (r < t0) return; - if (r < t1) t1 = r; - } - - if (!(t0 > 0) && !(t1 < 1)) return true; // TODO Better check? - - if (t0 > 0) edge[0] = [ax + t0 * dx, ay + t0 * dy]; - if (t1 < 1) edge[1] = [ax + t1 * dx, ay + t1 * dy]; - return true; -} - -function connectEdge(edge, x0, y0, x1, y1) { - var v1 = edge[1]; - if (v1) return true; - - var v0 = edge[0], - left = edge.left, - right = edge.right, - lx = left[0], - ly = left[1], - rx = right[0], - ry = right[1], - fx = (lx + rx) / 2, - fy = (ly + ry) / 2, - fm, - fb; - - if (ry === ly) { - if (fx < x0 || fx >= x1) return; - if (lx > rx) { - if (!v0) v0 = [fx, y0]; - else if (v0[1] >= y1) return; - v1 = [fx, y1]; - } else { - if (!v0) v0 = [fx, y1]; - else if (v0[1] < y0) return; - v1 = [fx, y0]; - } - } else { - fm = (lx - rx) / (ry - ly); - fb = fy - fm * fx; - if (fm < -1 || fm > 1) { - if (lx > rx) { - if (!v0) v0 = [(y0 - fb) / fm, y0]; - else if (v0[1] >= y1) return; - v1 = [(y1 - fb) / fm, y1]; - } else { - if (!v0) v0 = [(y1 - fb) / fm, y1]; - else if (v0[1] < y0) return; - v1 = [(y0 - fb) / fm, y0]; - } - } else { - if (ly < ry) { - if (!v0) v0 = [x0, fm * x0 + fb]; - else if (v0[0] >= x1) return; - v1 = [x1, fm * x1 + fb]; - } else { - if (!v0) v0 = [x1, fm * x1 + fb]; - else if (v0[0] < x0) return; - v1 = [x0, fm * x0 + fb]; - } - } - } - - edge[0] = v0; - edge[1] = v1; - return true; -} - -function clipEdges(x0, y0, x1, y1) { - var i = edges.length, - edge; - - while (i--) { - if (!connectEdge(edge = edges[i], x0, y0, x1, y1) - || !clipEdge(edge, x0, y0, x1, y1) - || !(Math.abs(edge[0][0] - edge[1][0]) > epsilon - || Math.abs(edge[0][1] - edge[1][1]) > epsilon)) { - delete edges[i]; - } - } -} - -function createCell(site) { - return cells[site.index] = { - site: site, - halfedges: [] - }; -} - -function cellHalfedgeAngle(cell, edge) { - var site = cell.site, - va = edge.left, - vb = edge.right; - if (site === vb) vb = va, va = site; - if (vb) return Math.atan2(vb[1] - va[1], vb[0] - va[0]); - if (site === va) va = edge[1], vb = edge[0]; - else va = edge[0], vb = edge[1]; - return Math.atan2(va[0] - vb[0], vb[1] - va[1]); -} - -function cellHalfedgeStart(cell, edge) { - return edge[+(edge.left !== cell.site)]; -} - -function cellHalfedgeEnd(cell, edge) { - return edge[+(edge.left === cell.site)]; -} - -function sortCellHalfedges() { - for (var i = 0, n = cells.length, cell, halfedges, j, m; i < n; ++i) { - if ((cell = cells[i]) && (m = (halfedges = cell.halfedges).length)) { - var index = new Array(m), - array = new Array(m); - for (j = 0; j < m; ++j) index[j] = j, array[j] = cellHalfedgeAngle(cell, edges[halfedges[j]]); - index.sort(function(i, j) { return array[j] - array[i]; }); - for (j = 0; j < m; ++j) array[j] = halfedges[index[j]]; - for (j = 0; j < m; ++j) halfedges[j] = array[j]; - } - } -} - -function clipCells(x0, y0, x1, y1) { - var nCells = cells.length, - iCell, - cell, - site, - iHalfedge, - halfedges, - nHalfedges, - start, - startX, - startY, - end, - endX, - endY, - cover = true; - - for (iCell = 0; iCell < nCells; ++iCell) { - if (cell = cells[iCell]) { - site = cell.site; - halfedges = cell.halfedges; - iHalfedge = halfedges.length; - - // Remove any dangling clipped edges. - while (iHalfedge--) { - if (!edges[halfedges[iHalfedge]]) { - halfedges.splice(iHalfedge, 1); - } - } - - // Insert any border edges as necessary. - iHalfedge = 0, nHalfedges = halfedges.length; - while (iHalfedge < nHalfedges) { - end = cellHalfedgeEnd(cell, edges[halfedges[iHalfedge]]), endX = end[0], endY = end[1]; - start = cellHalfedgeStart(cell, edges[halfedges[++iHalfedge % nHalfedges]]), startX = start[0], startY = start[1]; - if (Math.abs(endX - startX) > epsilon || Math.abs(endY - startY) > epsilon) { - halfedges.splice(iHalfedge, 0, edges.push(createBorderEdge(site, end, - Math.abs(endX - x0) < epsilon && y1 - endY > epsilon ? [x0, Math.abs(startX - x0) < epsilon ? startY : y1] - : Math.abs(endY - y1) < epsilon && x1 - endX > epsilon ? [Math.abs(startY - y1) < epsilon ? startX : x1, y1] - : Math.abs(endX - x1) < epsilon && endY - y0 > epsilon ? [x1, Math.abs(startX - x1) < epsilon ? startY : y0] - : Math.abs(endY - y0) < epsilon && endX - x0 > epsilon ? [Math.abs(startY - y0) < epsilon ? startX : x0, y0] - : null)) - 1); - ++nHalfedges; - } - } - - if (nHalfedges) cover = false; - } - } - - // If there weren’t any edges, have the closest site cover the extent. - // It doesn’t matter which corner of the extent we measure! - if (cover) { - var dx, dy, d2, dc = Infinity; - - for (iCell = 0, cover = null; iCell < nCells; ++iCell) { - if (cell = cells[iCell]) { - site = cell.site; - dx = site[0] - x0; - dy = site[1] - y0; - d2 = dx * dx + dy * dy; - if (d2 < dc) dc = d2, cover = cell; - } - } - - if (cover) { - var v00 = [x0, y0], v01 = [x0, y1], v11 = [x1, y1], v10 = [x1, y0]; - cover.halfedges.push( - edges.push(createBorderEdge(site = cover.site, v00, v01)) - 1, - edges.push(createBorderEdge(site, v01, v11)) - 1, - edges.push(createBorderEdge(site, v11, v10)) - 1, - edges.push(createBorderEdge(site, v10, v00)) - 1 - ); - } - } - - // Lastly delete any cells with no edges; these were entirely clipped. - for (iCell = 0; iCell < nCells; ++iCell) { - if (cell = cells[iCell]) { - if (!cell.halfedges.length) { - delete cells[iCell]; - } - } - } -} - -var circlePool = []; - -var firstCircle; - -function Circle() { - RedBlackNode(this); - this.x = - this.y = - this.arc = - this.site = - this.cy = null; -} - -function attachCircle(arc) { - var lArc = arc.P, - rArc = arc.N; - - if (!lArc || !rArc) return; - - var lSite = lArc.site, - cSite = arc.site, - rSite = rArc.site; - - if (lSite === rSite) return; - - var bx = cSite[0], - by = cSite[1], - ax = lSite[0] - bx, - ay = lSite[1] - by, - cx = rSite[0] - bx, - cy = rSite[1] - by; - - var d = 2 * (ax * cy - ay * cx); - if (d >= -epsilon2) return; - - var ha = ax * ax + ay * ay, - hc = cx * cx + cy * cy, - x = (cy * ha - ay * hc) / d, - y = (ax * hc - cx * ha) / d; - - var circle = circlePool.pop() || new Circle; - circle.arc = arc; - circle.site = cSite; - circle.x = x + bx; - circle.y = (circle.cy = y + by) + Math.sqrt(x * x + y * y); // y bottom - - arc.circle = circle; - - var before = null, - node = circles._; - - while (node) { - if (circle.y < node.y || (circle.y === node.y && circle.x <= node.x)) { - if (node.L) node = node.L; - else { before = node.P; break; } - } else { - if (node.R) node = node.R; - else { before = node; break; } - } - } - - circles.insert(before, circle); - if (!before) firstCircle = circle; -} - -function detachCircle(arc) { - var circle = arc.circle; - if (circle) { - if (!circle.P) firstCircle = circle.N; - circles.remove(circle); - circlePool.push(circle); - RedBlackNode(circle); - arc.circle = null; - } -} - -var beachPool = []; - -function Beach() { - RedBlackNode(this); - this.edge = - this.site = - this.circle = null; -} - -function createBeach(site) { - var beach = beachPool.pop() || new Beach; - beach.site = site; - return beach; -} - -function detachBeach(beach) { - detachCircle(beach); - beaches.remove(beach); - beachPool.push(beach); - RedBlackNode(beach); -} - -function removeBeach(beach) { - var circle = beach.circle, - x = circle.x, - y = circle.cy, - vertex = [x, y], - previous = beach.P, - next = beach.N, - disappearing = [beach]; - - detachBeach(beach); - - var lArc = previous; - while (lArc.circle - && Math.abs(x - lArc.circle.x) < epsilon - && Math.abs(y - lArc.circle.cy) < epsilon) { - previous = lArc.P; - disappearing.unshift(lArc); - detachBeach(lArc); - lArc = previous; - } - - disappearing.unshift(lArc); - detachCircle(lArc); - - var rArc = next; - while (rArc.circle - && Math.abs(x - rArc.circle.x) < epsilon - && Math.abs(y - rArc.circle.cy) < epsilon) { - next = rArc.N; - disappearing.push(rArc); - detachBeach(rArc); - rArc = next; - } - - disappearing.push(rArc); - detachCircle(rArc); - - var nArcs = disappearing.length, - iArc; - for (iArc = 1; iArc < nArcs; ++iArc) { - rArc = disappearing[iArc]; - lArc = disappearing[iArc - 1]; - setEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex); - } - - lArc = disappearing[0]; - rArc = disappearing[nArcs - 1]; - rArc.edge = createEdge(lArc.site, rArc.site, null, vertex); - - attachCircle(lArc); - attachCircle(rArc); -} - -function addBeach(site) { - var x = site[0], - directrix = site[1], - lArc, - rArc, - dxl, - dxr, - node = beaches._; - - while (node) { - dxl = leftBreakPoint(node, directrix) - x; - if (dxl > epsilon) node = node.L; else { - dxr = x - rightBreakPoint(node, directrix); - if (dxr > epsilon) { - if (!node.R) { - lArc = node; - break; - } - node = node.R; - } else { - if (dxl > -epsilon) { - lArc = node.P; - rArc = node; - } else if (dxr > -epsilon) { - lArc = node; - rArc = node.N; - } else { - lArc = rArc = node; - } - break; - } - } - } - - createCell(site); - var newArc = createBeach(site); - beaches.insert(lArc, newArc); - - if (!lArc && !rArc) return; - - if (lArc === rArc) { - detachCircle(lArc); - rArc = createBeach(lArc.site); - beaches.insert(newArc, rArc); - newArc.edge = rArc.edge = createEdge(lArc.site, newArc.site); - attachCircle(lArc); - attachCircle(rArc); - return; - } - - if (!rArc) { // && lArc - newArc.edge = createEdge(lArc.site, newArc.site); - return; - } - - // else lArc !== rArc - detachCircle(lArc); - detachCircle(rArc); - - var lSite = lArc.site, - ax = lSite[0], - ay = lSite[1], - bx = site[0] - ax, - by = site[1] - ay, - rSite = rArc.site, - cx = rSite[0] - ax, - cy = rSite[1] - ay, - d = 2 * (bx * cy - by * cx), - hb = bx * bx + by * by, - hc = cx * cx + cy * cy, - vertex = [(cy * hb - by * hc) / d + ax, (bx * hc - cx * hb) / d + ay]; - - setEdgeEnd(rArc.edge, lSite, rSite, vertex); - newArc.edge = createEdge(lSite, site, null, vertex); - rArc.edge = createEdge(site, rSite, null, vertex); - attachCircle(lArc); - attachCircle(rArc); -} - -function leftBreakPoint(arc, directrix) { - var site = arc.site, - rfocx = site[0], - rfocy = site[1], - pby2 = rfocy - directrix; - - if (!pby2) return rfocx; - - var lArc = arc.P; - if (!lArc) return -Infinity; - - site = lArc.site; - var lfocx = site[0], - lfocy = site[1], - plby2 = lfocy - directrix; - - if (!plby2) return lfocx; - - var hl = lfocx - rfocx, - aby2 = 1 / pby2 - 1 / plby2, - b = hl / plby2; - - if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx; - - return (rfocx + lfocx) / 2; -} - -function rightBreakPoint(arc, directrix) { - var rArc = arc.N; - if (rArc) return leftBreakPoint(rArc, directrix); - var site = arc.site; - return site[1] === directrix ? site[0] : Infinity; -} - -var epsilon = 1e-6; -var epsilon2 = 1e-12; -var beaches; -var cells; -var circles; -var edges; - -function triangleArea(a, b, c) { - return (a[0] - c[0]) * (b[1] - a[1]) - (a[0] - b[0]) * (c[1] - a[1]); -} - -function lexicographic(a, b) { - return b[1] - a[1] - || b[0] - a[0]; -} - -function Diagram(sites, extent) { - var site = sites.sort(lexicographic).pop(), - x, - y, - circle; - - edges = []; - cells = new Array(sites.length); - beaches = new RedBlackTree; - circles = new RedBlackTree; - - while (true) { - circle = firstCircle; - if (site && (!circle || site[1] < circle.y || (site[1] === circle.y && site[0] < circle.x))) { - if (site[0] !== x || site[1] !== y) { - addBeach(site); - x = site[0], y = site[1]; - } - site = sites.pop(); - } else if (circle) { - removeBeach(circle.arc); - } else { - break; - } - } - - sortCellHalfedges(); - - if (extent) { - var x0 = +extent[0][0], - y0 = +extent[0][1], - x1 = +extent[1][0], - y1 = +extent[1][1]; - clipEdges(x0, y0, x1, y1); - clipCells(x0, y0, x1, y1); - } - - this.edges = edges; - this.cells = cells; - - beaches = - circles = - edges = - cells = null; -} - -Diagram.prototype = { - constructor: Diagram, - - polygons: function() { - var edges = this.edges; - - return this.cells.map(function(cell) { - var polygon = cell.halfedges.map(function(i) { return cellHalfedgeStart(cell, edges[i]); }); - polygon.data = cell.site.data; - return polygon; - }); - }, - - triangles: function() { - var triangles = [], - edges = this.edges; - - this.cells.forEach(function(cell, i) { - if (!(m = (halfedges = cell.halfedges).length)) return; - var site = cell.site, - halfedges, - j = -1, - m, - s0, - e1 = edges[halfedges[m - 1]], - s1 = e1.left === site ? e1.right : e1.left; - - while (++j < m) { - s0 = s1; - e1 = edges[halfedges[j]]; - s1 = e1.left === site ? e1.right : e1.left; - if (s0 && s1 && i < s0.index && i < s1.index && triangleArea(site, s0, s1) < 0) { - triangles.push([site.data, s0.data, s1.data]); - } - } - }); - - return triangles; - }, - - links: function() { - return this.edges.filter(function(edge) { - return edge.right; - }).map(function(edge) { - return { - source: edge.left.data, - target: edge.right.data - }; - }); - }, - - find: function(x, y, radius) { - var that = this, i0, i1 = that._found || 0, n = that.cells.length, cell; - - // Use the previously-found cell, or start with an arbitrary one. - while (!(cell = that.cells[i1])) if (++i1 >= n) return null; - var dx = x - cell.site[0], dy = y - cell.site[1], d2 = dx * dx + dy * dy; - - // Traverse the half-edges to find a closer cell, if any. - do { - cell = that.cells[i0 = i1], i1 = null; - cell.halfedges.forEach(function(e) { - var edge = that.edges[e], v = edge.left; - if ((v === cell.site || !v) && !(v = edge.right)) return; - var vx = x - v[0], vy = y - v[1], v2 = vx * vx + vy * vy; - if (v2 < d2) d2 = v2, i1 = v.index; - }); - } while (i1 !== null); - - that._found = i0; - - return radius == null || d2 <= radius * radius ? cell.site : null; - } -}; - -var voronoi = function() { - var x$$1 = x, - y$$1 = y, - extent = null; - - function voronoi(data) { - return new Diagram(data.map(function(d, i) { - var s = [Math.round(x$$1(d, i, data) / epsilon) * epsilon, Math.round(y$$1(d, i, data) / epsilon) * epsilon]; - s.index = i; - s.data = d; - return s; - }), extent); - } - - voronoi.polygons = function(data) { - return voronoi(data).polygons(); - }; - - voronoi.links = function(data) { - return voronoi(data).links(); - }; - - voronoi.triangles = function(data) { - return voronoi(data).triangles(); - }; - - voronoi.x = function(_) { - return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant(+_), voronoi) : x$$1; - }; - - voronoi.y = function(_) { - return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant(+_), voronoi) : y$$1; - }; - - voronoi.extent = function(_) { - return arguments.length ? (extent = _ == null ? null : [[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]], voronoi) : extent && [[extent[0][0], extent[0][1]], [extent[1][0], extent[1][1]]]; - }; - - voronoi.size = function(_) { - return arguments.length ? (extent = _ == null ? null : [[0, 0], [+_[0], +_[1]]], voronoi) : extent && [extent[1][0] - extent[0][0], extent[1][1] - extent[0][1]]; - }; - - return voronoi; -}; - -exports.voronoi = voronoi; - -Object.defineProperty(exports, '__esModule', { value: true }); - -}))); diff --git a/js/lib/third-party/jquery/LICENSE.txt b/js/lib/third-party/jquery/LICENSE.txt deleted file mode 100644 index e3dbacb9..00000000 --- a/js/lib/third-party/jquery/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright JS Foundation and other contributors, https://js.foundation/ - -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/js/lib/third-party/jquery/README.md b/js/lib/third-party/jquery/README.md deleted file mode 100644 index 5318a4fc..00000000 --- a/js/lib/third-party/jquery/README.md +++ /dev/null @@ -1,10 +0,0 @@ - -Project website: https://github.com/jquery/jquery - -Downloaded from: https://github.com/jquery/jquery/releases - -2022-05-25: Version 3.6.0 - https://github.com/jquery/jquery/archive/3.6.0.zip - -Previous versions: - -2018-01-10: Version 3.3.1 - https://github.com/jquery/jquery/archive/3.3.1.zip diff --git a/js/lib/third-party/jquery/jquery-3.6.0.js b/js/lib/third-party/jquery/jquery-3.6.0.js deleted file mode 100644 index fc6c299b..00000000 --- a/js/lib/third-party/jquery/jquery-3.6.0.js +++ /dev/null @@ -1,10881 +0,0 @@ -/*! - * jQuery JavaScript Library v3.6.0 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2021-03-02T17:08Z - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var flat = arr.flat ? function( array ) { - return arr.flat.call( array ); -} : function( array ) { - return arr.concat.apply( [], array ); -}; - - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - -var isFunction = function isFunction( obj ) { - - // Support: Chrome <=57, Firefox <=52 - // In some browsers, typeof returns "function" for HTML elements - // (i.e., `typeof document.createElement( "object" ) === "function"`). - // We don't want to classify *any* DOM node as a function. - // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 - // Plus for old WebKit, typeof returns "function" for HTML collections - // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) - return typeof obj === "function" && typeof obj.nodeType !== "number" && - typeof obj.item !== "function"; - }; - - -var isWindow = function isWindow( obj ) { - return obj != null && obj === obj.window; - }; - - -var document = window.document; - - - - var preservedScriptAttributes = { - type: true, - src: true, - nonce: true, - noModule: true - }; - - function DOMEval( code, node, doc ) { - doc = doc || document; - - var i, val, - script = doc.createElement( "script" ); - - script.text = code; - if ( node ) { - for ( i in preservedScriptAttributes ) { - - // Support: Firefox 64+, Edge 18+ - // Some browsers don't support the "nonce" property on scripts. - // On the other hand, just using `getAttribute` is not enough as - // the `nonce` attribute is reset to an empty string whenever it - // becomes browsing-context connected. - // See https://github.com/whatwg/html/issues/2369 - // See https://html.spec.whatwg.org/#nonce-attributes - // The `node.getAttribute` check was added for the sake of - // `jQuery.globalEval` so that it can fake a nonce-containing node - // via an object. - val = node[ i ] || node.getAttribute && node.getAttribute( i ); - if ( val ) { - script.setAttribute( i, val ); - } - } - } - doc.head.appendChild( script ).parentNode.removeChild( script ); - } - - -function toType( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; -} -/* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.6.0", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - even: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return ( i + 1 ) % 2; - } ) ); - }, - - odd: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return i % 2; - } ) ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - copy = options[ name ]; - - // Prevent Object.prototype pollution - // Prevent never-ending loop - if ( name === "__proto__" || target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - src = target[ name ]; - - // Ensure proper type for the source value - if ( copyIsArray && !Array.isArray( src ) ) { - clone = []; - } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { - clone = {}; - } else { - clone = src; - } - copyIsArray = false; - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - // Evaluates a script in a provided context; falls back to the global one - // if not specified. - globalEval: function( code, options, doc ) { - DOMEval( code, { nonce: options && options.nonce }, doc ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return flat( ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), - function( _i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); - } ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = toType( obj ); - - if ( isFunction( obj ) || isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.6 - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://js.foundation/ - * - * Date: 2021-02-16 - */ -( function( window ) { -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - nonnativeSelectorCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ( {} ).hasOwnProperty, - arr = [], - pop = arr.pop, - pushNative = arr.push, - push = arr.push, - slice = arr.slice, - - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[ i ] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + - "ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram - identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + - "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - - // "Attribute values must be CSS identifiers [capture 5] - // or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + - whitespace + "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + - whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + - "*" ), - rdescend = new RegExp( whitespace + "|>" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + - whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + - whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + - "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + - "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rhtml = /HTML$/i, - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), - funescape = function( escape, nonHex ) { - var high = "0x" + escape.slice( 1 ) - 0x10000; - - return nonHex ? - - // Strip the backslash prefix from a non-hex escape sequence - nonHex : - - // Replace a hexadecimal escape sequence with the encoded Unicode code point - // Support: IE <=11+ - // For values outside the Basic Multilingual Plane (BMP), manually construct a - // surrogate pair - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + - ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - inDisabledFieldset = addCombinator( - function( elem ) { - return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - ( arr = slice.call( preferredDoc.childNodes ) ), - preferredDoc.childNodes - ); - - // Support: Android<4.0 - // Detect silently failing push.apply - // eslint-disable-next-line no-unused-expressions - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - pushNative.apply( target, slice.call( els ) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - - // Can't trust NodeList.length - while ( ( target[ j++ ] = els[ i++ ] ) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - setDocument( context ); - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { - - // ID selector - if ( ( m = match[ 1 ] ) ) { - - // Document context - if ( nodeType === 9 ) { - if ( ( elem = context.getElementById( m ) ) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && ( elem = newContext.getElementById( m ) ) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[ 2 ] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !nonnativeSelectorCache[ selector + " " ] && - ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && - - // Support: IE 8 only - // Exclude object elements - ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { - - newSelector = selector; - newContext = context; - - // qSA considers elements outside a scoping root when evaluating child or - // descendant combinators, which is not what we want. - // In such cases, we work around the behavior by prefixing every selector in the - // list with an ID selector referencing the scope context. - // The technique has to be used as well when a leading combinator is used - // as such selectors are not recognized by querySelectorAll. - // Thanks to Andrew Dupont for this technique. - if ( nodeType === 1 && - ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - - // We can use :scope instead of the ID hack if the browser - // supports it & if we're not changing the context. - if ( newContext !== context || !support.scope ) { - - // Capture the context ID, setting it first if necessary - if ( ( nid = context.getAttribute( "id" ) ) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", ( nid = expando ) ); - } - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + - toSelector( groups[ i ] ); - } - newSelector = groups.join( "," ); - } - - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - nonnativeSelectorCache( selector, true ); - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return ( cache[ key + " " ] = value ); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement( "fieldset" ); - - try { - return !!fn( el ); - } catch ( e ) { - return false; - } finally { - - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split( "|" ), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[ i ] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( ( cur = cur.nextSibling ) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return ( name === "input" || name === "button" ) && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - inDisabledFieldset( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction( function( argument ) { - argument = +argument; - return markFunction( function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ ( j = matchIndexes[ i ] ) ] ) { - seed[ j ] = !( matches[ j ] = seed[ j ] ); - } - } - } ); - } ); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - var namespace = elem && elem.namespaceURI, - docElem = elem && ( elem.ownerDocument || elem ).documentElement; - - // Support: IE <=8 - // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes - // https://bugs.jquery.com/ticket/4833 - return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9 - 11+, Edge 12 - 18+ - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( preferredDoc != document && - ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, - // Safari 4 - 5 only, Opera <=11.6 - 12.x only - // IE/Edge & older browsers don't support the :scope pseudo-class. - // Support: Safari 6.0 only - // Safari 6.0 supports :scope but it's an alias of :root there. - support.scope = assert( function( el ) { - docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); - return typeof el.querySelectorAll !== "undefined" && - !el.querySelectorAll( ":scope fieldset div" ).length; - } ); - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert( function( el ) { - el.className = "i"; - return !el.getAttribute( "className" ); - } ); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert( function( el ) { - el.appendChild( document.createComment( "" ) ); - return !el.getElementsByTagName( "*" ).length; - } ); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert( function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - } ); - - // ID filter and find - if ( support.getById ) { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute( "id" ) === attrId; - }; - }; - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode( "id" ); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( ( elem = elems[ i++ ] ) ) { - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find[ "TAG" ] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { - - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert( function( el ) { - - var input; - - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "" + - ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll( "[selected]" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push( "~=" ); - } - - // Support: IE 11+, Edge 15 - 18+ - // IE 11/Edge don't find elements on a `[name='']` query in some cases. - // Adding a temporary attribute to the document before the selection works - // around the issue. - // Interestingly, IE 10 & older don't seem to have the issue. - input = document.createElement( "input" ); - input.setAttribute( "name", "" ); - el.appendChild( input ); - if ( !el.querySelectorAll( "[name='']" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + - whitespace + "*(?:''|\"\")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll( ":checked" ).length ) { - rbuggyQSA.push( ":checked" ); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push( ".#.+[+~]" ); - } - - // Support: Firefox <=3.6 - 5 only - // Old Firefox doesn't throw on a badly-escaped identifier. - el.querySelectorAll( "\\\f" ); - rbuggyQSA.push( "[\\r\\n\\f]" ); - } ); - - assert( function( el ) { - el.innerHTML = "" + - ""; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement( "input" ); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll( "[name=d]" ).length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: Opera 10 - 11 only - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll( "*,:x" ); - rbuggyQSA.push( ",.*:" ); - } ); - } - - if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector ) ) ) ) { - - assert( function( el ) { - - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - } ); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - ) ); - } : - function( a, b ) { - if ( b ) { - while ( ( b = b.parentNode ) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { - - // Choose the first element that is related to our preferred document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( a == document || a.ownerDocument == preferredDoc && - contains( preferredDoc, a ) ) { - return -1; - } - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( b == document || b.ownerDocument == preferredDoc && - contains( preferredDoc, b ) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - return a == document ? -1 : - b == document ? 1 : - /* eslint-enable eqeqeq */ - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( ( cur = cur.parentNode ) ) { - ap.unshift( cur ); - } - cur = b; - while ( ( cur = cur.parentNode ) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[ i ] === bp[ i ] ) { - i++; - } - - return i ? - - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[ i ], bp[ i ] ) : - - // Otherwise nodes in our document sort first - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - ap[ i ] == preferredDoc ? -1 : - bp[ i ] == preferredDoc ? 1 : - /* eslint-enable eqeqeq */ - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - setDocument( elem ); - - if ( support.matchesSelector && documentIsHTML && - !nonnativeSelectorCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch ( e ) { - nonnativeSelectorCache( expr, true ); - } - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( context.ownerDocument || context ) != document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( elem.ownerDocument || elem ) != document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; -}; - -Sizzle.escape = function( sel ) { - return ( sel + "" ).replace( rcssescape, fcssescape ); -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - - // If no nodeType, this is expected to be an array - while ( ( node = elem[ i++ ] ) ) { - - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[ 1 ] = match[ 1 ].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[ 3 ] = ( match[ 3 ] || match[ 4 ] || - match[ 5 ] || "" ).replace( runescape, funescape ); - - if ( match[ 2 ] === "~=" ) { - match[ 3 ] = " " + match[ 3 ] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[ 1 ] = match[ 1 ].toLowerCase(); - - if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { - - // nth-* requires argument - if ( !match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[ 4 ] = +( match[ 4 ] ? - match[ 5 ] + ( match[ 6 ] || 1 ) : - 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); - match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); - - // other types prohibit arguments - } else if ( match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[ 6 ] && match[ 2 ]; - - if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[ 3 ] ) { - match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - - // Get excess from tokenize (recursively) - ( excess = tokenize( unquoted, true ) ) && - - // advance to the next closing parenthesis - ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { - - // excess is a negative index - match[ 0 ] = match[ 0 ].slice( 0, excess ); - match[ 2 ] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { - return true; - } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - ( pattern = new RegExp( "(^|" + whitespace + - ")" + className + "(" + whitespace + "|$)" ) ) && classCache( - className, function( elem ) { - return pattern.test( - typeof elem.className === "string" && elem.className || - typeof elem.getAttribute !== "undefined" && - elem.getAttribute( "class" ) || - "" - ); - } ); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - /* eslint-disable max-len */ - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - /* eslint-enable max-len */ - - }; - }, - - "CHILD": function( type, what, _argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, _context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( ( node = node[ dir ] ) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( ( node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - - // Use previously-cached element index if available - if ( useCache ) { - - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - - // Use the same loop as above to seek `elem` from the start - while ( ( node = ++nodeIndex && node && node[ dir ] || - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - if ( ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || - ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction( function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[ i ] ); - seed[ idx ] = !( matches[ idx ] = matched[ i ] ); - } - } ) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - - // Potentially complex pseudos - "not": markFunction( function( selector ) { - - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction( function( seed, matches, _context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( ( elem = unmatched[ i ] ) ) { - seed[ i ] = !( matches[ i ] = elem ); - } - } - } ) : - function( elem, _context, xml ) { - input[ 0 ] = elem; - matcher( input, null, xml, results ); - - // Don't keep the element (issue #299) - input[ 0 ] = null; - return !results.pop(); - }; - } ), - - "has": markFunction( function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - } ), - - "contains": markFunction( function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; - }; - } ), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - - // lang value must be a valid identifier - if ( !ridentifier.test( lang || "" ) ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( ( elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); - return false; - }; - } ), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && - ( !document.hasFocus || document.hasFocus() ) && - !!( elem.type || elem.href || ~elem.tabIndex ); - }, - - // Boolean properties - "enabled": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( true ), - - "checked": function( elem ) { - - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return ( nodeName === "input" && !!elem.checked ) || - ( nodeName === "option" && !!elem.selected ); - }, - - "selected": function( elem ) { - - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - // eslint-disable-next-line no-unused-expressions - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos[ "empty" ]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( ( attr = elem.getAttribute( "type" ) ) == null || - attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo( function() { - return [ 0 ]; - } ), - - "last": createPositionalPseudo( function( _matchIndexes, length ) { - return [ length - 1 ]; - } ), - - "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - } ), - - "even": createPositionalPseudo( function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "odd": createPositionalPseudo( function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? - argument + length : - argument > length ? - length : - argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ) - } -}; - -Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || ( match = rcomma.exec( soFar ) ) ) { - if ( match ) { - - // Don't consume trailing commas as valid - soFar = soFar.slice( match[ 0 ].length ) || soFar; - } - groups.push( ( tokens = [] ) ); - } - - matched = false; - - // Combinators - if ( ( match = rcombinators.exec( soFar ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - - // Cast descendant combinators to space - type: match[ 0 ].replace( rtrim, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || - ( match = preFilters[ type ]( match ) ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[ i ].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - return false; - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || ( elem[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || - ( outerCache[ elem.uniqueID ] = {} ); - - if ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( ( oldCache = uniqueCache[ key ] ) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return ( newCache[ 2 ] = oldCache[ 2 ] ); - } else { - - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { - return true; - } - } - } - } - } - return false; - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[ i ]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[ 0 ]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[ i ], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( ( elem = unmatched[ i ] ) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction( function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( - selector || "*", - context.nodeType ? [ context ] : context, - [] - ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( ( elem = temp[ i ] ) ) { - matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) ) { - - // Restore matcherIn since elem is not yet a final match - temp.push( ( matcherIn[ i ] = elem ) ); - } - } - postFinder( null, ( matcherOut = [] ), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) && - ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { - - seed[ temp ] = !( results[ temp ] = elem ); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - } ); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[ 0 ].type ], - implicitRelative = leadingRelative || Expr.relative[ " " ], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - ( checkContext = context ).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { - matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; - } else { - matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[ j ].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens - .slice( 0, i - 1 ) - .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), - - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), - len = elems.length; - - if ( outermost ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - outermostContext = context == document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( !context && elem.ownerDocument != document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( ( matcher = elementMatchers[ j++ ] ) ) { - if ( matcher( elem, context || document, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - - // They will have gone through all possible matchers - if ( ( elem = !matcher && elem ) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( ( matcher = setMatchers[ j++ ] ) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !( unmatched[ i ] || setMatched[ i ] ) ) { - setMatched[ i ] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[ i ] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( - selector, - matcherFromGroupMatchers( elementMatchers, setMatchers ) - ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( ( selector = compiled.selector || selector ) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[ 0 ] = match[ 0 ].slice( 0 ); - if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { - - context = ( Expr.find[ "ID" ]( token.matches[ 0 ] - .replace( runescape, funescape ), context ) || [] )[ 0 ]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[ i ]; - - // Abort if we hit a combinator - if ( Expr.relative[ ( type = token.type ) ] ) { - break; - } - if ( ( find = Expr.find[ type ] ) ) { - - // Search, expanding context for leading sibling combinators - if ( ( seed = find( - token.matches[ 0 ].replace( runescape, funescape ), - rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || - context - ) ) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert( function( el ) { - - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; -} ); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert( function( el ) { - el.innerHTML = ""; - return el.firstChild.getAttribute( "href" ) === "#"; -} ) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - } ); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert( function( el ) { - el.innerHTML = ""; - el.firstChild.setAttribute( "value", "" ); - return el.firstChild.getAttribute( "value" ) === ""; -} ) ) { - addHandle( "value", function( elem, _name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - } ); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert( function( el ) { - return el.getAttribute( "disabled" ) == null; -} ) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; - } - } ); -} - -return Sizzle; - -} )( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; - -// Deprecated -jQuery.expr[ ":" ] = jQuery.expr.pseudos; -jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; -jQuery.escapeSelector = Sizzle.escape; - - - - -var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - - - -function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - -} -var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Filtered directly for both simple and complex selectors - return jQuery.filter( qualifier, elements, not ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, _i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, _i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, _i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - if ( elem.contentDocument != null && - - // Support: IE 11+ - // elements with no `data` attribute has an object - // `contentDocument` with a `null` prototype. - getProto( elem.contentDocument ) ) { - - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -} ); -var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = locked || options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && toType( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -function Identity( v ) { - return v; -} -function Thrower( ex ) { - throw ex; -} - -function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } -} - -jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( _i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // rejected_handlers.disable - // fulfilled_handlers.disable - tuples[ 3 - i ][ 3 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock, - - // progress_handlers.lock - tuples[ 0 ][ 3 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the primary Deferred - primary = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - primary.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( primary.state() === "pending" || - isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return primary.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); - } - - return primary.promise(); - } -} ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. -var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - -jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } -}; - - - - -jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); -}; - - - - -// The deferred used on DOM ready -var readyList = jQuery.Deferred(); - -jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; -}; - -jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } -} ); - -jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method -function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); -} - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - -} else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); -} - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( toType( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, _key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; -}; - - -// Matches dashed string for camelizing -var rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g; - -// Used by camelCase as callback to replace() -function fcamelCase( _all, letter ) { - return letter.toUpperCase(); -} - -// Convert dashed to camelCase; used by the css and data modules -// Support: IE <=9 - 11, Edge 12 - 15 -// Microsoft forgot to hump their vendor prefix (#9572) -function camelCase( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); -} -var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - - - -function Data() { - this.expando = jQuery.expando + Data.uid++; -} - -Data.uid = 1; - -Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( camelCase ); - } else { - key = camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } -}; -var dataPriv = new Data(); - -var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - -function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; -} - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); -var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - -var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var documentElement = document.documentElement; - - - - var isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ); - }, - composed = { composed: true }; - - // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only - // Check attachment across shadow DOM boundaries when possible (gh-3504) - // Support: iOS 10.0-10.2 only - // Early iOS 10 versions support `attachShadow` but not `getRootNode`, - // leading to errors. We need to check for `getRootNode`. - if ( documentElement.getRootNode ) { - isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ) || - elem.getRootNode( composed ) === elem.ownerDocument; - }; - } -var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - isAttached( elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, scale, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = elem.nodeType && - ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Support: Firefox <=54 - // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) - initial = initial / 2; - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - while ( maxIterations-- ) { - - // Evaluate and update our best guess (doubling guesses that zero out). - // Finish if the scale equals or crosses 1 (making the old*new product non-positive). - jQuery.style( elem, prop, initialInUnit + unit ); - if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { - maxIterations = 0; - } - initialInUnit = initialInUnit / scale; - - } - - initialInUnit = initialInUnit * 2; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; -} - - -var defaultDisplayMap = {}; - -function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; -} - -function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; -} - -jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } -} ); -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); - -var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); - - - -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // Support: IE <=9 only - // IE <=9 replaces "; - support.option = !!div.lastChild; -} )(); - - -// We have to close these tags to support XHTML (#13200) -var wrapMap = { - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting
", "
" ], - col: [ 2, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - _default: [ 0, "", "" ] -}; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// Support: IE <=9 only -if ( !support.option ) { - wrapMap.optgroup = wrapMap.option = [ 1, "" ]; -} - - -function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/; - -function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, attached, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( toType( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - attached = isAttached( elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( attached ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; -} - - -var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -// Support: IE <=9 - 11+ -// focus() and blur() are asynchronous, except when they are no-op. -// So expect focus to be synchronous when the element is already active, -// and blur to be synchronous when the element is not already active. -// (focus and blur are always synchronous in other supported browsers, -// this just defines when we can count on it). -function expectSync( elem, type ) { - return ( elem === safeActiveElement() ) === ( type === "focus" ); -} - -// Support: IE <=9 only -// Accessing document.activeElement can throw unexpectedly -// https://bugs.jquery.com/ticket/13393 -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Only attach events to objects that accept data - if ( !acceptData( elem ) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = Object.create( null ); - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( nativeEvent ), - - handlers = ( - dataPriv.get( this, "events" ) || Object.create( null ) - )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // If the event is namespaced, then each handler is only invoked if it is - // specially universal or its namespaces are a superset of the event's. - if ( !event.rnamespace || handleObj.namespace === false || - event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - click: { - - // Utilize native event to ensure correct state for checkable inputs - setup: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Claim the first handler - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - // dataPriv.set( el, "click", ... ) - leverageNative( el, "click", returnTrue ); - } - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Force setup before triggering a click - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - leverageNative( el, "click" ); - } - - // Return non-false to allow normal event-path propagation - return true; - }, - - // For cross-browser consistency, suppress native .click() on links - // Also prevent it if we're currently inside a leveraged native-event stack - _default: function( event ) { - var target = event.target; - return rcheckableType.test( target.type ) && - target.click && nodeName( target, "input" ) && - dataPriv.get( target, "click" ) || - nodeName( target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } -}; - -// Ensure the presence of an event listener that handles manually-triggered -// synthetic events by interrupting progress until reinvoked in response to -// *native* events that it fires directly, ensuring that state changes have -// already occurred before other listeners are invoked. -function leverageNative( el, type, expectSync ) { - - // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add - if ( !expectSync ) { - if ( dataPriv.get( el, type ) === undefined ) { - jQuery.event.add( el, type, returnTrue ); - } - return; - } - - // Register the controller as a special universal handler for all event namespaces - dataPriv.set( el, type, false ); - jQuery.event.add( el, type, { - namespace: false, - handler: function( event ) { - var notAsync, result, - saved = dataPriv.get( this, type ); - - if ( ( event.isTrigger & 1 ) && this[ type ] ) { - - // Interrupt processing of the outer synthetic .trigger()ed event - // Saved data should be false in such cases, but might be a leftover capture object - // from an async native handler (gh-4350) - if ( !saved.length ) { - - // Store arguments for use when handling the inner native event - // There will always be at least one argument (an event object), so this array - // will not be confused with a leftover capture object. - saved = slice.call( arguments ); - dataPriv.set( this, type, saved ); - - // Trigger the native event and capture its result - // Support: IE <=9 - 11+ - // focus() and blur() are asynchronous - notAsync = expectSync( this, type ); - this[ type ](); - result = dataPriv.get( this, type ); - if ( saved !== result || notAsync ) { - dataPriv.set( this, type, false ); - } else { - result = {}; - } - if ( saved !== result ) { - - // Cancel the outer synthetic event - event.stopImmediatePropagation(); - event.preventDefault(); - - // Support: Chrome 86+ - // In Chrome, if an element having a focusout handler is blurred by - // clicking outside of it, it invokes the handler synchronously. If - // that handler calls `.remove()` on the element, the data is cleared, - // leaving `result` undefined. We need to guard against this. - return result && result.value; - } - - // If this is an inner synthetic event for an event with a bubbling surrogate - // (focus or blur), assume that the surrogate already propagated from triggering the - // native event and prevent that from happening again here. - // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the - // bubbling surrogate propagates *after* the non-bubbling base), but that seems - // less bad than duplication. - } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { - event.stopPropagation(); - } - - // If this is a native event triggered above, everything is now in order - // Fire an inner synthetic event with the original arguments - } else if ( saved.length ) { - - // ...and capture the result - dataPriv.set( this, type, { - value: jQuery.event.trigger( - - // Support: IE <=9 - 11+ - // Extend with the prototype to reset the above stopImmediatePropagation() - jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), - saved.slice( 1 ), - this - ) - } ); - - // Abort handling of the native event - event.stopImmediatePropagation(); - } - } - } ); -} - -jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } -}; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || Date.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Includes all common event props including KeyEvent and MouseEvent specific props -jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - code: true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - which: true -}, jQuery.event.addProp ); - -jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { - jQuery.event.special[ type ] = { - - // Utilize native event if possible so blur/focus sequence is correct - setup: function() { - - // Claim the first handler - // dataPriv.set( this, "focus", ... ) - // dataPriv.set( this, "blur", ... ) - leverageNative( this, type, expectSync ); - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function() { - - // Force setup before trigger - leverageNative( this, type ); - - // Return non-false to allow normal event-path propagation - return true; - }, - - // Suppress native focus or blur as it's already being fired - // in leverageNative. - _default: function() { - return true; - }, - - delegateType: delegateType - }; -} ); - -// Create mouseenter/leave events using mouseover/out and event-time checks -// so that event delegation works in jQuery. -// Do the same for pointerenter/pointerleave and pointerover/pointerout -// -// Support: Safari 7 only -// Safari sends mouseenter too often; see: -// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 -// for the description of the bug (it existed in older Chrome versions as well). -jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } -} ); - - -var - - // Support: IE <=10 - 11, Edge 12 - 13 only - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g; - -// Prefer a tbody over its parent table for containing new rows -function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( elem ).children( "tbody" )[ 0 ] || elem; - } - - return elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { - elem.type = elem.type.slice( 5 ); - } else { - elem.removeAttribute( "type" ); - } - - return elem; -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.get( src ); - events = pdataOld.events; - - if ( events ) { - dataPriv.remove( dest, "handle events" ); - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } -} - -// Fix IE bugs, see support tests -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = flat( args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - valueIsFunction = isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( valueIsFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( valueIsFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl && !node.noModule ) { - jQuery._evalUrl( node.src, { - nonce: node.nonce || node.getAttribute( "nonce" ) - }, doc ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); - } - } - } - } - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && isAttached( node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html; - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = isAttached( elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } -} ); - -jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); -var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - -var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - -var swap = function( elem, options, callback ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.call( elem ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - -var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); - - - -( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - container.style.cssText = "position:absolute;left:-11111px;width:60px;" + - "margin-top:1px;padding:0;border:0"; - div.style.cssText = - "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + - "margin:auto;border:1px;padding:1px;" + - "width:60%;top:1%"; - documentElement.appendChild( container ).appendChild( div ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; - - // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 - // Some styles come back with percentage values, even though they shouldn't - div.style.right = "60%"; - pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; - - // Support: IE 9 - 11 only - // Detect misreporting of content dimensions for box-sizing:border-box elements - boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; - - // Support: IE 9 only - // Detect overflow:scroll screwiness (gh-3699) - // Support: Chrome <=64 - // Don't get tricked when zoom affects offsetWidth (gh-4029) - div.style.position = "absolute"; - scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - function roundPixelMeasures( measure ) { - return Math.round( parseFloat( measure ) ); - } - - var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, - reliableTrDimensionsVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - jQuery.extend( support, { - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelBoxStyles: function() { - computeStyleTests(); - return pixelBoxStylesVal; - }, - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - }, - scrollboxSize: function() { - computeStyleTests(); - return scrollboxSizeVal; - }, - - // Support: IE 9 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Behavior in IE 9 is more subtle than in newer versions & it passes - // some versions of this test; make sure not to make it pass there! - // - // Support: Firefox 70+ - // Only Firefox includes border widths - // in computed dimensions. (gh-4529) - reliableTrDimensions: function() { - var table, tr, trChild, trStyle; - if ( reliableTrDimensionsVal == null ) { - table = document.createElement( "table" ); - tr = document.createElement( "tr" ); - trChild = document.createElement( "div" ); - - table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; - tr.style.cssText = "border:1px solid"; - - // Support: Chrome 86+ - // Height set through cssText does not get applied. - // Computed height then comes back as 0. - tr.style.height = "1px"; - trChild.style.height = "9px"; - - // Support: Android 8 Chrome 86+ - // In our bodyBackground.html iframe, - // display for all div elements is set to "inline", - // which causes a problem only in Android 8 Chrome 86. - // Ensuring the div is display: block - // gets around this issue. - trChild.style.display = "block"; - - documentElement - .appendChild( table ) - .appendChild( tr ) - .appendChild( trChild ); - - trStyle = window.getComputedStyle( tr ); - reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + - parseInt( trStyle.borderTopWidth, 10 ) + - parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; - - documentElement.removeChild( table ); - } - return reliableTrDimensionsVal; - } - } ); -} )(); - - -function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !isAttached( elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; -} - - -function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; -} - - -var cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style, - vendorProps = {}; - -// Return a vendor-prefixed property or undefined -function vendorPropName( name ) { - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } -} - -// Return a potentially-mapped jQuery.cssProps or vendor prefixed property -function finalPropName( name ) { - var final = jQuery.cssProps[ name ] || vendorProps[ name ]; - - if ( final ) { - return final; - } - if ( name in emptyStyle ) { - return name; - } - return vendorProps[ name ] = vendorPropName( name ) || name; -} - - -var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }; - -function setPositiveNumber( _elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; -} - -function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { - var i = dimension === "width" ? 1 : 0, - extra = 0, - delta = 0; - - // Adjustment may not be necessary - if ( box === ( isBorderBox ? "border" : "content" ) ) { - return 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin - if ( box === "margin" ) { - delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); - } - - // If we get here with a content-box, we're seeking "padding" or "border" or "margin" - if ( !isBorderBox ) { - - // Add padding - delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // For "border" or "margin", add border - if ( box !== "padding" ) { - delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - - // But still keep track of it otherwise - } else { - extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - - // If we get here with a border-box (content + padding + border), we're seeking "content" or - // "padding" or "margin" - } else { - - // For "content", subtract padding - if ( box === "content" ) { - delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // For "content" or "padding", subtract border - if ( box !== "margin" ) { - delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - // Account for positive content-box scroll gutter when requested by providing computedVal - if ( !isBorderBox && computedVal >= 0 ) { - - // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border - // Assuming integer scroll gutter, subtract the rest and round down - delta += Math.max( 0, Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - computedVal - - delta - - extra - - 0.5 - - // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter - // Use an explicit zero to avoid NaN (gh-3964) - ) ) || 0; - } - - return delta; -} - -function getWidthOrHeight( elem, dimension, extra ) { - - // Start with computed style - var styles = getStyles( elem ), - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). - // Fake content-box until we know it's needed to know the true value. - boxSizingNeeded = !support.boxSizingReliable() || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - valueIsBorderBox = isBorderBox, - - val = curCSS( elem, dimension, styles ), - offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); - - // Support: Firefox <=54 - // Return a confounding non-pixel value or feign ignorance, as appropriate. - if ( rnumnonpx.test( val ) ) { - if ( !extra ) { - return val; - } - val = "auto"; - } - - - // Support: IE 9 - 11 only - // Use offsetWidth/offsetHeight for when box sizing is unreliable. - // In those cases, the computed value can be trusted to be border-box. - if ( ( !support.boxSizingReliable() && isBorderBox || - - // Support: IE 10 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Interestingly, in some cases IE 9 doesn't suffer from this issue. - !support.reliableTrDimensions() && nodeName( elem, "tr" ) || - - // Fall back to offsetWidth/offsetHeight when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - val === "auto" || - - // Support: Android <=4.1 - 4.3 only - // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) - !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && - - // Make sure the element is visible & connected - elem.getClientRects().length ) { - - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Where available, offsetWidth/offsetHeight approximate border box dimensions. - // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the - // retrieved value as a content box dimension. - valueIsBorderBox = offsetProp in elem; - if ( valueIsBorderBox ) { - val = elem[ offsetProp ]; - } - } - - // Normalize "" and auto - val = parseFloat( val ) || 0; - - // Adjust for the element's box model - return ( val + - boxModelAdjustment( - elem, - dimension, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles, - - // Provide the current computed size to request scroll gutter calculation (gh-3589) - val - ) - ) + "px"; -} - -jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "gridArea": true, - "gridColumn": true, - "gridColumnEnd": true, - "gridColumnStart": true, - "gridRow": true, - "gridRowEnd": true, - "gridRowStart": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: {}, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append - // "px" to a few hardcoded values. - if ( type === "number" && !isCustomProp ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } -} ); - -jQuery.each( [ "height", "width" ], function( _i, dimension ) { - jQuery.cssHooks[ dimension ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, dimension, extra ); - } ) : - getWidthOrHeight( elem, dimension, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = getStyles( elem ), - - // Only read styles.position if the test has a chance to fail - // to avoid forcing a reflow. - scrollboxSizeBuggy = !support.scrollboxSize() && - styles.position === "absolute", - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) - boxSizingNeeded = scrollboxSizeBuggy || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - subtract = extra ? - boxModelAdjustment( - elem, - dimension, - extra, - isBorderBox, - styles - ) : - 0; - - // Account for unreliable border-box dimensions by comparing offset* to computed and - // faking a content-box to get border and padding (gh-3699) - if ( isBorderBox && scrollboxSizeBuggy ) { - subtract -= Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - parseFloat( styles[ dimension ] ) - - boxModelAdjustment( elem, dimension, "border", false, styles ) - - 0.5 - ); - } - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ dimension ] = value; - value = jQuery.css( elem, dimension ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; -} ); - -jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } -); - -// These hooks are used by animate to expand properties -jQuery.each( { - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( prefix !== "margin" ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -} ); - -jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } -} ); - - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && ( - jQuery.cssHooks[ tween.prop ] || - tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" -}; - -jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point -jQuery.fx.step = {}; - - - - -var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - -function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } -} - -// Animations created synchronously will run synchronously -function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = Date.now() ); -} - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } -} - -function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 15 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY and Edge just mirrors - // the overflowX value there. - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - result.stop.bind( result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } -} ); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } -} ); - -jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -} ); - -// Generate shortcuts for custom animations -jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -} ); - -jQuery.timers = []; -jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = Date.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); -}; - -jQuery.fx.interval = 13; -jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); -}; - -jQuery.fx.stop = function() { - inProgress = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 -}; - - -// Based off of the plugin by Clint Helfers, with permission. -// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ -jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); -}; - - -( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; -} )(); - - -var boolHook, - attrHandle = jQuery.expr.attrHandle; - -jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } -} ); - -jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } -} ); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } -}; - -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; -} ); - - - - -var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - -jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } -} ); - -jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } -} ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -// eslint rule "no-unused-expressions" is disabled for this code -// since it considers such accessions noop -if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; -} - -jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -} ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - -function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; -} - -function classesToArray( value ) { - if ( Array.isArray( value ) ) { - return value; - } - if ( typeof value === "string" ) { - return value.match( rnothtmlwhite ) || []; - } - return []; -} - -jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isValidValue = type === "string" || Array.isArray( value ); - - if ( typeof stateVal === "boolean" && isValidValue ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( isValidValue ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = classesToArray( value ); - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } -} ); - - - - -var rreturn = /\r/g; - -jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, valueIsFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - valueIsFunction = isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( valueIsFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } -} ); - -jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } -} ); - -// Radios and checkboxes getter/setter -jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } -} ); - - - - -// Return jQuery for attributes-only inclusion - - -support.focusin = "onfocusin" in window; - - -var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - stopPropagationCallback = function( e ) { - e.stopPropagation(); - }; - -jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = lastElement = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - lastElement = cur; - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - - if ( event.isPropagationStopped() ) { - lastElement.addEventListener( type, stopPropagationCallback ); - } - - elem[ type ](); - - if ( event.isPropagationStopped() ) { - lastElement.removeEventListener( type, stopPropagationCallback ); - } - - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - -} ); - -jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -} ); - - -// Support: Firefox <=44 -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 -// focus(in | out) events fire after focus & blur events, -// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order -// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 -if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - - // Handle: regular nodes (via `this.ownerDocument`), window - // (via `this.document`) & document (via `this`). - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); -} -var location = window.location; - -var nonce = { guid: Date.now() }; - -var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml, parserErrorElem; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) {} - - parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; - if ( !xml || parserErrorElem ) { - jQuery.error( "Invalid XML: " + ( - parserErrorElem ? - jQuery.map( parserErrorElem.childNodes, function( el ) { - return el.textContent; - } ).join( "\n" ) : - data - ) ); - } - return xml; -}; - - -var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && toType( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } -} - -// Serialize an array of form elements or a set of -// key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - if ( a == null ) { - return ""; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); -}; - -jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ).filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ).map( function( _i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } -} ); - - -var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - -originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; -} - -/* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -/* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ -function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; -} - -jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() + " " ] = - ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) - .concat( match[ 2 ] ); - } - } - match = responseHeaders[ key.toLowerCase() + " " ]; - } - return match == null ? null : match.join( ", " ); - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 15 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available and should be processed, append data to url - if ( s.data && ( s.processData || typeof s.data === "string" ) ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + - uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Use a noop converter for missing script but not if jsonp - if ( !isSuccess && - jQuery.inArray( "script", s.dataTypes ) > -1 && - jQuery.inArray( "json", s.dataTypes ) < 0 ) { - s.converters[ "text script" ] = function() {}; - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } -} ); - -jQuery.each( [ "get", "post" ], function( _i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; -} ); - -jQuery.ajaxPrefilter( function( s ) { - var i; - for ( i in s.headers ) { - if ( i.toLowerCase() === "content-type" ) { - s.contentType = s.headers[ i ] || ""; - } - } -} ); - - -jQuery._evalUrl = function( url, options, doc ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - - // Only evaluate the response if it is successful (gh-4126) - // dataFilter is not invoked for failure responses, so using it instead - // of the default converter is kludgy but it works. - converters: { - "text script": function() {} - }, - dataFilter: function( response ) { - jQuery.globalEval( response, options, doc ); - } - } ); -}; - - -jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var htmlIsFunction = isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } -} ); - - -jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); -}; -jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); -}; - - - - -jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} -}; - -var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); -support.ajax = xhrSupported = !!xhrSupported; - -jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.ontimeout = - xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) -jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } -} ); - -// Install script dataType -jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -} ); - -// Handle cache's special case and crossDomain -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } -} ); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain or forced-by-attrs requests - if ( s.crossDomain || s.scriptAttrs ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( "