diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..d72fd520b --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.pdf binary diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index e89c89c60..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: JorjMcKie - ---- - -_**Please provide all mandatory information!**_ - -## Describe the bug (mandatory) -A clear and concise description of what the bug is. - -## To Reproduce (mandatory) -Explain the steps to reproduce the behavior, For example, include a minimal code snippet, example files, etc. - -## Expected behavior (optional) -Describe what you expected to happen (if not obvious). - -## Screenshots (optional) -If applicable, add screenshots to help explain your problem. - -## Your configuration (mandatory) - - Operating system, potentially version and bitness - - Python version, bitness - - PyMuPDF version, installation method (**wheel** or **generated** from source). - -For example, the output of `print(sys.version, "\n", sys.platform, "\n", fitz.__doc__)` would be sufficient (for the first two bullets). - -## Additional context (optional) -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..7fdb600ce --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,93 @@ +name: Bug Report +description: Create a bug report for PyMuPDF + +# We omit `title: "..."` so that the field defaults to blank. If we set it to +# empty string, Github seems to reject this .yml file. + +body: + + - type: textarea + id: description + attributes: + label: Description of the bug + description: | + A clear and concise description of the bug. + + validations: + required: true + + - type: textarea + id: reproduce + attributes: + label: How to reproduce the bug + + # Should not word-wrap this description here. + description: | + * Explain the steps required to reproduce the bug. + * Include required code snippets, example files, etc. + * Describe what you expected to happen (if not obvious). + * If applicable, add screenshots to help explain the problem. + * Include any other information that could be relevant, for example information about the Python environment. + + For problems when building or installing PyMuPDF: + * Give the **exact** build/install commands that were run. + * Give the **complete** output from these commands. + + validations: + required: true + +# - type: markdown +# attributes: +# value: | +# # The information below is required. + + - type: dropdown + id: version + attributes: + label: PyMuPDF version + options: + - 1.26.6 + - 1.26.5 + - 1.26.4 + - 1.26.3 + - 1.26.1 + - 1.26.0 + - 1.25.x or earlier + - Built from source + description: | + * For example from `pymupdf.pymupdf_version`. + * We generally only look at bugs in the most recent release of PyMuPDF. + validations: + required: true + + - type: dropdown + id: os_name + attributes: + label: Operating system + #multiple: true + options: + - + - Windows + - Linux + - MacOS + - OpenBSD + - Other + validations: + required: true + + - type: dropdown + id: python_version + attributes: + label: Python version + #multiple: true + # Need quotes around `3.10` otherwise it is treated as a number and shows as `3.1`. + options: + - + - "3.14" + - "3.13" + - "3.12" + - "3.11" + - "3.10" + - "3.9" + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index f5ed2dc54..92ad708a0 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -3,7 +3,7 @@ name: Feature request about: Suggest an idea for this project title: '' labels: enhancement -assignees: JorjMcKie +assignees: --- diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml new file mode 100644 index 000000000..40d29767f --- /dev/null +++ b/.github/workflows/build_wheels.yml @@ -0,0 +1,162 @@ +name: Build wheels + +on: + workflow_dispatch: + inputs: + + flavours: + description: 'If set, we build separate PyMuPDF and PyMuPDFb wheels.' + type: boolean + default: false + + sdist: + type: boolean + default: true + + wheels_linux_aarch64: + type: boolean + default: true + + wheels_linux_auto: + type: boolean + default: true + + wheels_linux_pyodide: + type: boolean + default: false + + wheels_windows_auto: + type: boolean + default: true + + wheels_macos_auto: + type: boolean + default: true + + wheels_cps: + description: 'wheels_cps: sets $CIBW_BUILD, E.g. "cp310* cp311*".' + type: string + + PYMUPDF_SETUP_MUPDF_BUILD: + description: 'Value for PYMUPDF_SETUP_MUPDF_BUILD, e.g.: git:--branch master https://github.com/ArtifexSoftware/mupdf.git' + type: string + default: '-' + + #PYMUPDF_SETUP_MUPDF_BUILD_TYPE: + # description: 'Value for PYMUPDF_SETUP_MUPDF_BUILD, e.g. debug.' + # type: string + # default: '-' + # We can't currently have more than 10 inputs + + PYMUPDF_SETUP_PY_LIMITED_API: + description: 'If not "0", we build a single wheel for each platform.' + type: string + default: '' + +jobs: + + build_sdist: + if: ${{ inputs.sdist }} + name: Build sdist + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + env: + inputs_wheels_default: 0 + inputs_sdist: 1 + inputs_flavours: ${{inputs.flavours}} + inputs_PYMUPDF_SETUP_MUPDF_BUILD: ${{inputs.PYMUPDF_SETUP_MUPDF_BUILD}} + run: + python scripts/gh_release.py + + - uses: actions/upload-artifact@v4 + with: + name: sdist-${{ matrix.os }} + path: dist/*.tar.gz + + + build_wheels: + #if: ${{ inputs.wheels }} + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + # 2024-05-08: Need to specify macos-13/14 to get x86_64/arm64. + os: [ubuntu-latest, windows-2019, macos-13, macos-14] + + # Avoid cancelling of all cibuildwheel runs after a single failure. + fail-fast: false + + steps: + + - uses: actions/checkout@v4 + + # Get Python 3.12 x32 and x64 on Windows. (As of 2023-10-12 these are not + # always available by default.) + # + - name: Install Python 3.12 x32 on Windows. + if: runner.os == 'Windows' + uses: actions/setup-python@v5 + with: + python-version: '3.12' + architecture: x86 + - name: Install Python 3.12 x64 on Windows. + if: runner.os == 'Windows' + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + # Get Python for running cibuildwheel. This also ensures that 'python' + # works on MacOS, where it seems only 'python3' is available by default. + # + # Note that it seem to be important on MacOS not to specify a + # Python version here with `python-version: '3.12'` - this makes + # `python-config3` return settings for Python-3.12, instead of for + # whatever Python is being used by cibuildwheel. + # + - uses: actions/setup-python@v5 + + # On Linux, get qemu so we can build for aarch64. + # + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v1 + with: + platforms: all + + - name: gh_release + # Doesn't seem to be a way to passing inputs.* on command + # line, so we set environment instead. E.g. see: + # https://github.com/orgs/community/discussions/27088 + # + env: + inputs_flavours: ${{inputs.flavours}} + inputs_sdist: ${{inputs.sdist}} + + inputs_wheels_linux_aarch64: ${{inputs.wheels_linux_aarch64}} + inputs_wheels_linux_auto: ${{inputs.wheels_linux_auto}} + inputs_wheels_linux_pyodide: ${{inputs.wheels_linux_pyodide}} + #inputs_wheels_macos_arm64: ${{inputs.wheels_macos_arm64}} + inputs_wheels_macos_auto: ${{inputs.wheels_macos_auto}} + inputs_wheels_windows_auto: ${{inputs.wheels_windows_auto}} + + inputs_PYMUPDF_SETUP_MUPDF_BUILD: ${{inputs.PYMUPDF_SETUP_MUPDF_BUILD}} + #inputs_PYMUPDF_SETUP_MUPDF_BUILD_TYPE: ${{inputs.PYMUPDF_SETUP_MUPDF_BUILD_TYPE}} + + inputs_wheels_cps: ${{inputs.wheels_cps}} + + PYMUPDF_SETUP_PY_LIMITED_API: ${{inputs.PYMUPDF_SETUP_PY_LIMITED_API}} + + run: + python scripts/gh_release.py + + + # Upload generated wheels, to be accessible from github Actions page. + # + - uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.os }} + path: ./wheelhouse/*.whl diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml new file mode 100644 index 000000000..1ff2e9591 --- /dev/null +++ b/.github/workflows/cla.yml @@ -0,0 +1,34 @@ +name: "CLA Assistant" +on: + pull_request_target: + types: [opened,closed,synchronize] + +jobs: + CLAAssistant: + runs-on: ubuntu-latest + steps: + - name: "CLA Assistant" + if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' + # Beta Release + uses: contributor-assistant/github-action@v2.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # the below token should have repo scope and must be manually added by you in the repository's secret + PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + with: + path-to-signatures: 'signatures/version1/cla.json' + path-to-document: 'https://artifex.com/documents/Artifex%20Contributor%20License%20Agreement.pdf' + # branch should not be protected + branch: 'CLA' + allowlist: + + # the following are the optional inputs - If the optional inputs are not given, then default values will be taken + #remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository) + #remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository) + #create-file-commit-message: 'For example: Creating file for storing CLA Signatures' + #signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo' + #custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign' + #custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA' + #custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.' + #lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true) + #use-dco-flag: true - If you are using DCO instead of CLA diff --git a/.github/workflows/test-valgrind.yml b/.github/workflows/test-valgrind.yml new file mode 100644 index 000000000..244fcb95a --- /dev/null +++ b/.github/workflows/test-valgrind.yml @@ -0,0 +1,27 @@ +name: Test valgrind + +on: + workflow_dispatch: + schedule: + - cron: '13 6 * * *' + +jobs: + + valgrind: + name: valgrind + runs-on: ubuntu-latest + strategy: + matrix: + args: [ + '', + '-m "git:--branch master https://github.com/ArtifexSoftware/mupdf"', + '-m "git:--branch 1.26.x https://github.com/ArtifexSoftware/mupdf"', + ] + fail-fast: false + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: valgrind + run: + python scripts/test.py ${{matrix.args}} -P 1 -T valgrind build test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..c7b59c722 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,64 @@ +# Run scripts/test.py directly on multiple Github servers. Instead of +# specifying individual inputs, we support a single string input which is used +# for the command line directly. +# +# This ensures we behave exactly like scripts/test.py, without confusion caused +# by having to translate between differing APIs. + +name: Tests + +on: + #schedule: + # - cron: '47 4 * * *' + #pull_request: + # branches: [main] + workflow_dispatch: + inputs: + args: + type: string + default: '' + description: 'Arguments to pass to scripts/test.py' + +jobs: + + test: + name: Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-2022, macos-13, macos-14] + + # Avoid cancelling of all runs after a single failure. + fail-fast: false + + steps: + + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + + # https://github.com/pypa/cibuildwheel/issues/2114 + # https://cibuildwheel.pypa.io/en/stable/faq/#emulation + # + - name: Set up QEMU + if: runner.os == 'Linux' && runner.arch == 'X64' + uses: docker/setup-qemu-action@v3 + with: + platforms: all + + - name: test + env: + PYMUPDF_test_args: ${{inputs.args}} + run: + python scripts/test.py -a PYMUPDF_test_args + + # Upload generated wheels, to be accessible from github Actions page. + # + - uses: actions/upload-artifact@v4 + with: + path: | + wheelhouse/pymupdf*.whl + wheelhouse/pymupdf*.tar.gz + name: artifact-${{ matrix.os }} diff --git a/.github/workflows/test_multiple.yml b/.github/workflows/test_multiple.yml new file mode 100644 index 000000000..54f09444b --- /dev/null +++ b/.github/workflows/test_multiple.yml @@ -0,0 +1,39 @@ +# Run scripts/test.py on multiple OS's (Windows, Linux, MacOS x64, MacOS arm64) +# and with multiple specifications of MuPDF (PyMuPDF's hard-coded default, +# master branch, release branch). + +name: multiple + +on: + workflow_dispatch: + inputs: + args: + type: string + default: '' + description: 'Additional arguments to scripts/test.py' + schedule: + - cron: '13 6 * * *' + +jobs: + + multiple: + name: multiple + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-2022, macos-13, macos-14] + args: [ + '', + '-m "git:--branch master https://github.com/ArtifexSoftware/mupdf"', + '-m "git:--branch 1.26.x https://github.com/ArtifexSoftware/mupdf"', + ] + fail-fast: false + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: multiple + env: + PYMUPDF_test_args: ${{inputs.args}} + run: + python scripts/test.py ${{matrix.args}} wheel test -a PYMUPDF_test_args diff --git a/.github/workflows/test_pyodide.yml b/.github/workflows/test_pyodide.yml new file mode 100644 index 000000000..bc1e823ef --- /dev/null +++ b/.github/workflows/test_pyodide.yml @@ -0,0 +1,41 @@ +name: Test pyodide + +# Build and test pyodide wheels using cibuildwheel. + +on: + workflow_dispatch: + + schedule: + - cron: '13 5 * * *' + +jobs: + + pyodide: + name: pyodide + runs-on: ubuntu-latest + strategy: + matrix: + # 2025-09-05: We don't test with default mupdf because mupdf-1.26.7 + # does not have the required pyodide rpath changes. + args: [ + # '', + '-m "git:--branch master https://github.com/ArtifexSoftware/mupdf"', + '-m "git:--branch 1.26.x https://github.com/ArtifexSoftware/mupdf"', + ] + fail-fast: false + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.12 + + - name: pyodide + run: + python scripts/test.py ${{matrix.args}} --cibw-pyodide 1 cibw + + # We do not use upload-artifact@v4 because it fails due to us creating + # identically-named wheels. + #- uses: actions/upload-artifact@v4 + # with: + # path: ./wheelhouse/*.whl diff --git a/.github/workflows/test_quick.yml b/.github/workflows/test_quick.yml new file mode 100644 index 000000000..e07aadf35 --- /dev/null +++ b/.github/workflows/test_quick.yml @@ -0,0 +1,46 @@ +name: test_quick + +on: + pull_request: + branches: [main] + + workflow_dispatch: + inputs: + args: + type: string + default: '' + description: 'Additional arguments to scripts/test.py' + +jobs: + + master: + name: mupdf master + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + fail-fast: false + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: mupdf master + env: + PYMUPDF_test_args: ${{inputs.args}} + run: + python scripts/test.py build test -m 'git:--branch master https://github.com/ArtifexSoftware/mupdf.git' -a PYMUPDF_test_args + + release: + name: mupdf release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + fail-fast: false + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: mupdf release + env: + PYMUPDF_test_args: ${{inputs.args}} + run: + python scripts/test.py build test -m 'git:--branch 1.26.x https://github.com/ArtifexSoftware/mupdf.git' -a PYMUPDF_test_args diff --git a/.github/workflows/test_sysinstall.yml b/.github/workflows/test_sysinstall.yml new file mode 100644 index 000000000..a913de748 --- /dev/null +++ b/.github/workflows/test_sysinstall.yml @@ -0,0 +1,50 @@ +name: Test sysinstall + +on: + schedule: + - cron: '13 4 * * *' + workflow_dispatch: + inputs: + args: + description: 'Extra args for scripts/sysinstall.py.' + +jobs: + + sysinstall: + name: Test sysinstall + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + + steps: + + - uses: actions/checkout@v4 + + # It seems to be important not to install a custom python here, + # because `sudo` (which we need to use when installing to /usr/local + # etc) always ends up running the default python, even if we set + # $PATH etc. So for example we can end up with mupdf files and + # pymupdf files being installed into .../python3.11/site-packages and + # .../python3.10/site-packages, and tests all fail to import pymupdf. + # + #- uses: actions/setup-python@v5 + #with: + # # 3.12 doesn't have setuptools. As of 2024-01-03, MuPDF build requires setuptools before it + # # sees `--venv` and defers to a venv, so we currently have to force use of python 3.11. + # python-version: '3.11' + + + - name: sysinstall_venv + env: + PYMUDF_SCRIPTS_SYSINSTALL_ARGS_POST: ${{inputs.args}} + run: + # Use venv. + python3 scripts/sysinstall.py --mupdf-git '--branch master https://github.com/ArtifexSoftware/mupdf.git' + + - name: sysinstall_sudo + env: + PYMUDF_SCRIPTS_SYSINSTALL_ARGS_POST: ${{inputs.args}} + run: + # Do not use a venv, instead install required packages with sudo. + python3 scripts/sysinstall.py --mupdf-git '--branch master https://github.com/ArtifexSoftware/mupdf.git' --pip sudo --root / diff --git a/.gitignore b/.gitignore index e55e79db4..23e954719 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ *.swp build/ demo/README.rst +docs/build \ No newline at end of file diff --git a/.python-version b/.python-version new file mode 100644 index 000000000..e4fba2183 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 000000000..d20a78bb1 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,28 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-20.04 + tools: + python: "3.9" + # You can also specify other tool versions: + # nodejs: "16" + # rust: "1.55" + # golang: "1.17" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# If using Sphinx, optionally build your docs in additional formats such as PDF +formats: all + +# Optionally declare the Python requirements required to build your docs +python: + install: + - requirements: docs/requirements.txt diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json index d33b3d63d..8d55e0d69 100644 --- a/.vs/ProjectSettings.json +++ b/.vs/ProjectSettings.json @@ -1,3 +1,3 @@ { - "CurrentProjectSetting": "Keine Konfigurationen" -} \ No newline at end of file + "CurrentProjectSetting": "" +} diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index d282b3b24..48ce01f3d 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -2,6 +2,6 @@ "ExpandedNodes": [ "" ], - "SelectedNode": "\\README.md", + "SelectedNode": "", "PreviewInSolutionExplorer": false -} \ No newline at end of file +} diff --git a/README.md b/README.md index 9b7b511be..b9f99949d 100644 --- a/README.md +++ b/README.md @@ -1,114 +1,60 @@ -# PyMuPDF 1.19.1 +# PyMuPDF -![logo](https://github.com/pymupdf/PyMuPDF/blob/master/demo/pymupdf.jpg) +**PyMuPDF** is a high performance **Python** library for data extraction, analysis, conversion & manipulation of [PDF (and other) documents](https://pymupdf.readthedocs.io/en/latest/the-basics.html#supported-file-types). -Release date: October 23, 2021 +# Community +Join us on **Discord** here: [#pymupdf](https://discord.gg/TSpYGBW4eq) -On **[PyPI](https://pypi.org/project/PyMuPDF)** since August 2016: [![Downloads](https://static.pepy.tech/personalized-badge/pymupdf?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads)](https://pepy.tech/project/pymupdf) -# Author -[Jorj X. McKie](mailto:jorj.x.mckie@outlook.de), based on original code by [Ruikai Liu](mailto:lrk700@gmail.com). +# Installation -# Introduction +**PyMuPDF** requires **Python 3.9 or later**, install using **pip** with: -PyMuPDF (current version 1.19.1) is a Python binding with support for [MuPDF](https://mupdf.com/) (current version 1.19.*), a lightweight PDF, XPS, and E-book viewer, renderer, and toolkit, which is maintained and developed by Artifex Software, Inc. +`pip install PyMuPDF` -MuPDF can access files in PDF, XPS, OpenXPS, CBZ, EPUB and FB2 (e-books) formats, and it is known for its top performance and high rendering quality. +There are **no mandatory** external dependencies. However, some [optional features](#pymupdf-optional-features) become available only if additional packages are installed. -With PyMuPDF you can access files with extensions like ".pdf", ".xps", ".oxps", ".cbz", ".fb2" or ".epub". In addition, about 10 popular image formats can also be handled like documents: ".png", ".jpg", ".bmp", ".tiff", etc.. +You can also try without installing by visiting [PyMuPDF.io](https://pymupdf.io/#examples). -> In partnership with [Artifex](https://artifex.com/), PyMuPDF is now also available for commercial licensing. This agreement has no impact on use cases, that are compliant with the open-source license AGPL. Please see the "License and Copyright" section below for additional information. # Usage -For all supported document types (i.e. **_including images_**) you can -* decrypt the document -* access meta information, links and bookmarks -* render pages in raster formats (PNG and some others), or the vector format SVG -* search for text -* extract text and images -* convert to other formats: PDF, (X)HTML, XML, JSON, text -* perform Optical Character Recognition if Tesseract is installed - -> To some degree, PyMuPDF can therefore be used as an [image converter](https://github.com/pymupdf/PyMuPDF/wiki/How-to-Convert-Images): it can read a range of input formats and can produce **Portable Network Graphics (PNG)**, **Portable Anymaps** (**PNM**, etc.), **Portable Arbitrary Maps (PAM)**, **Adobe Postscript** and **Adobe Photoshop** documents, making the use of other graphics packages obselete in these cases. But interfacing with e.g. PIL/Pillow for image input and output is easy as well. - -For **PDF documents,** there exists a plethora of additional features: they can be created, joined or split up. Pages can be inserted, deleted, re-arranged or modified in many ways (including annotations and form fields). - -* Images and fonts can be extracted or inserted. - > You may want to have a look at [this](https://github.com/pymupdf/PyMuPDF-Utilities/blob/master/examples/image-maintenance.py) cool GUI example script, which lets you **_insert, delete, replace_** or **_re-position_** images under your visual control. - > If [fontTools](https://pypi.org/project/fonttools/) is installed, subsets can be built for eligible fonts based on their usage in the document. Especially for new PDFs, this can lead to significant file size reductions. -* Embedded files are fully supported. -* PDFs can be reformatted to support double-sided printing, posterizing, applying logos or watermarks -* Password protection is fully supported: decryption, encryption, encryption method selection, permission level and user / owner password setting. -* Support of the **PDF Optional Content** concept for images, text and drawings. -* Low-level PDF structures can be accessed and modified. -* **Command line module** ``"python -m fitz ..."``. A versatile utility with the following features +Basic usage is as follows: - - **encryption / decryption / optimization** - - creation of **sub-documents** - - document **joining** - - **image / font extraction** - - full support of **embedded files** - - **_layout-preserving text extraction_** (all documents) +```python +import pymupdf # imports the pymupdf library +doc = pymupdf.open("example.pdf") # open a document +for page in doc: # iterate the document pages + text = page.get_text() # get plain text encoded as UTF-8 - -Have a look at the basic [demos](https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/demo), the [examples](https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/examples) (which contain complete, working programs), and the **recipes** section of our [Wiki](https://github.com/pymupdf/PyMuPDF/wiki) sidebar, which contains more than a dozen of guides in How-To-style. +``` # Documentation -Our documentation, written using Sphinx, is available in various formats from the following sources. It currently is a combination of reference guide and user manual. For a **quick start** look at the [tutorial](https://pymupdf.readthedocs.io/en/latest/tutorial.html) and the [recipes](https://pymupdf.readthedocs.io/en/latest/faq.html) chapters. - -* You can view it online at [Read the Docs](https://readthedocs.org/projects/pymupdf/). This site also provides download options for PDF. -* The search function on Read the Docs does not work for me currently. If you want a working searchable local version, please download a zipped HTML for [here](https://github.com/pymupdf/PyMuPDF-optional-material/tree/master/doc/pymupdf.zip). -* Find a Windows help file [here](https://github.com/pymupdf/PyMuPDF-optional-material/tree/master/doc/PyMuPDF.chm). - -The latest changelog can be viewed [here](https://pymupdf.readthedocs.io/en/latest/changes.html). - - -# Installation - -PyMuPDF requires **Python 3.6 or later**. - -Python wheels exist for **Windows** (32bit and 64bit), **Linux** (64bit, Intel and ARM) and **Mac OSX** (64bit, Intel only), so it can be installed from [PyPI](https://pypi.org/search/?q=pymupdf) in the usual way: - -``` -python -m pip install --upgrade pip -python -m pip install --upgrade pymupdf -``` +Full documentation can be found on [pymupdf.readthedocs.io](https://pymupdf.readthedocs.io). -There are **no mandatory** external dependencies. However, a some **optional features** become available if additional packages are installed: -* [Pillow](https://pypi.org/project/Pillow/) for using pillow image output directly from PyMuPDF -* [fontTools](https://pypi.org/project/fonttools/) for creating font subsets -* [pymupdf-fonts](https://pypi.org/project/pymupdf-fonts/) contains some nice fonts for your text output -* [Tesseract-OCR](https://github.com/tesseract-ocr/tesseract) for optical character recognition in images and document pages. Tesseract is separate software, not a Python package. To enable OCR functions in PyMuPDF, the system environment variable `"TESSDATA_PREFIX"` must be defined and contain the `tessdata` folder name of the Tesseract installation location +# Optional Features -Older wheels - also with support for older Python versions - can be found [here](https://github.com/pymupdf/PyMuPDF-Optional-Material/tree/master/wheels-upto-Py3.5>) and on PyPI. +* [fontTools](https://pypi.org/project/fonttools/) for creating font subsets. +* [pymupdf-fonts](https://pypi.org/project/pymupdf-fonts/) contains some nice fonts for your text output. +* [Tesseract-OCR](https://github.com/tesseract-ocr/tesseract) for optical character recognition in images and document pages. -> Starting with v1.18.15, to minimize network traffic we no longer redundantly store wheels in this repository's `releases` folder. You can find older versions back to v1.9.2 on [PyPI](https://pypi.org/project/PyMuPDF/#history). Sources for every release continue to be stored in [here](https://github.com/pymupdf/PyMuPDF/releases). -Other platforms **require installation from sources**, follow [these](https://pymupdf.readthedocs.io/en/latest/installation.html) instructions in the documentation. -> **Note:** If `pip` cannot find a wheel that is compatible with your platform, it will automatically start an installation from sources - **_which will fail_** if MuPDF is not installed on your system. +# About -This repo's folder [installation](https://github.com/pymupdf/PyMuPDF/tree/master/installation) contains several platform-specific source installation scripts contributed by users. You may also find the following Wiki pages useful: +**PyMuPDF** adds **Python** bindings and abstractions to [MuPDF](https://mupdf.com/), a lightweight **PDF**, **XPS**, and **eBook** viewer, renderer, and toolkit. Both **PyMuPDF** and **MuPDF** are maintained and developed by [Artifex Software, Inc](https://artifex.com). -* [Ubuntu installation experience](https://github.com/pymupdf/PyMuPDF/wiki/Ubuntu-Installation-Experience). -* [Windows wheels](https://github.com/pymupdf/PyMuPDF/wiki/Windows-Binaries-Generation). +**PyMuPDF** was originally written by [Jorj X. McKie](mailto:jorj.x.mckie@outlook.de). # License and Copyright -In order to comply with MuPDF’s dual licensing model, PyMuPDF has entered into an agreement with Artifex who has the right to sublicense PyMuPDF to third parties. -PyMuPDF and MuPDF are now available under both, open-source AGPL and commercial license agreements. +**PyMuPDF** is available under [open-source AGPL](https://www.gnu.org/licenses/agpl-3.0.html) and commercial license agreements. If you determine you cannot meet the requirements of the **AGPL**, please contact [Artifex](https://artifex.com/contact/pymupdf-inquiry.php) for more information regarding a commercial license. -Please read the full text of the [AGPL license agreement](https://www.gnu.org/licenses/agpl-3.0.html) (which is also included here in file COPYING) to ensure that your use case complies with the guidelines of this license. If you determine you cannot meet the requirements of the AGPL, please contact [Artifex](https://artifex.com/contact/) for more information regarding a commercial license. -Artifex is the exclusive commercial licensing agent for MuPDF. -Artifex, the Artifex logo, MuPDF, and the MuPDF logo are registered trademarks of Artifex Software Inc. © 2021 Artifex Software, Inc. All rights reserved. -# Contact -Please use the [Discussions](https://github.com/pymupdf/PyMuPDF/discussions) menu for questions, comments, or asking for help, and submit issues [here](https://github.com/pymupdf/PyMuPDF/issues). If you wish, you can also contact me directly via jorj.x.mckie@outlook.de. diff --git a/READMEb.md b/READMEb.md new file mode 100644 index 000000000..3e1900038 --- /dev/null +++ b/READMEb.md @@ -0,0 +1,7 @@ +# PyMuPDFb + +This wheel contains [MuPDF](https://mupdf.readthedocs.io/) shared libraries for +use by [PyMuPDF](https://pymupdf.readthedocs.io/). + +This wheel is shared by PyMuPDF wheels that are specific to different Python +versions, significantly reducing the total size of a release. diff --git a/READMEd.md b/READMEd.md new file mode 100644 index 000000000..e37c5c0ea --- /dev/null +++ b/READMEd.md @@ -0,0 +1,4 @@ +# PyMuPDFd + +This wheel contains [MuPDF](https://mupdf.readthedocs.io/) build-time files +that were used to build [PyMuPDF](https://pymupdf.readthedocs.io/). diff --git a/changes.rst b/changes.txt similarity index 56% rename from changes.rst rename to changes.txt index 563e70cd3..ff33fb6a0 100644 --- a/changes.rst +++ b/changes.txt @@ -1,17 +1,1533 @@ Change Log -=========== +========== + + +**Changes in version 1.26.6** + +* Fixed issues: + + * **Fixed** `4699 `_: cannot find ExtGState resource + * **Fixed** `4712 `_: Crash with "corrupted double-linked list" + * **Fixed** `4742 `_: 'Rect' object has no attribute 'get_area' + * **Fixed** `4746 `_: Document.__init__() got an unexpected keyword argument 'encoding' + + +**Changes in version 1.26.5** (2025-10-10) + +* Use MuPDF-1.26.10. + +* Fixed issues: + + * **Fixed** `2883 `_: Improve the Python type annotations for fitz_new + * **Fixed** `4507 `_: Bugs in pyodide + * **Fixed** `4613 `_: Thai and number blocks are not auto-scaled and get wrong hyphen when using in insert_htmlbox + * **Fixed** `4700 `_: pymupdf.open() processes .zip file without raising + * **Fixed** `4716 `_: Problems with unreadable characters + +* Other: + + * Supported Python versions are now 3.9-3.14. + * We now define all class methods explicitly instead of with dynamic assignment; this improves type hints. + * Removed `pymupdf.utils.Shape` class, was duplicate of `pymupdf.Shape`. + * Allow use of cibuildwheel to build and test on Pyodide. + * Fixed various Pyodide bugs. + * In documentation, added section about Linux wheels and glibc compatibility. + * Improved documentation of pymupdf.open()'s arg. + * Retrospectively mark `4544 `_ as fixed in 1.26.4. + + +**Changes in version 1.26.4 (2025-08-25)** + +* Use MuPDF-1.26.7. + +* Fixed issues: + + * **Fixed** `3806 `_: pdf to image rendering ignore optional content offs + * **Fixed** `4388 `_: Incorrect PixMap from page due to cached data from other PDF + * **Fixed** `4457 `_: Wrong characters displayed after font subsetting (w/ native method) + * **Fixed** `4462 `_: delete_pages() does not accept a single int + * **Fixed** `4533 `_: Open PDF error segmentation fault + * **Fixed** `4544 `_: About pdf_clip_page + * **Fixed** `4565 `_: MacOS uses Tesseract and not Tesseract-OCR + * **Fixed** `4571 `_: Broken merged pdfs. + * **Fixed** `4590 `_: TypeError in utils.py scrub(): annot.update_file(buffer=...) is invalid + * **Fixed** `4614 `_: Intercept bad widgets when inserting to another PDF + * **Fixed** `4639 `_: pymupdf.mupdf.FzErrorGeneric: code=1: Director error: : 'JM_new_bbox_device_Device' object has no attribute 'layer_name' + +* Other: + + * Check that #4392 `Segfault when running with pytest and -Werror` is fixed if PyMuPDF is built with swig>=4.4. + * Add `Page.clip_to_rect()`. + * Improved search for Tesseract data. + * Retrospectively mark #4496 as fixed in 1.26.1. + * Retrospectively mark #4503 as fixed in 1.26.3. + * Added experimental support for Graal. + + +**Changes in version 1.26.3 (2025-07-02)** + +* Use MuPDF-1.26.3. + +* Fixed issues: + + * **Fixed** `4462 `_: delete_pages() does not accept a single int + * **Fixed** `4503 `_: Undetected character styles + * **Fixed** `4527 `_: Rect.intersects() is much slower than necessary + * **Fixed** `4564 `_: Possible encoding issue in PDF metadata + * **Fixed** `4575 `_: Bug with IRect contains method + +* Other: + + * Class Shape is now available as pymupdf.Shape. + * Added table cell markdown support. + + +**Changes in version 1.26.2** + +[Skipped.] + + +**Changes in version 1.26.1 (2025-06-11)** + +* Use MuPDF-1.26.2. + +* Fixed issues: + + * **Fixed** `4520 `_: show_pdf_page does not like empty pages created by new_page + * **Fixed** `4524 `_: fitz.get_text ignores 'pages' kwarg + * **Fixed** `4412 `_: Regression? Spurious error? in insert_pdf in v1.25.4 + * **Fixed** `4496 `_: pymupdf4llm with pymupdfpro + +* Other: + + * Partial fix for `4503 `_: Undetected character styles + * New method `Document.rewrite_images()`, useful for reducing file size, changing image formats, or converting color spaces. + * `Page.get_text()`: restrict positional args to match docs. + * Removed bogus definition of class `Shape`. + * Removed release date from module, docs and changelog. + * `pymupdf.pymupdf_date` and `pymupdf.VersionDate` are now both None. + * They will be removed in a future release. + + +**Changes in version 1.26.0 (2025-05-22)** + +* Use MuPDF-1.26.1. + +* Fixed issues: + + * **Fixed** `4324 `_: cluster_drawings() fails to cluster horizontal and vertical thin lines + * **Fixed** `4363 `_: Trouble with searching + * **Fixed** `4404 `_: IndexError in page.get_links() + * **Fixed** `4412 `_: Regression? Spurious error? in insert_pdf in v1.25.4 + * **Fixed** `4423 `_: pymupdf.mupdf.FzErrorFormat: code=7: cannot find object in xref error encountered after version 1.25.3 + * **Fixed** `4435 `_: get_pixmap method stuck on one page + * **Fixed** `4439 `_: New Xml class from data does not work - bug in code + * **Fixed** `4445 `_: Broken XREF table incorrectly repaired + * **Fixed** `4447 `_: Stroke color of annotations cannot be correctly set + * **Fixed** `4479 `_: set_layer_ui_config() toggles all layers rather than just one + * **Fixed** `4505 `_: Follow Widget flag values up its parent structure + +* Other: + + * Partial fixed for `4457 `_: Wrong characters displayed after font subsetting (w/ native method) + * Support image stamp annotations. + * Support recoloring pages. + * Added example of using Django's file storage API to open files with pymupdf. + * Clarified FreeText annotation color options. + We now raise an exception if an attempt is made to set attributes that can not be supported. + * Fixed potential segv in Pixmap.is_unicolor(). + * Added runtime assert that that PyMuPDF and MuPDF were built with compatible + NDEBUG settings (related to `4390 `_). + * Simplified handling of filename/filetype when opening documents. + * Removed PDF linearization support. + * Calls to `Document.save()` with `linear` set to true will now raise an exception. + * See https://artifex.com/blog/mupdf-removes-linearisation for more information. + +**Changes in version 1.25.5 (2025-03-31)** + +* Fixed issues: + + * **Fixed** `4372 `_: Text insertion fails due to missing /Resources object + * **Fixed** `4400 `_: Infinite loop in fill_textbox + * **Fixed** `4403 `_: Unable to get_text() - layer/clip nesting too deep + * **Fixed** `4415 `_: PDF page is mirrored, origin is at bottom-left + +* Other: + + * Use MuPDF-1.25.6. + * Fixed MuPDF SEGV on MacOS with particular fonts. + * Fixed `Annot.get_textpage()`'s `clip` arg. + * Fixed Python-3.14 (pre-release) build error. + + +**Changes in version 1.25.4 (2025-03-14)** + +* Use MuPDF-1.25.5. + +* Fixed issues: + + * **Fixed** `4079 `_: Unexpected result for apply_redactions() + * **Fixed** `4224 `_: MuPDF error: format error: negative code in 1d faxd + * **Fixed** `4303 `_: page.get_image_info() returns outdated cached results after replacing image + * **Fixed** `4309 `_: FzErrorFormat Error When Deleting First Page + * **Fixed** `4336 `_: Major Performance Regression: pix.color_count is 150x slower in version 1.25.3 compared to 1.23.8 + * **Fixed** `4341 `_: Invalid label retrieval when /Kids is an array of multiple /Nums + +* Other: + + * Fixed handling of duplicate widget names when joining PDFs (PR #4347). + * Improved Pyodide build. + * Avoid SWIG-related build errors with Python-3.13 by disabling PY_LIMITED_API. + + +**Changes in version 1.25.3 (2025-02-06)** + +* Use MuPDF-1.25.4. + +* Fixed issues: + + * **Fixed** `4139 `_: Text color numbers change between 1.24.14 and 1.25.0 + * **Fixed** `4141 `_: Some insertion methods fails for pages without a /Resources object + * **Fixed** `4180 `_: Search problems + * **Fixed** `4182 `_: Text coordinate extraction error + * **Fixed** `4245 `_: Highlighting issue distorted on recent versions + * **Fixed** `4254 `_: add_freetext_annot is drawing text outside the annotation box + +* Other: + + * In annotations: + * Added support for subtype FreeTextCallout. + * Added support for rich text. + * Added miter_limit arg to insert_text*() to allow suppression of spikes caused by long miters. + * Add Widget Support to `Document.insert_pdf()`. + * Add `bibi` to span dicts. + * Add `synthetic' to char dict. + * Fixed Pyodide builds. + + +**Changes in version 1.25.2 (2025-01-17)** + +* Fixed issues: + + * **Fixed** `4055 `_: "Yes" for all checkboxes does not work for all PDF rendering engines. + * **Fixed** `4155 `_: samples_mv is unsafe + * **Fixed** `4162 `_: Got AttributeError, when tried to add Signature field + * **Fixed** `4186 `_: Incorrect handling of JPEG with color space CMYK image extraction + * **Fixed** `4195 `_: Pixmaps that are inverted and have an alpha channel are not rendered properly + * **Fixed** `4225 `_: pixmap.pil_save() fails due to colorspace definition + * **Fixed** `4232 `_: Incorrect Font style and Size + +* Other: + + * Use Python's built-in glyphname <> unicode conversion. + * Improve speed of pixmap color inversion. + * Add new `char_flags` member to span dictionary, for example allows detection of invisible text. + * Detect image masks in TextPage output. + * Added `Pixmap.pil_image()`. + + +**Changes in version 1.25.1 (2024-12-11)** + +* Use MuPDF-1.25.2. + +* Fixed issues: + + * **Fixed** `4125 `_: memory leak while convert Pixmap's colorspace + * **Fixed** `4034 `_: Possible regression in pdf cleaning during save. + + +**Changes in version 1.25.0 (2024-12-05)** + +* Use MuPDF-1.25.1. + +* Fixed issues: + + * **Fixed** `4026 `_: page.get_text('blocks') output two piece of very similar text with different bbox + * **Fixed** `4004 `_: Segmentation Fault When Updating PDF Form Field Value + * **Fixed** `3887 `_: Subset Fonts problem using Fallback Font + * **Fixed** `3886 `_: Another issue with destroying PDF when inserting html + * **Fixed** `3751 `_: apply_redactions causes part of the page content to be hidden / transparent + + +.. codespell:ignore-begin + +**Changes in version 1.24.14 (2024-11-19)** + +* Use MuPDF-1.24.11. + +* Fixed issues: + + * **Fixed** `3448 `_: get_pixmap function removes the table and leaves just the content behind + * **Fixed** `3758 `_: Got "malloc(): unaligned tcache chunk detected Aborted (core dumped)" while using add_redact_annot/apply_redactions + * **Fixed** `3813 `_: Stories: Ordered list count broken with nested unordered list + * **Fixed** `3933 `_: font.valid_codepoints() - malfunction + * **Fixed** `4018 `_: PyMuPDF hangs when iterating over zero page PDF pages backwards + * **Fixed** `4043 `_: fullcopypage bug + * **Fixed** `4047 `_: Segmentation Fault in add_redact_annot + * **Fixed** `4050 `_: Content of dict returned by doc.embfile_info() does not fit to documentation + +* Other: + + * Ensure that words from `Page.get_text()` never contain RTL/LTR char mixtures. + * Fix building with system MuPDF. + * Add dot product for points and vectors. + + +**Changes in version 1.24.13 (2024-10-29)** + +* Fixed issues: + + * **Fixed** `3848 `_: Piximap program crash + * **Fixed** `3950 `_: Unable to consistently extract field labels from PDFs + * **Fixed** `3981 `_: PyMuPDF 1.24.12 with pyinstaller throws error. + * **Fixed** `3994 `_: pix.color_topusage raise Segmentation fault (core dumped) + + +**Changes in version 1.24.12 (2024-10-21)** + +* Fixed issues: + + * **Fixed** `3914 `_: Ability to print MuPDF errors to logging instead of stdout + * **Fixed** `3916 `_: insert_htmlbox error: int too large to convert to float + * **Fixed** `3950 `_: Unable to consistently extract field labels from PDFs + +* Supported Python versions are now 3.9-3.13. + + * Dropped support for Python-3.8 because end-of-life. + * Added support for Python-3.13 because now released. + * See: https://devguide.python.org/versions/ + + +**Changes in version 1.24.11 (2024-10-03)** + +* Use MuPDF-1.24.10. + +* Fixed issues: + + * **Fixed** `3624 `_: Pdf file transform to image have a black block + * **Fixed** `3859 `_: doc.need_appearances() fails with "AttributeError: module 'pymupdf.mupdf' has no attribute 'PDF_TRUE' " + * **Fixed** `3863 `_: apply_redactions() does not work as expected + * **Fixed** `3905 `_: open stream can raise a FzErrorFormat error instead of FileDataError + +* Wheels now use the Python Stable ABI: + + * There is one PyMuPDF wheel for each platform. + * Each wheel works with all supported Python versions. + * Each wheel is built using the oldest supported Python version (currently 3.8). + * There is no PyMuPDFb wheel. + +* Other: + + * Improvements to get_text_words() with sort=True. + * Tests now always get the latest versions of required Python packages. + * Removed dependency on setuptools. + * Added item to PyMuPDF-1.24.10 changes below - fix of #3630. + + +**Changes in version 1.24.10 (2024-09-02)** + +* Use MuPDF-1.24.9. + +* Fixed issues: + + * **Fixed** `3450 `_: get_pixmap function takes too long to process + * **Fixed** `3569 `_: Invalid OCGs not ignored by SVG image creation + * **Fixed** `3603 `_: ObjStm compression and PDF linearization doesn't work together + * **Fixed** `3650 `_: Linebreak inserted between each letter + * **Fixed** `3661 `_: Update Document to check the /XYZ len + * **Fixed** `3698 `_: documentation issue - old code in the annotations documentation + * **Fixed** `3705 `_: Document.select() behaves weirdly in some particular kind of pdf files + * **Fixed** `3706 `_: extend Document.__getitem__ type annotation to reflect that the method also accepts slices + * **Fixed** `3727 `_: Method get_pixmap() make the program exit without any exceptions or messages + * **Fixed** `3767 `_: Cannot get Tessdata with Tesseract-OCR 5 + * **Fixed** `3773 `_: Link.set_border gives TypeError: '<' not supported between instances of 'NoneType' and 'int' + * **Fixed** `3774 `_: fitz.__version__` does not work anymore + * **Fixed** `3789 `_: ValueError: not enough values to unpack (expected 3, got 2) is thrown when call insert_pdf + * **Fixed** `3820 `_: class improves namedDest handling + + * **Fixed** `3630 `_: page.apply_redactions gives unwanted black rectangle + +* Other: + + * Object streams and linearization cannot be used together; attempting to do + so will raise an exception. (#3603) + * Fixed handling of non-existing /Contents object. + + +**Changes in version 1.24.9 (2024-07-24)** + +* Use MuPDF-1.24.8. + + +**Changes in version 1.24.8 (2024-07-22)** + +* Fixed issues: + + * **Fixed** `3636 `_: API documentation for the open function is not obvious to find. + * **Fixed** `3654 `_: docx parsing was broken in 1.24.7 + * **Fixed** `3677 `_: Unable to extract subset font name using the newer versions of PyMuPDF : 1.24.6 and 1.24.7. + * **Fixed** `3687 `_: Page.get_text results in AssertionError for epub files + +Other: + +* Fixed various spelling mistakes spotted by codespell. +* Improved how we modify MuPDF's default configuration on Windows. +* Make text search to work with ligatures. + + +**Changes in version 1.24.7 (2024-06-26)** + +* Fixed issues: + + * **Fixed** `3615 `_: Document.pagemode or Document.pagelayout crashes for epub files + * **Fixed** `3616 `_: not last version reported + + +**Changes in version 1.24.6 (2024-06-25)** + +* Use MuPDF-1.24.4 + +* Fixed issues: + + * **Fixed** `3599 `_: Story.fit_width() has a weird line + * **Fixed** `3594 `_: Garbled extraction for Amazon Sustainability Report + * **Fixed** `3591 `_: 'width' in Page.get_drawings() returns width equal as 0 + * **Fixed** `3561 `_: ZeroDivisionError: float division by zero with page.apply_redactions() + * **Fixed** `3559 `_: SegFault 11 when empty H1 H2 H3 H4 etc element is used in insert_htmlbox + * **Fixed** `3539 `_: Add dotted gridline detection to table recognition + * **Fixed** `3519 `_: get_toc(simple=False) AttributeError: 'Outline' object has no attribute 'rect' + * **Fixed** `3510 `_: page.get_label() gets wrong label on the first page of doc + * **Fixed** `3494 `_: 1.24.2/1.24.3: spurious characters introduced when using subset_fonts and insert_pdf + * **Fixed** `3470 `_: subset_fonts error exit without exception/warning + * **Fixed** `3400 `_: set_toc alters link coordinates for some rotated pages on pymupdf 1.24.2 + * **Fixed** `3347 `_: Incorrect links to points on pages having different heights + * **Fixed** `3237 `_: Set_metadata() does not work + * **Fixed** `3493 `_: Isolate PyMuPDF from other libraries; issues when PyMuPDF is loaded with other libraries like GdkPixbuf + +* Other: + + * Fixed concurrent use of PyMuPDF caused by use of constant temporary filenames. + + * Add musllinux x86_64 wheels to release. + + * Added clearer version information: + + * `pymupdf.pymupdf_version`. + * `pymupdf.mupdf_version`. + * `pymupdf.pymupdf_date`. + + +**Changes in version 1.24.5 (2024-05-30)** + +* Fixed issues: + + * **Fixed** `3479 `_: regression: fill_textbox: IndexError: pop from empty list + * **Fixed** `3488 `_: set_toc method error + +* Other: + + * Some more fixes to use MuPDF floating formatting. + * Removed/disabled some unnecessary diagnostics. + * Fixed utils.do_links() crash. + * Experimental new functions `pymupdf.apply_pages()` and `pymupdf.get_text()`. + * Addresses wrong label generation for label styles "a" and "A". + + +**Changes in version 1.24.4 (2024-05-16)** + + * **Fixed** `3418 `_: Re-introduced bug, text align add_redact_annot + * **Fixed** `3472 `_: insert_pdf gives SystemError + +* Other: + + * Fixed sysinstall test failing to remove all of prior installation before + new install. + * Fixed `utils.do_links()` crash. + * Correct `TextPage` creation Code. + * Unified various diagnostics. + * Fix bug in `page_merge()`. + + +**Changes in version 1.24.3 (2024-05-09)** + +* + The Python module is now called `pymupdf`. `fitz` is still supported for + backwards compatibility. + +* Use MuPDF-1.24.2. + +* Fixed issues: + + * **Fixed** `3357 `_: PyMuPDF==1.24.0 will hanging when using page.get_text("text") + * **Fixed** `3376 `_: Redacting results are not as expected in 1.24.x. + * **Fixed** `3379 `_: Documentation mismatch for get_text_blocks return value order. + * **Fixed** `3381 `_: Contents stream contains floats in scientific notation + * **Fixed** `3402 `_: Cannot add Widgets containing inter-field-calculation JavaScript + * **Fixed** `3414 `_: missing attribute set_dpi() + * **Fixed** `3430 `_: page.get_text() cause process freeze with certain pdf on v1.24.2 + +* Other: + + * New/modified methods: + + * `Page.remove_rotation()`: new, set page rotation to zero while keeping appearance. + + * Fixed some problems when checking for PDF properties. + * Fixed pip builds from sdist + (see discussion `3360 `_: + Alpine linux docker build failing "No matching distribution found for pymupdfb==1.24.1"). + + +**Changes in version 1.24.2 (2024-04-17)** + +* Removed obsolete classic implementation from releases + (previously available as module `fitz_old`). + +* Fixed issues: + + * **Fixed** `3331 `_: Document.pages() is incorrectly type-hinted + * **Fixed** `3354 `_: PyMuPDF==1.24.1: AttributeError: property 'metadata' of 'Document' object has no setter + +* Other: + + * New/modified methods: + + * `Document.bake()`: new, make annotations / fields permanent content. + * `Page.cluster_drawings()`: new, identifies drawing items + (i.e. vector graphics or line-art) + that belong together based on their geometrical vicinity. + * `Page.apply_redactions()`: added new parameter `text`. + * `Document.subset_fonts()`: use MuPDF's `pdf_subset_fonts()` instead of PyMuPDF code. + + * The `Document` class now supports page numbers specified as slices. + * Avoid causing MuPDF warnings. + + +**Changes in version 1.24.1 (2024-04-02)** + +* Fixed issues: + + * **Fixed** `3278 `_: apply_redactions moves some unredacted text + * **Fixed** `3301 `_: Be more permissive when classifying links as kind LINK_URI + * **Fixed** `3306 `_: Text containing capital 'ET' not appearing as annotation + +* Other: + + * Use MuPDF-1.24.1. + * Support ObjStm Compression. + Methods `Document.save()`, `Document.ez_save()` and `Document.write()` + now support new parameters `use_objstm`, compression_effort` and + `preserve_metadata`. + + +**Changes in version 1.24.0 (2024-03-21)** + +* Fixed issues: + + * **Fixed** `3281 `_: Preparing metadata (pyproject.toml) did not run successfully + * **Fixed** `3279 `_: PyMuPDF no longer builds in Alpine Linux + * **Fixed** `3257 `_: apply_redactions() deleting text outside of annoted box + * **Fixed** `3216 `_: AttributeError: 'Annot' object has no attribute '__del__' + * **Fixed** `3207 `_: get_drawings's items is missing line from h path operator + * **Fixed** `3201 `_: Memory leaks when merging PDFs + * **Fixed** `3197 `_: page.get_text() returns hexadecimal text for some characters + * **Fixed** `3196 `_: Remove text not working in 1.23.25 version vs 1.20.2 + * **Fixed** `3172 `_: PDF's 45º lines dissapearing in png conversion + * **Fixed** `3135 `_: Do not log warnings to stdout + * **Fixed** `3125 `_: get_pixmap method stuck on one page and runs forever + * **Fixed** `2964 `_: There is an issue with the image generated by the page.get_pixmap() function + +* Other: + + * Use MuPDF-1.24.0. + * Add support for redacting vector graphics. + * Several fixes for table module + + * Add new method for outputting the table as a markdown string. + + * Address errors in computing the table header object: + + We now allow None as the cell value, because this will be resolved where + needed (e.g. in the pandas DataFrame). + + We previously tried to enforce rect-like tuples in all header cell + bboxes, however this fails for tables with all-None columns. This fix + enables this and constructs an empty string in the corresponding cell + string. + + We now correctly include start / stop points of lines in the bbox of the + clustered graphic. We previously joined the line's rectangle - which had + no effect because this is always empty. + + * Improved exception text if we fail to open document. + * Fixed build with new libclang 18. + + +**Changes in version 1.23.26 (2024-02-29)** + +* Fixed issues: + + * **Fixed** `3199 `_: Add entry_points to setuptools configuration to provide command-line console scripts + * **Fixed** `3209 `_: Empty vertices in ink annotation + +* Other: + + * Improvements to table detection: + + * Improved check for empty tables, fixes bugs when determining table headers. + * Improved computation of enveloping vector graphic rectangles. + * Ignore more meaningless "pseudo" tables + + * Install command-line 'pymupdf' command that runs fitz/__main__.py. + * Don't overwrite MuPDF's config.h when building on non-Windows. + * Fix `Story` constructor's `archive` arg to match docs - now accepts a single `Archive` constructor arg. + * Do not include MuPDF source in sdist; will be downloaded automatically when building. + + +**Changes in version 1.23.25 (2024-02-20)** + +* Fixed issues: + + * **Fixed** `3182 `_: Pixmap.invert_irect argument type error + * **Fixed** `3186 `_: extractText() extracts broken text from pdf + * **Fixed** `3191 `_: Error on .find_tables() + +* Other: + + * When building, be able to specify python-config directly, with environment + variable `PIPCL_PYTHON_CONFIG`. + + +**Changes in version 1.23.24 (2024-02-19)** + +* Fixed issues: + + * **Fixed** `3148 `_: Table extraction - vertical text not handled correctly + * **Fixed** `3179 `_: Table Detection: Incorrect Separation of Vector Graphics Clusters + * **Fixed** `3180 `_: Cannot show optional content group: AttributeError: module 'fitz.mupdf' has no attribute 'pdf_array_push_drop' + +* Other: + + * Be able to test system install using `sudo pip install` instead of a venv. + + +**Changes in version 1.23.23 (2024-02-18)** + +* Fixed issues: + + * **Fixed** `3126 `_: Initialising Archive with a pathlib.Path fails. + * **Fixed** `3131 `_: Calling the next attribute of an Annot raises a "No attribute .parent" warning + * **Fixed** `3134 `_: Using an IRect as clip parameter in Page.get_pixmap no longer works since 1.23.9 + * **Fixed** `3140 `_: PDF document stays in use after closing + * **Fixed** `3150 `_: doc.select() hangs on this doc. + * **Fixed** `3163 `_: AssertionError on using fitz.IRect + * **Fixed** `3177 `_: fitz.Pixmap(None, pix) Unrecognised args for constructing Pixmap + +* Other: + + * + Improved `Document.select() by using new MuPDF function + `pdf_rearrange_pages()`. This is a more complete (and faster) + implementation of what needs to be done here in that not only pages will + be rearranged, but also consequential changes will be made to the table + of contents, links to removed pages and affected entries in the Optional + Content definitions. + * `TextWriter.appendv()`: added `small_caps` arg. + * Fixed some valgrind errors with MuPDF master. + * Fixed `Document.insert_image()` when build with MuPDF master. + + +**Changes in version 1.23.22 (2024-02-12)** + +* Fixed issues: + + * **Fixed** `3143 `_: Difference in decoding of OCGs names between doc.get_ocgs() and page.get_drawings() + + * **Fixed** `3139 `_: Pixmap resizing needs positional arg "clip" - even if None. + +* Other: + + * Removed the use of MuPDF function `fz_image_size()` from PyMuPDF. + + +**Changes in version 1.23.21 (2024-02-01)** + +* Fixed issues: + +* Other: + + * Fixed bug in set_xml_metadata(), PR `3112 https://github.com/pymupdf/PyMuPDF/pull/3112>`_: Fix pdf_add_stream metadata error + * Fixed lack of `.parent` member in `TextPage` from `Annot.get_textpage()`. + * Fixed bug in `Page.add_widget()`. + + +**Changes in version 1.23.20 (2024-01-29)** + +* Bug fixes: + + * **Fixed** `3100 `_: Wrong internal property accessed in get_xml_metadata + +* Other: + + * Significantly improved speed of `Document.get_toc()`. + + +**Changes in version 1.23.19 (2024-01-25)** + +* Bug fixes: + + * **Fixed** `3087 `_: Exception in insert_image with mask specified + * **Fixed** `3094 `_: TypeError: '<' not supported between instances of 'FzLocation' and 'int' in doc.delete_pages + +* Other: + + * When finding tables: + + * Allow addition of user-defined "virtual" vector graphics when finding tables. + * Confirm that the enveloping bboxes of vector graphics are inside the clip rectangle. + * Avoid slow finding of rectangle intersections. + + * Added `Font.bbox` property. + + +**Changes in version 1.23.18 (2024-01-23)** + +* Bug fixes: + + * **Fixed** `3081 `_: doc.close() not closing the document + +* Other: + + * Reduced size of sdist to fit on pypi.org (by reducing size of two test files). + * Fix `Annot.file_info()` if no `Desc` item. + + +**Changes in version 1.23.17 (2024-01-22)** + +* Bug fixes: + + * **Fixed** `3062 `_: page_rotation_reset does not return page to original rotation + * **Fixed** `3070 `_: update_link(): AttributeError: 'Page' object has no attribute 'super' + +* Other: + + * Fixed bug in `Page.links()` (PR #3075). + * Fixed bug in `Page.get_bboxlog()` with layers. + * Add support for timeouts in scripts/ and tests/run_compound.py. + + +**Changes in version 1.23.16 (2024-01-18)** + +* Bug fixes: + + * **Fixed** `3058 `_: Pixmap created from CMYK JPEG delivers RGB format + +* Other: + + * In table detection strategy "lines_strict", exclude fill-only vector graphics. + * Fixed sysinstall test failure. + * In documentation, update feature matrix with item about text writing. + + +**Changes in version 1.23.15 (2024-01-16)** + +* Bug fixes: + + * **Fixed** `3050 `_: python3.9 pix.set_pixel has something wrong in c.append( ord(i)) + +* Other: + + * Improved docs for Page.find_tables(). + + +**Changes in version 1.23.14 (2024-01-15)** + +* Bug fixes: + + * **Fixed** `3038 `_: JM_pixmap_from_display_list > Assertion Error : Checking for wrong type + * **Fixed** `3039 `_: Issue with doc.close() not closing the document in PyMuPDF + +* Other: + + * Ensure valid "re" rectangles in `Page.get_drawings()` with derotated pages. + + +**Changes in version 1.23.13 (2024-01-15)** + +* Bug fixes: + + * **Fixed** `2979 `_: list index out of range in to_pandas() + * **Fixed** `3001 `_: Calling find_tables() on one document alters the bounding boxes of a subsequent document + +* Other: + + * Fixed `Rect.height` and `Rect.width` to never return negative values. + * Fixed `TextPage.extractIMGINFO()`'s returned `dictkey_yres` value. + + +**Changes in version 1.23.12 (2024-01-12)** + +* * **Fixed** `3027 `_: Page.get_text throws Attribute Error for 'parent' + + +**Changes in version 1.23.11 (2024-01-12)** + +* Fixed some Pixmap construction bugs. +* Fixed Pixmap.yres(). + + +**Changes in version 1.23.10 (2024-01-12)** + +* Bug fixes: + + * **Fixed** `3020 `_: Can't resize a PixMap + +* Other: + + * Fixed Page.delete_image(). + + +**Changes in version 1.23.9 (2024-01-11)** + +* Default to new "rebased" implementation. + + * The old "classic" implementation is available with `import fitz_old as fitz`. + * For more information about why we are changing to the rebased implementation, + see: https://github.com/pymupdf/PyMuPDF/discussions/2680 + +* Use MuPDF-1.23.9. + +* Bug fixes (rebased implementation only): + + * **Fixed** `2911 `_: Page.derotation_matrix returns a tuple instead of a Matrix with rebased implementation + * **Fixed** `2919 `_: Rebased version: KeyError in resolve_names when merging pdfs + * **Fixed** `2922 `_: New feature that allows inserting named-destination links doesn't work + * **Fixed** `2943 `_: ZeroDivisionError: float division by zero when use apply_redactions() + * **Fixed** `2950 `_: Shelling out to pip during tests is problematic + * **Fixed** `2954 `_: Replacement unicode character in text extraction + * **Fixed** `2957 `_: apply_redactions() moving text + * **Fixed** `2961 `_: Passing a string as a page number raises IndexError instead of TypeError. + * **Fixed** `2969 `_: annot.next throws AttributeError + * **Fixed** `2978 `_: 1.23.9rc1: module 'fitz.mupdf' has no attribute 'fz_copy_pixmap_rect' + + * **Fixed** `2907 `_: segfault trying to call clean_contents on certain pdfs with python 3.12 + * **Fixed** `2905 `_: SystemError: returned a result with an exception set + * **Fixed** `2742 `_: Segmentation Fault when inserting three (but not two) copies of the same source page into one destination page + +* Other: + + * Add optional setting of opacity to `Page.insert_htmlbox()`. + * Fixed issue with add_redact_annot() mentioned in #2934. + * Fixed `Page.rotation()` to return 0 for non-PDF documents instead of raising an exception. + * Fixed internal quad detection to cope with any Python sequence. + * Fixed rebased `fitz.pymupdf_version_tuple` - was previously set to mupdf version. + * Improved support for Linux system installs, including adding regular testing on Github. + * Add missing `flake8` to `scripts/gh_release.py:test_packages`. + * Use newly public functions in MuPDF-1.23.8. + * Improved `scripts/test.py` to help investigation of MuPDF issues. + + +**Changes in version 1.23.8 (2023-12-19)** + +* Bug fixes (rebased implementation only): + + * **Fixed** `2634 `_: get_toc and set_toc do not behave consistently for rotated pages + * **Fixed** `2861 `_: AttributeError in getLinkDict during PDF Merge + * **Fixed** `2871 `_: KeyError in getLinkDict during PDF merge + * **Fixed** `2886 `_: Error in Skeleton for Named Link Destinations + +* Bug fixes (rebased and classic implementations): + + * **Fixed** `2885 `_: pymupdf find tables too slow + +* Other: + + * Rebased implementation: + + * `Page.insert_htmlbox()`: new, much more powerful alternative to `Page.insert_textbox()` or `TextWriter.fill_textbox()`, using `Story`. + * `Story.fit*()`: new methods for fitting a Story into an expanded rect. + * `Story.write_with_links()`: add support for external links. + * `Document.language()`: fixed to use MuPDF's new `mupdf.fz_string_from_text_language2()`. + * `Document.subset_fonts()` - fixed. + * Fixed internal `Archive._add_treeitem()` method. + * Fixed `fitz_new.__doc__` to contain PyMuPDF and Python version information, and OS name. + * Removed use of `(*args, **kwargs)` in API, we now specify keyword args explicitly. + * Work with new MuPDF Python exception classes. + + * Fixed bug where `button_states()` returns None when `/AP` points to an indirect object. + * Fixed pillow test to not ignore all errors, and install pillow when testing. + * Added test for `fitz.css_for_pymupdf_font()` (uses package `pymupdf-fonts`). + * Simplified Github Actions test specifications. + * Updated `tests/README.md`. + + +**Changes in version 1.23.7 (2023-11-30)** + +* Bug fixes in rebased implementation, not fixed in classic implementation: + + * **Fixed** `2232 `_: Geometry helper classes should support keyword arguments + * **Fixed** `2788 `_: Problem with get_toc in pymupdf 1.23.6 + * **Fixed** `2791 `_: Experiencing small memory leak in save() + +* Bug fixes (rebased and classic implementations): + + * **Fixed** `2736 `_: Failure when set cropbox with mediabox negative value + * **Fixed** `2749 `_: RuntimeError: cycle in structure tree + * **Fixed** `2753 `_: Story.write_with_links will ignore everything after the first "page break" in the HTML. + * **Fixed** `2812 `_: find_tables on landscape page generates reversed text + * **Fixed** `2829 `_: [cannot create /Annot for kind] is still printed despite #2345 is closed. + * **Fixed** `2841 `_: Unexpected KeyError when using scrub with fitz_new + +* Use MuPDF-1.23.7. + +* Other: + + * Rebased implementation: + + * Added flake8 code checking to test suite, and made various fixes. + * Disable diagnostics during Document constructor to match classic implementation. + + * Additional fix to `2553 `_: Invalid characters in versions >= 1.22 + * Fixed `MuPDF Bug 707324 `_: Story: HTML table row background color repeated incorrectly + * Added `scripts/test.py`, for simple build+test of PyMuPDF git checkout. + * Added `fitz.pymupdf_version_tuple`, e.g. `(1, 23, 6)`. + * Restored mistakenly-reverted fix for `2345 `_: Turn off print statements in utils.py + * Include any trailing `... repeated times...` text in warnings returned by `mupdf_warnings()` (rebased only). + + + +**Changes in version 1.23.6 (2023-11-06)** + +* Bug fixes: + + * **Fixed** `2553 `_: Invalid characters in versions >= 1.22 + * **Fixed** `2608 `_: Incorrect utf32 text extraction (high & low surrogates are split) + * **Fixed** `2710 `_: page.rect and text location wrong / differing from older version + * **Fixed** `2774 `_: wrong encoding for "\?" character when sort=True + * **Fixed** `2775 `_: fitz_new does not work with python3.10 or earlier + * **Fixed** `2777 `_: With fitz_new, wrong type for Page.mediabox + +* Other: + + * Use MuPDF-1.23.5. + * Added Document.resolve_names() (rebased implementation only). + + +**Changes in version 1.23.5 (2023-10-11)** + +* Bug fixes: + + * **Fixed** `2341 `_: Handling negative values in the zoom section for LINK_GOTO in linkDest + * **Fixed** `2522 `_: Typo in set_layer() - NameError: name 'f' is not defined + * **Fixed** `2548 `_: Fitz freezes on some PDFs when calling the fitz.Page.get_text_blocks method. + * **Fixed** `2596 `_: save(garbage=3) breaks get_pixmap() with side effect + * **Fixed** `2635 `_: "clean=True" makes objects invisible in the pdf + * **Fixed** `2637 `_: Page.insert_textbox incorrectly handles the last word if it starts a new line + * **Fixed** `2699 `_: extract paragraph with below table + * **Fixed** `2703 `_: Wrong fontsize calculation in corner cases ("page.get_texttrace()") + * **Fixed** `2710 `_: page.rect and text location wrong / differing from older version + * **Fixed** `2723 `_: When will a Python 3.12 wheel be available? + * **Fixed** `2730 `_: persistent get_text() formatting + +* Other: + + * Use MuPDF-1.23.4. + * Fix optimisation flags with system installs. + * Fixed the problem that the clip parameter does not take effect during table recognition + * Support Pillow mode "RGBa" + * Support extra word delimiters + * Support checking valid PDF name objects + + +**Changes in version 1.23.4 (2023-09-26)** + +* Improved build instructions. +* Fixed Tesseract in rebased implementation. +* Improvements to build/install with system MuPDF. +* Fixed Pyodide builds. +* Fixed rebased bug in _insert_image(). + +* Bug fixes: + + * **Fixed** `2556 `_: Segmentation fault at caling get_cdrawings(extended=True) + * **Fixed** `2637 `_: Page.insert_textbox incorrectly handles the last word if it starts a new line + * **Fixed** `2683 `_: Windows sdist build failure - non-quoting of path and using UNIX which command + * **Fixed** `2691 `_: Page.get_textpage_ocr() bug in rebased fitz_new version + * **Fixed** `2692 `_: Page.get_pixmap(clip=Rect()) bug in rebased fitz_new version + + +**Changes in version 1.23.3 (2023-08-31)** + +* Fixed use of Tesseract for OCR. + + +**Changes in version 1.23.2 (2023-08-28)** + +* **Fixed** `#2613 `_: release 1.23.0 not MacOS-arm64 compatible + + +**Changes in version 1.23.1 (2023-08-24)** + +* Updated README and package summary description. + +* + Fixed a problem on some Linux installations with Python-3.10 + (and possibly earlier versions) where `import fitz` failed with + `ImportError: libcrypt.so.2: cannot open shared object file: No such + file or directory`. + +* + Fixed `incompatible architecture` error on MacOS arm64. + +* + Fixed installation warning from Poetry about missing entry in wheels' + RECORD files. + + +**Changes in version 1.23.0 (2023-08-22)** + +* Add method `find_tables()` to the `Page` object. + + This allows locating tables on any supported document page, and + extracting table content by cell. + +* New "rebased" implementation of PyMuPDF. + + The rebased implementation is available as Python module + `fitz_new`. It can be used as a drop-in replacement with `import + fitz_new as fitz`. + +* + Python-independent MuPDF libraries are now in a second wheel called + `PyMuPDFb` that will be automatically installed by pip. + + This is to save space on pypi.org - a full release only needs one + `PyMuPDFb` wheel for each OS. + +* Bug fixes: + + * **Fixed** `#2542 `_: fitz.utils.scrub AttributeError Annot object has no attribute fileUpd inside + * **Fixed** `#2533 `_: get_texttrace returned a incorrect character bbox + * **Fixed** `#2537 `_: Validation when setting a grouped RadioButton throws a RuntimeError: path to 'V' has indirects + +* Other changes: + + * Dropped support for Python-3.7. + + * Fix for wrong page / annot `/Contents` cleaning. + + We need to set `pdf_filter_options::no_update` to zero. + + * Added new function get_tessdata(). + + * Cope with problem `/Annot` arrays. + + When copying page annotations in method Document.insert_pdf we + previously did not check the validity of members of the `/Annots` + array. For faulty members (like null or non-dictionary items) this + could cause unnecessary exceptions. This fix implements more checks + and skips such array items. + + * Additional annotation type checks. + + We did not previously check for annotation type when getting / + setting annotation border properties. This is now checked in + accordance with MuPDF. + + * Increase fault tolerance. + + Avoid exceptions in method `insert_pdf()` when source pages contains + invalid items in the `/Annots` array. + + * Return empty border dict for applicable annots. + + We previously were returning a non-empty border dictionary even for + non-applicable annotation types. We now return the empty dictionary + `{}` in these cases. This requires some corresponding changes in the + annotation `.update()` method, namely for dashes and border width. + + * Restrict `set_rect` to applicable annot types. + + We were insufficiently excluding non-applicable annotation types + from `set_rect()` method. We now let MuPDF catch unsupported + annotations and return `False` in these cases. + + * Wrong fontsize computation in `page.get_texttrace()`. + + When computing the font size we were using the final text + transformation matrix, where we should have taken `span->trm` + instead. This is corrected here. + + * Updates to cope with changes to latest MuPDF. + + `pdf_lookup_anchor()` has been removed. + + * Update fill_textbox to better respect rect.width + + The function norm_words in fill_textbox had a bug in its last + loop, appending n+1 characters when actually measuring width of n + characters. It led to a bug in fill_texbox when you tried to write + a single word mostly composed of "wide" letters (M,m, W, w...), + causing the written text to exceed the given rect. + + The fix was just to replace n+1 by n. + + * Add `script_focus` and `script_blur` options to widget. + + + +**Changes in version 1.22.5 (2023-06-21)** + +* This release uses ``MuPDF-1.22.2``. + +* Bug fixes: + + * **Fixed** `#2365 `_: Incorrect dictionary values for type "fs" drawings. + * **Fixed** `#2391 `_: Check box automatically uncheck when we update same checkbox more than 1 times. + * **Fixed** `#2400 `_: Gaps within text of same line not filled with spaces. + * **Fixed** `#2404 `_: Blacklining an image in PDF won't remove underlying content in version 1.22.X. + * **Fixed** `#2430 `_: Incorrectly reducing ref count of Py_None. + * **Fixed** `#2450 `_: Empty fill color and fill opacity for paths with fill and stroke operations with 1.22.* + * **Fixed** `#2462 `_: Error at "get_drawing(extended=True )" + * **Fixed** `#2468 `_: Decode error when trying to get drawings + * **Fixed** `#2710 `_: page.rect and text location wrong / differing from older version + * **Fixed** `#2723 `_: When will a Python 3.12 wheel be available? + +* New features: + + * **Changed** Annotations now support "cloudy" borders. + The :attr:`Annot.border` property has the new item `clouds`, + and method :meth:`Annot.set_border` supports the corresponding `clouds` argument. + + * **Changed** Radio button widgets in the same RB group + are now consistently updated **if the group is defined in the standard way**. + + * **Added** Support for the `/Locked` key in PDF Optional Content. + This array inside the catalog entry `/OCProperties` can now be extracted and set. + + * **Added** Support for new parameter `tessdata` in OCR functions. + New function :meth:`get_tessdata` locates the language support folder if Tesseract is installed. + + + +**Changes in version 1.22.3 (2023-05-10)** + +* This release uses ``MuPDF-1.22.0``. + +* Bug fixes: + + * **Fixed** `#2333 `_: Unable to set any of button radio group in form + + +**Changes in version 1.22.2 (2023-04-26)** + +* This release uses ``MuPDF-1.22.0``. + +* Bug fixes: + + * **Fixed** `#2369 `_: Image extraction bugs with newer versions + + +**Changes in version 1.22.1 (2023-04-18)** + +* This release uses ``MuPDF-1.22.0``. + +* Bug fixes: + + * **Fixed** `#2345 `_: Turn off print statements in utils.py + * **Fixed** `#2348 `_: extract_image returns an extension "flate" instead of "png" + * **Fixed** `#2350 `_: Can not make widget (checkbox) to read-only by adding flags PDF_FIELD_IS_READ_ONLY + * **Fixed** `#2355 `_: 1.22.0 error when using get_toc (AttributeError: 'SwigPyObject' object has no attribute) + + +**Changes in version 1.22.0 (2023-04-14)** + +* This release uses ``MuPDF-1.22.0``. + +* Behavioural changes: + + * Text extraction now includes glyphs that overlap with clip rect; previously + they were included only if they were entirely contained within the clip + rect. + +* Bug fixes: + + * **Fixed** `#1763 `_: Interactive(smartform) form PDF calculation not working in pymupdf + * **Fixed** `#1995 `_: RuntimeError: image is too high for a long paged pdf file when trying + * **Fixed** `#2093 `_: Image in pdf changes color after applying redactions + * **Fixed** `#2108 `_: Redaction removing more text than expected + * **Fixed** `#2141 `_: Failed to read JPX header when trying to get blocks + * **Fixed** `#2144 `_: Replace image throws an error + * **Fixed** `#2146 `_: Wrong Handling of Reference Count of "None" Object + * **Fixed** `#2161 `_: Support adding images as pages directly + * **Fixed** `#2168 `_: ``page.add_highlight_annot(start=pointa, stop=pointb)`` not working + * **Fixed** `#2173 `_: Double free of ``Colorspace`` used in ``Pixmap`` + * **Fixed** `#2179 `_: Incorrect documentation for ``pixmap.tint_with()`` + * **Fixed** `#2208 `_: Pushbutton widget appears as check box + * **Fixed** `#2210 `_: ``apply_redactions()`` move pdf text to right after redaction + * **Fixed** `#2220 `_: ``Page.delete_image()`` | object has no attribute ``is_image`` + * **Fixed** `#2228 `_: open some pdf cost too much time + * **Fixed** `#2238 `_: Bug - can not extract data from file in the newest version 1.21.1 + * **Fixed** `#2242 `_: Python quits silently in ``Story.element_positions()`` if callback function prototype is wrong + * **Fixed** `#2246 `_: TextWriter write text in a wrong position + * **Fixed** `#2248 `_: After redacting the content, the position of the remaining text changes + * **Fixed** `#2250 `_: docs: unclear or broken link in page.rst + * **Fixed** `#2251 `_: mupdf_display_errors does not apply to Pixmap when loading broken image + * **Fixed** `#2270 `_: ``Annot.get_text("words")`` - doesn't return the first line of words + * **Fixed** `#2275 `_: insert_image: document that rotations are counterclockwise + * **Fixed** `#2278 `_: Can not make widget (checkbox) to read-only by adding flags PDF_FIELD_IS_READ_ONLY + * **Fixed** `#2290 `_: Different image format/data from Page.get_text("dict") and Fitz.get_page_images() + * **Fixed** `#2293 `_: 68 failed tests when installing from sdist on my box + * **Fixed** `#2300 `_: Too much recursion in tree (parents), makes program terminate + * **Fixed** `#2322 `_: add_highlight_annot using clip generates "A Number is Out of Range" error in PDF + +* Other: + + * Add key "/AS (Yes)" to the underlying annot object of a selected button form field. + + * Remove unused ``Document`` methods ``has_xref_streams()`` and + ``has_old_style_xrefs()`` as MuPDF equivalents have been removed. + + * Add new ``Document`` methods and properties for getting/setting + ``/PageMode``, ``/PageLayout`` and ``/MarkInfo``. + + * New ``Document`` property ``version_count``, which contains the number of + incremental saves plus one. + + * New ``Document`` property ``is_fast_webaccess`` which tells whether the + document is linearized. + + * ``DocumentWriter`` is now a context manager. + + * Add support for ``Pixmap`` JPEG output. + + * Add support for drawing rectangles with rounded corners. + + * ``get_drawings()``: added optional ``extended`` arg. + + * Fixed issue where trace devices' state was not being initialised + correctly; data returned from things like ``fitz.Page.get_texttrace()`` + might be slightly altered, e.g. ``linewidth`` values. + + * Output warning to ``stderr`` if it looks like we are being used with + current directory containing an invalid ``fitz/`` directory, because + this can break import of ``fitz`` module. For example this happens + if one attempts to use ``fitz`` when current directory is a PyMuPDF + checkout. + +* Documentation: + + * General rework: + + * Introduces a new home page and new table of contents. + * Structural update to include new About section. + * Comparison & performance graphing. + * Includes performance methodology in appendix. + * Updates conf.py to understand single back-ticks as code. + * Converts double back-ticks to single back-ticks. + * Removes redundant files. + + * Improve ``insert_file()`` documentation. + + * ``get_bboxlog()``: aded optional ``layers`` to ``get_bboxlog()``. + * ``Page.get_texttrace()``: add new dictionary key ``layer``, name of Optional Content Group. + + * Mention use of Python venv in installation documentation. + + * Added missing fix for #2057 to release 1.21.1's changelog. + + * Fixes many links to the PyMuPDF-Utilities repo scripts. + + * Avoid duplication of ``changes.txt`` and ``docs/changes.rst``. + +* Build + + * Added ``pyproject.toml`` file to improve builds using pip etc. + + + +**Changes in Version 1.21.1 (2022-12-13)** + +* This release uses ``MuPDF-1.21.1``. + +* Bug fixes: + + * **Fixed** `#2110 `_: Fully embedded font is extracted only partially if it occupies more than one object + * **Fixed** `#2094 `_: Rectangle Detection Logic + * **Fixed** `#2088 `_: Destination point not set for named links in toc + * **Fixed** `#2087 `_: Image with Filter "[/FlateDecode/JPXDecode]" not extracted + * **Fixed** `#2086 `_: Document.save() owner_pw & user_pw has buffer overflow bug + * **Fixed** `#2076 `_: Segfault in fitz.py + * **Fixed** `#2057 `_: Document.save garbage parameter not working in PyMuPDF 1.21.0 + * **Fixed** `#2051 `_: Missing DPI Parameter + * **Fixed** `#2048 `_: Invalid size of TextPage and bbox with newest version 1.21.0 + * **Fixed** `#2045 `_: SystemError: returned a result with an error set + * **Fixed** `#2039 `_: 1.21.0 fails to build against system libmupdf + * **Fixed** `#2036 `_: Archive::Archive defined twice + +* Other + + * Swallow "&zoom=nan" in link uri strings. + * Add new Page utility methods ``Page.replace_image()`` and ``Page.delete_image()``. + +* Documentation: + + * `#2040 `_: Added note about test failure with non-default build of MuPDF, to ``tests/README.md``. + * `#2037 `_: In ``docs/installation.rst``, mention incompatibility with chocolatey.org on Windows. + * `#2061 `_: Fixed description of ``Annot.file_info``. + * `#2065 `_: Show how to insert internal PDF link. + * Improved description of building from source without an sdist. + * Added information about running tests. + * `#2084 `_: Fixed broken link to PyMuPDF-Utilities. + + +**Changes in Version 1.21.0 (2022-11-8)** + +* This release uses ``MuPDF-1.21.0``. + +* New feature: Stories. + +* Added wheels for Python-3.11. + +* Bug fixes: + + * **Fixed** `#1701 `_: Broken custom image insertion. + * **Fixed** `#1854 `_: `Document.delete_pages()` declines keyword arguments. + * **Fixed** `#1868 `_: Access Violation Error at `page.apply_redactions()`. + * **Fixed** `#1909 `_: Adding text with `fontname="Helvetica"` can silently fail. + * **Fixed** `#1913 `_: `draw_rect()`: does not respect width if color is not specified. + * **Fixed** `#1917 `_: `subset_fonts()`: make it possible to silence the stdout. + * **Fixed** `#1936 `_: Rectangle detection can be incorrect producing wrong output. + * **Fixed** `#1945 `_: Segmentation fault when saving with `clean=True`. + * **Fixed** `#1965 `_: `pdfocr_save()` Hard Crash. + * **Fixed** `#1971 `_: Segmentation fault when using `get_drawings()`. + * **Fixed** `#1946 `_: `block_no` and `block_type` switched in `get_text()` docs. + * **Fixed** `#2013 `_: AttributeError: 'Widget' object has no attribute '_annot' in delete widget. + +* Misc changes to core code: + + * Fixed various compiler warnings and a sequence-point bug. + * Added support for Memento builds. + * Fixed leaks detected by Memento in test suite. + * Fixed handling of exceptions in set_name() and set_rect(). + * Allow build with latest MuPDF, for regular testing of PyMuPDF master. + * Cope with new MuPDF exceptions when setting rect for some Annot types. + * Reduced cosmetic differences between MuPDF's config.h and PyMuPDF's _config.h. + * Cope with various changes to MuPDF API. + +* Other: + + * Fixed various broken links and typos in docs. + * Mention install of `swig-python` on MacOS for #875. + * Added (untested) wheels for macos-arm64. + + + + +**Changes in Version 1.20.2** + +* This release uses ``MuPDF-1.20.3``. + +* **Fixed** `#1787 `_. + Fix linking issues on Unix systems. + +* **Fixed** `#1824 `_. + SegFault when applying redactions overlapping a transparent image. (Fixed + in ``MuPDF-1.20.3``.) + +* Improvements to documentation: + + * Improved information about building from source in ``docs/installation.rst``. + * Clarified memory allocation setting ``JM_MEMORY` in ``docs/tools.rst``. + * Fixed link to PDF Reference manual in ``docs/app3.rst``. + * Fixed building of html documentation on OpenBSD. + * Moved old ``docs/faq.rst`` into separate ``docs/recipes-*`` files. + +* Removed some unused files and directories: + + * ``installation/`` + * ``docs/wheelnames.txt`` + + +**Changes in Version 1.20.1** + +* **Fixed** `#1724 `_. + Fix for building on FreeBSD. + +* **Fixed** `#1771 `_. + `linkDest()` had a broken call to `re.match()`, introduced in 1.20.0. + +* **Fixed** `#1751 `_. + `get_drawings()` and `get_cdrawings()` previously always returned with `closePath=False`. + +* **Fixed** `#1645 `_. + Default FreeText annotation text color is now black. + +* Improvements to sphinx-generated documentation: + + * Use readthedocs theme with enhancements. + * Renamed the `.txt` files to have `.rst` suffixes. + +------ + +**Changes in Version 1.20.0** + +This release uses ``MuPDF-1.20.0``, released 2022-06-15. + +* Cope with new MuPDF link uri format, changed from ``#,,`` to ``#page=&zoom=,,``. + + * In ``tests/test_insertpdf.py``, use new reference output ``joined-1.20.pdf``. We also check that new output values are approximately the same as the old ones. + +* **Fixed** `#1738 `_. Leak of `pdf_graft_map`. + Also fixed a SEGV issue that this seemed to expose, caused by incorrect freeing of underlying fz_document. + +* **Fixed** `#1733 `_. Fixed ownership of `Annotation.get_pixmap()`. + +Changes to build/release process: + +* If pip builds from source because an appropriate wheel is not available, we no longer require MuPDF to be pre-installed. Instead the required MuPDF source is embedded in the sdist and automatically built into PyMuPDF. + +* Various changes to ``setup.py`` to download the required MuPDF release as required. See comments at start of setup.py for details. + +* Added ``.github/workflows/build_wheels.yml`` to control building of wheels on Github. + +------ + +**Changes in Version 1.19.6** + +* **Fixed** `#1620 `_. The :ref:`TextPage` created by :meth:`Page.get_textpage` will now be freed correctly (removed memory leak). +* **Fixed** `#1601 `_. Document open errors should now be more concise and easier to interpret. In the course of this, two PyMuPDF-specific Python exceptions have been **added:** + + - ``EmptyFileError`` -- raised when trying to create a :ref:`Document` (``fitz.open()``) from an empty file or zero-length memory. + - ``FileDataError`` -- raised when MuPDF encounters irrecoverable document structure issues. + +* **Added** :meth:`Page.load_widget` given a PDF field's xref. + +* **Added** Dictionary :attr:`pdfcolor` which provide the about 500 colors defined as PDF color values with the lower case color name as key. + +* **Added** algebra functionality to the :ref:`Quad` class. These objects can now also be added and subtracted among themselves, and be multiplied by numbers and matrices. + +* **Added** new constants defining the default text extraction flags for more comfortable handling. Their naming convention is like :data:`TEXTFLAGS_WORDS` for ``page.get_text("words")``. See :ref:`text_extraction_flags`. + +* **Changed** :meth:`Page.annots` and :meth:`Page.widgets` to detect and prevent reloading the page (illegally) inside the iterator loops via :meth:`Document.reload_page`. Doing this brings down the interpretor. Documented clean ways to do annotation and widget mass updates within properly designed loops. + +* **Changed** several internal utility functions to become standalone ("SWIG inline") as opposed to be part of the :ref:`Tools` class. This, among other things, increases the performance of geometry object creation. + +* **Changed** :meth:`Document.update_stream` to always accept stream updates - whether or not the dictionary object behind the xref already is a stream. Thus the former ``new`` parameter is now ignored and will be removed in v1.20.0. + + +------ + +**Changes in Version 1.19.5** + +* **Fixed** `#1518 `_. A limited "fix": in some cases, rectangles and quadrupels were not correctly encoded to support re-drawing by :ref:`Shape`. + +* **Fixed** `#1521 `_. This had the same ultimate reason behind issue #1510. + +* **Fixed** `#1513 `_. Some Optional Content functions did not support non-ASCII characters. + +* **Fixed** `#1510 `_. Support more soft-mask image subtypes. + +* **Fixed** `#1507 `_. Immunize against items in the outlines chain, that are ``"null"`` objects. + +* **Fixed** re-opened `#1417 `_. ("too many open files"). This was due to insufficient calls to MuPDF's ``fz_drop_document()``. This also fixes `#1550 `_. + +* **Fixed** several undocumented issues in relation to incorrectly setting the text span origin :data:`point_like`. + +* **Fixed** undocumented error computing the character bbox in method :meth:`Page.get_texttrace` when text is **flipped** (as opposed to just rotated). + +* **Added** items to the dictionary returned by :meth:`image_properties`: ``orientation`` and ``transform`` report the natural image orientation (EXIF data). + +* **Added** method :meth:`Document.xref_copy`. It will make a given target PDF object an exact copy of a source object. + + +------ + +**Changes in Version 1.19.4** + + +* **Fixed** `#1505 `_. Immunize against circular outline items. + +* **Fixed** `#1484 `_. Correct CropBox coordinates are now returned in all situations. + +* **Fixed** `#1479 `_. + +* **Fixed** `#1474 `_. TextPage objects are now properly deleted again. + +* **Added** :ref:`Page` methods and attributes for PDF ``/ArtBox``, ``/BleedBox``, ``/TrimBox``. + +* **Added** global attribute :attr:`TESSDATA_PREFIX` for easy checking of OCR support. + +* **Changed** :meth:`Document.xref_set_key` such that dictionary keys will physically be removed if set to value ``"null"``. + +* **Changed** :meth:`Document.extract_font` to optionally return a dictionary (instead of a tuple). + +------ + +**Changes in Version 1.19.3** + +This patch version implements minor improvements for :ref:`Pixmap` and also some important fixes. + +* **Fixed** `#1351 `_. Reverted code that introduced the memory growth in v1.18.15. + +* **Fixed** `#1417 `_. Developped circumvention for growth of open file handles using :meth:`Document.insert_pdf`. + +* **Fixed** `#1418 `_. Developped circumvention for memory growth using :meth:`Document.insert_pdf`. + +* **Fixed** `#1430 `_. Developped circumvention for mass pixmap generations of document pages. + +* **Fixed** `#1433 `_. Solves a bbox error for some Type 3 font in PyMuPDF text processing. + +* **Added** :meth:`Pixmap.color_topusage` to determine the share of the most frequently used color. Solves `#1397 `_. + +* **Added** :meth:`Pixmap.warp` which makes a new pixmap from a given arbitrary convex quad inside the pixmap. + +* **Added** :attr:`Annot.irt_xref` and :meth:`Annot.set_irt_xref` to inquire or set the `/IRT` ("In Responde To") property of an annotation. Implements `#1450 `_. + +* **Added** :meth:`Rect.torect` and :meth:`IRect.torect` which compute a matrix that transforms to a given other rectangle. + +* **Changed** :meth:`Pixmap.color_count` to also return the count of each color. +* **Changed** :meth:`Page.get_texttrace` to also return correct span and character bboxes if ``span["dir"] != (1, 0)``. + +------ + +**Changes in Version 1.19.2** + +This patch version implements minor improvements for :meth:`Page.get_drawings` and also some important fixes. + +* **Fixed** `#1388 `_. Fixed intermittent memory corruption when insert or updating annotations. + +* **Fixed** `#1375 `_. Inconsistencies between line numbers as returned by the "words" and the "dict" options of :meth:`Page.get_text` have been corrected. + +* **Fixed** `#1364 `_. The check for being a ``"rawdict"`` span in :meth:`recover_span_quad` now works correctly. + +* **Fixed** `#1342 `_. Corrected the check for rectangle infiniteness in :meth:`Page.show_pdf_page`. + +* **Changed** :meth:`Page.get_drawings`, :meth:`Page.get_cdrawings` to return an indicator on the area orientation covered by a rectangle. This implements `#1355 `_. Also, the recognition rate for rectangles and quads has been significantly improved. + +* **Changed** all text search and extraction methods to set the new ``flags`` option ``TEXT_MEDIABOX_CLIP`` to ON by default. That bit causes the automatic suppression of all characters that are completely outside a page's mediabox (in as far as that notion is supported for a document type). This eliminates the need for using ``clip=page.rect`` or similar for omitting text outside the visible area. + +* **Added** parameter ``"dpi"`` to :meth:`Page.get_pixmap` and :meth:`Annot.get_pixmap`. When given, parameter ``"matrix"`` is ignored, and a :ref:`Pixmap` with the desired dots per inch is created. + +* **Added** attributes :attr:`Pixmap.is_monochrome` and :attr:`Pixmap.is_unicolor` allowing fast checks of pixmap properties. Addresses `#1397 `_. + +* **Added** method :meth:`Pixmap.color_count` to determine the unique colors in the pixmap. + +* **Added** boolean parameter ``"compress"`` to PDF document method :meth:`Document.update_stream`. Addresses / enables solution for `#1408 `_. ------ **Changes in Version 1.19.1** -* **Fixed** `#1328 `_. "words" text extraction again returns correct coordinates. +This is the first patch version to support MuPDF v1.19.0. Apart from one bug fix, it includes important improvements for OCR support and the option to **sort extracted text** to the standard reading order "from top-left to bottom-right". -* **Changed** :meth:`Page.get_textpage_ocr` -- support specifying the desired OCR quality via parameter ``dpi``, support choice between full page OCR versus only OCRing displayed images. +* **Fixed** `#1328 `_. "words" text extraction again returns correct ``(x0, y0)`` coordinates. + +* **Changed** :meth:`Page.get_textpage_ocr`: it now supports parameter ``dpi`` to control OCR quality. It is also possible to choose whether the **full page** should be OCRed or **only the images displayed** by the page. * **Changed** :meth:`Page.get_drawings` and :meth:`Page.get_cdrawings` to automatically convert colors to RGB color tuples. Implements `#1332 `_. Similar change was applied to :meth:`Page.get_texttrace`. -* **Changed** :meth:`Page.get_text` to support a new parameter ``sort``. If set to ``True`` the output is conveniently sorted. +* **Changed** :meth:`Page.get_text` to support a parameter ``sort``. If set to ``True`` the output is conveniently sorted. ------ @@ -138,7 +1654,7 @@ Focus of this version are major performance improvements of selected functions. * **Fixed** issue `#1043 `_. Added ``Pixmap.getPNGdata`` to the aliases of :meth:`Pixmap.tobytes`. -* **Fixed** an internal error when computing the envelopping rectangle of drawn paths as returned by :meth:`Page.get_drawings`. +* **Fixed** an internal error when computing the enveloping rectangle of drawn paths as returned by :meth:`Page.get_drawings`. * **Fixed** an internal error occasionally causing loops when outputting text via :meth:`TextWriter.fill_textbox`. @@ -483,7 +1999,7 @@ This version introduces several new features around PDF text output. The motivat One major achievement is using MuPDF's capabilities to dynamically choosing fallback fonts whenever a character cannot be found in the current one. This seemlessly works for Base-14 fonts in combination with CJK fonts (China, Japan, Korea). So a text may contain **any combination of characters** from the Latin, Greek, Russian, Chinese, Japanese and Korean languages. * **Fixed** issue `#493 `_. ``Pixmap(doc, xref)`` should now again correctly resemble the loaded image object. -* **Fixed** issue `#488 `_. Widget names are now modifyable. +* **Fixed** issue `#488 `_. Widget names are now modifiable. * **Added** new class :ref:`Font` which represents a font. * **Added** new class :ref:`TextWriter` which serves as a container for text to be written on a page. * **Added** :meth:`Page.writeText` to write one or more :ref:`TextWriter` objects to the page. @@ -1251,7 +2767,7 @@ This version is also based on MuPDF v1.9a. Changes compared to version 1.9.1: Type of memory area *stream* may be *bytes* or *bytearray*. Thus, e.g. *area = open("file.pdf", "rb").read()* may be used directly (without first converting it to bytearray). * New method *Document.insert_pdf()* (PDFs only) inserts a range of pages from another PDF. -* *Document* objects doc now support the *len()* function: *len(doc) == doc.pageCount*. +* *Document* objects doc now support the *len()* function: ``len(doc) == doc.pageCount``. * New method *Document.getPageImageList()* creates a list of images used on a page. * New method *Document.getPageFontList()* creates a list of fonts referenced by a page. * New pixmap constructor *fitz.Pixmap(doc, xref)* creates a pixmap based on an opened PDF document and an :data:`xref` number of the image. @@ -1291,3 +2807,5 @@ Changes in version 1.9.1 compared to version 1.8.0 are the following: * Incremental saves for changes are possible now using the call pattern *doc.save(doc.name, incremental=True)*. * A PDF's metadata can now be deleted, set or changed by document method *set_metadata()*. Supports incremental saves. * A PDF's bookmarks (or table of contents) can now be deleted, set or changed with the entries of a list using document method *set_toc(list)*. Supports incremental saves. + +.. codespell:ignore-end diff --git a/demo/pymupdf.jpg b/demo/pymupdf.jpg deleted file mode 100644 index 0c23705bb..000000000 Binary files a/demo/pymupdf.jpg and /dev/null differ diff --git a/docs/404.rst b/docs/404.rst new file mode 100644 index 000000000..cf66a997a --- /dev/null +++ b/docs/404.rst @@ -0,0 +1,12 @@ +.. include:: header-404.rst + +404! +====== + + +**This page is not available.** + + +Please use the menu or search to find what you are looking for. + +.. include:: footer.rst diff --git a/docs/PyMuPDF.ico b/docs/PyMuPDF.ico deleted file mode 100644 index db1809d45..000000000 Binary files a/docs/PyMuPDF.ico and /dev/null differ diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..438469d34 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,88 @@ +# PyMuPDF documentation + +Welcome to the PyMuPDF documentation. This documentation relies on [Sphinx](https://www.sphinx-doc.org/en/master/) to publish HTML docs from markdown files written with [restructured text](https://en.wikipedia.org/wiki/ReStructuredText) (RST). + + +## Sphinx version + +This README assumes you have [Sphinx v5.0.2 installed](https://www.sphinx-doc.org/en/master/usage/installation.html) on your system. + + +## Updating the documentation + +Within `docs` update the associated restructured text (`.rst`) files. These files represent the corresponding document pages. + +### Conventions + +- Code parameters and referenced code objects should be referenced within backticks, not italics, double backtick is better for safety +- When referencing names of some of our products surround with | , e.g. |PyMuPDF| , not PyMuPDF, see `header.rst` for products names listing +- When hyperlinking, avoid inline hyperlinks and try to references link from common location at page bottom, also avoid the use of "here" or "click here" as this provides little information about the link content. e.g. + +"`Click here ` for our Story class". Should be re-written to something more like "Find out more `on our Story class `" + +## Building HTML documentation + +- Ensure you have the `furo` theme installed: + +`pip install furo` + +Furo theme, Copyright (c) 2020 Pradyun Gedam , thank you to: + +https://github.com/pradyunsg/furo/blob/main/LICENSE + + +- From the "docs" location run: + +`sphinx-build -b html . build/html` + +This then creates the HTML documentation within `build/html`. + +> Use: `sphinx-build -a -b html . build/html` to build all, including the assets in `_static` (important if you have updated CSS). + + +### Using Sphinx Autobuild + +A better way of building the documentation if you are actively working on updates is to run: + +`sphinx-autobuild . _build/html` + +This will serve the docs on a localhost and auto-update the pages live as you make edits. + +### Building the Japanese documentation + +- From the "docs" location run: + +`sphinx-build -a -b html -D language=ja . _build/html/ja` + + +- Updating, after changes on the `main` branch and a sync with the main `en` .rst files, from the "docs" location, do: + +`sphinx-build -b gettext . _build/gettext` + +then: + +`sphinx-intl update -p _build/gettext -l ja` + +This will update the corresponding `po` files for further edits. Then check these files for "#, fuzzy" entries as the new stuff might exist there and requires editing. + + +## Building PDF documentation + +- First ensure you have [rst2pdf](https://pypi.org/project/rst2pdf/) installed: + +`python -m pip install rst2pdf` + +- Then run: + +`sphinx-build -b pdf . build/pdf` + +This will then generate a single PDF for all of the documentation within `build/pdf`. + + +--- + + +For full details see: [Using Sphinx](https://www.sphinx-doc.org/en/master/usage/index.html) + + + diff --git a/docs/_static/PyMuPDF.ico b/docs/_static/PyMuPDF.ico new file mode 100644 index 000000000..de307f0f9 Binary files /dev/null and b/docs/_static/PyMuPDF.ico differ diff --git a/docs/_static/ajax-loader.gif b/docs/_static/ajax-loader.gif deleted file mode 100644 index b18553e2a..000000000 Binary files a/docs/_static/ajax-loader.gif and /dev/null differ diff --git a/docs/_static/basic.css b/docs/_static/basic.css deleted file mode 100644 index 43e8bafaf..000000000 --- a/docs/_static/basic.css +++ /dev/null @@ -1,540 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox input[type="text"] { - width: 170px; -} - -div.sphinxsidebar #searchbox input[type="submit"] { - width: 30px; -} - -img { - border: 0; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- general body styles --------------------------------------------------- */ - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.refcount { - color: #060; -} - -.optional { - font-size: 1.3em; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -tt.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -tt.descclassname { - background-color: transparent; -} - -tt.xref, a tt { - background-color: transparent; - font-weight: bold; -} - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/docs/_static/comment-bright.png b/docs/_static/comment-bright.png deleted file mode 100644 index aae0010c8..000000000 Binary files a/docs/_static/comment-bright.png and /dev/null differ diff --git a/docs/_static/comment-close.png b/docs/_static/comment-close.png deleted file mode 100644 index 958d19acf..000000000 Binary files a/docs/_static/comment-close.png and /dev/null differ diff --git a/docs/_static/comment.png b/docs/_static/comment.png deleted file mode 100644 index b51e974a8..000000000 Binary files a/docs/_static/comment.png and /dev/null differ diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 000000000..8162d076c --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,196 @@ +/* main document page: ensures pages fit to the available width and height */ +.wy-nav-content { + min-width: 100%; + min-height: 100vh; +} + +/* Accessibility: Artifex color for main document links */ +.wy-nav-content a { + color: #007aff; +} + +/* Artifex blue color for background elements */ +.wy-side-nav-search, .wy-nav-top { + background-color: #007aff; +} + +/* Accessibility: ensures that the version number is readable against the background color */ +.wy-side-nav-search>div.version { + color:hsla(0,0%,100%,1); +} + +.htmltag { + padding: 2px 5px; + background-color: #fbff68; + border-radius: 4px; + border: 1px solid #222; + color:#000; +} + +.discordLink { + display:flex; + justify-content:flex-end; + margin:0; + padding:0; + font-size: 13px; +} + +.discordLink img { + width: 30px; + height: 30px; + margin-left: 8px; +} + +.feedbackLink { + display:flex; + justify-content:flex-end; + margin:0 0 10px; + padding:0; + font-size: 13px; +} + +.intro-title { + font-size: 22px; + margin: 0 0 20px 0; +} + +h1 { + padding: 10px !important; + background-color: #007aff !important; + color: #fff !important; + border-radius: 5px !important; + margin-top: 20px !important; + margin-left: -10px !important; +} + +cite { + font-weight: bold; + font-style: normal; +} + +.red-color { + color: #cc0000; +} + +.orange-color { + color: #ff6600; +} + +.green-color { + color: #00cc00; +} + +button.cta { + -webkit-appearance: none; + -moz-appearance: none; + border:0; + text-transform:uppercase; + border-radius:5px; + font-size:16px; + font-weight:500; + min-height:40px; + line-height:40px; + padding: 0 15px; + color:#fff; + cursor:pointer; +} + +button.cta.orange { + width:auto; + background-image: linear-gradient(to right, #ea5842, #ec6343, #ed6d45, #ef7747, #f0804a) !important; +} + +button.cta.orange:hover { + background:#ea5842 !important; +} + +button.cta a { + color:#fff !important; +} + +.footer-version { + font-weight: bold; + font-size: 12px; + color: #999; +} + + +/*** Furo theme overrides ***/ +/* This is to do with hiding the Furo link text and the "Made with" text */ +.bottom-of-page .left-details { + font-size:0; +} + +.bottom-of-page .left-details a { + display:none; +} + +/* Now ensure that the other copyright text is visible here */ +.bottom-of-page .left-details > * { + font-size:12px; +} + +.sidebar-brand-text { + font-size: 13px; + padding: 0; + margin: 0; +} + +.sidebar-logo { + width: auto; + height: 60px; +} + +.sidebar-container { + margin: 0; + padding: 0; +} + + +.sidebar-search-container.top { + /*position:sticky; + top:10px;*/ + border-radius: 20px; + border: solid #333 1px; + /*background-color: #fff;*/ +} + +.sidebar-search-container.top .sidebar-search { + border-top: 0 !important; + border-bottom: 0 !important; +} + +.sidebar-drawer .sidebar-search-container { + width: 95%; +} + +.toc-drawer .toc-title { + font-weight: bold; + text-decoration: underline; +} + +:target>h1:first-of-type, span:target~h1:first-of-type { + background-color: #007aff !important; + color: #fff !important; + padding-top: 40px; /* accommodates header search blocking target */ + margin-top: -40px; +} + + +:target>h2:first-of-type, :target>h3:first-of-type, +:target>h4:first-of-type, :target>h5:first-of-type, :target>h6:first-of-type, +span:target~h2:first-of-type, span:target~h3:first-of-type, +span:target~h4:first-of-type, span:target~h5:first-of-type, span:target~h6:first-of-type { + background-color: transparent !important; + padding-top: 40px; /* accommodates header search blocking target */ + margin-top: -40px; + text-decoration: underline; +} + + +/* small screens */ +@media all and (max-width : 550px) { + .discordLink img { + display: none; + } +} diff --git a/docs/_static/default.css b/docs/_static/default.css deleted file mode 100644 index 21f3f5098..000000000 --- a/docs/_static/default.css +++ /dev/null @@ -1,256 +0,0 @@ -/* - * default.css_t - * ~~~~~~~~~~~~~ - * - * Sphinx stylesheet -- default theme. - * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: sans-serif; - font-size: 100%; - background-color: #11303d; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - background-color: #1c4e63; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 230px; -} - -div.body { - background-color: #ffffff; - color: #000000; - padding: 0 20px 30px 20px; -} - -div.footer { - color: #ffffff; - width: 100%; - padding: 9px 0 9px 0; - text-align: center; - font-size: 75%; -} - -div.footer a { - color: #ffffff; - text-decoration: underline; -} - -div.related { - background-color: #133f52; - line-height: 30px; - color: #ffffff; -} - -div.related a { - color: #ffffff; -} - -div.sphinxsidebar { -} - -div.sphinxsidebar h3 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.4em; - font-weight: normal; - margin: 0; - padding: 0; -} - -div.sphinxsidebar h3 a { - color: #ffffff; -} - -div.sphinxsidebar h4 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.3em; - font-weight: normal; - margin: 5px 0 0 0; - padding: 0; -} - -div.sphinxsidebar p { - color: #ffffff; -} - -div.sphinxsidebar p.topless { - margin: 5px 10px 10px 10px; -} - -div.sphinxsidebar ul { - margin: 10px; - padding: 0; - color: #ffffff; -} - -div.sphinxsidebar a { - color: #98dbcc; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - - - -/* -- hyperlink styles ------------------------------------------------------ */ - -a { - color: #355f7c; - text-decoration: none; -} - -a:visited { - color: #355f7c; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - - - -/* -- body styles ----------------------------------------------------------- */ - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Trebuchet MS', sans-serif; - background-color: #f2f2f2; - font-weight: normal; - color: #20435c; - border-bottom: 1px solid #ccc; - margin: 20px -20px 10px -20px; - padding: 3px 0 3px 10px; -} - -div.body h1 { margin-top: 0; font-size: 200%; } -div.body h2 { font-size: 160%; } -div.body h3 { font-size: 140%; } -div.body h4 { font-size: 120%; } -div.body h5 { font-size: 110%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #c60f0f; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #c60f0f; - color: white; -} - -div.body p, div.body dd, div.body li { - text-align: justify; - line-height: 130%; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.admonition p { - margin-bottom: 5px; -} - -div.admonition pre { - margin-bottom: 5px; -} - -div.admonition ul, div.admonition ol { - margin-bottom: 5px; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre { - padding: 5px; - background-color: #eeffcc; - color: #333333; - line-height: 120%; - border: 1px solid #ac9; - border-left: none; - border-right: none; -} - -tt { - background-color: #ecf0f3; - padding: 0 1px 0 1px; - font-size: 0.95em; -} - -th { - background-color: #ede; -} - -.warning tt { - background: #efc2c2; -} - -.note tt { - background: #d6d6d6; -} - -.viewcode-back { - font-family: sans-serif; -} - -div.viewcode-block:target { - background-color: #f4debf; - border-top: 1px solid #ac9; - border-bottom: 1px solid #ac9; -} \ No newline at end of file diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js deleted file mode 100644 index d4619fdfb..000000000 --- a/docs/_static/doctools.js +++ /dev/null @@ -1,247 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -} - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * small function to check if an array contains - * a given item. - */ -jQuery.contains = function(arr, item) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] == item) - return true; - } - return false; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash && $.browser.mozilla) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); diff --git a/docs/_static/down-pressed.png b/docs/_static/down-pressed.png deleted file mode 100644 index 48ec3d368..000000000 Binary files a/docs/_static/down-pressed.png and /dev/null differ diff --git a/docs/_static/down.png b/docs/_static/down.png deleted file mode 100644 index 8f1f3517a..000000000 Binary files a/docs/_static/down.png and /dev/null differ diff --git a/docs/_static/file.png b/docs/_static/file.png deleted file mode 100644 index 0820ac470..000000000 Binary files a/docs/_static/file.png and /dev/null differ diff --git a/docs/_static/forum-logo-wink.png b/docs/_static/forum-logo-wink.png new file mode 100644 index 000000000..20bc16b70 Binary files /dev/null and b/docs/_static/forum-logo-wink.png differ diff --git a/docs/_static/forum-logo.gif b/docs/_static/forum-logo.gif new file mode 100644 index 000000000..ba9ebd146 Binary files /dev/null and b/docs/_static/forum-logo.gif differ diff --git a/docs/_static/jquery.js b/docs/_static/jquery.js deleted file mode 100644 index 7d859515a..000000000 --- a/docs/_static/jquery.js +++ /dev/null @@ -1,3500 +0,0 @@ -/*! - * jQuery JavaScript Library v1.4.2 - * http://jquery.com/ - * - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2010, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Sat Feb 13 22:33:48 2010 -0500 - */ -(function (A, w) { - function ma() { - if (!c.isReady) { - try { - s.documentElement.doScroll("left") - } catch (a) { - setTimeout(ma, 1); - return - } - c.ready() - } - } - - function Qa(a, b) { - b.src ? c.ajax({ - url: b.src, - async: false, - dataType: "script" - }) : c.globalEval(b.text || b.textContent || b.innerHTML || ""); - b.parentNode && b.parentNode.removeChild(b) - } - - function X(a, b, d, f, e, j) { - var i = a.length; - if (typeof b === "object") { - for (var o in b) X(a, o, b[o], f, e, d); - return a - } - if (d !== w) { - f = !j && f && c.isFunction(d); - for (o = 0; o < i; o++) e(a[o], b, f ? d.call(a[o], o, e(a[o], b)) : d, j); - return a - } - return i ? - e(a[0], b) : w - } - - function J() { - return (new Date).getTime() - } - - function Y() { - return false - } - - function Z() { - return true - } - - function na(a, b, d) { - d[0].type = a; - return c.event.handle.apply(b, d) - } - - function oa(a) { - var b, d = [], - f = [], - e = arguments, - j, i, o, k, n, r; - i = c.data(this, "events"); - if (!(a.liveFired === this || !i || !i.live || a.button && a.type === "click")) { - a.liveFired = this; - var u = i.live.slice(0); - for (k = 0; k < u.length; k++) { - i = u[k]; - i.origType.replace(O, "") === a.type ? f.push(i.selector) : u.splice(k--, 1) - } - j = c(a.target).closest(f, a.currentTarget); - n = 0; - for (r = - j.length; n < r; n++) - for (k = 0; k < u.length; k++) { - i = u[k]; - if (j[n].selector === i.selector) { - o = j[n].elem; - f = null; - if (i.preType === "mouseenter" || i.preType === "mouseleave") f = c(a.relatedTarget).closest(i.selector)[0]; - if (!f || f !== o) d.push({ - elem: o, - handleObj: i - }) - } - } - n = 0; - for (r = d.length; n < r; n++) { - j = d[n]; - a.currentTarget = j.elem; - a.data = j.handleObj.data; - a.handleObj = j.handleObj; - if (j.handleObj.origHandler.apply(j.elem, e) === false) { - b = false; - break - } - } - return b - } - } - - function pa(a, b) { - return "live." + (a && a !== "*" ? a + "." : "") + b.replace(/\./g, "`").replace(/ /g, - "&") - } - - function qa(a) { - return !a || !a.parentNode || a.parentNode.nodeType === 11 - } - - function ra(a, b) { - var d = 0; - b.each(function () { - if (this.nodeName === (a[d] && a[d].nodeName)) { - var f = c.data(a[d++]), - e = c.data(this, f); - if (f = f && f.events) { - delete e.handle; - e.events = {}; - for (var j in f) - for (var i in f[j]) c.event.add(this, j, f[j][i], f[j][i].data) - } - } - }) - } - - function sa(a, b, d) { - var f, e, j; - b = b && b[0] ? b[0].ownerDocument || b[0] : s; - if (a.length === 1 && typeof a[0] === "string" && a[0].length < 512 && b === s && !ta.test(a[0]) && (c.support.checkClone || !ua.test(a[0]))) { - e = - true; - if (j = c.fragments[a[0]]) - if (j !== 1) f = j - } - if (!f) { - f = b.createDocumentFragment(); - c.clean(a, b, f, d) - } - if (e) c.fragments[a[0]] = j ? f : 1; - return { - fragment: f, - cacheable: e - } - } - - function K(a, b) { - var d = {}; - c.each(va.concat.apply([], va.slice(0, b)), function () { - d[this] = a - }); - return d - } - - function wa(a) { - return "scrollTo" in a && a.document ? a : a.nodeType === 9 ? a.defaultView || a.parentWindow : false - } - var c = function (a, b) { - return new c.fn.init(a, b) - }, - Ra = A.jQuery, - Sa = A.$, - s = A.document, - T, Ta = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/, - Ua = /^.[^:#\[\.,]*$/, - Va = /\S/, - Wa = /^(\s|\u00A0)+|(\s|\u00A0)+$/g, - Xa = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - P = navigator.userAgent, - xa = false, - Q = [], - L, $ = Object.prototype.toString, - aa = Object.prototype.hasOwnProperty, - ba = Array.prototype.push, - R = Array.prototype.slice, - ya = Array.prototype.indexOf; - c.fn = c.prototype = { - init: function (a, b) { - var d, f; - if (!a) return this; - if (a.nodeType) { - this.context = this[0] = a; - this.length = 1; - return this - } - if (a === "body" && !b) { - this.context = s; - this[0] = s.body; - this.selector = "body"; - this.length = 1; - return this - } - if (typeof a === "string") - if ((d = Ta.exec(a)) && - (d[1] || !b)) - if (d[1]) { - f = b ? b.ownerDocument || b : s; - if (a = Xa.exec(a)) - if (c.isPlainObject(b)) { - a = [s.createElement(a[1])]; - c.fn.attr.call(a, b, true) - } else a = [f.createElement(a[1])]; - else { - a = sa([d[1]], [f]); - a = (a.cacheable ? a.fragment.cloneNode(true) : a.fragment).childNodes - } - return c.merge(this, a) - } else { - if (b = s.getElementById(d[2])) { - if (b.id !== d[2]) return T.find(a); - this.length = 1; - this[0] = b - } - this.context = s; - this.selector = a; - return this - } - else if (!b && /^\w+$/.test(a)) { - this.selector = a; - this.context = s; - a = s.getElementsByTagName(a); - return c.merge(this, - a) - } else return !b || b.jquery ? (b || T).find(a) : c(b).find(a); - else if (c.isFunction(a)) return T.ready(a); - if (a.selector !== w) { - this.selector = a.selector; - this.context = a.context - } - return c.makeArray(a, this) - }, - selector: "", - jquery: "1.4.2", - length: 0, - size: function () { - return this.length - }, - toArray: function () { - return R.call(this, 0) - }, - get: function (a) { - return a == null ? this.toArray() : a < 0 ? this.slice(a)[0] : this[a] - }, - pushStack: function (a, b, d) { - var f = c(); - c.isArray(a) ? ba.apply(f, a) : c.merge(f, a); - f.prevObject = this; - f.context = this.context; - if (b === - "find") f.selector = this.selector + (this.selector ? " " : "") + d; - else if (b) f.selector = this.selector + "." + b + "(" + d + ")"; - return f - }, - each: function (a, b) { - return c.each(this, a, b) - }, - ready: function (a) { - c.bindReady(); - if (c.isReady) a.call(s, c); - else Q && Q.push(a); - return this - }, - eq: function (a) { - return a === -1 ? this.slice(a) : this.slice(a, +a + 1) - }, - first: function () { - return this.eq(0) - }, - last: function () { - return this.eq(-1) - }, - slice: function () { - return this.pushStack(R.apply(this, arguments), "slice", R.call(arguments).join(",")) - }, - map: function (a) { - return this.pushStack(c.map(this, - function (b, d) { - return a.call(b, d, b) - })) - }, - end: function () { - return this.prevObject || c(null) - }, - push: ba, - sort: [].sort, - splice: [].splice - }; - c.fn.init.prototype = c.fn; - c.extend = c.fn.extend = function () { - var a = arguments[0] || {}, - b = 1, - d = arguments.length, - f = false, - e, j, i, o; - if (typeof a === "boolean") { - f = a; - a = arguments[1] || {}; - b = 2 - } - if (typeof a !== "object" && !c.isFunction(a)) a = {}; - if (d === b) { - a = this; - --b - } - for (; b < d; b++) - if ((e = arguments[b]) != null) - for (j in e) { - i = a[j]; - o = e[j]; - if (a !== o) - if (f && o && (c.isPlainObject(o) || c.isArray(o))) { - i = i && (c.isPlainObject(i) || - c.isArray(i)) ? i : c.isArray(o) ? [] : {}; - a[j] = c.extend(f, i, o) - } else if (o !== w) a[j] = o - } - return a - }; - c.extend({ - noConflict: function (a) { - A.$ = Sa; - if (a) A.jQuery = Ra; - return c - }, - isReady: false, - ready: function () { - if (!c.isReady) { - if (!s.body) return setTimeout(c.ready, 13); - c.isReady = true; - if (Q) { - for (var a, b = 0; a = Q[b++];) a.call(s, c); - Q = null - } - c.fn.triggerHandler && c(s).triggerHandler("ready") - } - }, - bindReady: function () { - if (!xa) { - xa = true; - if (s.readyState === "complete") return c.ready(); - if (s.addEventListener) { - s.addEventListener("DOMContentLoaded", - L, false); - A.addEventListener("load", c.ready, false) - } else if (s.attachEvent) { - s.attachEvent("onreadystatechange", L); - A.attachEvent("onload", c.ready); - var a = false; - try { - a = A.frameElement == null - } catch (b) {} - s.documentElement.doScroll && a && ma() - } - } - }, - isFunction: function (a) { - return $.call(a) === "[object Function]" - }, - isArray: function (a) { - return $.call(a) === "[object Array]" - }, - isPlainObject: function (a) { - if (!a || $.call(a) !== "[object Object]" || a.nodeType || a.setInterval) return false; - if (a.constructor && !aa.call(a, "constructor") && !aa.call(a.constructor.prototype, - "isPrototypeOf")) return false; - var b; - for (b in a); - return b === w || aa.call(a, b) - }, - is_emptyObject: function (a) { - for (var b in a) return false; - return true - }, - error: function (a) { - throw a; - }, - parseJSON: function (a) { - if (typeof a !== "string" || !a) return null; - a = c.trim(a); - if (/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return A.JSON && A.JSON.parse ? A.JSON.parse(a) : (new Function("return " + - a))(); - else c.error("Invalid JSON: " + a) - }, - noop: function () {}, - globalEval: function (a) { - if (a && Va.test(a)) { - var b = s.getElementsByTagName("head")[0] || s.documentElement, - d = s.createElement("script"); - d.type = "text/javascript"; - if (c.support.scriptEval) d.appendChild(s.createTextNode(a)); - else d.text = a; - b.insertBefore(d, b.firstChild); - b.removeChild(d) - } - }, - nodeName: function (a, b) { - return a.nodeName && a.nodeName.toUpperCase() === b.toUpperCase() - }, - each: function (a, b, d) { - var f, e = 0, - j = a.length, - i = j === w || c.isFunction(a); - if (d) - if (i) - for (f in a) { - if (b.apply(a[f], - d) === false) break - } else - for (; e < j;) { - if (b.apply(a[e++], d) === false) break - } else if (i) - for (f in a) { - if (b.call(a[f], f, a[f]) === false) break - } else - for (d = a[0]; e < j && b.call(d, e, d) !== false; d = a[++e]); - return a - }, - trim: function (a) { - return (a || "").replace(Wa, "") - }, - makeArray: function (a, b) { - b = b || []; - if (a != null) a.length == null || typeof a === "string" || c.isFunction(a) || typeof a !== "function" && a.setInterval ? ba.call(b, a) : c.merge(b, a); - return b - }, - inArray: function (a, b) { - if (b.indexOf) return b.indexOf(a); - for (var d = 0, f = b.length; d < f; d++) - if (b[d] === - a) return d; - return -1 - }, - merge: function (a, b) { - var d = a.length, - f = 0; - if (typeof b.length === "number") - for (var e = b.length; f < e; f++) a[d++] = b[f]; - else - for (; b[f] !== w;) a[d++] = b[f++]; - a.length = d; - return a - }, - grep: function (a, b, d) { - for (var f = [], e = 0, j = a.length; e < j; e++) !d !== !b(a[e], e) && f.push(a[e]); - return f - }, - map: function (a, b, d) { - for (var f = [], e, j = 0, i = a.length; j < i; j++) { - e = b(a[j], j, d); - if (e != null) f[f.length] = e - } - return f.concat.apply([], f) - }, - guid: 1, - proxy: function (a, b, d) { - if (arguments.length === 2) - if (typeof b === "string") { - d = a; - a = d[b]; - b = w - } else if (b && - !c.isFunction(b)) { - d = b; - b = w - } - if (!b && a) b = function () { - return a.apply(d || this, arguments) - }; - if (a) b.guid = a.guid = a.guid || b.guid || c.guid++; - return b - }, - uaMatch: function (a) { - a = a.toLowerCase(); - a = /(webkit)[ \/]([\w.]+)/.exec(a) || /(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a) || /(msie) ([\w.]+)/.exec(a) || !/compatible/.test(a) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec(a) || []; - return { - browser: a[1] || "", - version: a[2] || "0" - } - }, - browser: {} - }); - P = c.uaMatch(P); - if (P.browser) { - c.browser[P.browser] = true; - c.browser.version = P.version - } - if (c.browser.webkit) c.browser.safari = - true; - if (ya) c.inArray = function (a, b) { - return ya.call(b, a) - }; - T = c(s); - if (s.addEventListener) L = function () { - s.removeEventListener("DOMContentLoaded", L, false); - c.ready() - }; - else if (s.attachEvent) L = function () { - if (s.readyState === "complete") { - s.detachEvent("onreadystatechange", L); - c.ready() - } - }; - (function () { - c.support = {}; - var a = s.documentElement, - b = s.createElement("script"), - d = s.createElement("div"), - f = "script" + J(); - d.style.display = "none"; - d.innerHTML = "
a"; - var e = d.getElementsByTagName("*"), - j = d.getElementsByTagName("a")[0]; - if (!(!e || !e.length || !j)) { - c.support = { - leadingWhitespace: d.firstChild.nodeType === 3, - tbody: !d.getElementsByTagName("tbody").length, - htmlSerialize: !!d.getElementsByTagName("link").length, - style: /red/.test(j.getAttribute("style")), - hrefNormalized: j.getAttribute("href") === "/a", - opacity: /^0.55$/.test(j.style.opacity), - cssFloat: !!j.style.cssFloat, - checkOn: d.getElementsByTagName("input")[0].value === "on", - optSelected: s.createElement("select").appendChild(s.createElement("option")).selected, - parentNode: d.removeChild(d.appendChild(s.createElement("div"))).parentNode === null, - deleteExpando: true, - checkClone: false, - scriptEval: false, - noCloneEvent: true, - boxModel: null - }; - b.type = "text/javascript"; - try { - b.appendChild(s.createTextNode("window." + f + "=1;")) - } catch (i) {} - a.insertBefore(b, a.firstChild); - if (A[f]) { - c.support.scriptEval = true; - delete A[f] - } - try { - delete b.test - } catch (o) { - c.support.deleteExpando = false - } - a.removeChild(b); - if (d.attachEvent && d.fireEvent) { - d.attachEvent("onclick", function k() { - c.support.noCloneEvent = - false; - d.detachEvent("onclick", k) - }); - d.cloneNode(true).fireEvent("onclick") - } - d = s.createElement("div"); - d.innerHTML = ""; - a = s.createDocumentFragment(); - a.appendChild(d.firstChild); - c.support.checkClone = a.cloneNode(true).cloneNode(true).lastChild.checked; - c(function () { - var k = s.createElement("div"); - k.style.width = k.style.paddingLeft = "1px"; - s.body.appendChild(k); - c.boxModel = c.support.boxModel = k.offsetWidth === 2; - s.body.removeChild(k).style.display = "none" - }); - a = function (k) { - var n = - s.createElement("div"); - k = "on" + k; - var r = k in n; - if (!r) { - n.setAttribute(k, "return;"); - r = typeof n[k] === "function" - } - return r - }; - c.support.submitBubbles = a("submit"); - c.support.changeBubbles = a("change"); - a = b = d = e = j = null - } - })(); - c.props = { - "for": "htmlFor", - "class": "className", - readonly: "readOnly", - maxlength: "maxLength", - cellspacing: "cellSpacing", - rowspan: "rowSpan", - colspan: "colSpan", - tabindex: "tabIndex", - usemap: "useMap", - frameborder: "frameBorder" - }; - var G = "jQuery" + J(), - Ya = 0, - za = {}; - c.extend({ - cache: {}, - expando: G, - noData: { - embed: true, - object: true, - applet: true - }, - data: function (a, b, d) { - if (!(a.nodeName && c.noData[a.nodeName.toLowerCase()])) { - a = a == A ? za : a; - var f = a[G], - e = c.cache; - if (!f && typeof b === "string" && d === w) return null; - f || (f = ++Ya); - if (typeof b === "object") { - a[G] = f; - e[f] = c.extend(true, {}, b) - } else if (!e[f]) { - a[G] = f; - e[f] = {} - } - a = e[f]; - if (d !== w) a[b] = d; - return typeof b === "string" ? a[b] : a - } - }, - removeData: function (a, b) { - if (!(a.nodeName && c.noData[a.nodeName.toLowerCase()])) { - a = a == A ? za : a; - var d = a[G], - f = c.cache, - e = f[d]; - if (b) { - if (e) { - delete e[b]; - c.is_emptyObject(e) && c.removeData(a) - } - } else { - if (c.support.deleteExpando) delete a[c.expando]; - else a.removeAttribute && a.removeAttribute(c.expando); - delete f[d] - } - } - } - }); - c.fn.extend({ - data: function (a, b) { - if (typeof a === "undefined" && this.length) return c.data(this[0]); - else if (typeof a === "object") return this.each(function () { - c.data(this, a) - }); - var d = a.split("."); - d[1] = d[1] ? "." + d[1] : ""; - if (b === w) { - var f = this.triggerHandler("getData" + d[1] + "!", [d[0]]); - if (f === w && this.length) f = c.data(this[0], a); - return f === w && d[1] ? this.data(d[0]) : f - } else return this.trigger("setData" + d[1] + "!", [d[0], b]).each(function () { - c.data(this, - a, b) - }) - }, - removeData: function (a) { - return this.each(function () { - c.removeData(this, a) - }) - } - }); - c.extend({ - queue: function (a, b, d) { - if (a) { - b = (b || "fx") + "queue"; - var f = c.data(a, b); - if (!d) return f || []; - if (!f || c.isArray(d)) f = c.data(a, b, c.makeArray(d)); - else f.push(d); - return f - } - }, - dequeue: function (a, b) { - b = b || "fx"; - var d = c.queue(a, b), - f = d.shift(); - if (f === "inprogress") f = d.shift(); - if (f) { - b === "fx" && d.unshift("inprogress"); - f.call(a, function () { - c.dequeue(a, b) - }) - } - } - }); - c.fn.extend({ - queue: function (a, b) { - if (typeof a !== "string") { - b = a; - a = "fx" - } - if (b === - w) return c.queue(this[0], a); - return this.each(function () { - var d = c.queue(this, a, b); - a === "fx" && d[0] !== "inprogress" && c.dequeue(this, a) - }) - }, - dequeue: function (a) { - return this.each(function () { - c.dequeue(this, a) - }) - }, - delay: function (a, b) { - a = c.fx ? c.fx.speeds[a] || a : a; - b = b || "fx"; - return this.queue(b, function () { - var d = this; - setTimeout(function () { - c.dequeue(d, b) - }, a) - }) - }, - clearQueue: function (a) { - return this.queue(a || "fx", []) - } - }); - var Aa = /[\n\t]/g, - ca = /\s+/, - Za = /\r/g, - $a = /href|src|style/, - ab = /(button|input)/i, - bb = /(button|input|object|select|textarea)/i, - cb = /^(a|area)$/i, - Ba = /radio|checkbox/; - c.fn.extend({ - attr: function (a, b) { - return X(this, a, b, true, c.attr) - }, - removeAttr: function (a) { - return this.each(function () { - c.attr(this, a, ""); - this.nodeType === 1 && this.removeAttribute(a) - }) - }, - addClass: function (a) { - if (c.isFunction(a)) return this.each(function (n) { - var r = c(this); - r.addClass(a.call(this, n, r.attr("class"))) - }); - if (a && typeof a === "string") - for (var b = (a || "").split(ca), d = 0, f = this.length; d < f; d++) { - var e = this[d]; - if (e.nodeType === 1) - if (e.className) { - for (var j = " " + e.className + " ", - i = e.className, o = 0, k = b.length; o < k; o++) - if (j.indexOf(" " + b[o] + " ") < 0) i += " " + b[o]; - e.className = c.trim(i) - } else e.className = a - } - return this - }, - removeClass: function (a) { - if (c.isFunction(a)) return this.each(function (k) { - var n = c(this); - n.removeClass(a.call(this, k, n.attr("class"))) - }); - if (a && typeof a === "string" || a === w) - for (var b = (a || "").split(ca), d = 0, f = this.length; d < f; d++) { - var e = this[d]; - if (e.nodeType === 1 && e.className) - if (a) { - for (var j = (" " + e.className + " ").replace(Aa, " "), i = 0, o = b.length; i < o; i++) j = j.replace(" " + b[i] + " ", - " "); - e.className = c.trim(j) - } else e.className = "" - } - return this - }, - toggleClass: function (a, b) { - var d = typeof a, - f = typeof b === "boolean"; - if (c.isFunction(a)) return this.each(function (e) { - var j = c(this); - j.toggleClass(a.call(this, e, j.attr("class"), b), b) - }); - return this.each(function () { - if (d === "string") - for (var e, j = 0, i = c(this), o = b, k = a.split(ca); e = k[j++];) { - o = f ? o : !i.hasClass(e); - i[o ? "addClass" : "removeClass"](e) - } else if (d === "undefined" || d === "boolean") { - this.className && c.data(this, "__className__", this.className); - this.className = - this.className || a === false ? "" : c.data(this, "__className__") || "" - } - }) - }, - hasClass: function (a) { - a = " " + a + " "; - for (var b = 0, d = this.length; b < d; b++) - if ((" " + this[b].className + " ").replace(Aa, " ").indexOf(a) > -1) return true; - return false - }, - val: function (a) { - if (a === w) { - var b = this[0]; - if (b) { - if (c.nodeName(b, "option")) return (b.attributes.value || {}).specified ? b.value : b.text; - if (c.nodeName(b, "select")) { - var d = b.selectedIndex, - f = [], - e = b.options; - b = b.type === "select-one"; - if (d < 0) return null; - var j = b ? d : 0; - for (d = b ? d + 1 : e.length; j < d; j++) { - var i = - e[j]; - if (i.selected) { - a = c(i).val(); - if (b) return a; - f.push(a) - } - } - return f - } - if (Ba.test(b.type) && !c.support.checkOn) return b.getAttribute("value") === null ? "on" : b.value; - return (b.value || "").replace(Za, "") - } - return w - } - var o = c.isFunction(a); - return this.each(function (k) { - var n = c(this), - r = a; - if (this.nodeType === 1) { - if (o) r = a.call(this, k, n.val()); - if (typeof r === "number") r += ""; - if (c.isArray(r) && Ba.test(this.type)) this.checked = c.inArray(n.val(), r) >= 0; - else if (c.nodeName(this, "select")) { - var u = c.makeArray(r); - c("option", this).each(function () { - this.selected = - c.inArray(c(this).val(), u) >= 0 - }); - if (!u.length) this.selectedIndex = -1 - } else this.value = r - } - }) - } - }); - c.extend({ - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - attr: function (a, b, d, f) { - if (!a || a.nodeType === 3 || a.nodeType === 8) return w; - if (f && b in c.attrFn) return c(a)[b](d); - f = a.nodeType !== 1 || !c.isXMLDoc(a); - var e = d !== w; - b = f && c.props[b] || b; - if (a.nodeType === 1) { - var j = $a.test(b); - if (b in a && f && !j) { - if (e) { - b === "type" && ab.test(a.nodeName) && a.parentNode && c.error("type property can't be changed"); - a[b] = d - } - if (c.nodeName(a, "form") && a.getAttributeNode(b)) return a.getAttributeNode(b).nodeValue; - if (b === "tabIndex") return (b = a.getAttributeNode("tabIndex")) && b.specified ? b.value : bb.test(a.nodeName) || cb.test(a.nodeName) && a.href ? 0 : w; - return a[b] - } - if (!c.support.style && f && b === "style") { - if (e) a.style.cssText = "" + d; - return a.style.cssText - } - e && a.setAttribute(b, "" + d); - a = !c.support.hrefNormalized && f && j ? a.getAttribute(b, 2) : a.getAttribute(b); - return a === null ? w : a - } - return c.style(a, b, d) - } - }); - var O = /\.(.*)$/, - db = function (a) { - return a.replace(/[^\w\s\.\|`]/g, - function (b) { - return "\\" + b - }) - }; - c.event = { - add: function (a, b, d, f) { - if (!(a.nodeType === 3 || a.nodeType === 8)) { - if (a.setInterval && a !== A && !a.frameElement) a = A; - var e, j; - if (d.handler) { - e = d; - d = e.handler - } - if (!d.guid) d.guid = c.guid++; - if (j = c.data(a)) { - var i = j.events = j.events || {}, - o = j.handle; - if (!o) j.handle = o = function () { - return typeof c !== "undefined" && !c.event.triggered ? c.event.handle.apply(o.elem, arguments) : w - }; - o.elem = a; - b = b.split(" "); - for (var k, n = 0, r; k = b[n++];) { - j = e ? c.extend({}, e) : { - handler: d, - data: f - }; - if (k.indexOf(".") > -1) { - r = k.split("."); - k = r.shift(); - j.namespace = r.slice(0).sort().join(".") - } else { - r = []; - j.namespace = "" - } - j.type = k; - j.guid = d.guid; - var u = i[k], - z = c.event.special[k] || {}; - if (!u) { - u = i[k] = []; - if (!z.setup || z.setup.call(a, f, r, o) === false) - if (a.addEventListener) a.addEventListener(k, o, false); - else a.attachEvent && a.attachEvent("on" + k, o) - } - if (z.add) { - z.add.call(a, j); - if (!j.handler.guid) j.handler.guid = d.guid - } - u.push(j); - c.event.global[k] = true - } - a = null - } - } - }, - global: {}, - remove: function (a, b, d, f) { - if (!(a.nodeType === 3 || a.nodeType === 8)) { - var e, j = 0, - i, o, k, n, r, u, z = c.data(a), - C = z && z.events; - if (z && C) { - if (b && b.type) { - d = b.handler; - b = b.type - } - if (!b || typeof b === "string" && b.charAt(0) === ".") { - b = b || ""; - for (e in C) c.event.remove(a, e + b) - } else { - for (b = b.split(" "); e = b[j++];) { - n = e; - i = e.indexOf(".") < 0; - o = []; - if (!i) { - o = e.split("."); - e = o.shift(); - k = new RegExp("(^|\\.)" + c.map(o.slice(0).sort(), db).join("\\.(?:.*\\.)?") + "(\\.|$)") - } - if (r = C[e]) - if (d) { - n = c.event.special[e] || {}; - for (B = f || 0; B < r.length; B++) { - u = r[B]; - if (d.guid === u.guid) { - if (i || k.test(u.namespace)) { - f == null && r.splice(B--, 1); - n.remove && n.remove.call(a, u) - } - if (f != - null) break - } - } - if (r.length === 0 || f != null && r.length === 1) { - if (!n.teardown || n.teardown.call(a, o) === false) Ca(a, e, z.handle); - delete C[e] - } - } else - for (var B = 0; B < r.length; B++) { - u = r[B]; - if (i || k.test(u.namespace)) { - c.event.remove(a, n, u.handler, B); - r.splice(B--, 1) - } - } - } - if (c.is_emptyObject(C)) { - if (b = z.handle) b.elem = null; - delete z.events; - delete z.handle; - c.is_emptyObject(z) && c.removeData(a) - } - } - } - } - }, - trigger: function (a, b, d, f) { - var e = a.type || a; - if (!f) { - a = typeof a === "object" ? a[G] ? a : c.extend(c.Event(e), a) : c.Event(e); - if (e.indexOf("!") >= 0) { - a.type = - e = e.slice(0, -1); - a.exclusive = true - } - if (!d) { - a.stopPropagation(); - c.event.global[e] && c.each(c.cache, function () { - this.events && this.events[e] && c.event.trigger(a, b, this.handle.elem) - }) - } - if (!d || d.nodeType === 3 || d.nodeType === 8) return w; - a.result = w; - a.target = d; - b = c.makeArray(b); - b.unshift(a) - } - a.currentTarget = d; - (f = c.data(d, "handle")) && f.apply(d, b); - f = d.parentNode || d.ownerDocument; - try { - if (!(d && d.nodeName && c.noData[d.nodeName.toLowerCase()])) - if (d["on" + e] && d["on" + e].apply(d, b) === false) a.result = false - } catch (j) {} - if (!a.isPropagationStopped() && - f) c.event.trigger(a, b, f, true); - else if (!a.isDefaultPrevented()) { - f = a.target; - var i, o = c.nodeName(f, "a") && e === "click", - k = c.event.special[e] || {}; - if ((!k._default || k._default.call(d, a) === false) && !o && !(f && f.nodeName && c.noData[f.nodeName.toLowerCase()])) { - try { - if (f[e]) { - if (i = f["on" + e]) f["on" + e] = null; - c.event.triggered = true; - f[e]() - } - } catch (n) {} - if (i) f["on" + e] = i; - c.event.triggered = false - } - } - }, - handle: function (a) { - var b, d, f, e; - a = arguments[0] = c.event.fix(a || A.event); - a.currentTarget = this; - b = a.type.indexOf(".") < 0 && !a.exclusive; - if (!b) { - d = a.type.split("."); - a.type = d.shift(); - f = new RegExp("(^|\\.)" + d.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)") - } - e = c.data(this, "events"); - d = e[a.type]; - if (e && d) { - d = d.slice(0); - e = 0; - for (var j = d.length; e < j; e++) { - var i = d[e]; - if (b || f.test(i.namespace)) { - a.handler = i.handler; - a.data = i.data; - a.handleObj = i; - i = i.handler.apply(this, arguments); - if (i !== w) { - a.result = i; - if (i === false) { - a.preventDefault(); - a.stopPropagation() - } - } - if (a.isImmediatePropagationStopped()) break - } - } - } - return a.result - }, - props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), - fix: function (a) { - if (a[G]) return a; - var b = a; - a = c.Event(b); - for (var d = this.props.length, f; d;) { - f = this.props[--d]; - a[f] = b[f] - } - if (!a.target) a.target = a.srcElement || s; - if (a.target.nodeType === 3) a.target = a.target.parentNode; - if (!a.relatedTarget && a.fromElement) a.relatedTarget = a.fromElement === a.target ? a.toElement : a.fromElement; - if (a.pageX == null && a.clientX != null) { - b = s.documentElement; - d = s.body; - a.pageX = a.clientX + (b && b.scrollLeft || d && d.scrollLeft || 0) - (b && b.clientLeft || d && d.clientLeft || 0); - a.pageY = a.clientY + (b && b.scrollTop || - d && d.scrollTop || 0) - (b && b.clientTop || d && d.clientTop || 0) - } - if (!a.which && (a.charCode || a.charCode === 0 ? a.charCode : a.keyCode)) a.which = a.charCode || a.keyCode; - if (!a.metaKey && a.ctrlKey) a.metaKey = a.ctrlKey; - if (!a.which && a.button !== w) a.which = a.button & 1 ? 1 : a.button & 2 ? 3 : a.button & 4 ? 2 : 0; - return a - }, - guid: 1E8, - proxy: c.proxy, - special: { - ready: { - setup: c.bindReady, - teardown: c.noop - }, - live: { - add: function (a) { - c.event.add(this, a.origType, c.extend({}, a, { - handler: oa - })) - }, - remove: function (a) { - var b = true, - d = a.origType.replace(O, ""); - c.each(c.data(this, - "events").live || [], function () { - if (d === this.origType.replace(O, "")) return b = false - }); - b && c.event.remove(this, a.origType, oa) - } - }, - beforeunload: { - setup: function (a, b, d) { - if (this.setInterval) this.onbeforeunload = d; - return false - }, - teardown: function (a, b) { - if (this.onbeforeunload === b) this.onbeforeunload = null - } - } - } - }; - var Ca = s.removeEventListener ? function (a, b, d) { - a.removeEventListener(b, d, false) - } : function (a, b, d) { - a.detachEvent("on" + b, d) - }; - c.Event = function (a) { - if (!this.preventDefault) return new c.Event(a); - if (a && a.type) { - this.originalEvent = - a; - this.type = a.type - } else this.type = a; - this.timeStamp = J(); - this[G] = true - }; - c.Event.prototype = { - preventDefault: function () { - this.isDefaultPrevented = Z; - var a = this.originalEvent; - if (a) { - a.preventDefault && a.preventDefault(); - a.returnValue = false - } - }, - stopPropagation: function () { - this.isPropagationStopped = Z; - var a = this.originalEvent; - if (a) { - a.stopPropagation && a.stopPropagation(); - a.cancelBubble = true - } - }, - stopImmediatePropagation: function () { - this.isImmediatePropagationStopped = Z; - this.stopPropagation() - }, - isDefaultPrevented: Y, - isPropagationStopped: Y, - isImmediatePropagationStopped: Y - }; - var Da = function (a) { - var b = a.relatedTarget; - try { - for (; b && b !== this;) b = b.parentNode; - if (b !== this) { - a.type = a.data; - c.event.handle.apply(this, arguments) - } - } catch (d) {} - }, - Ea = function (a) { - a.type = a.data; - c.event.handle.apply(this, arguments) - }; - c.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" - }, function (a, b) { - c.event.special[a] = { - setup: function (d) { - c.event.add(this, b, d && d.selector ? Ea : Da, a) - }, - teardown: function (d) { - c.event.remove(this, b, d && d.selector ? Ea : Da) - } - } - }); - if (!c.support.submitBubbles) c.event.special.submit = { - setup: function () { - if (this.nodeName.toLowerCase() !== "form") { - c.event.add(this, "click.specialSubmit", function (a) { - var b = a.target, - d = b.type; - if ((d === "submit" || d === "image") && c(b).closest("form").length) return na("submit", this, arguments) - }); - c.event.add(this, "keypress.specialSubmit", function (a) { - var b = a.target, - d = b.type; - if ((d === "text" || d === "password") && c(b).closest("form").length && a.keyCode === 13) return na("submit", this, arguments) - }) - } else return false - }, - teardown: function () { - c.event.remove(this, ".specialSubmit") - } - }; - if (!c.support.changeBubbles) { - var da = /textarea|input|select/i, - ea, Fa = function (a) { - var b = a.type, - d = a.value; - if (b === "radio" || b === "checkbox") d = a.checked; - else if (b === "select-multiple") d = a.selectedIndex > -1 ? c.map(a.options, function (f) { - return f.selected - }).join("-") : ""; - else if (a.nodeName.toLowerCase() === "select") d = a.selectedIndex; - return d - }, - fa = function (a, b) { - var d = a.target, - f, e; - if (!(!da.test(d.nodeName) || d.readOnly)) { - f = c.data(d, "_change_data"); - e = Fa(d); - if (a.type !== "focusout" || d.type !== "radio") c.data(d, "_change_data", - e); - if (!(f === w || e === f)) - if (f != null || e) { - a.type = "change"; - return c.event.trigger(a, b, d) - } - } - }; - c.event.special.change = { - filters: { - focusout: fa, - click: function (a) { - var b = a.target, - d = b.type; - if (d === "radio" || d === "checkbox" || b.nodeName.toLowerCase() === "select") return fa.call(this, a) - }, - keydown: function (a) { - var b = a.target, - d = b.type; - if (a.keyCode === 13 && b.nodeName.toLowerCase() !== "textarea" || a.keyCode === 32 && (d === "checkbox" || d === "radio") || d === "select-multiple") return fa.call(this, a) - }, - beforeactivate: function (a) { - a = a.target; - c.data(a, - "_change_data", Fa(a)) - } - }, - setup: function () { - if (this.type === "file") return false; - for (var a in ea) c.event.add(this, a + ".specialChange", ea[a]); - return da.test(this.nodeName) - }, - teardown: function () { - c.event.remove(this, ".specialChange"); - return da.test(this.nodeName) - } - }; - ea = c.event.special.change.filters - } - s.addEventListener && c.each({ - focus: "focusin", - blur: "focusout" - }, function (a, b) { - function d(f) { - f = c.event.fix(f); - f.type = b; - return c.event.handle.call(this, f) - } - c.event.special[b] = { - setup: function () { - this.addEventListener(a, - d, true) - }, - teardown: function () { - this.removeEventListener(a, d, true) - } - } - }); - c.each(["bind", "one"], function (a, b) { - c.fn[b] = function (d, f, e) { - if (typeof d === "object") { - for (var j in d) this[b](j, f, d[j], e); - return this - } - if (c.isFunction(f)) { - e = f; - f = w - } - var i = b === "one" ? c.proxy(e, function (k) { - c(this).unbind(k, i); - return e.apply(this, arguments) - }) : e; - if (d === "unload" && b !== "one") this.one(d, f, e); - else { - j = 0; - for (var o = this.length; j < o; j++) c.event.add(this[j], d, i, f) - } - return this - } - }); - c.fn.extend({ - unbind: function (a, b) { - if (typeof a === "object" && - !a.preventDefault) - for (var d in a) this.unbind(d, a[d]); - else { - d = 0; - for (var f = this.length; d < f; d++) c.event.remove(this[d], a, b) - } - return this - }, - delegate: function (a, b, d, f) { - return this.live(b, d, f, a) - }, - undelegate: function (a, b, d) { - return arguments.length === 0 ? this.unbind("live") : this.die(b, null, d, a) - }, - trigger: function (a, b) { - return this.each(function () { - c.event.trigger(a, b, this) - }) - }, - triggerHandler: function (a, b) { - if (this[0]) { - a = c.Event(a); - a.preventDefault(); - a.stopPropagation(); - c.event.trigger(a, b, this[0]); - return a.result - } - }, - toggle: function (a) { - for (var b = arguments, d = 1; d < b.length;) c.proxy(a, b[d++]); - return this.click(c.proxy(a, function (f) { - var e = (c.data(this, "lastToggle" + a.guid) || 0) % d; - c.data(this, "lastToggle" + a.guid, e + 1); - f.preventDefault(); - return b[e].apply(this, arguments) || false - })) - }, - hover: function (a, b) { - return this.mouseenter(a).mouseleave(b || a) - } - }); - var Ga = { - focus: "focusin", - blur: "focusout", - mouseenter: "mouseover", - mouseleave: "mouseout" - }; - c.each(["live", "die"], function (a, b) { - c.fn[b] = function (d, f, e, j) { - var i, o = 0, - k, n, r = j || this.selector, - u = j ? this : c(this.context); - if (c.isFunction(f)) { - e = f; - f = w - } - for (d = (d || "").split(" "); - (i = d[o++]) != null;) { - j = O.exec(i); - k = ""; - if (j) { - k = j[0]; - i = i.replace(O, "") - } - if (i === "hover") d.push("mouseenter" + k, "mouseleave" + k); - else { - n = i; - if (i === "focus" || i === "blur") { - d.push(Ga[i] + k); - i += k - } else i = (Ga[i] || i) + k; - b === "live" ? u.each(function () { - c.event.add(this, pa(i, r), { - data: f, - selector: r, - handler: e, - origType: i, - origHandler: e, - preType: n - }) - }) : u.unbind(pa(i, r), e) - } - } - return this - } - }); - c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "), - function (a, b) { - c.fn[b] = function (d) { - return d ? this.bind(b, d) : this.trigger(b) - }; - if (c.attrFn) c.attrFn[b] = true - }); - A.attachEvent && !A.addEventListener && A.attachEvent("onunload", function () { - for (var a in c.cache) - if (c.cache[a].handle) try { - c.event.remove(c.cache[a].handle.elem) - } catch (b) {} - }); - (function () { - function a(g) { - for (var h = "", l, m = 0; g[m]; m++) { - l = g[m]; - if (l.nodeType === 3 || l.nodeType === 4) h += l.nodeValue; - else if (l.nodeType !== 8) h += a(l.childNodes) - } - return h - } - - function b(g, h, l, m, q, p) { - q = 0; - for (var v = m.length; q < v; q++) { - var t = m[q]; - if (t) { - t = t[g]; - for (var y = false; t;) { - if (t.sizcache === l) { - y = m[t.sizset]; - break - } - if (t.nodeType === 1 && !p) { - t.sizcache = l; - t.sizset = q - } - if (t.nodeName.toLowerCase() === h) { - y = t; - break - } - t = t[g] - } - m[q] = y - } - } - } - - function d(g, h, l, m, q, p) { - q = 0; - for (var v = m.length; q < v; q++) { - var t = m[q]; - if (t) { - t = t[g]; - for (var y = false; t;) { - if (t.sizcache === l) { - y = m[t.sizset]; - break - } - if (t.nodeType === 1) { - if (!p) { - t.sizcache = l; - t.sizset = q - } - if (typeof h !== "string") { - if (t === h) { - y = true; - break - } - } else if (k.filter(h, [t]).length > 0) { - y = t; - break - } - } - t = t[g] - } - m[q] = y - } - } - } - var f = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - e = 0, - j = Object.prototype.toString, - i = false, - o = true; - [0, 0].sort(function () { - o = false; - return 0 - }); - var k = function (g, h, l, m) { - l = l || []; - var q = h = h || s; - if (h.nodeType !== 1 && h.nodeType !== 9) return []; - if (!g || typeof g !== "string") return l; - for (var p = [], v, t, y, S, H = true, M = x(h), I = g; - (f.exec(""), v = f.exec(I)) !== null;) { - I = v[3]; - p.push(v[1]); - if (v[2]) { - S = v[3]; - break - } - } - if (p.length > 1 && r.exec(g)) - if (p.length === 2 && n.relative[p[0]]) t = ga(p[0] + p[1], h); - else - for (t = n.relative[p[0]] ? [h] : k(p.shift(), h); p.length;) { - g = p.shift(); - if (n.relative[g]) g += p.shift(); - t = ga(g, t) - } else { - if (!m && p.length > 1 && h.nodeType === 9 && !M && n.match.ID.test(p[0]) && !n.match.ID.test(p[p.length - 1])) { - v = k.find(p.shift(), h, M); - h = v.expr ? k.filter(v.expr, v.set)[0] : v.set[0] - } - if (h) { - v = m ? { - expr: p.pop(), - set: z(m) - } : k.find(p.pop(), p.length === 1 && (p[0] === "~" || p[0] === "+") && h.parentNode ? h.parentNode : h, M); - t = v.expr ? k.filter(v.expr, v.set) : v.set; - if (p.length > 0) y = z(t); - else H = false; - for (; p.length;) { - var D = p.pop(); - v = D; - if (n.relative[D]) v = p.pop(); - else D = ""; - if (v == null) v = h; - n.relative[D](y, v, M) - } - } else y = [] - } - y || (y = t); - y || k.error(D || - g); - if (j.call(y) === "[object Array]") - if (H) - if (h && h.nodeType === 1) - for (g = 0; y[g] != null; g++) { - if (y[g] && (y[g] === true || y[g].nodeType === 1 && E(h, y[g]))) l.push(t[g]) - } else - for (g = 0; y[g] != null; g++) y[g] && y[g].nodeType === 1 && l.push(t[g]); - else l.push.apply(l, y); - else z(y, l); - if (S) { - k(S, q, l, m); - k.uniqueSort(l) - } - return l - }; - k.uniqueSort = function (g) { - if (B) { - i = o; - g.sort(B); - if (i) - for (var h = 1; h < g.length; h++) g[h] === g[h - 1] && g.splice(h--, 1) - } - return g - }; - k.matches = function (g, h) { - return k(g, null, null, h) - }; - k.find = function (g, h, l) { - var m, q; - if (!g) return []; - for (var p = 0, v = n.order.length; p < v; p++) { - var t = n.order[p]; - if (q = n.leftMatch[t].exec(g)) { - var y = q[1]; - q.splice(1, 1); - if (y.substr(y.length - 1) !== "\\") { - q[1] = (q[1] || "").replace(/\\/g, ""); - m = n.find[t](q, h, l); - if (m != null) { - g = g.replace(n.match[t], ""); - break - } - } - } - } - m || (m = h.getElementsByTagName("*")); - return { - set: m, - expr: g - } - }; - k.filter = function (g, h, l, m) { - for (var q = g, p = [], v = h, t, y, S = h && h[0] && x(h[0]); g && h.length;) { - for (var H in n.filter) - if ((t = n.leftMatch[H].exec(g)) != null && t[2]) { - var M = n.filter[H], - I, D; - D = t[1]; - y = false; - t.splice(1, 1); - if (D.substr(D.length - - 1) !== "\\") { - if (v === p) p = []; - if (n.preFilter[H]) - if (t = n.preFilter[H](t, v, l, p, m, S)) { - if (t === true) continue - } else y = I = true; - if (t) - for (var U = 0; - (D = v[U]) != null; U++) - if (D) { - I = M(D, t, U, v); - var Ha = m ^ !!I; - if (l && I != null) - if (Ha) y = true; - else v[U] = false; - else if (Ha) { - p.push(D); - y = true - } - } if (I !== w) { - l || (v = p); - g = g.replace(n.match[H], ""); - if (!y) return []; - break - } - } - } if (g === q) - if (y == null) k.error(g); - else break; - q = g - } - return v - }; - k.error = function (g) { - throw "Syntax error, unrecognized expression: " + g; - }; - var n = k.selectors = { - order: ["ID", "NAME", "TAG"], - match: { - ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - leftMatch: {}, - attrMap: { - "class": "className", - "for": "htmlFor" - }, - attrHandle: { - href: function (g) { - return g.getAttribute("href") - } - }, - relative: { - "+": function (g, h) { - var l = typeof h === "string", - m = l && !/\W/.test(h); - l = l && !m; - if (m) h = h.toLowerCase(); - m = 0; - for (var q = g.length, p; m < q; m++) - if (p = g[m]) { - for (; - (p = p.previousSibling) && p.nodeType !== 1;); - g[m] = l || p && p.nodeName.toLowerCase() === h ? p || false : p === h - } l && k.filter(h, g, true) - }, - ">": function (g, h) { - var l = typeof h === "string"; - if (l && !/\W/.test(h)) { - h = h.toLowerCase(); - for (var m = 0, q = g.length; m < q; m++) { - var p = g[m]; - if (p) { - l = p.parentNode; - g[m] = l.nodeName.toLowerCase() === h ? l : false - } - } - } else { - m = 0; - for (q = g.length; m < q; m++) - if (p = g[m]) g[m] = - l ? p.parentNode : p.parentNode === h; - l && k.filter(h, g, true) - } - }, - "": function (g, h, l) { - var m = e++, - q = d; - if (typeof h === "string" && !/\W/.test(h)) { - var p = h = h.toLowerCase(); - q = b - } - q("parentNode", h, m, g, p, l) - }, - "~": function (g, h, l) { - var m = e++, - q = d; - if (typeof h === "string" && !/\W/.test(h)) { - var p = h = h.toLowerCase(); - q = b - } - q("previousSibling", h, m, g, p, l) - } - }, - find: { - ID: function (g, h, l) { - if (typeof h.getElementById !== "undefined" && !l) return (g = h.getElementById(g[1])) ? [g] : [] - }, - NAME: function (g, h) { - if (typeof h.getElementsByName !== "undefined") { - var l = []; - h = h.getElementsByName(g[1]); - for (var m = 0, q = h.length; m < q; m++) h[m].getAttribute("name") === g[1] && l.push(h[m]); - return l.length === 0 ? null : l - } - }, - TAG: function (g, h) { - return h.getElementsByTagName(g[1]) - } - }, - preFilter: { - CLASS: function (g, h, l, m, q, p) { - g = " " + g[1].replace(/\\/g, "") + " "; - if (p) return g; - p = 0; - for (var v; - (v = h[p]) != null; p++) - if (v) - if (q ^ (v.className && (" " + v.className + " ").replace(/[\t\n]/g, " ").indexOf(g) >= 0)) l || m.push(v); - else if (l) h[p] = false; - return false - }, - ID: function (g) { - return g[1].replace(/\\/g, "") - }, - TAG: function (g) { - return g[1].toLowerCase() - }, - CHILD: function (g) { - if (g[1] === "nth") { - var h = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2] === "even" && "2n" || g[2] === "odd" && "2n+1" || !/\D/.test(g[2]) && "0n+" + g[2] || g[2]); - g[2] = h[1] + (h[2] || 1) - 0; - g[3] = h[3] - 0 - } - g[0] = e++; - return g - }, - ATTR: function (g, h, l, m, q, p) { - h = g[1].replace(/\\/g, ""); - if (!p && n.attrMap[h]) g[1] = n.attrMap[h]; - if (g[2] === "~=") g[4] = " " + g[4] + " "; - return g - }, - PSEUDO: function (g, h, l, m, q) { - if (g[1] === "not") - if ((f.exec(g[3]) || "").length > 1 || /^\w/.test(g[3])) g[3] = k(g[3], null, null, h); - else { - g = k.filter(g[3], h, l, true ^ q); - l || m.push.apply(m, - g); - return false - } - else if (n.match.POS.test(g[0]) || n.match.CHILD.test(g[0])) return true; - return g - }, - POS: function (g) { - g.unshift(true); - return g - } - }, - filters: { - enabled: function (g) { - return g.disabled === false && g.type !== "hidden" - }, - disabled: function (g) { - return g.disabled === true - }, - checked: function (g) { - return g.checked === true - }, - selected: function (g) { - return g.selected === true - }, - parent: function (g) { - return !!g.firstChild - }, - empty: function (g) { - return !g.firstChild - }, - has: function (g, h, l) { - return !!k(l[3], g).length - }, - header: function (g) { - return /h\d/i.test(g.nodeName) - }, - text: function (g) { - return "text" === g.type - }, - radio: function (g) { - return "radio" === g.type - }, - checkbox: function (g) { - return "checkbox" === g.type - }, - file: function (g) { - return "file" === g.type - }, - password: function (g) { - return "password" === g.type - }, - submit: function (g) { - return "submit" === g.type - }, - image: function (g) { - return "image" === g.type - }, - reset: function (g) { - return "reset" === g.type - }, - button: function (g) { - return "button" === g.type || g.nodeName.toLowerCase() === "button" - }, - input: function (g) { - return /input|select|textarea|button/i.test(g.nodeName) - } - }, - setFilters: { - first: function (g, h) { - return h === 0 - }, - last: function (g, h, l, m) { - return h === m.length - 1 - }, - even: function (g, h) { - return h % 2 === 0 - }, - odd: function (g, h) { - return h % 2 === 1 - }, - lt: function (g, h, l) { - return h < l[3] - 0 - }, - gt: function (g, h, l) { - return h > l[3] - 0 - }, - nth: function (g, h, l) { - return l[3] - 0 === h - }, - eq: function (g, h, l) { - return l[3] - 0 === h - } - }, - filter: { - PSEUDO: function (g, h, l, m) { - var q = h[1], - p = n.filters[q]; - if (p) return p(g, l, h, m); - else if (q === "contains") return (g.textContent || g.innerText || a([g]) || "").indexOf(h[3]) >= 0; - else if (q === "not") { - h = - h[3]; - l = 0; - for (m = h.length; l < m; l++) - if (h[l] === g) return false; - return true - } else k.error("Syntax error, unrecognized expression: " + q) - }, - CHILD: function (g, h) { - var l = h[1], - m = g; - switch (l) { - case "only": - case "first": - for (; m = m.previousSibling;) - if (m.nodeType === 1) return false; - if (l === "first") return true; - m = g; - case "last": - for (; m = m.nextSibling;) - if (m.nodeType === 1) return false; - return true; - case "nth": - l = h[2]; - var q = h[3]; - if (l === 1 && q === 0) return true; - h = h[0]; - var p = g.parentNode; - if (p && (p.sizcache !== h || !g.nodeIndex)) { - var v = 0; - for (m = p.firstChild; m; m = - m.nextSibling) - if (m.nodeType === 1) m.nodeIndex = ++v; - p.sizcache = h - } - g = g.nodeIndex - q; - return l === 0 ? g === 0 : g % l === 0 && g / l >= 0 - } - }, - ID: function (g, h) { - return g.nodeType === 1 && g.getAttribute("id") === h - }, - TAG: function (g, h) { - return h === "*" && g.nodeType === 1 || g.nodeName.toLowerCase() === h - }, - CLASS: function (g, h) { - return (" " + (g.className || g.getAttribute("class")) + " ").indexOf(h) > -1 - }, - ATTR: function (g, h) { - var l = h[1]; - g = n.attrHandle[l] ? n.attrHandle[l](g) : g[l] != null ? g[l] : g.getAttribute(l); - l = g + ""; - var m = h[2]; - h = h[4]; - return g == null ? m === "!=" : m === - "=" ? l === h : m === "*=" ? l.indexOf(h) >= 0 : m === "~=" ? (" " + l + " ").indexOf(h) >= 0 : !h ? l && g !== false : m === "!=" ? l !== h : m === "^=" ? l.indexOf(h) === 0 : m === "$=" ? l.substr(l.length - h.length) === h : m === "|=" ? l === h || l.substr(0, h.length + 1) === h + "-" : false - }, - POS: function (g, h, l, m) { - var q = n.setFilters[h[2]]; - if (q) return q(g, l, h, m) - } - } - }, - r = n.match.POS; - for (var u in n.match) { - n.match[u] = new RegExp(n.match[u].source + /(?![^\[]*\])(?![^\(]*\))/.source); - n.leftMatch[u] = new RegExp(/(^(?:.|\r|\n)*?)/.source + n.match[u].source.replace(/\\(\d+)/g, function (g, - h) { - return "\\" + (h - 0 + 1) - })) - } - var z = function (g, h) { - g = Array.prototype.slice.call(g, 0); - if (h) { - h.push.apply(h, g); - return h - } - return g - }; - try { - Array.prototype.slice.call(s.documentElement.childNodes, 0) - } catch (C) { - z = function (g, h) { - h = h || []; - if (j.call(g) === "[object Array]") Array.prototype.push.apply(h, g); - else if (typeof g.length === "number") - for (var l = 0, m = g.length; l < m; l++) h.push(g[l]); - else - for (l = 0; g[l]; l++) h.push(g[l]); - return h - } - } - var B; - if (s.documentElement.compareDocumentPosition) B = function (g, h) { - if (!g.compareDocumentPosition || - !h.compareDocumentPosition) { - if (g == h) i = true; - return g.compareDocumentPosition ? -1 : 1 - } - g = g.compareDocumentPosition(h) & 4 ? -1 : g === h ? 0 : 1; - if (g === 0) i = true; - return g - }; - else if ("sourceIndex" in s.documentElement) B = function (g, h) { - if (!g.sourceIndex || !h.sourceIndex) { - if (g == h) i = true; - return g.sourceIndex ? -1 : 1 - } - g = g.sourceIndex - h.sourceIndex; - if (g === 0) i = true; - return g - }; - else if (s.createRange) B = function (g, h) { - if (!g.ownerDocument || !h.ownerDocument) { - if (g == h) i = true; - return g.ownerDocument ? -1 : 1 - } - var l = g.ownerDocument.createRange(), - m = - h.ownerDocument.createRange(); - l.setStart(g, 0); - l.setEnd(g, 0); - m.setStart(h, 0); - m.setEnd(h, 0); - g = l.compareBoundaryPoints(Range.START_TO_END, m); - if (g === 0) i = true; - return g - }; - (function () { - var g = s.createElement("div"), - h = "script" + (new Date).getTime(); - g.innerHTML = ""; - var l = s.documentElement; - l.insertBefore(g, l.firstChild); - if (s.getElementById(h)) { - n.find.ID = function (m, q, p) { - if (typeof q.getElementById !== "undefined" && !p) return (q = q.getElementById(m[1])) ? q.id === m[1] || typeof q.getAttributeNode !== "undefined" && - q.getAttributeNode("id").nodeValue === m[1] ? [q] : w : [] - }; - n.filter.ID = function (m, q) { - var p = typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id"); - return m.nodeType === 1 && p && p.nodeValue === q - } - } - l.removeChild(g); - l = g = null - })(); - (function () { - var g = s.createElement("div"); - g.appendChild(s.createComment("")); - if (g.getElementsByTagName("*").length > 0) n.find.TAG = function (h, l) { - l = l.getElementsByTagName(h[1]); - if (h[1] === "*") { - h = []; - for (var m = 0; l[m]; m++) l[m].nodeType === 1 && h.push(l[m]); - l = h - } - return l - }; - g.innerHTML = ""; - if (g.firstChild && typeof g.firstChild.getAttribute !== "undefined" && g.firstChild.getAttribute("href") !== "#") n.attrHandle.href = function (h) { - return h.getAttribute("href", 2) - }; - g = null - })(); - s.querySelectorAll && function () { - var g = k, - h = s.createElement("div"); - h.innerHTML = "

