From 866cf9036d59998c1141d00bba8403918358aef0 Mon Sep 17 00:00:00 2001 From: Riley Thai Date: Thu, 16 Jul 2026 18:26:40 +1000 Subject: [PATCH 1/4] fix(bokeh): patch out callback logging issue - prevent callback from occuring upstream in patched jupyter_bokeh version (which should be moved to a submodule but relied on compiled artifacts to attach the env) - also explicitly remove the Widget from the document with a cleanup callback - this doesn't fix "No such comm" issues (they still spawn N no comm messages on add/remove, where N is the number of effects attached I think) - added currently as a uv tool source but we can change later --- Dockerfile | 4 + jupyter_bokeh/.eslintignore | 5 + jupyter_bokeh/.eslintrc.js | 39 + jupyter_bokeh/.github/workflows/build.yml | 54 + jupyter_bokeh/.github/workflows/codeql.yml | 42 + jupyter_bokeh/.gitignore | 14 + jupyter_bokeh/.yarnrc.yml | 1 + jupyter_bokeh/DEVGUIDE.md | 8 + jupyter_bokeh/LICENSE.txt | 28 + jupyter_bokeh/MANIFEST.in | 25 + jupyter_bokeh/README.md | 103 + jupyter_bokeh/VENDORED.md | 23 + jupyter_bokeh/conda.recipe/meta.yaml | 62 + .../examples/jupyter_interactors.ipynb | 112 + jupyter_bokeh/examples/jupyter_sliders.ipynb | 86 + jupyter_bokeh/examples/jupyter_widgets.ipynb | 106 + jupyter_bokeh/examples/notebook_comms.ipynb | 158 + jupyter_bokeh/examples/server_embed.ipynb | 136 + jupyter_bokeh/examples/static_plot.ipynb | 76 + jupyter_bokeh/install.json | 5 + jupyter_bokeh/jupyter_bokeh.json | 5 + jupyter_bokeh/jupyter_bokeh/__init__.py | 25 + .../jupyter_bokeh/labextension/package.json | 93 + .../static/25.7f0e791faf45c908d390.js | 1 + .../static/7.ff5312a50bb152fd32e7.js | 2 + .../7.ff5312a50bb152fd32e7.js.LICENSE.txt | 10 + .../static/824.d21aab68a9a658930418.js | 1 + .../remoteEntry.a0edbce3f9b6f9f73223.js | 1 + .../labextension/static/style.js | 4 + .../static/third-party-licenses.json | 46 + .../jupyter_bokeh/nbextension/extension.js | 15 + .../jupyter_bokeh/nbextension/index.js | 3 + .../nbextension/index.js.LICENSE.txt | 10 + .../jupyter_bokeh/nbextension/index.js.map | 1 + jupyter_bokeh/jupyter_bokeh/widgets.py | 186 + jupyter_bokeh/package.json | 88 + jupyter_bokeh/pyproject.toml | 99 + jupyter_bokeh/scripts/deploy.sh | 18 + jupyter_bokeh/setup.cfg | 3 + jupyter_bokeh/setup.py | 1 + jupyter_bokeh/src/extension.ts | 10 + jupyter_bokeh/src/index.ts | 4 + jupyter_bokeh/src/manager.ts | 36 + jupyter_bokeh/src/metadata.d.ts | 2 + jupyter_bokeh/src/plugin.ts | 77 + jupyter_bokeh/src/renderer.ts | 148 + jupyter_bokeh/src/widgets.ts | 247 + jupyter_bokeh/style/base.css | 0 jupyter_bokeh/style/index.css | 1 + jupyter_bokeh/style/index.js | 1 + jupyter_bokeh/tsconfig.json | 25 + jupyter_bokeh/webpack.config.js | 61 + jupyter_bokeh/yarn.lock | 7861 +++++++++++++++++ pyproject.toml | 5 + .../dashboard/components/views/figurebokeh.py | 27 +- uv.lock | 22 +- 56 files changed, 10217 insertions(+), 9 deletions(-) create mode 100644 jupyter_bokeh/.eslintignore create mode 100644 jupyter_bokeh/.eslintrc.js create mode 100644 jupyter_bokeh/.github/workflows/build.yml create mode 100644 jupyter_bokeh/.github/workflows/codeql.yml create mode 100644 jupyter_bokeh/.gitignore create mode 100644 jupyter_bokeh/.yarnrc.yml create mode 100644 jupyter_bokeh/DEVGUIDE.md create mode 100644 jupyter_bokeh/LICENSE.txt create mode 100644 jupyter_bokeh/MANIFEST.in create mode 100644 jupyter_bokeh/README.md create mode 100644 jupyter_bokeh/VENDORED.md create mode 100644 jupyter_bokeh/conda.recipe/meta.yaml create mode 100644 jupyter_bokeh/examples/jupyter_interactors.ipynb create mode 100644 jupyter_bokeh/examples/jupyter_sliders.ipynb create mode 100644 jupyter_bokeh/examples/jupyter_widgets.ipynb create mode 100644 jupyter_bokeh/examples/notebook_comms.ipynb create mode 100644 jupyter_bokeh/examples/server_embed.ipynb create mode 100644 jupyter_bokeh/examples/static_plot.ipynb create mode 100644 jupyter_bokeh/install.json create mode 100644 jupyter_bokeh/jupyter_bokeh.json create mode 100644 jupyter_bokeh/jupyter_bokeh/__init__.py create mode 100644 jupyter_bokeh/jupyter_bokeh/labextension/package.json create mode 100644 jupyter_bokeh/jupyter_bokeh/labextension/static/25.7f0e791faf45c908d390.js create mode 100644 jupyter_bokeh/jupyter_bokeh/labextension/static/7.ff5312a50bb152fd32e7.js create mode 100644 jupyter_bokeh/jupyter_bokeh/labextension/static/7.ff5312a50bb152fd32e7.js.LICENSE.txt create mode 100644 jupyter_bokeh/jupyter_bokeh/labextension/static/824.d21aab68a9a658930418.js create mode 100644 jupyter_bokeh/jupyter_bokeh/labextension/static/remoteEntry.a0edbce3f9b6f9f73223.js create mode 100644 jupyter_bokeh/jupyter_bokeh/labextension/static/style.js create mode 100644 jupyter_bokeh/jupyter_bokeh/labextension/static/third-party-licenses.json create mode 100644 jupyter_bokeh/jupyter_bokeh/nbextension/extension.js create mode 100644 jupyter_bokeh/jupyter_bokeh/nbextension/index.js create mode 100644 jupyter_bokeh/jupyter_bokeh/nbextension/index.js.LICENSE.txt create mode 100644 jupyter_bokeh/jupyter_bokeh/nbextension/index.js.map create mode 100644 jupyter_bokeh/jupyter_bokeh/widgets.py create mode 100644 jupyter_bokeh/package.json create mode 100644 jupyter_bokeh/pyproject.toml create mode 100755 jupyter_bokeh/scripts/deploy.sh create mode 100644 jupyter_bokeh/setup.cfg create mode 100644 jupyter_bokeh/setup.py create mode 100644 jupyter_bokeh/src/extension.ts create mode 100644 jupyter_bokeh/src/index.ts create mode 100644 jupyter_bokeh/src/manager.ts create mode 100644 jupyter_bokeh/src/metadata.d.ts create mode 100644 jupyter_bokeh/src/plugin.ts create mode 100644 jupyter_bokeh/src/renderer.ts create mode 100644 jupyter_bokeh/src/widgets.ts create mode 100644 jupyter_bokeh/style/base.css create mode 100644 jupyter_bokeh/style/index.css create mode 100644 jupyter_bokeh/style/index.js create mode 100644 jupyter_bokeh/tsconfig.json create mode 100644 jupyter_bokeh/webpack.config.js create mode 100644 jupyter_bokeh/yarn.lock diff --git a/Dockerfile b/Dockerfile index f1b068a..06cb614 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,10 @@ WORKDIR /app # project files COPY ./pyproject.toml ./uv.lock ./ +# vendored patched jupyter_bokeh fork, installed editable via tool.uv.sources +# must be present before dep sync so uv can build the editable dependency +COPY ./jupyter_bokeh ./jupyter_bokeh + # install system requirements RUN apt-get update && \ apt-get upgrade -y && \ diff --git a/jupyter_bokeh/.eslintignore b/jupyter_bokeh/.eslintignore new file mode 100644 index 0000000..5c99ba7 --- /dev/null +++ b/jupyter_bokeh/.eslintignore @@ -0,0 +1,5 @@ +node_modules +dist +coverage +**/*.d.ts +tests diff --git a/jupyter_bokeh/.eslintrc.js b/jupyter_bokeh/.eslintrc.js new file mode 100644 index 0000000..befaaf2 --- /dev/null +++ b/jupyter_bokeh/.eslintrc.js @@ -0,0 +1,39 @@ +module.exports = { + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended' + ], + parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.json', + sourceType: 'module' + }, + plugins: ['@typescript-eslint'], + rules: { + '@typescript-eslint/naming-convention': [ + 'warn', + { + 'selector': 'interface', + 'format': ['PascalCase'], + 'custom': { + 'regex': '^I[A-Z]', + 'match': true + } + } + ], + '@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }], + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/quotes': [ + 'error', + 'single', + { avoidEscape: true, allowTemplateLiterals: false } + ], + curly: ['error', 'all'], + semi: ['warn', 'never'], + eqeqeq: 'warn', + 'prefer-arrow-callback': 'error' + } +}; diff --git a/jupyter_bokeh/.github/workflows/build.yml b/jupyter_bokeh/.github/workflows/build.yml new file mode 100644 index 0000000..322ba5f --- /dev/null +++ b/jupyter_bokeh/.github/workflows/build.yml @@ -0,0 +1,54 @@ +name: Build + +on: + push: + branches: main + pull_request: + branches: '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install node + uses: actions/setup-node@v3 + with: + node-version: '18.x' + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: '3.8' + architecture: 'x64' + - name: Setup pip cache + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: pip-3.8-${{ hashFiles('package.json') }} + restore-keys: | + pip-3.8- + pip- + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Setup yarn cache + uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + yarn- + + - name: Install dependencies + run: python -m pip install -U jupyterlab~=4.0 jupyter_packaging~=0.12.3 + - name: Build the extension + run: | + jlpm + jlpm run eslint:check + python -m pip install . + + jupyter labextension list 2>&1 | grep -ie "@bokeh/jupyter_bokeh.*OK" + python -m jupyterlab.browser_check diff --git a/jupyter_bokeh/.github/workflows/codeql.yml b/jupyter_bokeh/.github/workflows/codeql.yml new file mode 100644 index 0000000..f731497 --- /dev/null +++ b/jupyter_bokeh/.github/workflows/codeql.yml @@ -0,0 +1,42 @@ +name: "CodeQL" + +on: + push: + branches: [ "main", "bokeh-2.4" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: "1 3 * * 6" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ javascript, python ] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + queries: +security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + if: ${{ matrix.language == 'javascript' || matrix.language == 'python' }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{ matrix.language }}" diff --git a/jupyter_bokeh/.gitignore b/jupyter_bokeh/.gitignore new file mode 100644 index 0000000..4eda709 --- /dev/null +++ b/jupyter_bokeh/.gitignore @@ -0,0 +1,14 @@ +/lib/ +/dist/ +/node_modules/ +/build/ +/*.egg-info/ +/*.tgz +.ipynb_checkpoints/ +/tsconfig.tsbuildinfo +/jupyter_bokeh/labextension/ +/jupyter_bokeh/nbextension/index.js +/jupyter_bokeh/nbextension/index.js.map +__pycache__/ +/.yarn +/jupyter_bokeh/_version.py \ No newline at end of file diff --git a/jupyter_bokeh/.yarnrc.yml b/jupyter_bokeh/.yarnrc.yml new file mode 100644 index 0000000..3186f3f --- /dev/null +++ b/jupyter_bokeh/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/jupyter_bokeh/DEVGUIDE.md b/jupyter_bokeh/DEVGUIDE.md new file mode 100644 index 0000000..ee920fb --- /dev/null +++ b/jupyter_bokeh/DEVGUIDE.md @@ -0,0 +1,8 @@ +# Release process + +## Update package version + +| File | Entry | Content | +| --------------------------- | ----------------- | -------------- | +| `package.json` | `version` | `3.0.3-dev.2` | +| `package-lock.json` | `version` | `3.0.3-dev.2` | diff --git a/jupyter_bokeh/LICENSE.txt b/jupyter_bokeh/LICENSE.txt new file mode 100644 index 0000000..758436e --- /dev/null +++ b/jupyter_bokeh/LICENSE.txt @@ -0,0 +1,28 @@ +Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors +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 Anaconda nor the names of any 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. diff --git a/jupyter_bokeh/MANIFEST.in b/jupyter_bokeh/MANIFEST.in new file mode 100644 index 0000000..396fde3 --- /dev/null +++ b/jupyter_bokeh/MANIFEST.in @@ -0,0 +1,25 @@ +include LICENSE.txt +include README.md +include pyproject.toml +include jupyter-config/jupyter_bokeh.json + +include package.json +include install.json +include ts*.json +include yarn.lock + +recursive-include jupyter_bokeh/nbextension/ *.js *.js.map *.d.ts +graft jupyter_bokeh/labextension + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/jupyter_bokeh/README.md b/jupyter_bokeh/README.md new file mode 100644 index 0000000..90b6ba9 --- /dev/null +++ b/jupyter_bokeh/README.md @@ -0,0 +1,103 @@ +# jupyter_bokeh + +![Github Actions Status](https://github.com/bokeh/jupyter_bokeh/workflows/Build/badge.svg) + +A Jupyter extension for rendering [Bokeh](https://bokeh.org) content within Jupyter. See also the separate [ipywidgets_bokeh](https://github.com/bokeh/ipywidgets_bokeh) library for support for using Jupyter widgets/ipywidgets objects within Bokeh applications. + + +## Install + +For versions 3.0 and newer of JupyterLab, you have the option to install +jupyter_bokeh with either ``pip`` or ``conda``: + +```bash +pip install jupyter_bokeh +``` + +or + +```bash +conda install -c conda-forge jupyter_bokeh +``` + +For versions of Jupyter Lab older than 3.0, you must install the labextension +separately: + +```bash +conda install -c conda-forge jupyter_bokeh +jupyter labextension install @jupyter-widgets/jupyterlab-manager +jupyter labextension install @bokeh/jupyter_bokeh +``` + +To install a specific version: + +```bash +jupyter labextension install @bokeh/jupyter_bokeh@x.y.x +``` + +## Compatibility + +The core [Bokeh](https://github.com/bokeh/bokeh) library is generally version independent of +[JupyterLab](https://github.com/jupyterlab/jupyterlab) and this ``jupyter_bokeh`` extension +for versions of ``bokeh>=2.0.0``. + +Our goal is that ``jupyter_bokeh`` minor releases (using the [SemVer](https://semver.org/) pattern) are +made to follow JupyterLab minor release bumps, while micro releases are for new ``jupyter_bokeh`` features +or bug fix releases. We've been previously inconsistent with having the extension release minor version bumps +track that of JupyterLab, so users seeking to find extension releases that are compatible with their JupyterLab +installation may refer to the below table. + +###### Compatible JupyterLab and `jupyter_bokeh` versions + +| JupyterLab | `jupyter_bokeh` | +| ------------- | ---------------- | +| 0.34.x | 0.6.2 | +| 0.35.x | 0.6.3 | +| 1.0.x | 1.0.0 | +| 2.0.x | 2.0.0 | +| 3.0.x | 3.0.0 | +| 4.0.x | 4.0.0 | + +## Contributing + +### Development install + +Note: You will need NodeJS to build the extension package. + +The `jlpm` command is JupyterLab's pinned version of +[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use +`yarn` or `npm` in lieu of `jlpm` below. + +```bash +# Clone the repo to your local environment +# Change directory to the jupyter_bokeh directory +# Install package in development mode +pip install -e . +# Link your development version of the extension with JupyterLab +jupyter labextension develop . --overwrite +# Rebuild extension Typescript source after making changes +jlpm run build +``` + +You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension. + +```bash +# Watch the source directory in one terminal, automatically rebuilding when needed +jlpm run watch +# Run JupyterLab in another terminal +jupyter lab +``` + +With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt). + +By default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command: + +```bash +jupyter lab build --minimize=False +``` + +### Uninstall + +```bash +pip uninstall jupyter_bokeh +``` diff --git a/jupyter_bokeh/VENDORED.md b/jupyter_bokeh/VENDORED.md new file mode 100644 index 0000000..b95153c --- /dev/null +++ b/jupyter_bokeh/VENDORED.md @@ -0,0 +1,23 @@ +# Vendored jupyter_bokeh + +This is a vendored copy of [bokeh/jupyter_bokeh](https://github.com/bokeh/jupyter_bokeh), +installed editable via `[tool.uv.sources]` in the top level `pyproject.toml`. + +- upstream: https://github.com/bokeh/jupyter_bokeh +- base: `475f4e96f9ea4ce46b10c35119cfdd1cbeb523ab` (`4.1.0-3-g475f4e9`) + +The prebuilt frontend assets (`jupyter_bokeh/labextension`, +`jupyter_bokeh/nbextension/index.js`) are committed here so the docker image can +install the extension without a node/jlpm build. `_version.py` is left +untracked and regenerated by hatchling at install time. + +## Local patches + +Both in `jupyter_bokeh/widgets.py`: + +1. `BokehModel.close` only detaches document callbacks when still registered. + ipywidgets calls `close()` again from `__del__`, which previously raised + `KeyError` on the second detach. +2. `BokehModel._sync_model` catches `DeserializationError` and drops the event. + A frontend event can reference a model already removed/replaced server side, + which previously raised an uncaught `UnknownReferenceError`. diff --git a/jupyter_bokeh/conda.recipe/meta.yaml b/jupyter_bokeh/conda.recipe/meta.yaml new file mode 100644 index 0000000..bdf150a --- /dev/null +++ b/jupyter_bokeh/conda.recipe/meta.yaml @@ -0,0 +1,62 @@ +{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %} +{% set pkgjson = load_file_data('../package.json', from_recipe_dir=True) %} +{% set project = pyproject['project'] %} + +{% set name = project['name'] %} +{% set version = VERSION %} + +package: + name: {{ name }} + version: {{ version }} + +source: + path: .. + +build: + noarch: python + script: {{ PYTHON }} -m pip install --no-deps --ignore-installed . + script_env: + - JUPYTERLAB_TEST_VERSION + +requirements: + build: + - jupyter-packaging + - jupyterlab 4.0.* + - notebook + - python + - pip + - setuptools >=40.8.0 + - wheel + - nodejs >=18.0 + - hatchling >=1.5.0 + - hatch-jupyter-builder>=0.8.2 + - hatch-nodejs-version + run: + - python + - bokeh 3.* + - ipywidgets 8.* + run_constrained: + - jupyterlab 4.* + +test: + requires: + - jupyterlab + imports: + - jupyter_bokeh + commands: + - jupyter labextension list 2>&1 + - jupyter labextension list 2>&1 | grep -q 'jupyter.bokeh.*enabled.*OK' + +about: + home: {{ pkgjson['homepage'] }} + license: {{ project['license']['file'] }} + summary: {{ pkgjson['description'] }} + +extra: + deploy: + - anaconda-client + - setuptools + - jq + channels: + - bokeh + - conda-forge diff --git a/jupyter_bokeh/examples/jupyter_interactors.ipynb b/jupyter_bokeh/examples/jupyter_interactors.ipynb new file mode 100644 index 0000000..630a2df --- /dev/null +++ b/jupyter_bokeh/examples/jupyter_interactors.ipynb @@ -0,0 +1,112 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Basic Interactor Demo\n", + "---------------------\n", + "\n", + "This demo shows off an interactive visualization using [Bokeh](https://bokeh.org) for plotting, and Ipython interactors for widgets. The demo runs entirely inside the Ipython notebook, with no Bokeh server required.\n", + "\n", + "The dropdown offers a choice of trig functions to plot, and the sliders control the frequency, amplitude, and phase. \n", + "\n", + "To run, click on, `Cell->Run All` in the top menu, then scroll to the bottom and move the sliders. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from ipywidgets import interact\n", + "import numpy as np\n", + "\n", + "from bokeh.io import push_notebook, show, output_notebook\n", + "from bokeh.plotting import figure\n", + "output_notebook()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "x = np.linspace(0, 2*np.pi, 2000)\n", + "y = np.sin(x)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p = figure(title=\"simple line example\", width=600, height=300, y_range=(-5,5),\n", + " background_fill_color='#efefef')\n", + "r = p.line(x, y, color=\"#8888cc\", line_width=1.5, alpha=0.8)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def update(f, w=1, A=1, phi=0):\n", + " if f == \"sin\": func = np.sin\n", + " elif f == \"cos\": func = np.cos\n", + " r.data_source.data['y'] = A * func(w * x + phi)\n", + " push_notebook()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "show(p, notebook_handle=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "interact(update, f=[\"sin\", \"cos\"], w=(0,50), A=(1,10), phi=(0, 20, 0.1))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.8" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/jupyter_bokeh/examples/jupyter_sliders.ipynb b/jupyter_bokeh/examples/jupyter_sliders.ipynb new file mode 100644 index 0000000..4b10719 --- /dev/null +++ b/jupyter_bokeh/examples/jupyter_sliders.ipynb @@ -0,0 +1,86 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from bokeh.io import output_notebook\n", + "import bokeh.models.widgets as bk\n", + "import jupyter_bokeh as jbk\n", + "import ipywidgets as ip" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "output_notebook()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "bk_slider = bk.Slider(start=0, end=10, value=0)\n", + "ip_slider = ip.IntSlider(min=0, max=10, value=0)\n", + "\n", + "def on_change_bk(_attr, _old, new):\n", + " ip_slider.value = new\n", + " \n", + "def on_change_ip(change):\n", + " new = change[\"new\"]\n", + " bk_slider.value = new\n", + " \n", + "bk_slider.on_change(\"value\", on_change_bk)\n", + "ip_slider.observe(on_change_ip, names=\"value\")\n", + "\n", + "ip.VBox(children=[jbk.BokehModel(bk_slider), ip_slider])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "bk_slider.value = 5" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ip_slider.value = 3" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.8" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/jupyter_bokeh/examples/jupyter_widgets.ipynb b/jupyter_bokeh/examples/jupyter_widgets.ipynb new file mode 100644 index 0000000..830e7f2 --- /dev/null +++ b/jupyter_bokeh/examples/jupyter_widgets.ipynb @@ -0,0 +1,106 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from bokeh.plotting import figure\n", + "from bokeh.io import output_notebook\n", + "import bokeh.models.widgets as bk\n", + "import jupyter_bokeh as jbk\n", + "import ipywidgets as ip" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "output_notebook()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "x = np.linspace(0, 2*np.pi, 2000)\n", + "y = np.sin(x)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p = figure(title=\"simple line example\", width=600, height=300, y_range=(-5,5),\n", + " background_fill_color='#efefef')\n", + "r = p.line(x, y, color=\"#8888cc\", line_width=1.5, alpha=0.8)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def update(f, w=1, A=1, phi=0):\n", + " if f == \"sin\": func = np.sin\n", + " elif f == \"cos\": func = np.cos\n", + " r.data_source.data['y'] = A * func(w * x + phi)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "jbk.BokehModel(p)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ip.interact(update, f=[\"sin\", \"cos\"], w=(0,50), A=(1,10), phi=(0, 20, 0.1))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.8" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/jupyter_bokeh/examples/notebook_comms.ipynb b/jupyter_bokeh/examples/notebook_comms.ipynb new file mode 100644 index 0000000..3bcf7f5 --- /dev/null +++ b/jupyter_bokeh/examples/notebook_comms.ipynb @@ -0,0 +1,158 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Test Case: Notebook Comms" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Expected result:\n", + "\n", + "* The initial output should be \"BokehJS is loading...\"\n", + "* The output should be updated to /[Logo] BokehJS x.y.z successfully loaded" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, + "outputs": [], + "source": [ + "from bokeh.io import push_notebook, show, output_notebook\n", + "from bokeh.layouts import row\n", + "from bokeh.plotting import figure\n", + "\n", + "output_notebook()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Expected result:\n", + "\n", + "* Two scatter plots in a row should be rendered\n", + "* The scatter points should be solid filled blue" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, + "outputs": [], + "source": [ + "opts = dict(width=250, height=250, min_border=0)\n", + "\n", + "p1 = figure(**opts)\n", + "r1 = p1.circle([1,2,3], [4,5,6], size=20)\n", + "\n", + "p2 = figure(**opts)\n", + "r2 = p2.circle([1,2,3], [4,5,6], size=20)\n", + "\n", + "# get a handle to update the shown cell with\n", + "t = show(row(p1, p2), notebook_handle=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, + "outputs": [], + "source": [ + "# the comms handle repr show what cell it can be used to update\n", + "t" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Expected result:\n", + "\n", + "* The scatter points on the above left plot should become solid filled white" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, + "outputs": [], + "source": [ + "# this will update the left plot circle color with an explicit handle\n", + "r1.glyph.fill_color = \"white\"\n", + "push_notebook(handle=t)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Expected result:\n", + "\n", + "* The scatter points on the above right plot should become solid flled pink" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, + "outputs": [], + "source": [ + "# and this will update the right plot circle color because it was in the last shown cell\n", + "r2.glyph.fill_color = \"pink\"\n", + "push_notebook()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.8" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/jupyter_bokeh/examples/server_embed.ipynb b/jupyter_bokeh/examples/server_embed.ipynb new file mode 100644 index 0000000..dcbece7 --- /dev/null +++ b/jupyter_bokeh/examples/server_embed.ipynb @@ -0,0 +1,136 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Test Case: Server embed" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Expected result:\n", + "\n", + "* The initial output should be \"BokehJS is loading...\"\n", + "* The output should be updated to /[Logo] BokehJS x.y.z successfully loaded" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "\n", + "from bokeh.layouts import column, row\n", + "from bokeh.models import ColumnDataSource\n", + "from bokeh.models.widgets import Slider, TextInput\n", + "from bokeh.plotting import figure, output_notebook, show\n", + "\n", + "output_notebook()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def modify_doc(doc):\n", + " # Set up data\n", + " N = 200\n", + " x = np.linspace(0, 4*np.pi, N)\n", + " y = np.sin(x)\n", + " source = ColumnDataSource(data=dict(x=x, y=y))\n", + "\n", + " # Set up plot\n", + " plot = figure(plot_height=400, plot_width=400, title=\"my sine wave\",\n", + " tools=\"crosshair,pan,reset,save,wheel_zoom\",\n", + " x_range=[0, 4*np.pi], y_range=[-2.5, 2.5])\n", + "\n", + " plot.line('x', 'y', source=source, line_width=3, line_alpha=0.6)\n", + "\n", + " # Set up widgets\n", + " text = TextInput(title=\"title\", value='my sine wave')\n", + " offset = Slider(title=\"offset\", value=0.0, start=-5.0, end=5.0, step=0.1)\n", + " amplitude = Slider(title=\"amplitude\", value=1.0, start=-5.0, end=5.0, step=0.1)\n", + " phase = Slider(title=\"phase\", value=0.0, start=0.0, end=2*np.pi)\n", + " freq = Slider(title=\"frequency\", value=1.0, start=0.1, end=5.1, step=0.1)\n", + "\n", + " # Set up callbacks\n", + " def update_title(attrname, old, new):\n", + " plot.title.text = text.value\n", + "\n", + " text.on_change('value', update_title)\n", + "\n", + " def update_data(attrname, old, new):\n", + "\n", + " # Get the current slider values\n", + " a = amplitude.value\n", + " b = offset.value\n", + " w = phase.value\n", + " k = freq.value\n", + "\n", + " # Generate the new curve\n", + " x = np.linspace(0, 4*np.pi, N)\n", + " y = a*np.sin(k*x + w) + b\n", + "\n", + " source.data = dict(x=x, y=y)\n", + "\n", + " for w in [offset, amplitude, phase, freq]:\n", + " w.on_change('value', update_data)\n", + "\n", + "\n", + " # Set up layouts and add to document\n", + " inputs = column(text, offset, amplitude, phase, freq)\n", + "\n", + " doc.add_root(row(inputs, plot, width=800))\n", + " doc.title = \"Sliders\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Expected Result:\n", + " \n", + "* A Bokeh line plot should be rendered\n", + "* Dragging the sliders should update the line glyph\n", + "* Changing the title text area and hitting Enter should update the plot title" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "show(modify_doc)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.8" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/jupyter_bokeh/examples/static_plot.ipynb b/jupyter_bokeh/examples/static_plot.ipynb new file mode 100644 index 0000000..20e3374 --- /dev/null +++ b/jupyter_bokeh/examples/static_plot.ipynb @@ -0,0 +1,76 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Test Case: Static plot" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Expected result:\n", + "\n", + "* The initial output should be \"BokehJS is loading...\"\n", + "* The output should be updated to /[Logo] BokehJS x.y.z successfully loaded" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from bokeh.plotting import output_notebook, figure, show\n", + "\n", + "output_notebook()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Expected Result:\n", + " \n", + "* A Bokeh scatter plot should be rendered\n", + "* The toolbar bar should be rendered\n", + "* The interactive tools should be functional" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "p = figure()\n", + "p.scatter(x=[1,2,3], y=[1,2,3])\n", + "\n", + "show(p)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.8" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/jupyter_bokeh/install.json b/jupyter_bokeh/install.json new file mode 100644 index 0000000..08dc4dd --- /dev/null +++ b/jupyter_bokeh/install.json @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "jupyter_bokeh", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyter_bokeh" +} diff --git a/jupyter_bokeh/jupyter_bokeh.json b/jupyter_bokeh/jupyter_bokeh.json new file mode 100644 index 0000000..eaae553 --- /dev/null +++ b/jupyter_bokeh/jupyter_bokeh.json @@ -0,0 +1,5 @@ +{ + "load_extensions": { + "jupyter_bokeh/extension": true + } +} diff --git a/jupyter_bokeh/jupyter_bokeh/__init__.py b/jupyter_bokeh/jupyter_bokeh/__init__.py new file mode 100644 index 0000000..7cd2303 --- /dev/null +++ b/jupyter_bokeh/jupyter_bokeh/__init__.py @@ -0,0 +1,25 @@ +import json + +from pathlib import Path + +from ._version import __version__ + +HERE = Path(__file__).parent.resolve() + +from .widgets import BokehModel +with (HERE / "labextension" / "package.json").open() as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + "src": "labextension", + "dest": data["name"] + }] + +def _jupyter_nbextension_paths(): + return [{ + "section": "notebook", + "src": "nbextension", + "dest": "jupyter_bokeh", + "require": "jupyter_bokeh/extension", + }] diff --git a/jupyter_bokeh/jupyter_bokeh/labextension/package.json b/jupyter_bokeh/jupyter_bokeh/labextension/package.json new file mode 100644 index 0000000..1333e00 --- /dev/null +++ b/jupyter_bokeh/jupyter_bokeh/labextension/package.json @@ -0,0 +1,93 @@ +{ + "name": "@bokeh/jupyter_bokeh", + "version": "4.1.0", + "description": "A Jupyter extension for rendering Bokeh content.", + "keywords": [ + "jupyter", + "jupyterlab", + "jupyterlab-extension" + ], + "homepage": "https://github.com/bokeh/jupyter_bokeh", + "bugs": { + "url": "https://github.com/bokeh/jupyter_bokeh/issues" + }, + "license": "BSD-3-Clause", + "author": { + "name": "Bokeh team", + "email": "info@bokeh.org" + }, + "files": [ + "{dist,lib}/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}", + "style/**/*.{css,.js,eot,gif,html,jpg,json,png,svg,woff2,ttf}" + ], + "main": "lib/index.js", + "types": "lib/index.d.ts", + "style": "style/index.css", + "repository": { + "type": "git", + "url": "https://github.com/bokeh/jupyter_bokeh.git" + }, + "scripts": { + "build": "jlpm run build:lib && jlpm run build:nbextension && jlpm run build:labextension:dev", + "build:prod": "jlpm run build:lib && jlpm run build:nbextension && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:labextension:dev": "jupyter labextension build --development True .", + "build:nbextension": "webpack --mode=production", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", + "clean:labextension": "rimraf jupyter_bokeh/labextension", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "eslint": "eslint . --ext .ts,.tsx --fix", + "eslint:check": "eslint . --ext .ts,.tsx", + "install:extension": "jupyter labextension develop --overwrite .", + "__prepare": "jlpm run clean && jlpm run build:prod", + "watch": "run-p watch:src watch:labextension", + "watch:src": "tsc -w", + "watch:labextension": "jupyter labextension watch ." + }, + "dependencies": { + "@jupyter-widgets/base": "^2 || ^3 || ^4 || ^5 || ^6", + "@jupyterlab/application": "^4", + "@jupyterlab/docregistry": "^4", + "@jupyterlab/notebook": "^4", + "@jupyterlab/services": "^7", + "@lumino/disposable": "^2" + }, + "resolutions": { + "@lumino/widgets": "^2", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "peerDependencies": { + "@jupyter-widgets/jupyterlab-manager": "^5.0.4" + }, + "devDependencies": { + "@jupyterlab/builder": "^4", + "@typescript-eslint/eslint-plugin": "^7.0.1", + "@typescript-eslint/parser": "^7.0.1", + "css-loader": "^5.1.3", + "eslint": "^8.36.0", + "npm-run-all": "^4.1.5", + "rimraf": "^4.4.1", + "source-map-loader": "^5.0.0", + "style-loader": "^2.0.0", + "typescript": "~5.0.2", + "webpack": "^5.75.0", + "webpack-cli": "^4.10.0" + }, + "sideEffects": [ + "style/*.css", + "style/index.js" + ], + "styleModule": "style/index.js", + "jupyterlab": { + "extension": true, + "outputDir": "jupyter_bokeh/labextension", + "_build": { + "load": "static/remoteEntry.a0edbce3f9b6f9f73223.js", + "extension": "./extension", + "style": "./style" + } + } +} diff --git a/jupyter_bokeh/jupyter_bokeh/labextension/static/25.7f0e791faf45c908d390.js b/jupyter_bokeh/jupyter_bokeh/labextension/static/25.7f0e791faf45c908d390.js new file mode 100644 index 0000000..4d3dcac --- /dev/null +++ b/jupyter_bokeh/jupyter_bokeh/labextension/static/25.7f0e791faf45c908d390.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_bokeh_jupyter_bokeh=self.webpackChunk_bokeh_jupyter_bokeh||[]).push([[25],{6965(e,t,n){n.d(t,{A:()=>i});var r=n(6551),o=n.n(r),a=n(1992),c=n.n(a)()(o());c.push([e.id,"",""]);const i=c},1992(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var c={};if(r)for(var i=0;i0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=a),n&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=n):p[2]=n),o&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=o):p[4]="".concat(o)),t.push(p))}},t}},6551(e){e.exports=function(e){return e[1]}},8318(e){var t=[];function n(e){for(var n=-1,r=0;r0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},8495(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},4025(e,t,n){var r=n(8318),o=n.n(r),a=n(5879),c=n.n(a),i=n(237),s=n.n(i),u=n(4862),p=n.n(u),l=n(1050),f=n.n(l),d=n(8495),v=n.n(d),h=n(6965),m={};m.styleTagTransform=v(),m.setAttributes=p(),m.insert=s().bind(null,"head"),m.domAPI=c(),m.insertStyleElement=f(),o()(h.A,m),h.A&&h.A.locals&&h.A.locals}}]); \ No newline at end of file diff --git a/jupyter_bokeh/jupyter_bokeh/labextension/static/7.ff5312a50bb152fd32e7.js b/jupyter_bokeh/jupyter_bokeh/labextension/static/7.ff5312a50bb152fd32e7.js new file mode 100644 index 0000000..283497a --- /dev/null +++ b/jupyter_bokeh/jupyter_bokeh/labextension/static/7.ff5312a50bb152fd32e7.js @@ -0,0 +1,2 @@ +/*! For license information please see 7.ff5312a50bb152fd32e7.js.LICENSE.txt */ +(self.webpackChunk_bokeh_jupyter_bokeh=self.webpackChunk_bokeh_jupyter_bokeh||[]).push([[7],{4007(e,t,n){"use strict";n.r(t),n.d(t,{BROKEN_FILE_SVG_ICON:()=>v,DOMWidgetModel:()=>P,DOMWidgetView:()=>q,ErrorWidgetView:()=>X,IJupyterWidgetRegistry:()=>V,JUPYTER_WIDGETS_VERSION:()=>T,JupyterLuminoPanelWidget:()=>I,JupyterLuminoWidget:()=>M,JupyterPhosphorPanelWidget:()=>H,JupyterPhosphorWidget:()=>L,LayoutModel:()=>z,LayoutView:()=>W,PROTOCOL_VERSION:()=>S,StyleModel:()=>$,StyleView:()=>B,ViewList:()=>U,WidgetModel:()=>N,WidgetView:()=>D,assign:()=>u,createErrorWidgetModel:()=>J,createErrorWidgetView:()=>G,difference:()=>s,isEqual:()=>a,isObject:()=>p,isSerializable:()=>d,pack_models:()=>O,put_buffers:()=>h,reject:()=>f,remove_buffers:()=>g,resolvePromisesDict:()=>c,shims:()=>F,unpack_models:()=>C,uuid:()=>l});var r=n(7262),i=n(2404),o=n.n(i);function s(e,t){return e.filter(e=>-1===t.indexOf(e))}function a(e,t){return o()(e,t)}const u=Object.assign||function(e,...t){for(let n=1;n{const n={};for(let r=0;r=0&&t.item(n)!==this;);return n>-1};class j extends y.View{_removeElement(){this.undelegateEvents(),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}_setElement(e){this.el=e}_setAttributes(e){for(const t in e)t in this.el?this.el[t]=e[t]:this.el.setAttribute(t,e[t])}delegate(e,t,n){"string"!=typeof t&&(n=t,t=null),void 0===this._domEvents&&(this._domEvents=[]);const r=this.el,i=t?function(e){let i=e.target||e.srcElement;for(;i&&i!==r;i=i.parentNode)if(w.call(i,t))return e.delegateTarget=i,n.handleEvent?n.handleEvent(e):n(e)}:n;return this.el.addEventListener(e,i,!1),this._domEvents.push({eventName:e,handler:i,listener:n,selector:t}),i}undelegate(e,t,n){if("function"==typeof t&&(n=t,t=null),this.el&&this._domEvents){const r=this._domEvents.slice();let i=r.length;for(;i--;){const o=r[i];!(o.eventName!==e||n&&o.listener!==n||t&&o.selector!==t)&&(this.el.removeEventListener(o.eventName,o.handler,!1),this._domEvents.splice(i,1))}}return this}undelegateEvents(){if(this.el&&this._domEvents){const e=this._domEvents.length;for(let t=0;tthis.views[e].then(e=>e.remove()));return delete this.views,Promise.all(e).then(()=>{})}return Promise.resolve()}_handle_comm_closed(e){this.trigger("comm:close"),this.close(!0)}_handle_comm_msg(e){const t=e.content.data,n=t.method;switch(n){case"update":case"echo_update":return this.state_change=this.state_change.then(()=>{var r,i,o;const s=t.state,a=null!==(r=t.buffer_paths)&&void 0!==r?r:[],u=null!==(o=null===(i=e.buffers)||void 0===i?void 0:i.slice(0,a.length))&&void 0!==o?o:[];if(h(s,a,u),e.parent_header&&"echo_update"===n){const t=e.parent_header.msg_id;Object.keys(s).filter(e=>this._expectedEchoMsgIds.has(e)).forEach(e=>{this._expectedEchoMsgIds.get(e)!==t?delete s[e]:(this._expectedEchoMsgIds.delete(e),null!==this._msg_buffer&&Object.prototype.hasOwnProperty.call(this._msg_buffer,e)&&delete s[e])})}return this.constructor._deserialize_state(s,this.widget_manager)}).then(e=>{this.set_state(e)}).catch(f(`Could not process update msg for model id: ${this.model_id}`,!0)),this.state_change;case"custom":return this.trigger("msg:custom",t.content,e.buffers),Promise.resolve()}return Promise.resolve()}set_state(e){this._state_lock=e;try{this.set(e)}catch(e){console.error(`Error setting state: ${e instanceof Error?e.message:e}`)}finally{this._state_lock=null}}get_state(e){const t=this.attributes;if(e){const e=this.defaults,n="function"==typeof e?e.call(this):e,r={};return Object.keys(t).forEach(e=>{a(t[e],n[e])||(r[e]=t[e])}),r}return Object.assign({},t)}_handle_status(e){if(void 0!==this.comm&&"idle"===e.content.execution_state&&(this._pending_msgs--,this._pending_msgs<0&&(console.error(`Jupyter Widgets message throttle: Pending messages < 0 (=${this._pending_msgs}), which is unexpected. Resetting to 0 to continue.`),this._pending_msgs=0),null!==this._msg_buffer&&this._pending_msgs<1)){const e=this.send_sync_message(this._msg_buffer,this._msg_buffer_callbacks);this.rememberLastUpdateFor(e),this._msg_buffer=null,this._msg_buffer_callbacks=null}}callbacks(e){return this.widget_manager.callbacks(e)}set(e,t,n){const r=m.call(this,e,t,n);if(void 0!==this._buffered_state_diff){const e=this.changedAttributes()||{};if(this._state_lock)for(const t of Object.keys(this._state_lock))e[t]===this._state_lock[t]&&delete e[t];if(this._buffered_state_diff_synced)for(const t of Object.keys(this._buffered_state_diff_synced))e[t]===this._buffered_state_diff_synced[t]&&delete e[t];this._buffered_state_diff=u(this._buffered_state_diff,e)}return!1===this._changing&&(this._buffered_state_diff_synced={}),r}sync(e,t,n={}){if(void 0===this.comm)throw"Syncing error: no comm channel defined";const r="patch"===e?n.attrs:t.get_state(n.drop_defaults);if(this._state_lock)for(const e of Object.keys(this._state_lock))r[e]===this._state_lock[e]&&delete r[e];Object.keys(r).forEach(e=>{this._attrsToUpdate.add(e)});const i=this.serialize(r);if(Object.keys(i).length>0){const t=n.callbacks||this.callbacks();if(this._pending_msgs>=1){switch(e){case"patch":this._msg_buffer=u(this._msg_buffer||{},i);break;case"update":case"create":this._msg_buffer=i;break;default:throw"unrecognized syncing method"}this._msg_buffer_callbacks=t}else{const e=this.send_sync_message(r,t);this.rememberLastUpdateFor(e)}}}rememberLastUpdateFor(e){this._attrsToUpdate.forEach(t=>{this._expectedEchoMsgIds.set(t,e)}),this._attrsToUpdate=new Set}serialize(e){const t=this.constructor.serializers||r.JSONExt.emptyObject;for(const n of Object.keys(e))try{t[n]&&t[n].serialize?e[n]=t[n].serialize(e[n],this):e[n]=JSON.parse(JSON.stringify(e[n])),e[n]&&e[n].toJSON&&(e[n]=e[n].toJSON())}catch(e){throw console.error("Error serializing widget state attribute: ",n),e}return e}send_sync_message(e,t={}){if(!this.comm)return"";try{const n=(t={shell:Object.assign({},t.shell),iopub:Object.assign({},t.iopub),input:t.input}).iopub.status;t.iopub.status=e=>{this._handle_status(e),n&&n(e)};const r=g(e),i=this.comm.send({method:"update",state:r.state,buffer_paths:r.buffer_paths},t,{},r.buffers);return this._pending_msgs++,i}catch(e){console.error("Could not send widget sync message",e)}return""}save_changes(e){if(this.comm_live){const t={patch:!0};e&&(t.callbacks=e),this.save(this._buffered_state_diff,t),this._changing&&u(this._buffered_state_diff_synced,this._buffered_state_diff),this._buffered_state_diff={}}}on_some_change(e,t,n){this.on("change",(...r)=>{e.some(this.hasChanged,this)&&t.apply(n,r)},this)}toJSON(e){return`IPY_MODEL_${this.model_id}`}static _deserialize_state(e,t){const n=this.serializers;let r;if(n){r={};for(const i in e)n[i]&&n[i].deserialize?r[i]=n[i].deserialize(e[i],t):r[i]=e[i]}else r=e;return c(r)}}class P extends N{defaults(){return u(super.defaults(),{_dom_classes:[],tabbable:null,tooltip:null})}}P.serializers=Object.assign(Object.assign({},N.serializers),{layout:{deserialize:C},style:{deserialize:C}});class D extends j{constructor(e){super(e)}initialize(e){this.listenTo(this.model,"change",(e,t)=>{const n=Object.keys(this.model.changedAttributes()||{});"_view_count"===n[0]&&1===n.length||this.update(t)}),this.options=e.options,this.once("remove",()=>{"number"==typeof this.model.get("_view_count")&&(this.model.set("_view_count",this.model.get("_view_count")-1),this.model.save_changes())}),this.once("displayed",()=>{"number"==typeof this.model.get("_view_count")&&(this.model.set("_view_count",this.model.get("_view_count")+1),this.model.save_changes())}),this.displayed=new Promise((e,t)=>{this.once("displayed",e),this.model.on("msg:custom",this.handle_message.bind(this))})}handle_message(e){"focus"===e.do?this.el.focus():"blur"===e.do&&this.el.blur()}update(e){}render(){}create_child_view(e,t={}){return t=Object.assign({parent:this},t),this.model.widget_manager.create_view(e,t).catch(f("Could not create child view",!0))}callbacks(){return this.model.callbacks(this)}send(e,t){this.model.send(e,this.callbacks(),t)}touch(){this.model.save_changes(this.callbacks())}remove(){return super.remove(),this.trigger("remove"),this}}class M extends k.Widget{constructor(e){const t=e.view;delete e.view,super(e),this._view=t}dispose(){this.isDisposed||(super.dispose(),this._view.remove(),this._view=null)}processMessage(e){super.processMessage(e),this._view.processLuminoMessage(e)}}const L=M;class I extends k.Panel{constructor(e){const t=e.view;delete e.view,super(e),this._view=t}processMessage(e){super.processMessage(e),this._view.processLuminoMessage(e)}dispose(){var e;this.isDisposed||(super.dispose(),null===(e=this._view)||void 0===e||e.remove(),this._view=null)}}const H=I;class q extends D{initialize(e){super.initialize(e),this.listenTo(this.model,"change:_dom_classes",(e,t)=>{const n=e.previous("_dom_classes");this.update_classes(n,t)}),this.layoutPromise=Promise.resolve(),this.listenTo(this.model,"change:layout",(e,t)=>{this.setLayout(t,e.previous("layout"))}),this.stylePromise=Promise.resolve(),this.listenTo(this.model,"change:style",(e,t)=>{this.setStyle(t,e.previous("style"))}),this.displayed.then(()=>{this.update_classes([],this.model.get("_dom_classes")),this.setLayout(this.model.get("layout")),this.setStyle(this.model.get("style"))}),this._comm_live_update(),this.listenTo(this.model,"comm_live_update",()=>{this._comm_live_update()}),this.listenTo(this.model,"change:tooltip",this.updateTooltip),this.updateTooltip()}setLayout(e,t){e&&(this.layoutPromise=this.layoutPromise.then(t=>(t&&(t.unlayout(),this.stopListening(t.model),t.remove()),this.create_child_view(e).then(e=>this.displayed.then(()=>(e.trigger("displayed"),this.listenTo(e.model,"change",()=>{E.MessageLoop.postMessage(this.luminoWidget,k.Widget.ResizeMessage.UnknownSize)}),E.MessageLoop.postMessage(this.luminoWidget,k.Widget.ResizeMessage.UnknownSize),this.trigger("layout-changed"),e))).catch(f("Could not add LayoutView to DOMWidgetView",!0)))))}setStyle(e,t){e&&(this.stylePromise=this.stylePromise.then(t=>(t&&(t.unstyle(),this.stopListening(t.model),t.remove()),this.create_child_view(e).then(e=>this.displayed.then(()=>(e.trigger("displayed"),this.trigger("style-changed"),e))).catch(f("Could not add styleView to DOMWidgetView",!0)))))}updateTooltip(){const e=this.model.get("tooltip");e?0===this.model.get("description").length&&this.el.setAttribute("title",e):this.el.removeAttribute("title")}update_classes(e,t,n){void 0===n&&(n=this.el),s(e,t).map(function(e){n.classList?n.classList.remove(e):n.setAttribute("class",n.getAttribute("class").replace(e,""))}),s(t,e).map(function(e){n.classList?n.classList.add(e):n.setAttribute("class",n.getAttribute("class").concat(" ",e))})}update_mapped_classes(e,t,n){let r=this.model.previous(t);const i=e[r]?e[r]:[];r=this.model.get(t);const o=e[r]?e[r]:[];this.update_classes(i,o,n||this.el)}set_mapped_classes(e,t,n){const r=this.model.get(t),i=e[r]?e[r]:[];this.update_classes([],i,n||this.el)}_setElement(e){this.luminoWidget&&this.luminoWidget.dispose(),this.$el=e instanceof _()?e:_()(e),this.el=this.$el[0],this.luminoWidget=new M({node:e,view:this})}remove(){return this.luminoWidget&&this.luminoWidget.dispose(),super.remove()}processPhosphorMessage(e){this.processLuminoMessage(e)}processLuminoMessage(e){switch(e.type){case"after-attach":this.trigger("displayed");break;case"show":this.trigger("shown")}}_comm_live_update(){this.model.comm_live?this.luminoWidget.removeClass("jupyter-widgets-disconnected"):this.luminoWidget.addClass("jupyter-widgets-disconnected")}updateTabindex(){const e=this.model.get("tabbable");!0===e?this.el.setAttribute("tabIndex","0"):!1===e?this.el.setAttribute("tabIndex","-1"):null===e&&this.el.removeAttribute("tabIndex")}get pWidget(){return this.luminoWidget}set pWidget(e){this.luminoWidget=e}}const R={align_content:null,align_items:null,align_self:null,border_top:null,border_right:null,border_bottom:null,border_left:null,bottom:null,display:null,flex:null,flex_flow:null,height:null,justify_content:null,justify_items:null,left:null,margin:null,max_height:null,max_width:null,min_height:null,min_width:null,overflow:null,order:null,padding:null,right:null,top:null,visibility:null,width:null,object_fit:null,object_position:null,grid_auto_columns:null,grid_auto_flow:null,grid_auto_rows:null,grid_gap:null,grid_template_rows:null,grid_template_columns:null,grid_template_areas:null,grid_row:null,grid_column:null,grid_area:null};class z extends N{defaults(){return u(super.defaults(),{_model_name:"LayoutModel",_view_name:"LayoutView"},R)}}class W extends D{initialize(e){this._traitNames=[],super.initialize(e);for(const e of Object.keys(R))this.registerTrait(e)}registerTrait(e){this._traitNames.push(e),this.listenTo(this.model,"change:"+e,(t,n)=>{this.handleChange(e,n)}),this.handleChange(e,this.model.get(e))}css_name(e){return e.replace(/_/g,"-")}handleChange(e,t){const n=this.options.parent;n?null===t?n.el.style.removeProperty(this.css_name(e)):n.el.style.setProperty(this.css_name(e),t):console.warn("Style not applied because a parent view does not exist")}unlayout(){const e=this.options.parent;this._traitNames.forEach(t=>{e?e.el.style.removeProperty(this.css_name(t)):console.warn("Style not removed because a parent view does not exist")},this)}}class $ extends N{defaults(){const e=this.constructor;return u(super.defaults(),{_model_name:"StyleModel",_view_name:"StyleView"},Object.keys(e.styleProperties).reduce((t,n)=>(t[n]=e.styleProperties[n].default,t),{}))}}$.styleProperties={};class B extends D{initialize(e){this._traitNames=[],super.initialize(e);const t=this.model.constructor;for(const e of Object.keys(t.styleProperties))this.registerTrait(e);this.style()}registerTrait(e){this._traitNames.push(e),this.listenTo(this.model,"change:"+e,(t,n)=>{this.handleChange(e,n)})}handleChange(e,t){const n=this.options.parent;if(n){const r=this.model.constructor.styleProperties,i=r[e].attribute,o=r[e].selector,s=o?n.el.querySelectorAll(o):[n.el];if(null===t)for(let e=0;e!==s.length;++e)s[e].style.removeProperty(i);else for(let e=0;e!==s.length;++e)s[e].style.setProperty(i,t)}else console.warn("Style not applied because a parent view does not exist")}style(){for(const e of this._traitNames)this.handleChange(e,this.model.get(e))}unstyle(){const e=this.options.parent,t=this.model.constructor.styleProperties;this._traitNames.forEach(n=>{if(e){const r=t[n].attribute,i=t[n].selector,o=i?e.el.querySelectorAll(i):[e.el];for(let e=0;e!==o.length;++e)o[e].style.removeProperty(r)}else console.warn("Style not removed because a parent view does not exist")},this)}}var F;!function(e){let t;!function(e){e.CommManager=class{constructor(e){this.targets=Object.create(null),this.comms=Object.create(null),this.init_kernel(e)}init_kernel(e){this.kernel=e,this.jsServicesKernel=e}async new_comm(e,n,r,i,o,s){const a=this.jsServicesKernel.createComm(e,o),u=new t(a);return this.register_comm(u),u.open(n,r,i,s),u}register_target(e,n){const r=this.jsServicesKernel.registerCommTarget(e,(e,r)=>{const i=new t(e);this.register_comm(i);try{return n(i,r)}catch(e){i.close(),console.error(e),console.error(new Error("Exception opening new comm"))}});this.targets[e]=r}unregister_target(e,t){this.targets[e].dispose(),delete this.targets[e]}register_comm(e){return this.comms[e.comm_id]=Promise.resolve(e),e.kernel=this.kernel,e.comm_id}};class t{constructor(e){this.jsServicesComm=e}get comm_id(){return this.jsServicesComm.commId}get target_name(){return this.jsServicesComm.targetName}open(e,t,n,r){const i=this.jsServicesComm.open(e,n,r);return this._hookupCallbacks(i,t),i.msg.header.msg_id}send(e,t,n,r){const i=this.jsServicesComm.send(e,n,r);return this._hookupCallbacks(i,t),i.msg.header.msg_id}close(e,t,n,r){const i=this.jsServicesComm.close(e,n,r);return this._hookupCallbacks(i,t),i.msg.header.msg_id}on_msg(e){this.jsServicesComm.onMsg=e.bind(this)}on_close(e){this.jsServicesComm.onClose=e.bind(this)}_hookupCallbacks(e,t){t&&(e.onReply=function(e){t.shell&&t.shell.reply&&t.shell.reply(e)},e.onStdin=function(e){t.input&&t.input(e)},e.onIOPub=function(e){if(t.iopub)if(t.iopub.status&&"status"===e.header.msg_type)t.iopub.status(e);else if(t.iopub.clear_output&&"clear_output"===e.header.msg_type)t.iopub.clear_output(e);else if(t.iopub.output)switch(e.header.msg_type){case"display_data":case"execute_result":case"stream":case"error":t.iopub.output(e)}})}}e.Comm=t}(t=e.services||(e.services={}))}(F||(F={}));class U{constructor(e,t,n){this.initialize(e,t,n)}initialize(e,t,n){this._handler_context=n||this,this._models=[],this.views=[],this._create_view=e,this._remove_view=t||function(e){e.remove()}}update(e,t,n,r){const i=n||this._remove_view,o=t||this._create_view;r=r||this._handler_context;let s=0;for(;s=this._models.length||e[s]!==this._models[s]);s++);const a=s,u=this.views.splice(a,this.views.length-a);for(let e=0;e{e.forEach(e=>this._remove_view.call(this._handler_context,e)),this.views=[],this._models=[]})}dispose(){this.views=null,this._models=null}}const V=new r.Token("jupyter.extensions.jupyterWidgetRegistry");function J(e,t){return class extends P{constructor(n,r){super(n=Object.assign(Object.assign({},n),{_view_name:"ErrorWidgetView",_view_module:"@jupyter-widgets/base",_model_module_version:T,_view_module_version:T,msg:t,error:e}),r),this.comm_live=!0}}}class X extends q{generateErrorMessage(){return{msg:this.model.get("msg"),stack:String(this.model.get("error").stack)}}render(){const{msg:e,stack:t}=this.generateErrorMessage();this.el.classList.add("jupyter-widgets");const n=document.createElement("div");n.classList.add("jupyter-widgets-error-widget","icon-error"),n.innerHTML=v;const r=document.createElement("pre");let i,o;r.style.textAlign="center",r.innerText="Click to show javascript error.",n.append(r),this.el.appendChild(n),this.el.onclick=()=>{n.classList.contains("icon-error")&&(o=o||n.clientHeight,i=i||n.clientWidth,n.classList.remove("icon-error"),n.innerHTML=`\n
[Open Browser Console for more detailed log - Double click to close this message]\n${e}\n${t}
\n `,n.style.height=`${o}px`,n.style.width=`${i}px`,n.classList.add("text-error"))},this.el.ondblclick=()=>{n.classList.contains("text-error")&&(n.classList.remove("text-error"),n.innerHTML=v,n.append(r),n.classList.add("icon-error"))}}}function G(e,t){return class extends X{generateErrorMessage(){return{msg:t,stack:String(e instanceof Error?e.stack:e)}}}}},1391(e,t,n){var r,i,o;o="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g,r=[n(884),n(4692),t],i=function(e,t,n){o.Backbone=function(e,t,n,r){var i=e.Backbone,o=Array.prototype.slice;t.VERSION="1.4.0",t.$=r,t.noConflict=function(){return e.Backbone=i,this},t.emulateHTTP=!1,t.emulateJSON=!1;var s,a=t.Events={},u=/\s+/,l=function(e,t,r,i,o){var s,a=0;if(r&&"object"==typeof r){void 0!==i&&"context"in o&&void 0===o.context&&(o.context=i);for(s=n.keys(r);athis.length&&(i=this.length),i<0&&(i+=this.length+1);var o,s,a=[],u=[],l=[],c=[],f={},h=t.add,d=t.merge,p=t.remove,g=!1,v=this.comparator&&null==i&&!1!==t.sort,m=n.isString(this.comparator)?this.comparator:null;for(s=0;s7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(W,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash="#"+this.fragment}var o=window.addEventListener||function(e,t){return attachEvent("on"+e,t)};if(this._usePushState?o("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?o("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var e=window.removeEventListener||function(e,t){return detachEvent("on"+e,t)};this._usePushState?e("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&e("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),R.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();if(t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(e){return!!this.matchRoot()&&(e=this.fragment=this.getFragment(e),n.some(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0}))},navigate:function(e,t){if(!R.started)return!1;t&&!0!==t||(t={trigger:!!t}),e=this.getFragment(e||"");var n=this.root;""!==e&&"?"!==e.charAt(0)||(n=n.slice(0,-1)||"/");var r=n+e;e=e.replace($,"");var i=this.decodeFragment(e);if(this.fragment!==i){if(this.fragment=i,this._usePushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);if(this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getHash(this.iframe.contentWindow)){var o=this.iframe.contentWindow;t.replace||(o.document.open(),o.document.close()),this._updateHash(o.location,e,t.replace)}}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,n){if(n){var r=e.href.replace(/(javascript:|#).*$/,"");e.replace(r+"#"+t)}else e.hash="#"+t}}),t.history=new R;m.extend=y.extend=M.extend=S.extend=R.extend=function(e,t){var r,i=this;return r=e&&n.has(e,"constructor")?e.constructor:function(){return i.apply(this,arguments)},n.extend(r,i,t),r.prototype=n.create(i.prototype,e),r.prototype.constructor=r,r.__super__=i.prototype,r};var B=function(){throw new Error('A "url" property or function must be specified')},F=function(e,t){var n=t.error;t.error=function(r){n&&n.call(t.context,e,r,t),e.trigger("error",e,r,t)}};return t}(o,n,e,t)}.apply(t,r),void 0===i||(e.exports=i)},4692(e,t){var n;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(r,i){"use strict";var o=[],s=Object.getPrototypeOf,a=o.slice,u=o.flat?function(e){return o.flat.call(e)}:function(e){return o.concat.apply([],e)},l=o.push,c=o.indexOf,f={},h=f.toString,d=f.hasOwnProperty,p=d.toString,g=p.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},b=r.document,_={type:!0,src:!0,nonce:!0,noModule:!0};function x(e,t,n){var r,i,o=(n=n||b).createElement("script");if(o.text=e,t)for(r in _)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[h.call(e)]||"object":typeof e}var j="3.7.1",E=/HTML$/i,k=function(e,t){return new k.fn.init(e,t)};function T(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function S(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}k.fn=k.prototype={jquery:j,constructor:k,length:0,toArray:function(){return a.call(this)},get:function(e){return null==e?a.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(e){return this.pushStack(k.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(k.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(k.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+N+")"+N+"*"),W=new RegExp(N+"|>"),$=new RegExp(H),B=new RegExp("^"+D+"$"),F={ID:new RegExp("^#("+D+")"),CLASS:new RegExp("^\\.("+D+")"),TAG:new RegExp("^("+D+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+N+"*(even|odd|(([+-]|)(\\d*)n|)"+N+"*(?:([+-]|)"+N+"*(\\d+)|))"+N+"*\\)|)","i"),bool:new RegExp("^(?:"+T+")$","i"),needsContext:new RegExp("^"+N+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+N+"*((?:-\\d)?\\d*)"+N+"*\\)|)(?=[^-]|$)","i")},U=/^(?:input|select|textarea|button)$/i,V=/^h\d$/i,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,X=/[+~]/,G=new RegExp("\\\\[\\da-fA-F]{1,6}"+N+"?|\\\\([^\\r\\n\\f])","g"),Y=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},K=function(){ue()},Q=he(function(e){return!0===e.disabled&&S(e,"fieldset")},{dir:"parentNode",next:"legend"});try{g.apply(o=a.call(L.childNodes),L.childNodes),o[L.childNodes.length].nodeType}catch(e){g={apply:function(e,t){I.apply(e,a.call(t))},call:function(e){I.apply(e,a.call(arguments,1))}}}function Z(e,t,n,r){var i,o,s,a,l,c,d,p=t&&t.ownerDocument,y=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==y&&9!==y&&11!==y)return n;if(!r&&(ue(t),t=t||u,f)){if(11!==y&&(l=J.exec(e)))if(i=l[1]){if(9===y){if(!(s=t.getElementById(i)))return n;if(s.id===i)return g.call(n,s),n}else if(p&&(s=p.getElementById(i))&&Z.contains(t,s)&&s.id===i)return g.call(n,s),n}else{if(l[2])return g.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&t.getElementsByClassName)return g.apply(n,t.getElementsByClassName(i)),n}if(!(j[e+" "]||h&&h.test(e))){if(d=e,p=t,1===y&&(W.test(e)||z.test(e))){for((p=X.test(e)&&ae(t.parentNode)||t)==t&&v.scope||((a=t.getAttribute("id"))?a=k.escapeSelector(a):t.setAttribute("id",a=m)),o=(c=ce(e)).length;o--;)c[o]=(a?"#"+a:":scope")+" "+fe(c[o]);d=c.join(",")}try{return g.apply(n,p.querySelectorAll(d)),n}catch(t){j(e,!0)}finally{a===m&&t.removeAttribute("id")}}}return ye(e.replace(P,"$1"),t,n,r)}function ee(){var e=[];return function n(r,i){return e.push(r+" ")>t.cacheLength&&delete n[e.shift()],n[r+" "]=i}}function te(e){return e[m]=!0,e}function ne(e){var t=u.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function re(e){return function(t){return S(t,"input")&&t.type===e}}function ie(e){return function(t){return(S(t,"input")||S(t,"button"))&&t.type===e}}function oe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Q(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function se(e){return te(function(t){return t=+t,te(function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function ae(e){return e&&void 0!==e.getElementsByTagName&&e}function ue(e){var n,r=e?e.ownerDocument||e:L;return r!=u&&9===r.nodeType&&r.documentElement?(l=(u=r).documentElement,f=!k.isXMLDoc(u),p=l.matches||l.webkitMatchesSelector||l.msMatchesSelector,l.msMatchesSelector&&L!=u&&(n=u.defaultView)&&n.top!==n&&n.addEventListener("unload",K),v.getById=ne(function(e){return l.appendChild(e).id=k.expando,!u.getElementsByName||!u.getElementsByName(k.expando).length}),v.disconnectedMatch=ne(function(e){return p.call(e,"*")}),v.scope=ne(function(){return u.querySelectorAll(":scope")}),v.cssHas=ne(function(){try{return u.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),v.getById?(t.filter.ID=function(e){var t=e.replace(G,Y);return function(e){return e.getAttribute("id")===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n=t.getElementById(e);return n?[n]:[]}}):(t.filter.ID=function(e){var t=e.replace(G,Y);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),t.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},t.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&f)return t.getElementsByClassName(e)},h=[],ne(function(e){var t;l.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||h.push("\\["+N+"*(?:value|"+T+")"),e.querySelectorAll("[id~="+m+"-]").length||h.push("~="),e.querySelectorAll("a#"+m+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll(":checked").length||h.push(":checked"),(t=u.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),l.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),(t=u.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+N+"*name"+N+"*="+N+"*(?:''|\"\")")}),v.cssHas||h.push(":has"),h=h.length&&new RegExp(h.join("|")),E=function(e,t){if(e===t)return s=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!v.sortDetached&&t.compareDocumentPosition(e)===n?e===u||e.ownerDocument==L&&Z.contains(L,e)?-1:t===u||t.ownerDocument==L&&Z.contains(L,t)?1:i?c.call(i,e)-c.call(i,t):0:4&n?-1:1)},u):u}for(e in Z.matches=function(e,t){return Z(e,null,null,t)},Z.matchesSelector=function(e,t){if(ue(e),f&&!j[t+" "]&&(!h||!h.test(t)))try{var n=p.call(e,t);if(n||v.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){j(t,!0)}return Z(t,u,null,[e]).length>0},Z.contains=function(e,t){return(e.ownerDocument||e)!=u&&ue(e),k.contains(e,t)},Z.attr=function(e,n){(e.ownerDocument||e)!=u&&ue(e);var r=t.attrHandle[n.toLowerCase()],i=r&&d.call(t.attrHandle,n.toLowerCase())?r(e,n,!f):void 0;return void 0!==i?i:e.getAttribute(n)},Z.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},k.uniqueSort=function(e){var t,n=[],r=0,o=0;if(s=!v.sortStable,i=!v.sortStable&&a.call(e,0),C.call(e,E),s){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)O.call(e,n[r],1)}return i=null,e},k.fn.uniqueSort=function(){return this.pushStack(k.uniqueSort(a.apply(this)))},t=k.expr={cacheLength:50,createPseudo:te,match:F,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(G,Y),e[3]=(e[3]||e[4]||e[5]||"").replace(G,Y),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Z.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Z.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return F.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&$.test(n)&&(t=ce(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(G,Y).toLowerCase();return"*"===e?function(){return!0}:function(e){return S(e,t)}},CLASS:function(e){var t=_[e+" "];return t||(t=new RegExp("(^|"+N+")"+e+"("+N+"|$)"))&&_(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=Z.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(q," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,h,d,p=o!==s?"nextSibling":"previousSibling",g=t.parentNode,v=a&&t.nodeName.toLowerCase(),b=!u&&!a,_=!1;if(g){if(o){for(;p;){for(f=t;f=f[p];)if(a?S(f,v):1===f.nodeType)return!1;d=p="only"===e&&!d&&"nextSibling"}return!0}if(d=[s?g.firstChild:g.lastChild],s&&b){for(_=(h=(l=(c=g[m]||(g[m]={}))[e]||[])[0]===y&&l[1])&&l[2],f=h&&g.childNodes[h];f=++h&&f&&f[p]||(_=h=0)||d.pop();)if(1===f.nodeType&&++_&&f===t){c[e]=[y,h,_];break}}else if(b&&(_=h=(l=(c=t[m]||(t[m]={}))[e]||[])[0]===y&&l[1]),!1===_)for(;(f=++h&&f&&f[p]||(_=h=0)||d.pop())&&(!(a?S(f,v):1===f.nodeType)||!++_||(b&&((c=f[m]||(f[m]={}))[e]=[y,_]),f!==t)););return(_-=i)===r||_%r===0&&_/r>=0}}},PSEUDO:function(e,n){var r,i=t.pseudos[e]||t.setFilters[e.toLowerCase()]||Z.error("unsupported pseudo: "+e);return i[m]?i(n):i.length>1?(r=[e,e,"",n],t.setFilters.hasOwnProperty(e.toLowerCase())?te(function(e,t){for(var r,o=i(e,n),s=o.length;s--;)e[r=c.call(e,o[s])]=!(t[r]=o[s])}):function(e){return i(e,0,r)}):i}},pseudos:{not:te(function(e){var t=[],n=[],r=me(e.replace(P,"$1"));return r[m]?te(function(e,t,n,i){for(var o,s=r(e,null,i,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:te(function(e){return function(t){return Z(e,t).length>0}}),contains:te(function(e){return e=e.replace(G,Y),function(t){return(t.textContent||k.text(t)).indexOf(e)>-1}}),lang:te(function(e){return B.test(e||"")||Z.error("unsupported lang: "+e),e=e.replace(G,Y).toLowerCase(),function(t){var n;do{if(n=f?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=r.location&&r.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===l},focus:function(e){return e===function(){try{return u.activeElement}catch(e){}}()&&u.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:oe(!1),disabled:oe(!0),checked:function(e){return S(e,"input")&&!!e.checked||S(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!t.pseudos.empty(e)},header:function(e){return V.test(e.nodeName)},input:function(e){return U.test(e.nodeName)},button:function(e){return S(e,"input")&&"button"===e.type||S(e,"button")},text:function(e){var t;return S(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:se(function(){return[0]}),last:se(function(e,t){return[t-1]}),eq:se(function(e,t,n){return[n<0?n+t:n]}),even:se(function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e}),gt:se(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function pe(e,t,n,r,i){for(var o,s=[],a=0,u=e.length,l=null!=t;a-1&&(o[l]=!(s[l]=h))}}else d=pe(d===s?d.splice(m,d.length):d),i?i(null,s,d,u):g.apply(s,d)})}function ve(e){for(var r,i,o,s=e.length,a=t.relative[e[0].type],u=a||t.relative[" "],l=a?1:0,f=he(function(e){return e===r},u,!0),h=he(function(e){return c.call(r,e)>-1},u,!0),d=[function(e,t,i){var o=!a&&(i||t!=n)||((r=t).nodeType?f(e,t,i):h(e,t,i));return r=null,o}];l1&&de(d),l>1&&fe(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(P,"$1"),i,l0,o=e.length>0,s=function(s,a,l,c,h){var d,p,v,m=0,b="0",_=s&&[],x=[],w=n,j=s||o&&t.find.TAG("*",h),E=y+=null==w?1:Math.random()||.1,T=j.length;for(h&&(n=a==u||a||h);b!==T&&null!=(d=j[b]);b++){if(o&&d){for(p=0,a||d.ownerDocument==u||(ue(d),l=!f);v=e[p++];)if(v(d,a||u,l)){g.call(c,d);break}h&&(y=E)}i&&((d=!v&&d)&&m--,s&&_.push(d))}if(m+=b,i&&b!==m){for(p=0;v=r[p++];)v(_,x,a,l);if(s){if(m>0)for(;b--;)_[b]||x[b]||(x[b]=A.call(c));x=pe(x)}g.apply(c,x),h&&!s&&x.length>0&&m+r.length>1&&k.uniqueSort(c)}return h&&(y=E,n=w),_};return i?te(s):s}(s,o)),a.selector=e}return a}function ye(e,n,r,i){var o,s,a,u,l,c="function"==typeof e&&e,h=!i&&ce(e=c.selector||e);if(r=r||[],1===h.length){if((s=h[0]=h[0].slice(0)).length>2&&"ID"===(a=s[0]).type&&9===n.nodeType&&f&&t.relative[s[1].type]){if(!(n=(t.find.ID(a.matches[0].replace(G,Y),n)||[])[0]))return r;c&&(n=n.parentNode),e=e.slice(s.shift().value.length)}for(o=F.needsContext.test(e)?0:s.length;o--&&(a=s[o],!t.relative[u=a.type]);)if((l=t.find[u])&&(i=l(a.matches[0].replace(G,Y),X.test(s[0].type)&&ae(n.parentNode)||n))){if(s.splice(o,1),!(e=i.length&&fe(s)))return g.apply(r,i),r;break}}return(c||me(e,h))(i,n,!f,r,!n||X.test(e)&&ae(n.parentNode)||n),r}le.prototype=t.filters=t.pseudos,t.setFilters=new le,v.sortStable=m.split("").sort(E).join("")===m,ue(),v.sortDetached=ne(function(e){return 1&e.compareDocumentPosition(u.createElement("fieldset"))}),k.find=Z,k.expr[":"]=k.expr.pseudos,k.unique=k.uniqueSort,Z.compile=me,Z.select=ye,Z.setDocument=ue,Z.tokenize=ce,Z.escape=k.escapeSelector,Z.getText=k.text,Z.isXML=k.isXMLDoc,Z.selectors=k.expr,Z.support=k.support,Z.uniqueSort=k.uniqueSort}();var H=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&k(e).is(n))break;r.push(e)}return r},q=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},R=k.expr.match.needsContext,z=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function W(e,t,n){return m(t)?k.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?k.grep(e,function(e){return e===t!==n}):"string"!=typeof t?k.grep(e,function(e){return c.call(t,e)>-1!==n}):k.filter(t,e,n)}k.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?k.find.matchesSelector(r,e)?[r]:[]:k.find.matches(e,k.grep(t,function(e){return 1===e.nodeType}))},k.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(k(e).filter(function(){for(t=0;t1?k.uniqueSort(n):n},filter:function(e){return this.pushStack(W(this,e||[],!1))},not:function(e){return this.pushStack(W(this,e||[],!0))},is:function(e){return!!W(this,"string"==typeof e&&R.test(e)?k(e):e||[],!1).length}});var $,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||$,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:B.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:b,!0)),z.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=b.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,$=k(b);var F=/^(?:parents|prev(?:Until|All))/,U={children:!0,contents:!0,next:!0,prev:!0};function V(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&k.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?k.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?c.call(k(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),k.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return H(e,"parentNode")},parentsUntil:function(e,t,n){return H(e,"parentNode",n)},next:function(e){return V(e,"nextSibling")},prev:function(e){return V(e,"previousSibling")},nextAll:function(e){return H(e,"nextSibling")},prevAll:function(e){return H(e,"previousSibling")},nextUntil:function(e,t,n){return H(e,"nextSibling",n)},prevUntil:function(e,t,n){return H(e,"previousSibling",n)},siblings:function(e){return q((e.parentNode||{}).firstChild,e)},children:function(e){return q(e.firstChild)},contents:function(e){return null!=e.contentDocument&&s(e.contentDocument)?e.contentDocument:(S(e,"template")&&(e=e.content||e),k.merge([],e.childNodes))}},function(e,t){k.fn[e]=function(n,r){var i=k.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=k.filter(r,i)),this.length>1&&(U[e]||k.uniqueSort(i),F.test(e)&&i.reverse()),this.pushStack(i)}});var J=/[^\x20\t\r\n\f]+/g;function X(e){return e}function G(e){throw e}function Y(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}k.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return k.each(e.match(J)||[],function(e,n){t[n]=!0}),t}(e):k.extend({},e);var t,n,r,i,o=[],s=[],a=-1,u=function(){for(i=i||e.once,r=t=!0;s.length;a=-1)for(n=s.shift();++a-1;)o.splice(n,1),n<=a&&a--}),this},has:function(e){return e?k.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},k.extend({Deferred:function(e){var t=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return k.Deferred(function(n){k.each(t,function(t,r){var i=m(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&m(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,n,i){var o=0;function s(e,t,n,i){return function(){var a=this,u=arguments,l=function(){var r,l;if(!(e=o&&(n!==G&&(a=void 0,u=[r]),t.rejectWith(a,u))}};e?c():(k.Deferred.getErrorHook?c.error=k.Deferred.getErrorHook():k.Deferred.getStackHook&&(c.error=k.Deferred.getStackHook()),r.setTimeout(c))}}return k.Deferred(function(r){t[0][3].add(s(0,r,m(i)?i:X,r.notifyWith)),t[1][3].add(s(0,r,m(e)?e:X)),t[2][3].add(s(0,r,m(n)?n:G))}).promise()},promise:function(e){return null!=e?k.extend(e,i):i}},o={};return k.each(t,function(e,r){var s=r[2],a=r[5];i[r[1]]=s.add,a&&s.add(function(){n=a},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),s.add(r[3].fire),o[r[0]]=function(){return o[r[0]+"With"](this===o?void 0:this,arguments),this},o[r[0]+"With"]=s.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=a.call(arguments),o=k.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?a.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(Y(e,o.done(s(n)).resolve,o.reject,!t),"pending"===o.state()||m(i[n]&&i[n].then)))return o.then();for(;n--;)Y(i[n],s(n),o.reject);return o.promise()}});var K=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&K.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},k.readyException=function(e){r.setTimeout(function(){throw e})};var Q=k.Deferred();function Z(){b.removeEventListener("DOMContentLoaded",Z),r.removeEventListener("load",Z),k.ready()}k.fn.ready=function(e){return Q.then(e).catch(function(e){k.readyException(e)}),this},k.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--k.readyWait:k.isReady)||(k.isReady=!0,!0!==e&&--k.readyWait>0||Q.resolveWith(b,[k]))}}),k.ready.then=Q.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?r.setTimeout(k.ready):(b.addEventListener("DOMContentLoaded",Z),r.addEventListener("load",Z));var ee=function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===w(n))for(a in i=!0,n)ee(e,t,a,n[a],!0,o,s);else if(void 0!==r&&(i=!0,m(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(k(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each(function(){ue.remove(this,e)})}}),k.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=ae.get(e,t),n&&(!r||Array.isArray(n)?r=ae.access(e,t,k.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=k.queue(e,t),r=n.length,i=n.shift(),o=k._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){k.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ae.get(e,n)||ae.access(e,n,{empty:k.Callbacks("once memory").add(function(){ae.remove(e,[t+"queue",n])})})}}),k.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,Se=/^$|^module$|\/(?:java|ecma)script/i;je=b.createDocumentFragment().appendChild(b.createElement("div")),(Ee=b.createElement("input")).setAttribute("type","radio"),Ee.setAttribute("checked","checked"),Ee.setAttribute("name","t"),je.appendChild(Ee),v.checkClone=je.cloneNode(!0).cloneNode(!0).lastChild.checked,je.innerHTML="",v.noCloneChecked=!!je.cloneNode(!0).lastChild.defaultValue,je.innerHTML="",v.option=!!je.lastChild;var Ae={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Ce(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&S(e,t)?k.merge([e],n):n}function Oe(e,t){for(var n=0,r=e.length;n",""]);var Ne=/<|&#?\w+;/;function Pe(e,t,n,r,i){for(var o,s,a,u,l,c,f=t.createDocumentFragment(),h=[],d=0,p=e.length;d-1)i&&i.push(o);else if(l=ve(o),s=Ce(f.appendChild(o),"script"),l&&Oe(s),n)for(c=0;o=s[c++];)Se.test(o.type||"")&&n.push(o);return f}var De=/^([^.]*)(?:\.(.+)|)/;function Me(){return!0}function Le(){return!1}function Ie(e,t,n,r,i,o){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(r=r||n,n=void 0),t)Ie(e,a,n,r,t[a],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Le;else if(!i)return e;return 1===o&&(s=i,i=function(e){return k().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function He(e,t,n){n?(ae.set(e,t,!1),k.event.add(e,t,{namespace:!1,handler:function(e){var n,r=ae.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(k.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=a.call(arguments),ae.set(this,t,r),this[t](),n=ae.get(this,t),ae.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(ae.set(this,t,k.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Me)}})):void 0===ae.get(e,t)&&k.event.add(e,t,Me)}k.event={global:{},add:function(e,t,n,r,i){var o,s,a,u,l,c,f,h,d,p,g,v=ae.get(e);if(oe(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ge,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events=Object.create(null)),(s=v.handle)||(s=v.handle=function(t){return void 0!==k&&k.event.triggered!==t.type?k.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(J)||[""]).length;l--;)d=g=(a=De.exec(t[l])||[])[1],p=(a[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:p.join(".")},o),(h=u[d])||((h=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,p,s)||e.addEventListener&&e.addEventListener(d,s)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,c):h.push(c),k.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,s,a,u,l,c,f,h,d,p,g,v=ae.hasData(e)&&ae.get(e);if(v&&(u=v.events)){for(l=(t=(t||"").match(J)||[""]).length;l--;)if(d=g=(a=De.exec(t[l])||[])[1],p=(a[2]||"").split(".").sort(),d){for(f=k.event.special[d]||{},h=u[d=(r?f.delegateType:f.bindType)||d]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=h.length;o--;)c=h[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(h.splice(o,1),c.selector&&h.delegateCount--,f.remove&&f.remove.call(e,c));s&&!h.length&&(f.teardown&&!1!==f.teardown.call(e,p,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&ae.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,s,a=new Array(arguments.length),u=k.event.fix(e),l=(ae.get(this,"events")||Object.create(null))[u.type]||[],c=k.event.special[u.type]||{};for(a[0]=u,t=1;t=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],s={},n=0;n-1:k.find(i,this,null,[l]).length),s[i]&&o.push(r);o.length&&a.push({elem:l,handlers:o})}return l=this,u\s*$/g;function We(e,t){return S(e,"table")&&S(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function $e(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Be(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,s,a;if(1===t.nodeType){if(ae.hasData(e)&&(a=ae.get(e).events))for(i in ae.remove(t,"handle events"),a)for(n=0,r=a[i].length;n1&&"string"==typeof p&&!v.checkClone&&Re.test(p))return e.each(function(i){var o=e.eq(i);g&&(t[0]=p.call(this,i,o.html())),Ve(o,t,n,r)});if(h&&(o=(i=Pe(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=(s=k.map(Ce(i,"script"),$e)).length;f0&&Oe(s,!u&&Ce(e,"script")),a},cleanData:function(e){for(var t,n,r,i=k.event.special,o=0;void 0!==(n=e[o]);o++)if(oe(n)){if(t=n[ae.expando]){if(t.events)for(r in t.events)i[r]?k.event.remove(n,r):k.removeEvent(n,r,t.handle);n[ae.expando]=void 0}n[ue.expando]&&(n[ue.expando]=void 0)}}}),k.fn.extend({detach:function(e){return Je(this,e,!0)},remove:function(e){return Je(this,e)},text:function(e){return ee(this,function(e){return void 0===e?k.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Ve(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||We(this,e).appendChild(e)})},prepend:function(){return Ve(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=We(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Ve(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Ve(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(k.cleanData(Ce(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return k.clone(this,e,t)})},html:function(e){return ee(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!qe.test(e)&&!Ae[(Te.exec(e)||["",""])[1].toLowerCase()]){e=k.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-a-.5))||0),u+l}function ct(e,t,n){var r=Ye(e),i=(!v.boxSizingReliable()||n)&&"border-box"===k.css(e,"boxSizing",!1,r),o=i,s=Ze(e,t,r),a="offset"+t[0].toUpperCase()+t.slice(1);if(Xe.test(s)){if(!n)return s;s="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&S(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===k.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===k.css(e,"boxSizing",!1,r),(o=a in e)&&(s=e[a])),(s=parseFloat(s)||0)+lt(e,t,n||(i?"border":"content"),o,r,s)+"px"}function ft(e,t,n,r,i){return new ft.prototype.init(e,t,n,r,i)}k.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ze(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=ie(t),u=Ge.test(t),l=e.style;if(u||(t=it(a)),s=k.cssHooks[t]||k.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=de.exec(n))&&i[1]&&(n=be(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(k.cssNumber[a]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,s,a=ie(t);return Ge.test(t)||(t=it(a)),(s=k.cssHooks[t]||k.cssHooks[a])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=Ze(e,t,r)),"normal"===i&&t in at&&(i=at[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),k.each(["height","width"],function(e,t){k.cssHooks[t]={get:function(e,n,r){if(n)return!ot.test(k.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ct(e,t,r):Ke(e,st,function(){return ct(e,t,r)})},set:function(e,n,r){var i,o=Ye(e),s=!v.scrollboxSize()&&"absolute"===o.position,a=(s||r)&&"border-box"===k.css(e,"boxSizing",!1,o),u=r?lt(e,t,r,a,o):0;return a&&s&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-lt(e,t,"border",!1,o)-.5)),u&&(i=de.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=k.css(e,t)),ut(0,n,u)}}}),k.cssHooks.marginLeft=et(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ze(e,"marginLeft"))||e.getBoundingClientRect().left-Ke(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),k.each({margin:"",padding:"",border:"Width"},function(e,t){k.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+pe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(k.cssHooks[e+t].set=ut)}),k.fn.extend({css:function(e,t){return ee(this,function(e,t,n){var r,i,o={},s=0;if(Array.isArray(t)){for(r=Ye(e),i=t.length;s1)}}),k.Tween=ft,ft.prototype={constructor:ft,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||k.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(k.cssNumber[n]?"":"px")},cur:function(){var e=ft.propHooks[this.prop];return e&&e.get?e.get(this):ft.propHooks._default.get(this)},run:function(e){var t,n=ft.propHooks[this.prop];return this.options.duration?this.pos=t=k.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ft.propHooks._default.set(this),this}},ft.prototype.init.prototype=ft.prototype,ft.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=k.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){k.fx.step[e.prop]?k.fx.step[e.prop](e):1!==e.elem.nodeType||!k.cssHooks[e.prop]&&null==e.elem.style[it(e.prop)]?e.elem[e.prop]=e.now:k.style(e.elem,e.prop,e.now+e.unit)}}},ft.propHooks.scrollTop=ft.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},k.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},k.fx=ft.prototype.init,k.fx.step={};var ht,dt,pt=/^(?:toggle|show|hide)$/,gt=/queueHooks$/;function vt(){dt&&(!1===b.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(vt):r.setTimeout(vt,k.fx.interval),k.fx.tick())}function mt(){return r.setTimeout(function(){ht=void 0}),ht=Date.now()}function yt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=pe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function bt(e,t,n){for(var r,i=(_t.tweeners[t]||[]).concat(_t.tweeners["*"]),o=0,s=i.length;o1)},removeAttr:function(e){return this.each(function(){k.removeAttr(this,e)})}}),k.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?k.prop(e,t,n):(1===o&&k.isXMLDoc(e)||(i=k.attrHooks[t.toLowerCase()]||(k.expr.match.bool.test(t)?xt:void 0)),void 0!==n?null===n?void k.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=k.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&S(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(J);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),xt={set:function(e,t,n){return!1===t?k.removeAttr(e,n):e.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),function(e,t){var n=wt[t]||k.find.attr;wt[t]=function(e,t,r){var i,o,s=t.toLowerCase();return r||(o=wt[s],wt[s]=i,i=null!=n(e,t,r)?s:null,wt[s]=o),i}});var jt=/^(?:input|select|textarea|button)$/i,Et=/^(?:a|area)$/i;function kt(e){return(e.match(J)||[]).join(" ")}function Tt(e){return e.getAttribute&&e.getAttribute("class")||""}function St(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(J)||[]}k.fn.extend({prop:function(e,t){return ee(this,k.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[k.propFix[e]||e]})}}),k.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&k.isXMLDoc(e)||(t=k.propFix[t]||t,i=k.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=k.find.attr(e,"tabindex");return t?parseInt(t,10):jt.test(e.nodeName)||Et.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(k.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){k.propFix[this.toLowerCase()]=this}),k.fn.extend({addClass:function(e){var t,n,r,i,o,s;return m(e)?this.each(function(t){k(this).addClass(e.call(this,t,Tt(this)))}):(t=St(e)).length?this.each(function(){if(r=Tt(this),n=1===this.nodeType&&" "+kt(r)+" "){for(o=0;o-1;)n=n.replace(" "+i+" "," ");s=kt(n),r!==s&&this.setAttribute("class",s)}}):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,s=typeof e,a="string"===s||Array.isArray(e);return m(e)?this.each(function(n){k(this).toggleClass(e.call(this,n,Tt(this),t),t)}):"boolean"==typeof t&&a?t?this.addClass(e):this.removeClass(e):(n=St(e),this.each(function(){if(a)for(o=k(this),i=0;i-1)return!0;return!1}});var At=/\r/g;k.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=m(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,k(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=k.map(i,function(e){return null==e?"":e+""})),(t=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=k.valHooks[i.type]||k.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(At,""):null==n?"":n:void 0}}),k.extend({valHooks:{option:{get:function(e){var t=k.find.attr(e,"value");return null!=t?t:kt(k.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,s="select-one"===e.type,a=s?null:[],u=s?o+1:i.length;for(r=o<0?u:s?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),k.each(["radio","checkbox"],function(){k.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=k.inArray(k(e).val(),t)>-1}},v.checkOn||(k.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Ct=r.location,Ot={guid:Date.now()},Nt=/\?/;k.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||k.error("Invalid XML: "+(n?k.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Pt=/^(?:focusinfocus|focusoutblur)$/,Dt=function(e){e.stopPropagation()};k.extend(k.event,{trigger:function(e,t,n,i){var o,s,a,u,l,c,f,h,p=[n||b],g=d.call(e,"type")?e.type:e,v=d.call(e,"namespace")?e.namespace.split("."):[];if(s=h=a=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!Pt.test(g+k.event.triggered)&&(g.indexOf(".")>-1&&(v=g.split("."),g=v.shift(),v.sort()),l=g.indexOf(":")<0&&"on"+g,(e=e[k.expando]?e:new k.Event(g,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=v.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:k.makeArray(t,[e]),f=k.event.special[g]||{},i||!f.trigger||!1!==f.trigger.apply(n,t))){if(!i&&!f.noBubble&&!y(n)){for(u=f.delegateType||g,Pt.test(u+g)||(s=s.parentNode);s;s=s.parentNode)p.push(s),a=s;a===(n.ownerDocument||b)&&p.push(a.defaultView||a.parentWindow||r)}for(o=0;(s=p[o++])&&!e.isPropagationStopped();)h=s,e.type=o>1?u:f.bindType||g,(c=(ae.get(s,"events")||Object.create(null))[e.type]&&ae.get(s,"handle"))&&c.apply(s,t),(c=l&&s[l])&&c.apply&&oe(s)&&(e.result=c.apply(s,t),!1===e.result&&e.preventDefault());return e.type=g,i||e.isDefaultPrevented()||f._default&&!1!==f._default.apply(p.pop(),t)||!oe(n)||l&&m(n[g])&&!y(n)&&((a=n[l])&&(n[l]=null),k.event.triggered=g,e.isPropagationStopped()&&h.addEventListener(g,Dt),n[g](),e.isPropagationStopped()&&h.removeEventListener(g,Dt),k.event.triggered=void 0,a&&(n[l]=a)),e.result}},simulate:function(e,t,n){var r=k.extend(new k.Event,n,{type:e,isSimulated:!0});k.event.trigger(r,null,t)}}),k.fn.extend({trigger:function(e,t){return this.each(function(){k.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return k.event.trigger(e,t,n,!0)}});var Mt=/\[\]$/,Lt=/\r?\n/g,It=/^(?:submit|button|image|reset|file)$/i,Ht=/^(?:input|select|textarea|keygen)/i;function qt(e,t,n,r){var i;if(Array.isArray(t))k.each(t,function(t,i){n||Mt.test(e)?r(e,i):qt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==w(t))r(e,t);else for(i in t)qt(e+"["+i+"]",t[i],n,r)}k.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!k.isPlainObject(e))k.each(e,function(){i(this.name,this.value)});else for(n in e)qt(n,e[n],t,i);return r.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=k.prop(this,"elements");return e?k.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!k(this).is(":disabled")&&Ht.test(this.nodeName)&&!It.test(e)&&(this.checked||!ke.test(e))}).map(function(e,t){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}}):{name:t.name,value:n.replace(Lt,"\r\n")}}).get()}});var Rt=/%20/g,zt=/#.*$/,Wt=/([?&])_=[^&]*/,$t=/^(.*?):[ \t]*([^\r\n]*)$/gm,Bt=/^(?:GET|HEAD)$/,Ft=/^\/\//,Ut={},Vt={},Jt="*/".concat("*"),Xt=b.createElement("a");function Gt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(J)||[];if(m(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Yt(e,t,n,r){var i={},o=e===Vt;function s(a){var u;return i[a]=!0,k.each(e[a]||[],function(e,a){var l=a(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),s(l),!1)}),u}return s(t.dataTypes[0])||!i["*"]&&s("*")}function Kt(e,t){var n,r,i=k.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&k.extend(!0,e,r),e}Xt.href=Ct.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jt,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"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Kt(Kt(e,k.ajaxSettings),t):Kt(k.ajaxSettings,e)},ajaxPrefilter:Gt(Ut),ajaxTransport:Gt(Vt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,o,s,a,u,l,c,f,h,d=k.ajaxSetup({},t),p=d.context||d,g=d.context&&(p.nodeType||p.jquery)?k(p):k.event,v=k.Deferred(),m=k.Callbacks("once memory"),y=d.statusCode||{},_={},x={},w="canceled",j={readyState:0,getResponseHeader:function(e){var t;if(l){if(!s)for(s={};t=$t.exec(o);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(e,t){return null==l&&(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,_[e]=t),this},overrideMimeType:function(e){return null==l&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)j.always(e[j.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||w;return n&&n.abort(t),E(0,t),this}};if(v.promise(j),d.url=((e||d.url||Ct.href)+"").replace(Ft,Ct.protocol+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(J)||[""],null==d.crossDomain){u=b.createElement("a");try{u.href=d.url,u.href=u.href,d.crossDomain=Xt.protocol+"//"+Xt.host!=u.protocol+"//"+u.host}catch(e){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=k.param(d.data,d.traditional)),Yt(Ut,d,t,j),l)return j;for(f in(c=k.event&&d.global)&&0===k.active++&&k.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Bt.test(d.type),i=d.url.replace(zt,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Rt,"+")):(h=d.url.slice(i.length),d.data&&(d.processData||"string"==typeof d.data)&&(i+=(Nt.test(i)?"&":"?")+d.data,delete d.data),!1===d.cache&&(i=i.replace(Wt,"$1"),h=(Nt.test(i)?"&":"?")+"_="+Ot.guid+++h),d.url=i+h),d.ifModified&&(k.lastModified[i]&&j.setRequestHeader("If-Modified-Since",k.lastModified[i]),k.etag[i]&&j.setRequestHeader("If-None-Match",k.etag[i])),(d.data&&d.hasContent&&!1!==d.contentType||t.contentType)&&j.setRequestHeader("Content-Type",d.contentType),j.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Jt+"; q=0.01":""):d.accepts["*"]),d.headers)j.setRequestHeader(f,d.headers[f]);if(d.beforeSend&&(!1===d.beforeSend.call(p,j,d)||l))return j.abort();if(w="abort",m.add(d.complete),j.done(d.success),j.fail(d.error),n=Yt(Vt,d,t,j)){if(j.readyState=1,c&&g.trigger("ajaxSend",[j,d]),l)return j;d.async&&d.timeout>0&&(a=r.setTimeout(function(){j.abort("timeout")},d.timeout));try{l=!1,n.send(_,E)}catch(e){if(l)throw e;E(-1,e)}}else E(-1,"No Transport");function E(e,t,s,u){var f,h,b,_,x,w=t;l||(l=!0,a&&r.clearTimeout(a),n=void 0,o=u||"",j.readyState=e>0?4:0,f=e>=200&&e<300||304===e,s&&(_=function(e,t,n){for(var r,i,o,s,a=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==u[0]&&u.unshift(o),n[o]}(d,j,s)),!f&&k.inArray("script",d.dataTypes)>-1&&k.inArray("json",d.dataTypes)<0&&(d.converters["text script"]=function(){}),_=function(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(s=l[u+" "+o]||l["* "+o]))for(i in l)if((a=i.split(" "))[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){!0===s?s=l[i]:!0!==l[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(d,_,j,f),f?(d.ifModified&&((x=j.getResponseHeader("Last-Modified"))&&(k.lastModified[i]=x),(x=j.getResponseHeader("etag"))&&(k.etag[i]=x)),204===e||"HEAD"===d.type?w="nocontent":304===e?w="notmodified":(w=_.state,h=_.data,f=!(b=_.error))):(b=w,!e&&w||(w="error",e<0&&(e=0))),j.status=e,j.statusText=(t||w)+"",f?v.resolveWith(p,[h,w,j]):v.rejectWith(p,[j,w,b]),j.statusCode(y),y=void 0,c&&g.trigger(f?"ajaxSuccess":"ajaxError",[j,d,f?h:b]),m.fireWith(p,[j,w]),c&&(g.trigger("ajaxComplete",[j,d]),--k.active||k.event.trigger("ajaxStop")))}return j},getJSON:function(e,t,n){return k.get(e,t,n,"json")},getScript:function(e,t){return k.get(e,void 0,t,"script")}}),k.each(["get","post"],function(e,t){k[t]=function(e,n,r,i){return m(n)&&(i=i||r,r=n,n=void 0),k.ajax(k.extend({url:e,type:t,dataType:i,data:n,success:r},k.isPlainObject(e)&&e))}}),k.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),k._evalUrl=function(e,t,n){return k.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){k.globalEval(e,t,n)}})},k.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=k(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return m(e)?this.each(function(t){k(this).wrapInner(e.call(this,t))}):this.each(function(){var t=k(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=m(e);return this.each(function(n){k(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){k(this).replaceWith(this.childNodes)}),this}}),k.expr.pseudos.hidden=function(e){return!k.expr.pseudos.visible(e)},k.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Qt={0:200,1223:204},Zt=k.ajaxSettings.xhr();v.cors=!!Zt&&"withCredentials"in Zt,v.ajax=Zt=!!Zt,k.ajaxTransport(function(e){var t,n;if(v.cors||Zt&&!e.crossDomain)return{send:function(i,o){var s,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(s in e.xhrFields)a[s]=e.xhrFields[s];for(s in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(s,i[s]);t=function(e){return function(){t&&(t=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Qt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=t(),n=a.onerror=a.ontimeout=t("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&r.setTimeout(function(){t&&n()})},t=t("abort");try{a.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),k.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return k.globalEval(e),e}}}),k.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),k.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=k("