"; - if (!(h.querySelectorAll && h.querySelectorAll(".TEST").length === 0)) { - k = function (m, q, p, v) { - q = q || s; - if (!v && q.nodeType === 9 && !x(q)) try { - return z(q.querySelectorAll(m), p) - } catch (t) {} - return g(m, q, p, v) - }; - for (var l in g) k[l] = g[l]; - h = null - } - }(); - (function () { - var g = s.createElement("div"); - g.innerHTML = "
"; - if (!(!g.getElementsByClassName || g.getElementsByClassName("e").length === 0)) { - g.lastChild.className = "e"; - if (g.getElementsByClassName("e").length !== 1) { - n.order.splice(1, 0, "CLASS"); - n.find.CLASS = function (h, l, m) { - if (typeof l.getElementsByClassName !== "undefined" && !m) return l.getElementsByClassName(h[1]) - }; - g = null - } - } - })(); - var E = s.compareDocumentPosition ? function (g, h) { - return !!(g.compareDocumentPosition(h) & 16) - } : - function (g, h) { - return g !== h && (g.contains ? g.contains(h) : true) - }, - x = function (g) { - return (g = (g ? g.ownerDocument || g : 0).documentElement) ? g.nodeName !== "HTML" : false - }, - ga = function (g, h) { - var l = [], - m = "", - q; - for (h = h.nodeType ? [h] : h; q = n.match.PSEUDO.exec(g);) { - m += q[0]; - g = g.replace(n.match.PSEUDO, "") - } - g = n.relative[g] ? g + "*" : g; - q = 0; - for (var p = h.length; q < p; q++) k(g, h[q], l); - return k.filter(m, l) - }; - c.find = k; - c.expr = k.selectors; - c.expr[":"] = c.expr.filters; - c.unique = k.uniqueSort; - c.text = a; - c.isXMLDoc = x; - c.contains = E - })(); - var eb = /Until$/, - fb = /^(?:parents|prevUntil|prevAll)/, - gb = /,/; - R = Array.prototype.slice; - var Ia = function (a, b, d) { - if (c.isFunction(b)) return c.grep(a, function (e, j) { - return !!b.call(e, j, e) === d - }); - else if (b.nodeType) return c.grep(a, function (e) { - return e === b === d - }); - else if (typeof b === "string") { - var f = c.grep(a, function (e) { - return e.nodeType === 1 - }); - if (Ua.test(b)) return c.filter(b, f, !d); - else b = c.filter(b, f) - } - return c.grep(a, function (e) { - return c.inArray(e, b) >= 0 === d - }) - }; - c.fn.extend({ - find: function (a) { - for (var b = this.pushStack("", "find", a), d = 0, f = 0, e = this.length; f < e; f++) { - d = b.length; - c.find(a, this[f], b); - if (f > 0) - for (var j = d; j < b.length; j++) - for (var i = 0; i < d; i++) - if (b[i] === b[j]) { - b.splice(j--, 1); - break - } - } - return b - }, - has: function (a) { - var b = c(a); - return this.filter(function () { - for (var d = 0, f = b.length; d < f; d++) - if (c.contains(this, b[d])) return true - }) - }, - not: function (a) { - return this.pushStack(Ia(this, a, false), "not", a) - }, - filter: function (a) { - return this.pushStack(Ia(this, a, true), "filter", a) - }, - is: function (a) { - return !!a && c.filter(a, this).length > 0 - }, - closest: function (a, b) { - if (c.isArray(a)) { - var d = [], - f = this[0], - e, j = {}, - i; - if (f && a.length) { - e = 0; - for (var o = a.length; e < o; e++) { - i = a[e]; - j[i] || (j[i] = c.expr.match.POS.test(i) ? c(i, b || this.context) : i) - } - for (; f && f.ownerDocument && f !== b;) { - for (i in j) { - e = j[i]; - if (e.jquery ? e.index(f) > -1 : c(f).is(e)) { - d.push({ - selector: i, - elem: f - }); - delete j[i] - } - } - f = f.parentNode - } - } - return d - } - var k = c.expr.match.POS.test(a) ? c(a, b || this.context) : null; - return this.map(function (n, r) { - for (; r && r.ownerDocument && r !== b;) { - if (k ? k.index(r) > -1 : c(r).is(a)) return r; - r = r.parentNode - } - return null - }) - }, - index: function (a) { - if (!a || typeof a === - "string") return c.inArray(this[0], a ? c(a) : this.parent().children()); - return c.inArray(a.jquery ? a[0] : a, this) - }, - add: function (a, b) { - a = typeof a === "string" ? c(a, b || this.context) : c.makeArray(a); - b = c.merge(this.get(), a); - return this.pushStack(qa(a[0]) || qa(b[0]) ? b : c.unique(b)) - }, - andSelf: function () { - return this.add(this.prevObject) - } - }); - c.each({ - parent: function (a) { - return (a = a.parentNode) && a.nodeType !== 11 ? a : null - }, - parents: function (a) { - return c.dir(a, "parentNode") - }, - parentsUntil: function (a, b, d) { - return c.dir(a, "parentNode", - d) - }, - next: function (a) { - return c.nth(a, 2, "nextSibling") - }, - prev: function (a) { - return c.nth(a, 2, "previousSibling") - }, - nextAll: function (a) { - return c.dir(a, "nextSibling") - }, - prevAll: function (a) { - return c.dir(a, "previousSibling") - }, - nextUntil: function (a, b, d) { - return c.dir(a, "nextSibling", d) - }, - prevUntil: function (a, b, d) { - return c.dir(a, "previousSibling", d) - }, - siblings: function (a) { - return c.sibling(a.parentNode.firstChild, a) - }, - children: function (a) { - return c.sibling(a.firstChild) - }, - contents: function (a) { - return c.nodeName(a, "iframe") ? - a.contentDocument || a.contentWindow.document : c.makeArray(a.childNodes) - } - }, function (a, b) { - c.fn[a] = function (d, f) { - var e = c.map(this, b, d); - eb.test(a) || (f = d); - if (f && typeof f === "string") e = c.filter(f, e); - e = this.length > 1 ? c.unique(e) : e; - if ((this.length > 1 || gb.test(f)) && fb.test(a)) e = e.reverse(); - return this.pushStack(e, a, R.call(arguments).join(",")) - } - }); - c.extend({ - filter: function (a, b, d) { - if (d) a = ":not(" + a + ")"; - return c.find.matches(a, b) - }, - dir: function (a, b, d) { - var f = []; - for (a = a[b]; a && a.nodeType !== 9 && (d === w || a.nodeType !== 1 || !c(a).is(d));) { - a.nodeType === - 1 && f.push(a); - a = a[b] - } - return f - }, - nth: function (a, b, d) { - b = b || 1; - for (var f = 0; a; a = a[d]) - if (a.nodeType === 1 && ++f === b) break; - return a - }, - sibling: function (a, b) { - for (var d = []; a; a = a.nextSibling) a.nodeType === 1 && a !== b && d.push(a); - return d - } - }); - var Ja = / jQuery\d+="(?:\d+|null)"/g, - V = /^\s+/, - Ka = /(<([\w:]+)[^>]*?)\/>/g, - hb = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i, - La = /<([\w:]+)/, - ib = /" - }, - F = { - option: [1, ""], - legend: [1, "
", "
"], - thead: [1, "", "
"], - tr: [2, "", "
"], - td: [3, "", "
"], - col: [2, "", "
"], - area: [1, "", ""], - _default: [0, "", ""] - }; - F.optgroup = F.option; - F.tbody = F.tfoot = F.colgroup = F.caption = F.thead; - F.th = F.td; - if (!c.support.htmlSerialize) F._default = [1, "div
", "
"]; - c.fn.extend({ - text: function (a) { - if (c.isFunction(a)) return this.each(function (b) { - var d = - c(this); - d.text(a.call(this, b, d.text())) - }); - if (typeof a !== "object" && a !== w) return this.empty().append((this[0] && this[0].ownerDocument || s).createTextNode(a)); - return c.text(this) - }, - wrapAll: function (a) { - if (c.isFunction(a)) return this.each(function (d) { - c(this).wrapAll(a.call(this, d)) - }); - if (this[0]) { - var b = c(a, this[0].ownerDocument).eq(0).clone(true); - this[0].parentNode && b.insertBefore(this[0]); - b.map(function () { - for (var d = this; d.firstChild && d.firstChild.nodeType === 1;) d = d.firstChild; - return d - }).append(this) - } - return this - }, - wrapInner: function (a) { - if (c.isFunction(a)) return this.each(function (b) { - c(this).wrapInner(a.call(this, b)) - }); - return this.each(function () { - var b = c(this), - d = b.contents(); - d.length ? d.wrapAll(a) : b.append(a) - }) - }, - wrap: function (a) { - return this.each(function () { - c(this).wrapAll(a) - }) - }, - unwrap: function () { - return this.parent().each(function () { - c.nodeName(this, "body") || c(this).replaceWith(this.childNodes) - }).end() - }, - append: function () { - return this.domManip(arguments, true, function (a) { - this.nodeType === 1 && this.appendChild(a) - }) - }, - prepend: function () { - return this.domManip(arguments, true, function (a) { - this.nodeType === 1 && this.insertBefore(a, this.firstChild) - }) - }, - before: function () { - if (this[0] && this[0].parentNode) return this.domManip(arguments, false, function (b) { - this.parentNode.insertBefore(b, this) - }); - else if (arguments.length) { - var a = c(arguments[0]); - a.push.apply(a, this.toArray()); - return this.pushStack(a, "before", arguments) - } - }, - after: function () { - if (this[0] && this[0].parentNode) return this.domManip(arguments, false, function (b) { - this.parentNode.insertBefore(b, - this.nextSibling) - }); - else if (arguments.length) { - var a = this.pushStack(this, "after", arguments); - a.push.apply(a, c(arguments[0]).toArray()); - return a - } - }, - remove: function (a, b) { - for (var d = 0, f; - (f = this[d]) != null; d++) - if (!a || c.filter(a, [f]).length) { - if (!b && f.nodeType === 1) { - c.cleanData(f.getElementsByTagName("*")); - c.cleanData([f]) - } - f.parentNode && f.parentNode.removeChild(f) - } return this - }, - empty: function () { - for (var a = 0, b; - (b = this[a]) != null; a++) - for (b.nodeType === 1 && c.cleanData(b.getElementsByTagName("*")); b.firstChild;) b.removeChild(b.firstChild); - return this - }, - clone: function (a) { - var b = this.map(function () { - if (!c.support.noCloneEvent && !c.isXMLDoc(this)) { - var d = this.outerHTML, - f = this.ownerDocument; - if (!d) { - d = f.createElement("div"); - d.appendChild(this.cloneNode(true)); - d = d.innerHTML - } - return c.clean([d.replace(Ja, "").replace(/=([^="'>\s]+\/)>/g, '="$1">').replace(V, "")], f)[0] - } else return this.cloneNode(true) - }); - if (a === true) { - ra(this, b); - ra(this.find("*"), b.find("*")) - } - return b - }, - html: function (a) { - if (a === w) return this[0] && this[0].nodeType === 1 ? this[0].innerHTML.replace(Ja, - "") : null; - else if (typeof a === "string" && !ta.test(a) && (c.support.leadingWhitespace || !V.test(a)) && !F[(La.exec(a) || ["", ""])[1].toLowerCase()]) { - a = a.replace(Ka, Ma); - try { - for (var b = 0, d = this.length; b < d; b++) - if (this[b].nodeType === 1) { - c.cleanData(this[b].getElementsByTagName("*")); - this[b].innerHTML = a - } - } catch (f) { - this.empty().append(a) - } - } else c.isFunction(a) ? this.each(function (e) { - var j = c(this), - i = j.html(); - j.empty().append(function () { - return a.call(this, e, i) - }) - }) : this.empty().append(a); - return this - }, - replaceWith: function (a) { - if (this[0] && - this[0].parentNode) { - if (c.isFunction(a)) return this.each(function (b) { - var d = c(this), - f = d.html(); - d.replaceWith(a.call(this, b, f)) - }); - if (typeof a !== "string") a = c(a).detach(); - return this.each(function () { - var b = this.nextSibling, - d = this.parentNode; - c(this).remove(); - b ? c(b).before(a) : c(d).append(a) - }) - } else return this.pushStack(c(c.isFunction(a) ? a() : a), "replaceWith", a) - }, - detach: function (a) { - return this.remove(a, true) - }, - domManip: function (a, b, d) { - function f(u) { - return c.nodeName(u, "table") ? u.getElementsByTagName("tbody")[0] || - u.appendChild(u.ownerDocument.createElement("tbody")) : u - } - var e, j, i = a[0], - o = [], - k; - if (!c.support.checkClone && arguments.length === 3 && typeof i === "string" && ua.test(i)) return this.each(function () { - c(this).domManip(a, b, d, true) - }); - if (c.isFunction(i)) return this.each(function (u) { - var z = c(this); - a[0] = i.call(this, u, b ? z.html() : w); - z.domManip(a, b, d) - }); - if (this[0]) { - e = i && i.parentNode; - e = c.support.parentNode && e && e.nodeType === 11 && e.childNodes.length === this.length ? { - fragment: e - } : sa(a, this, o); - k = e.fragment; - if (j = k.childNodes.length === - 1 ? (k = k.firstChild) : k.firstChild) { - b = b && c.nodeName(j, "tr"); - for (var n = 0, r = this.length; n < r; n++) d.call(b ? f(this[n], j) : this[n], n > 0 || e.cacheable || this.length > 1 ? k.cloneNode(true) : k) - } - o.length && c.each(o, Qa) - } - return this - } - }); - c.fragments = {}; - c.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" - }, function (a, b) { - c.fn[a] = function (d) { - var f = []; - d = c(d); - var e = this.length === 1 && this[0].parentNode; - if (e && e.nodeType === 11 && e.childNodes.length === 1 && d.length === 1) { - d[b](this[0]); - return this - } else { - e = 0; - for (var j = d.length; e < j; e++) { - var i = (e > 0 ? this.clone(true) : this).get(); - c.fn[b].apply(c(d[e]), i); - f = f.concat(i) - } - return this.pushStack(f, a, d.selector) - } - } - }); - c.extend({ - clean: function (a, b, d, f) { - b = b || s; - if (typeof b.createElement === "undefined") b = b.ownerDocument || b[0] && b[0].ownerDocument || s; - for (var e = [], j = 0, i; - (i = a[j]) != null; j++) { - if (typeof i === "number") i += ""; - if (i) { - if (typeof i === "string" && !jb.test(i)) i = b.createTextNode(i); - else if (typeof i === "string") { - i = i.replace(Ka, Ma); - var o = (La.exec(i) || ["", - "" - ])[1].toLowerCase(), - k = F[o] || F._default, - n = k[0], - r = b.createElement("div"); - for (r.innerHTML = k[1] + i + k[2]; n--;) r = r.lastChild; - if (!c.support.tbody) { - n = ib.test(i); - o = o === "table" && !n ? r.firstChild && r.firstChild.childNodes : k[1] === "" && !n ? r.childNodes : []; - for (k = o.length - 1; k >= 0; --k) c.nodeName(o[k], "tbody") && !o[k].childNodes.length && o[k].parentNode.removeChild(o[k]) - }!c.support.leadingWhitespace && V.test(i) && r.insertBefore(b.createTextNode(V.exec(i)[0]), r.firstChild); - i = r.childNodes - } - if (i.nodeType) e.push(i); - else e = - c.merge(e, i) - } - } - if (d) - for (j = 0; e[j]; j++) - if (f && c.nodeName(e[j], "script") && (!e[j].type || e[j].type.toLowerCase() === "text/javascript")) f.push(e[j].parentNode ? e[j].parentNode.removeChild(e[j]) : e[j]); - else { - e[j].nodeType === 1 && e.splice.apply(e, [j + 1, 0].concat(c.makeArray(e[j].getElementsByTagName("script")))); - d.appendChild(e[j]) - } return e - }, - cleanData: function (a) { - for (var b, d, f = c.cache, e = c.event.special, j = c.support.deleteExpando, i = 0, o; - (o = a[i]) != null; i++) - if (d = o[c.expando]) { - b = f[d]; - if (b.events) - for (var k in b.events) e[k] ? - c.event.remove(o, k) : Ca(o, k, b.handle); - if (j) delete o[c.expando]; - else o.removeAttribute && o.removeAttribute(c.expando); - delete f[d] - } - } - }); - var kb = /z-?index|font-?weight|opacity|zoom|line-?height/i, - Na = /alpha\([^)]*\)/, - Oa = /opacity=([^)]*)/, - ha = /float/i, - ia = /-([a-z])/ig, - lb = /([A-Z])/g, - mb = /^-?\d+(?:px)?$/i, - nb = /^-?\d/, - ob = { - position: "absolute", - visibility: "hidden", - display: "block" - }, - pb = ["Left", "Right"], - qb = ["Top", "Bottom"], - rb = s.defaultView && s.defaultView.getComputedStyle, - Pa = c.support.cssFloat ? "cssFloat" : "styleFloat", - ja = - function (a, b) { - return b.toUpperCase() - }; - c.fn.css = function (a, b) { - return X(this, a, b, true, function (d, f, e) { - if (e === w) return c.curCSS(d, f); - if (typeof e === "number" && !kb.test(f)) e += "px"; - c.style(d, f, e) - }) - }; - c.extend({ - style: function (a, b, d) { - if (!a || a.nodeType === 3 || a.nodeType === 8) return w; - if ((b === "width" || b === "height") && parseFloat(d) < 0) d = w; - var f = a.style || a, - e = d !== w; - if (!c.support.opacity && b === "opacity") { - if (e) { - f.zoom = 1; - b = parseInt(d, 10) + "" === "NaN" ? "" : "alpha(opacity=" + d * 100 + ")"; - a = f.filter || c.curCSS(a, "filter") || ""; - f.filter = - Na.test(a) ? a.replace(Na, b) : b - } - return f.filter && f.filter.indexOf("opacity=") >= 0 ? parseFloat(Oa.exec(f.filter)[1]) / 100 + "" : "" - } - if (ha.test(b)) b = Pa; - b = b.replace(ia, ja); - if (e) f[b] = d; - return f[b] - }, - css: function (a, b, d, f) { - if (b === "width" || b === "height") { - var e, j = b === "width" ? pb : qb; - - function i() { - e = b === "width" ? a.offsetWidth : a.offsetHeight; - f !== "border" && c.each(j, function () { - f || (e -= parseFloat(c.curCSS(a, "padding" + this, true)) || 0); - if (f === "margin") e += parseFloat(c.curCSS(a, "margin" + this, true)) || 0; - else e -= parseFloat(c.curCSS(a, - "border" + this + "Width", true)) || 0 - }) - } - a.offsetWidth !== 0 ? i() : c.swap(a, ob, i); - return Math.max(0, Math.round(e)) - } - return c.curCSS(a, b, d) - }, - curCSS: function (a, b, d) { - var f, e = a.style; - if (!c.support.opacity && b === "opacity" && a.currentStyle) { - f = Oa.test(a.currentStyle.filter || "") ? parseFloat(RegExp.$1) / 100 + "" : ""; - return f === "" ? "1" : f - } - if (ha.test(b)) b = Pa; - if (!d && e && e[b]) f = e[b]; - else if (rb) { - if (ha.test(b)) b = "float"; - b = b.replace(lb, "-$1").toLowerCase(); - e = a.ownerDocument.defaultView; - if (!e) return null; - if (a = e.getComputedStyle(a, null)) f = - a.getPropertyValue(b); - if (b === "opacity" && f === "") f = "1" - } else if (a.currentStyle) { - d = b.replace(ia, ja); - f = a.currentStyle[b] || a.currentStyle[d]; - if (!mb.test(f) && nb.test(f)) { - b = e.left; - var j = a.runtimeStyle.left; - a.runtimeStyle.left = a.currentStyle.left; - e.left = d === "fontSize" ? "1em" : f || 0; - f = e.pixelLeft + "px"; - e.left = b; - a.runtimeStyle.left = j - } - } - return f - }, - swap: function (a, b, d) { - var f = {}; - for (var e in b) { - f[e] = a.style[e]; - a.style[e] = b[e] - } - d.call(a); - for (e in b) a.style[e] = f[e] - } - }); - if (c.expr && c.expr.filters) { - c.expr.filters.hidden = function (a) { - var b = - a.offsetWidth, - d = a.offsetHeight, - f = a.nodeName.toLowerCase() === "tr"; - return b === 0 && d === 0 && !f ? true : b > 0 && d > 0 && !f ? false : c.curCSS(a, "display") === "none" - }; - c.expr.filters.visible = function (a) { - return !c.expr.filters.hidden(a) - } - } - var sb = J(), - tb = //gi, - ub = /select|textarea/i, - vb = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i, - N = /=\?(&|$)/, - ka = /\?/, - wb = /(\?|&)_=.*?(&|$)/, - xb = /^(\w+:)?\/\/([^\/?#]+)/, - yb = /%20/g, - zb = c.fn.load; - c.fn.extend({ - load: function (a, b, d) { - if (typeof a !== - "string") return zb.call(this, a); - else if (!this.length) return this; - var f = a.indexOf(" "); - if (f >= 0) { - var e = a.slice(f, a.length); - a = a.slice(0, f) - } - f = "GET"; - if (b) - if (c.isFunction(b)) { - d = b; - b = null - } else if (typeof b === "object") { - b = c.param(b, c.ajaxSettings.traditional); - f = "POST" - } - var j = this; - c.ajax({ - url: a, - type: f, - dataType: "html", - data: b, - complete: function (i, o) { - if (o === "success" || o === "notmodified") j.html(e ? c("
").append(i.responseText.replace(tb, "")).find(e) : i.responseText); - d && j.each(d, [i.responseText, o, i]) - } - }); - return this - }, - serialize: function () { - return c.param(this.serializeArray()) - }, - serializeArray: function () { - return this.map(function () { - return this.elements ? c.makeArray(this.elements) : this - }).filter(function () { - return this.name && !this.disabled && (this.checked || ub.test(this.nodeName) || vb.test(this.type)) - }).map(function (a, b) { - a = c(this).val(); - return a == null ? null : c.isArray(a) ? c.map(a, function (d) { - return { - name: b.name, - value: d - } - }) : { - name: b.name, - value: a - } - }).get() - } - }); - c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), - function (a, b) { - c.fn[b] = function (d) { - return this.bind(b, d) - } - }); - c.extend({ - get: function (a, b, d, f) { - if (c.isFunction(b)) { - f = f || d; - d = b; - b = null - } - return c.ajax({ - type: "GET", - url: a, - data: b, - success: d, - dataType: f - }) - }, - getScript: function (a, b) { - return c.get(a, null, b, "script") - }, - getJSON: function (a, b, d) { - return c.get(a, b, d, "json") - }, - post: function (a, b, d, f) { - if (c.isFunction(b)) { - f = f || d; - d = b; - b = {} - } - return c.ajax({ - type: "POST", - url: a, - data: b, - success: d, - dataType: f - }) - }, - ajaxSetup: function (a) { - c.extend(c.ajaxSettings, a) - }, - ajaxSettings: { - url: location.href, - global: true, - type: "GET", - contentType: "application/x-www-form-urlencoded", - processData: true, - async: true, - xhr: A.XMLHttpRequest && (A.location.protocol !== "file:" || !A.ActiveXObject) ? function () { - return new A.XMLHttpRequest - } : function () { - try { - return new A.ActiveXObject("Microsoft.XMLHTTP") - } catch (a) {} - }, - accepts: { - xml: "application/xml, text/xml", - html: "text/html", - script: "text/javascript, application/javascript", - json: "application/json, text/javascript", - text: "text/plain", - _default: "*/*" - } - }, - lastModified: {}, - etag: {}, - ajax: function (a) { - function b() { - e.success && - e.success.call(k, o, i, x); - e.global && f("ajaxSuccess", [x, e]) - } - - function d() { - e.complete && e.complete.call(k, x, i); - e.global && f("ajaxComplete", [x, e]); - e.global && !--c.active && c.event.trigger("ajaxStop") - } - - function f(q, p) { - (e.context ? c(e.context) : c.event).trigger(q, p) - } - var e = c.extend(true, {}, c.ajaxSettings, a), - j, i, o, k = a && a.context || e, - n = e.type.toUpperCase(); - if (e.data && e.processData && typeof e.data !== "string") e.data = c.param(e.data, e.traditional); - if (e.dataType === "jsonp") { - if (n === "GET") N.test(e.url) || (e.url += (ka.test(e.url) ? - "&" : "?") + (e.jsonp || "callback") + "=?"); - else if (!e.data || !N.test(e.data)) e.data = (e.data ? e.data + "&" : "") + (e.jsonp || "callback") + "=?"; - e.dataType = "json" - } - if (e.dataType === "json" && (e.data && N.test(e.data) || N.test(e.url))) { - j = e.jsonpCallback || "jsonp" + sb++; - if (e.data) e.data = (e.data + "").replace(N, "=" + j + "$1"); - e.url = e.url.replace(N, "=" + j + "$1"); - e.dataType = "script"; - A[j] = A[j] || function (q) { - o = q; - b(); - d(); - A[j] = w; - try { - delete A[j] - } catch (p) {} - z && z.removeChild(C) - } - } - if (e.dataType === "script" && e.cache === null) e.cache = false; - if (e.cache === - false && n === "GET") { - var r = J(), - u = e.url.replace(wb, "$1_=" + r + "$2"); - e.url = u + (u === e.url ? (ka.test(e.url) ? "&" : "?") + "_=" + r : "") - } - if (e.data && n === "GET") e.url += (ka.test(e.url) ? "&" : "?") + e.data; - e.global && !c.active++ && c.event.trigger("ajaxStart"); - r = (r = xb.exec(e.url)) && (r[1] && r[1] !== location.protocol || r[2] !== location.host); - if (e.dataType === "script" && n === "GET" && r) { - var z = s.getElementsByTagName("head")[0] || s.documentElement, - C = s.createElement("script"); - C.src = e.url; - if (e.scriptCharset) C.charset = e.scriptCharset; - if (!j) { - var B = - false; - C.onload = C.onreadystatechange = function () { - if (!B && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) { - B = true; - b(); - d(); - C.onload = C.onreadystatechange = null; - z && C.parentNode && z.removeChild(C) - } - } - } - z.insertBefore(C, z.firstChild); - return w - } - var E = false, - x = e.xhr(); - if (x) { - e.username ? x.open(n, e.url, e.async, e.username, e.password) : x.open(n, e.url, e.async); - try { - if (e.data || a && a.contentType) x.setRequestHeader("Content-Type", e.contentType); - if (e.ifModified) { - c.lastModified[e.url] && x.setRequestHeader("If-Modified-Since", - c.lastModified[e.url]); - c.etag[e.url] && x.setRequestHeader("If-None-Match", c.etag[e.url]) - } - r || x.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - x.setRequestHeader("Accept", e.dataType && e.accepts[e.dataType] ? e.accepts[e.dataType] + ", */*" : e.accepts._default) - } catch (ga) {} - if (e.beforeSend && e.beforeSend.call(k, x, e) === false) { - e.global && !--c.active && c.event.trigger("ajaxStop"); - x.abort(); - return false - } - e.global && f("ajaxSend", [x, e]); - var g = x.onreadystatechange = function (q) { - if (!x || x.readyState === 0 || q === "abort") { - E || - d(); - E = true; - if (x) x.onreadystatechange = c.noop - } else if (!E && x && (x.readyState === 4 || q === "timeout")) { - E = true; - x.onreadystatechange = c.noop; - i = q === "timeout" ? "timeout" : !c.httpSuccess(x) ? "error" : e.ifModified && c.httpNotModified(x, e.url) ? "notmodified" : "success"; - var p; - if (i === "success") try { - o = c.httpData(x, e.dataType, e) - } catch (v) { - i = "parsererror"; - p = v - } - if (i === "success" || i === "notmodified") j || b(); - else c.handleError(e, x, i, p); - d(); - q === "timeout" && x.abort(); - if (e.async) x = null - } - }; - try { - var h = x.abort; - x.abort = function () { - x && h.call(x); - g("abort") - } - } catch (l) {} - e.async && e.timeout > 0 && setTimeout(function () { - x && !E && g("timeout") - }, e.timeout); - try { - x.send(n === "POST" || n === "PUT" || n === "DELETE" ? e.data : null) - } catch (m) { - c.handleError(e, x, null, m); - d() - } - e.async || g(); - return x - } - }, - handleError: function (a, b, d, f) { - if (a.error) a.error.call(a.context || a, b, d, f); - if (a.global)(a.context ? c(a.context) : c.event).trigger("ajaxError", [b, a, f]) - }, - active: 0, - httpSuccess: function (a) { - try { - return !a.status && location.protocol === "file:" || a.status >= 200 && a.status < 300 || a.status === 304 || a.status === - 1223 || a.status === 0 - } catch (b) {} - return false - }, - httpNotModified: function (a, b) { - var d = a.getResponseHeader("Last-Modified"), - f = a.getResponseHeader("Etag"); - if (d) c.lastModified[b] = d; - if (f) c.etag[b] = f; - return a.status === 304 || a.status === 0 - }, - httpData: function (a, b, d) { - var f = a.getResponseHeader("content-type") || "", - e = b === "xml" || !b && f.indexOf("xml") >= 0; - a = e ? a.responseXML : a.responseText; - e && a.documentElement.nodeName === "parsererror" && c.error("parsererror"); - if (d && d.dataFilter) a = d.dataFilter(a, b); - if (typeof a === "string") - if (b === - "json" || !b && f.indexOf("json") >= 0) a = c.parseJSON(a); - else if (b === "script" || !b && f.indexOf("javascript") >= 0) c.globalEval(a); - return a - }, - param: function (a, b) { - function d(i, o) { - if (c.isArray(o)) c.each(o, function (k, n) { - b || /\[\]$/.test(i) ? f(i, n) : d(i + "[" + (typeof n === "object" || c.isArray(n) ? k : "") + "]", n) - }); - else !b && o != null && typeof o === "object" ? c.each(o, function (k, n) { - d(i + "[" + k + "]", n) - }) : f(i, o) - } - - function f(i, o) { - o = c.isFunction(o) ? o() : o; - e[e.length] = encodeURIComponent(i) + "=" + encodeURIComponent(o) - } - var e = []; - if (b === w) b = c.ajaxSettings.traditional; - if (c.isArray(a) || a.jquery) c.each(a, function () { - f(this.name, this.value) - }); - else - for (var j in a) d(j, a[j]); - return e.join("&").replace(yb, "+") - } - }); - var la = {}, - Ab = /toggle|show|hide/, - Bb = /^([+-]=)?([\d+-.]+)(.*)$/, - W, va = [ - ["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"], - ["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"], - ["opacity"] - ]; - c.fn.extend({ - show: function (a, b) { - if (a || a === 0) return this.animate(K("show", 3), a, b); - else { - a = 0; - for (b = this.length; a < b; a++) { - var d = c.data(this[a], "olddisplay"); - this[a].style.display = d || ""; - if (c.css(this[a], "display") === "none") { - d = this[a].nodeName; - var f; - if (la[d]) f = la[d]; - else { - var e = c("<" + d + " />").appendTo("body"); - f = e.css("display"); - if (f === "none") f = "block"; - e.remove(); - la[d] = f - } - c.data(this[a], "olddisplay", f) - } - } - a = 0; - for (b = this.length; a < b; a++) this[a].style.display = c.data(this[a], "olddisplay") || ""; - return this - } - }, - hide: function (a, b) { - if (a || a === 0) return this.animate(K("hide", 3), a, b); - else { - a = 0; - for (b = this.length; a < b; a++) { - var d = c.data(this[a], "olddisplay"); - !d && d !== "none" && c.data(this[a], - "olddisplay", c.css(this[a], "display")) - } - a = 0; - for (b = this.length; a < b; a++) this[a].style.display = "none"; - return this - } - }, - _toggle: c.fn.toggle, - toggle: function (a, b) { - var d = typeof a === "boolean"; - if (c.isFunction(a) && c.isFunction(b)) this._toggle.apply(this, arguments); - else a == null || d ? this.each(function () { - var f = d ? a : c(this).is(":hidden"); - c(this)[f ? "show" : "hide"]() - }) : this.animate(K("toggle", 3), a, b); - return this - }, - fadeTo: function (a, b, d) { - return this.filter(":hidden").css("opacity", 0).show().end().animate({ - opacity: b - }, a, d) - }, - animate: function (a, b, d, f) { - var e = c.speed(b, d, f); - if (c.is_emptyObject(a)) return this.each(e.complete); - return this[e.queue === false ? "each" : "queue"](function () { - var j = c.extend({}, e), - i, o = this.nodeType === 1 && c(this).is(":hidden"), - k = this; - for (i in a) { - var n = i.replace(ia, ja); - if (i !== n) { - a[n] = a[i]; - delete a[i]; - i = n - } - if (a[i] === "hide" && o || a[i] === "show" && !o) return j.complete.call(this); - if ((i === "height" || i === "width") && this.style) { - j.display = c.css(this, "display"); - j.overflow = this.style.overflow - } - if (c.isArray(a[i])) { - (j.specialEasing = - j.specialEasing || {})[i] = a[i][1]; - a[i] = a[i][0] - } - } - if (j.overflow != null) this.style.overflow = "hidden"; - j.curAnim = c.extend({}, a); - c.each(a, function (r, u) { - var z = new c.fx(k, j, r); - if (Ab.test(u)) z[u === "toggle" ? o ? "show" : "hide" : u](a); - else { - var C = Bb.exec(u), - B = z.cur(true) || 0; - if (C) { - u = parseFloat(C[2]); - var E = C[3] || "px"; - if (E !== "px") { - k.style[r] = (u || 1) + E; - B = (u || 1) / z.cur(true) * B; - k.style[r] = B + E - } - if (C[1]) u = (C[1] === "-=" ? -1 : 1) * u + B; - z.custom(B, u, E) - } else z.custom(B, u, "") - } - }); - return true - }) - }, - stop: function (a, b) { - var d = c.timers; - a && this.queue([]); - this.each(function () { - for (var f = d.length - 1; f >= 0; f--) - if (d[f].elem === this) { - b && d[f](true); - d.splice(f, 1) - } - }); - b || this.dequeue(); - return this - } - }); - c.each({ - slideDown: K("show", 1), - slideUp: K("hide", 1), - slideToggle: K("toggle", 1), - fadeIn: { - opacity: "show" - }, - fadeOut: { - opacity: "hide" - } - }, function (a, b) { - c.fn[a] = function (d, f) { - return this.animate(b, d, f) - } - }); - c.extend({ - speed: function (a, b, d) { - var f = a && typeof a === "object" ? a : { - complete: d || !d && b || c.isFunction(a) && a, - duration: a, - easing: d && b || b && !c.isFunction(b) && b - }; - f.duration = c.fx.off ? 0 : typeof f.duration === - "number" ? f.duration : c.fx.speeds[f.duration] || c.fx.speeds._default; - f.old = f.complete; - f.complete = function () { - f.queue !== false && c(this).dequeue(); - c.isFunction(f.old) && f.old.call(this) - }; - return f - }, - easing: { - linear: function (a, b, d, f) { - return d + f * a - }, - swing: function (a, b, d, f) { - return (-Math.cos(a * Math.PI) / 2 + 0.5) * f + d - } - }, - timers: [], - fx: function (a, b, d) { - this.options = b; - this.elem = a; - this.prop = d; - if (!b.orig) b.orig = {} - } - }); - c.fx.prototype = { - update: function () { - this.options.step && this.options.step.call(this.elem, this.now, this); - (c.fx.step[this.prop] || - c.fx.step._default)(this); - if ((this.prop === "height" || this.prop === "width") && this.elem.style) this.elem.style.display = "block" - }, - cur: function (a) { - if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null)) return this.elem[this.prop]; - return (a = parseFloat(c.css(this.elem, this.prop, a))) && a > -10000 ? a : parseFloat(c.curCSS(this.elem, this.prop)) || 0 - }, - custom: function (a, b, d) { - function f(j) { - return e.step(j) - } - this.startTime = J(); - this.start = a; - this.end = b; - this.unit = d || this.unit || "px"; - this.now = this.start; - this.pos = this.state = 0; - var e = this; - f.elem = this.elem; - if (f() && c.timers.push(f) && !W) W = setInterval(c.fx.tick, 13) - }, - show: function () { - this.options.orig[this.prop] = c.style(this.elem, this.prop); - this.options.show = true; - this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur()); - c(this.elem).show() - }, - hide: function () { - this.options.orig[this.prop] = c.style(this.elem, this.prop); - this.options.hide = true; - this.custom(this.cur(), 0) - }, - step: function (a) { - var b = J(), - d = true; - if (a || b >= this.options.duration + this.startTime) { - this.now = - this.end; - this.pos = this.state = 1; - this.update(); - this.options.curAnim[this.prop] = true; - for (var f in this.options.curAnim) - if (this.options.curAnim[f] !== true) d = false; - if (d) { - if (this.options.display != null) { - this.elem.style.overflow = this.options.overflow; - a = c.data(this.elem, "olddisplay"); - this.elem.style.display = a ? a : this.options.display; - if (c.css(this.elem, "display") === "none") this.elem.style.display = "block" - } - this.options.hide && c(this.elem).hide(); - if (this.options.hide || this.options.show) - for (var e in this.options.curAnim) c.style(this.elem, - e, this.options.orig[e]); - this.options.complete.call(this.elem) - } - return false - } else { - e = b - this.startTime; - this.state = e / this.options.duration; - a = this.options.easing || (c.easing.swing ? "swing" : "linear"); - this.pos = c.easing[this.options.specialEasing && this.options.specialEasing[this.prop] || a](this.state, e, 0, 1, this.options.duration); - this.now = this.start + (this.end - this.start) * this.pos; - this.update() - } - return true - } - }; - c.extend(c.fx, { - tick: function () { - for (var a = c.timers, b = 0; b < a.length; b++) a[b]() || a.splice(b--, 1); - a.length || - c.fx.stop() - }, - stop: function () { - clearInterval(W); - W = null - }, - speeds: { - slow: 600, - fast: 200, - _default: 400 - }, - step: { - opacity: function (a) { - c.style(a.elem, "opacity", a.now) - }, - _default: function (a) { - if (a.elem.style && a.elem.style[a.prop] != null) a.elem.style[a.prop] = (a.prop === "width" || a.prop === "height" ? Math.max(0, a.now) : a.now) + a.unit; - else a.elem[a.prop] = a.now - } - } - }); - if (c.expr && c.expr.filters) c.expr.filters.animated = function (a) { - return c.grep(c.timers, function (b) { - return a === b.elem - }).length - }; - c.fn.offset = "getBoundingClientRect" in s.documentElement ? - function (a) { - var b = this[0]; - if (a) return this.each(function (e) { - c.offset.setOffset(this, a, e) - }); - if (!b || !b.ownerDocument) return null; - if (b === b.ownerDocument.body) return c.offset.bodyOffset(b); - var d = b.getBoundingClientRect(), - f = b.ownerDocument; - b = f.body; - f = f.documentElement; - return { - top: d.top + (self.pageYOffset || c.support.boxModel && f.scrollTop || b.scrollTop) - (f.clientTop || b.clientTop || 0), - left: d.left + (self.pageXOffset || c.support.boxModel && f.scrollLeft || b.scrollLeft) - (f.clientLeft || b.clientLeft || 0) - } - } : function (a) { - var b = - this[0]; - if (a) return this.each(function (r) { - c.offset.setOffset(this, a, r) - }); - if (!b || !b.ownerDocument) return null; - if (b === b.ownerDocument.body) return c.offset.bodyOffset(b); - c.offset.initialize(); - var d = b.offsetParent, - f = b, - e = b.ownerDocument, - j, i = e.documentElement, - o = e.body; - f = (e = e.defaultView) ? e.getComputedStyle(b, null) : b.currentStyle; - for (var k = b.offsetTop, n = b.offsetLeft; - (b = b.parentNode) && b !== o && b !== i;) { - if (c.offset.supportsFixedPosition && f.position === "fixed") break; - j = e ? e.getComputedStyle(b, null) : b.currentStyle; - k -= b.scrollTop; - n -= b.scrollLeft; - if (b === d) { - k += b.offsetTop; - n += b.offsetLeft; - if (c.offset.doesNotAddBorder && !(c.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(b.nodeName))) { - k += parseFloat(j.borderTopWidth) || 0; - n += parseFloat(j.borderLeftWidth) || 0 - } - f = d; - d = b.offsetParent - } - if (c.offset.subtractsBorderForOverflowNotVisible && j.overflow !== "visible") { - k += parseFloat(j.borderTopWidth) || 0; - n += parseFloat(j.borderLeftWidth) || 0 - } - f = j - } - if (f.position === "relative" || f.position === "static") { - k += o.offsetTop; - n += o.offsetLeft - } - if (c.offset.supportsFixedPosition && - f.position === "fixed") { - k += Math.max(i.scrollTop, o.scrollTop); - n += Math.max(i.scrollLeft, o.scrollLeft) - } - return { - top: k, - left: n - } - }; - c.offset = { - initialize: function () { - var a = s.body, - b = s.createElement("div"), - d, f, e, j = parseFloat(c.curCSS(a, "marginTop", true)) || 0; - c.extend(b.style, { - position: "absolute", - top: 0, - left: 0, - margin: 0, - border: 0, - width: "1px", - height: "1px", - visibility: "hidden" - }); - b.innerHTML = "
"; - a.insertBefore(b, a.firstChild); - d = b.firstChild; - f = d.firstChild; - e = d.nextSibling.firstChild.firstChild; - this.doesNotAddBorder = f.offsetTop !== 5; - this.doesAddBorderForTableAndCells = e.offsetTop === 5; - f.style.position = "fixed"; - f.style.top = "20px"; - this.supportsFixedPosition = f.offsetTop === 20 || f.offsetTop === 15; - f.style.position = f.style.top = ""; - d.style.overflow = "hidden"; - d.style.position = "relative"; - this.subtractsBorderForOverflowNotVisible = f.offsetTop === -5; - this.doesNotIncludeMarginInBodyOffset = a.offsetTop !== j; - a.removeChild(b); - c.offset.initialize = c.noop - }, - bodyOffset: function (a) { - var b = a.offsetTop, - d = a.offsetLeft; - c.offset.initialize(); - if (c.offset.doesNotIncludeMarginInBodyOffset) { - b += parseFloat(c.curCSS(a, "marginTop", true)) || 0; - d += parseFloat(c.curCSS(a, "marginLeft", true)) || 0 - } - return { - top: b, - left: d - } - }, - setOffset: function (a, b, d) { - if (/static/.test(c.curCSS(a, "position"))) a.style.position = "relative"; - var f = c(a), - e = f.offset(), - j = parseInt(c.curCSS(a, "top", true), 10) || 0, - i = parseInt(c.curCSS(a, "left", true), 10) || 0; - if (c.isFunction(b)) b = b.call(a, - d, e); - d = { - top: b.top - e.top + j, - left: b.left - e.left + i - }; - "using" in b ? b.using.call(a, d) : f.css(d) - } - }; - c.fn.extend({ - position: function () { - if (!this[0]) return null; - var a = this[0], - b = this.offsetParent(), - d = this.offset(), - f = /^body|html$/i.test(b[0].nodeName) ? { - top: 0, - left: 0 - } : b.offset(); - d.top -= parseFloat(c.curCSS(a, "marginTop", true)) || 0; - d.left -= parseFloat(c.curCSS(a, "marginLeft", true)) || 0; - f.top += parseFloat(c.curCSS(b[0], "borderTopWidth", true)) || 0; - f.left += parseFloat(c.curCSS(b[0], "borderLeftWidth", true)) || 0; - return { - top: d.top - - f.top, - left: d.left - f.left - } - }, - offsetParent: function () { - return this.map(function () { - for (var a = this.offsetParent || s.body; a && !/^body|html$/i.test(a.nodeName) && c.css(a, "position") === "static";) a = a.offsetParent; - return a - }) - } - }); - c.each(["Left", "Top"], function (a, b) { - var d = "scroll" + b; - c.fn[d] = function (f) { - var e = this[0], - j; - if (!e) return null; - if (f !== w) return this.each(function () { - if (j = wa(this)) j.scrollTo(!a ? f : c(j).scrollLeft(), a ? f : c(j).scrollTop()); - else this[d] = f - }); - else return (j = wa(e)) ? "pageXOffset" in j ? j[a ? "pageYOffset" : - "pageXOffset"] : c.support.boxModel && j.document.documentElement[d] || j.document.body[d] : e[d] - } - }); - c.each(["Height", "Width"], function (a, b) { - var d = b.toLowerCase(); - c.fn["inner" + b] = function () { - return this[0] ? c.css(this[0], d, false, "padding") : null - }; - c.fn["outer" + b] = function (f) { - return this[0] ? c.css(this[0], d, false, f ? "margin" : "border") : null - }; - c.fn[d] = function (f) { - var e = this[0]; - if (!e) return f == null ? null : this; - if (c.isFunction(f)) return this.each(function (j) { - var i = c(this); - i[d](f.call(this, j, i[d]())) - }); - return "scrollTo" in - e && e.document ? e.document.compatMode === "CSS1Compat" && e.document.documentElement["client" + b] || e.document.body["client" + b] : e.nodeType === 9 ? Math.max(e.documentElement["client" + b], e.body["scroll" + b], e.documentElement["scroll" + b], e.body["offset" + b], e.documentElement["offset" + b]) : f === w ? c.css(e, d) : this.css(d, typeof f === "string" ? f : f + "px") - } - }); - A.jQuery = A.$ = c -})(window); diff --git a/docs/_static/minus.png b/docs/_static/minus.png deleted file mode 100644 index 9cefd907e..000000000 Binary files a/docs/_static/minus.png and /dev/null differ diff --git a/docs/_static/plus.png b/docs/_static/plus.png deleted file mode 100644 index 90f001345..000000000 Binary files a/docs/_static/plus.png and /dev/null differ diff --git a/docs/_static/prism/prism.css b/docs/_static/prism/prism.css new file mode 100644 index 000000000..f02cfb303 --- /dev/null +++ b/docs/_static/prism/prism.css @@ -0,0 +1,4 @@ +/* PrismJS 1.29.0 +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+c+csharp+cpp+java+kotlin+objectivec+python+shell-session+swift&plugins=normalize-whitespace+toolbar+copy-to-clipboard */ +code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:14px;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help} +div.code-toolbar{position:relative}div.code-toolbar>.toolbar{position:absolute;z-index:10;top:.3em;right:.2em;transition:opacity .3s ease-in-out;opacity:0}div.code-toolbar:hover>.toolbar{opacity:1}div.code-toolbar:focus-within>.toolbar{opacity:1}div.code-toolbar>.toolbar>.toolbar-item{display:inline-block}div.code-toolbar>.toolbar>.toolbar-item>a{cursor:pointer}div.code-toolbar>.toolbar>.toolbar-item>button{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;padding:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}div.code-toolbar>.toolbar>.toolbar-item>a,div.code-toolbar>.toolbar>.toolbar-item>button,div.code-toolbar>.toolbar>.toolbar-item>span{color:#bbb;font-size:.8em;padding:0 .5em;background:#f5f2f0;background:rgba(224,224,224,.2);box-shadow:0 2px 0 0 rgba(0,0,0,.2);border-radius:.5em}div.code-toolbar>.toolbar>.toolbar-item>a:focus,div.code-toolbar>.toolbar>.toolbar-item>a:hover,div.code-toolbar>.toolbar>.toolbar-item>button:focus,div.code-toolbar>.toolbar>.toolbar-item>button:hover,div.code-toolbar>.toolbar>.toolbar-item>span:focus,div.code-toolbar>.toolbar>.toolbar-item>span:hover{color:inherit;text-decoration:none} diff --git a/docs/_static/prism/prism.html b/docs/_static/prism/prism.html new file mode 100644 index 000000000..a24e13d66 --- /dev/null +++ b/docs/_static/prism/prism.html @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + See: https://prismjs.com/download.html + + +
+                
+                import fitz
+
+                MEDIABOX = fitz.paper_rect("letter")
+                WHERE = MEDIABOX + (36, 36, -36, -36)
+
+                # create story, let it look at script folder for resources
+                story = fitz.Story(archive=".")
+                body = story.body  # access the body of its DOM
+
+                with body.add_paragraph() as para:
+                    # store desired content
+                    para.set_font("sans-serif").set_color("blue").add_text("Hello World!")
+
+                # another paragraph for our image:
+                with body.add_paragraph() as para:
+                    # store image in another paragraph
+                    para.add_image("world.jpg")
+
+                writer = fitz.DocumentWriter("output.pdf")
+
+                more = 1
+
+                while more:
+                    device = writer.begin_page(MEDIABOX)
+                    more, _ = story.place(WHERE)
+                    story.draw(device)
+                    writer.end_page()
+
+                writer.close()
+            
+            
+ + + + + +Here is some inline code ok... + + \ No newline at end of file diff --git a/docs/_static/prism/prism.js b/docs/_static/prism/prism.js new file mode 100644 index 000000000..8708f93d6 --- /dev/null +++ b/docs/_static/prism/prism.js @@ -0,0 +1,20 @@ +/* PrismJS 1.29.0 +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+c+csharp+cpp+java+kotlin+objectivec+python+shell-session+swift&plugins=normalize-whitespace+toolbar+copy-to-clipboard */ +var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,r={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof i?new i(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/=g.reach);A+=w.value.length,w=w.next){var E=w.value;if(n.length>e.length)return;if(!(E instanceof i)){var P,L=1;if(y){if(!(P=l(b,A,e,m))||P.index>=e.length)break;var S=P.index,O=P.index+P[0].length,j=A;for(j+=w.value.length;S>=j;)j+=(w=w.next).value.length;if(A=j-=w.value.length,w.value instanceof i)continue;for(var C=w;C!==n.tail&&(jg.reach&&(g.reach=W);var z=w.prev;if(_&&(z=u(n,z,_),A+=_.length),c(n,z,L),w=u(n,z,new i(f,p?a.tokenize(N,p):N,k,N)),M&&u(n,w,M),L>1){var I={cause:f+","+d,reach:W};o(e,n,t,w.prev,A,I),g&&I.reach>g.reach&&(g.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function u(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function c(e,n,t){for(var r=n.next,a=0;a"+i.content+""},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(n){var t=JSON.parse(n.data),r=t.language,i=t.code,l=t.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),l&&e.close()}),!1),a):a;var g=a.util.currentScript();function f(){a.manual||a.highlightAll()}if(g&&(a.filename=g.src,g.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&g&&g.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return a}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); +Prism.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^$/i;var t={"included-cdata":{pattern://i,inside:s}};t["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var n={};n[a]={pattern:RegExp("(<__[^>]*>)(?:))*\\]\\]>|(?!)".replace(/__/g,(function(){return a})),"i"),lookbehind:!0,greedy:!0,inside:t},Prism.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(a,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+a+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml; +!function(s){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:[^;{\\s\"']|\\s+(?!\\s)|"+e.source+")*?(?:;|(?=\\s*\\{))"),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var t=s.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(Prism); +Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}; +Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp("((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)/(?:(?:\\[(?:[^\\]\\\\\r\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|/\\*(?:[^*]|\\*(?!/))*\\*/)*(?:$|[\r\n,.;:})\\]]|//))"),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)","javascript")),Prism.languages.js=Prism.languages.javascript; +!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",a={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},n={bash:a,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:n},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:a}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:n.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:n.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},a.inside=e.languages.bash;for(var s=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=n.variable[1].inside,i=0;i>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean; +!function(e){function n(e,n){return e.replace(/<<(\d+)>>/g,(function(e,s){return"(?:"+n[+s]+")"}))}function s(e,s,a){return RegExp(n(e,s),a||"")}function a(e,n){for(var s=0;s>/g,(function(){return"(?:"+e+")"}));return e.replace(/<>/g,"[^\\s\\S]")}var t="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",r="class enum interface record struct",i="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",o="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var d=l(r),p=RegExp(l(t+" "+r+" "+i+" "+o)),c=l(r+" "+i+" "+o),u=l(t+" "+r+" "+o),g=a("<(?:[^<>;=+\\-*/%&|^]|<>)*>",2),b=a("\\((?:[^()]|<>)*\\)",2),h="@?\\b[A-Za-z_]\\w*\\b",f=n("<<0>>(?:\\s*<<1>>)?",[h,g]),m=n("(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*",[c,f]),k="\\[\\s*(?:,\\s*)*\\]",y=n("<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?",[m,k]),w=n("[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>",[g,b,k]),v=n("\\(<<0>>+(?:,<<0>>+)+\\)",[w]),x=n("(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?",[v,m,k]),$={keyword:p,punctuation:/[<>()?,.:[\]]/},_="'(?:[^\r\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'",B='"(?:\\\\.|[^\\\\"\r\n])*"';e.languages.csharp=e.languages.extend("clike",{string:[{pattern:s("(^|[^$\\\\])<<0>>",['@"(?:""|\\\\[^]|[^\\\\"])*"(?!")']),lookbehind:!0,greedy:!0},{pattern:s("(^|[^@$\\\\])<<0>>",[B]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:s("(\\busing\\s+static\\s+)<<0>>(?=\\s*;)",[m]),lookbehind:!0,inside:$},{pattern:s("(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)",[h,x]),lookbehind:!0,inside:$},{pattern:s("(\\busing\\s+)<<0>>(?=\\s*=)",[h]),lookbehind:!0},{pattern:s("(\\b<<0>>\\s+)<<1>>",[d,f]),lookbehind:!0,inside:$},{pattern:s("(\\bcatch\\s*\\(\\s*)<<0>>",[m]),lookbehind:!0,inside:$},{pattern:s("(\\bwhere\\s+)<<0>>",[h]),lookbehind:!0},{pattern:s("(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>",[y]),lookbehind:!0,inside:$},{pattern:s("\\b<<0>>(?=\\s+(?!<<1>>|with\\s*\\{)<<2>>(?:\\s*[=,;:{)\\]]|\\s+(?:in|when)\\b))",[x,u,h]),inside:$}],keyword:p,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:s("([(,]\\s*)<<0>>(?=\\s*:)",[h]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:s("(\\b(?:namespace|using)\\s+)<<0>>(?:\\s*\\.\\s*<<0>>)*(?=\\s*[;{])",[h]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:s("(\\b(?:default|sizeof|typeof)\\s*\\(\\s*(?!\\s))(?:[^()\\s]|\\s(?!\\s)|<<0>>)*(?=\\s*\\))",[b]),lookbehind:!0,alias:"class-name",inside:$},"return-type":{pattern:s("<<0>>(?=\\s+(?:<<1>>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))",[x,m]),inside:$,alias:"class-name"},"constructor-invocation":{pattern:s("(\\bnew\\s+)<<0>>(?=\\s*[[({])",[x]),lookbehind:!0,inside:$,alias:"class-name"},"generic-method":{pattern:s("<<0>>\\s*<<1>>(?=\\s*\\()",[h,g]),inside:{function:s("^<<0>>",[h]),generic:{pattern:RegExp(g),alias:"class-name",inside:$}}},"type-list":{pattern:s("\\b((?:<<0>>\\s+<<1>>|record\\s+<<1>>\\s*<<5>>|where\\s+<<2>>)\\s*:\\s*)(?:<<3>>|<<4>>|<<1>>\\s*<<5>>|<<6>>)(?:\\s*,\\s*(?:<<3>>|<<4>>|<<6>>))*(?=\\s*(?:where|[{;]|=>|$))",[d,f,h,x,p.source,b,"\\bnew\\s*\\(\\s*\\)"]),lookbehind:!0,inside:{"record-arguments":{pattern:s("(^(?!new\\s*\\()<<0>>\\s*)<<1>>",[f,b]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:p,"class-name":{pattern:RegExp(x),greedy:!0,inside:$},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var E=B+"|"+_,R=n("/(?![*/])|//[^\r\n]*[\r\n]|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>",[E]),z=a(n("[^\"'/()]|<<0>>|\\(<>*\\)",[R]),2),S="\\b(?:assembly|event|field|method|module|param|property|return|type)\\b",j=n("<<0>>(?:\\s*\\(<<1>>*\\))?",[m,z]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:s("((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<<0>>\\s*:\\s*)?<<1>>(?:\\s*,\\s*<<1>>)*(?=\\s*\\])",[S,j]),lookbehind:!0,greedy:!0,inside:{target:{pattern:s("^<<0>>(?=\\s*:)",[S]),alias:"keyword"},"attribute-arguments":{pattern:s("\\(<<0>>*\\)",[z]),inside:e.languages.csharp},"class-name":{pattern:RegExp(m),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var A=":[^}\r\n]+",F=a(n("[^\"'/()]|<<0>>|\\(<>*\\)",[R]),2),P=n("\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}",[F,A]),U=a(n("[^\"'/()]|/(?!\\*)|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>|\\(<>*\\)",[E]),2),Z=n("\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}",[U,A]);function q(n,a){return{interpolation:{pattern:s("((?:^|[^{])(?:\\{\\{)*)<<0>>",[n]),lookbehind:!0,inside:{"format-string":{pattern:s("(^\\{(?:(?![}:])<<0>>)*)<<1>>(?=\\}$)",[a,A]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:s('(^|[^\\\\])(?:\\$@|@\\$)"(?:""|\\\\[^]|\\{\\{|<<0>>|[^\\\\{"])*"',[P]),lookbehind:!0,greedy:!0,inside:q(P,F)},{pattern:s('(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<<0>>|[^\\\\"{])*"',[Z]),lookbehind:!0,greedy:!0,inside:q(Z,U)}],char:{pattern:RegExp(_),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism); +!function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n="\\b(?!)\\w+(?:\\s*\\.\\s*\\w+)*\\b".replace(//g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp("(\\b(?:class|concept|enum|struct|typename)\\s+)(?!)\\w+".replace(//g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp('(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\r\n|[^])|[^"\\\\\r\n])*"|<[^<>\r\n]*>|'+"(?:\\s*:\\s*)?|:\\s*".replace(//g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism); +!function(e){var n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t="(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*",s={pattern:RegExp("(^|[^\\w.])"+t+"[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b"),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp("(^|[^\\w.])"+t+"[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)"),lookbehind:!0,inside:s.inside},{pattern:RegExp("(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)"+t+"[A-Z]\\w*\\b"),lookbehind:!0,inside:s.inside}],keyword:n,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp("(\\bimport\\s+)"+t+"(?:[A-Z]\\w*|\\*)(?=\\s*;)"),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp("(\\bimport\\s+static\\s+)"+t+"(?:\\w+|\\*)(?=\\s*;)"),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp("(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?".replace(//g,(function(){return n.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism); +!function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var e={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:e},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:e},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin}(Prism); +Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec; +Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python; +!function(s){var n=['"(?:\\\\[^]|\\$\\([^)]+\\)|\\$(?!\\()|`[^`]+`|[^"\\\\`$])*"',"'[^']*'","\\$'(?:[^'\\\\]|\\\\[^])*'","<<-?\\s*([\"']?)(\\w+)\\1\\s[^]*?[\r\n]\\2"].join("|");s.languages["shell-session"]={command:{pattern:RegExp('^(?:[^\\s@:$#%*!/\\\\]+@[^\r\n@:$#%*!/\\\\]+(?::[^\0-\\x1F$#%*?"<>:;|]+)?|[/~.][^\0-\\x1F$#%*?"<>@:;|]*)?[$#%](?=\\s)'+"(?:[^\\\\\r\n \t'\"<$]|[ \t](?:(?!#)|#.*$)|\\\\(?:[^\r]|\r\n?)|\\$(?!')|<(?!<)|<>)+".replace(/<>/g,(function(){return n})),"m"),greedy:!0,inside:{info:{pattern:/^[^#$%]+/,alias:"punctuation",inside:{user:/^[^\s@:$#%*!/\\]+@[^\r\n@:$#%*!/\\]+/,punctuation:/:/,path:/[\s\S]+/}},bash:{pattern:/(^[$#%]\s*)\S[\s\S]*/,lookbehind:!0,alias:"language-bash",inside:s.languages.bash},"shell-symbol":{pattern:/^[$#%]/,alias:"important"}}},output:/.(?:.*(?:[\r\n]|.$))*/},s.languages["sh-session"]=s.languages.shellsession=s.languages["shell-session"]}(Prism); +Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp('(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\r\n|[^(])|[^\\\\\r\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])'),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp('(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\r\n|[^#])|[^\\\\\r\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2'),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp("#(?:(?:elseif|if)\\b(?:[ \t]*(?:![ \t]*)?(?:\\b\\w+\\b(?:[ \t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift})); +!function(){if("undefined"!=typeof Prism){var e=Object.assign||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},t={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};n.prototype={setDefaults:function(t){this.defaults=e(this.defaults,t)},normalize:function(t,n){for(var r in n=e(this.defaults,n)){var i=r.replace(/-(\w)/g,(function(e,t){return t.toUpperCase()}));"normalize"!==r&&"setDefaults"!==i&&n[r]&&this[i]&&(t=this[i].call(this,t,n[r]))}return t},leftTrim:function(e){return e.replace(/^\s+/,"")},rightTrim:function(e){return e.replace(/\s+$/,"")},tabsToSpaces:function(e,t){return t=0|t||4,e.replace(/\t/g,new Array(++t).join(" "))},spacesToTabs:function(e,t){return t=0|t||4,e.replace(RegExp(" {"+t+"}","g"),"\t")},removeTrailing:function(e){return e.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(e){return e.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(e){var t=e.match(/^[^\S\n\r]*(?=\S)/gm);return t&&t[0].length?(t.sort((function(e,t){return e.length-t.length})),t[0].length?e.replace(RegExp("^"+t[0],"gm"),""):e):e},indent:function(e,t){return e.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++t).join("\t")+"$&")},breakLines:function(e,t){t=!0===t?80:0|t||80;for(var n=e.split("\n"),i=0;it&&(o[l]="\n"+o[l],a=s)}n[i]=o.join("")}return n.join("\n")}},"undefined"!=typeof module&&module.exports&&(module.exports=n),Prism.plugins.NormalizeWhitespace=new n({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",(function(e){var n=Prism.plugins.NormalizeWhitespace;if((!e.settings||!1!==e.settings["whitespace-normalization"])&&Prism.util.isActive(e.element,"whitespace-normalization",!0))if(e.element&&e.element.parentNode||!e.code){var r=e.element.parentNode;if(e.code&&r&&"pre"===r.nodeName.toLowerCase()){for(var i in null==e.settings&&(e.settings={}),t)if(Object.hasOwnProperty.call(t,i)){var o=t[i];if(r.hasAttribute("data-"+i))try{var a=JSON.parse(r.getAttribute("data-"+i)||"true");typeof a===o&&(e.settings[i]=a)}catch(e){}}for(var l=r.childNodes,s="",c="",u=!1,m=0;m -1) - start = i; - }); - start = Math.max(start - 120, 0); - var excerpt = ((start > 0) ? '...' : '') + - $.trim(text.substr(start, 240)) + - ((start + 240 - text.length) ? '...' : ''); - var rv = $('
').text(excerpt); - $.each(hlwords, function() { - rv = rv.highlightText(this, 'highlighted'); - }); - return rv; -} - - -/** - * Porter Stemmer - */ -var Stemmer = function() { - - var step2list = { - ational: 'ate', - tional: 'tion', - enci: 'ence', - anci: 'ance', - izer: 'ize', - bli: 'ble', - alli: 'al', - entli: 'ent', - eli: 'e', - ousli: 'ous', - ization: 'ize', - ation: 'ate', - ator: 'ate', - alism: 'al', - iveness: 'ive', - fulness: 'ful', - ousness: 'ous', - aliti: 'al', - iviti: 'ive', - biliti: 'ble', - logi: 'log' - }; - - var step3list = { - icate: 'ic', - ative: '', - alize: 'al', - iciti: 'ic', - ical: 'ic', - ful: '', - ness: '' - }; - - var c = "[^aeiou]"; // consonant - var v = "[aeiouy]"; // vowel - var C = c + "[^aeiouy]*"; // consonant sequence - var V = v + "[aeiou]*"; // vowel sequence - - var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 - var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 - var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 - var s_v = "^(" + C + ")?" + v; // vowel in stem - - this.stemWord = function (w) { - var stem; - var suffix; - var firstch; - var origword = w; - - if (w.length < 3) - return w; - - var re; - var re2; - var re3; - var re4; - - firstch = w.substr(0,1); - if (firstch == "y") - w = firstch.toUpperCase() + w.substr(1); - - // Step 1a - re = /^(.+?)(ss|i)es$/; - re2 = /^(.+?)([^s])s$/; - - if (re.test(w)) - w = w.replace(re,"$1$2"); - else if (re2.test(w)) - w = w.replace(re2,"$1$2"); - - // Step 1b - re = /^(.+?)eed$/; - re2 = /^(.+?)(ed|ing)$/; - if (re.test(w)) { - var fp = re.exec(w); - re = new RegExp(mgr0); - if (re.test(fp[1])) { - re = /.$/; - w = w.replace(re,""); - } - } - else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1]; - re2 = new RegExp(s_v); - if (re2.test(stem)) { - w = stem; - re2 = /(at|bl|iz)$/; - re3 = new RegExp("([^aeiouylsz])\\1$"); - re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re2.test(w)) - w = w + "e"; - else if (re3.test(w)) { - re = /.$/; - w = w.replace(re,""); - } - else if (re4.test(w)) - w = w + "e"; - } - } - - // Step 1c - re = /^(.+?)y$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(s_v); - if (re.test(stem)) - w = stem + "i"; - } - - // Step 2 - re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step2list[suffix]; - } - - // Step 3 - re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step3list[suffix]; - } - - // Step 4 - re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; - re2 = /^(.+?)(s|t)(ion)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(mgr1); - if (re.test(stem)) - w = stem; - } - else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1] + fp[2]; - re2 = new RegExp(mgr1); - if (re2.test(stem)) - w = stem; - } - - // Step 5 - re = /^(.+?)e$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(mgr1); - re2 = new RegExp(meq1); - re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) - w = stem; - } - re = /ll$/; - re2 = new RegExp(mgr1); - if (re.test(w) && re2.test(w)) { - re = /.$/; - w = w.replace(re,""); - } - - // and turn initial Y back to y - if (firstch == "y") - w = firstch.toLowerCase() + w.substr(1); - return w; - } -} - - -/** - * Search Module - */ -var Search = { - - _index : null, - _queued_query : null, - _pulse_status : -1, - - init : function() { - var params = $.getQueryParameters(); - if (params.q) { - var query = params.q[0]; - $('input[name="q"]')[0].value = query; - this.performSearch(query); - } - }, - - loadIndex : function(url) { - $.ajax({type: "GET", url: url, data: null, success: null, - dataType: "script", cache: true}); - }, - - setIndex : function(index) { - var q; - this._index = index; - if ((q = this._queued_query) !== null) { - this._queued_query = null; - Search.query(q); - } - }, - - hasIndex : function() { - return this._index !== null; - }, - - deferQuery : function(query) { - this._queued_query = query; - }, - - stopPulse : function() { - this._pulse_status = 0; - }, - - startPulse : function() { - if (this._pulse_status >= 0) - return; - function pulse() { - Search._pulse_status = (Search._pulse_status + 1) % 4; - var dotString = ''; - for (var i = 0; i < Search._pulse_status; i++) - dotString += '.'; - Search.dots.text(dotString); - if (Search._pulse_status > -1) - window.setTimeout(pulse, 500); - }; - pulse(); - }, - - /** - * perform a search for something - */ - performSearch : function(query) { - // create the required interface elements - this.out = $('#search-results'); - this.title = $('

' + _('Searching') + '

').appendTo(this.out); - this.dots = $('').appendTo(this.title); - this.status = $('

').appendTo(this.out); - this.output = $('