From fb67cf9f01736ec55fbb97f54845b82a05e3b782 Mon Sep 17 00:00:00 2001 From: krypton-byte Date: Wed, 1 Apr 2026 20:08:55 +0700 Subject: [PATCH 01/11] feat(release): enhance workflow dispatch with release type options and improve documentation --- .github/workflows/CI.yml | 1 - .github/workflows/release.yml | 26 +++++++++++++++++++++++--- CONTRIBUTING.md | 16 +++++++++------- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1b81be0..07e0bba 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -4,7 +4,6 @@ on: push: tags: - "v*" - pull_request: workflow_dispatch: permissions: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 577a493..8d3f5e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,17 @@ name: Semantic Release on: workflow_dispatch: + inputs: + release_type: + description: "Version bump strategy" + required: true + default: auto + type: choice + options: + - auto + - patch + - minor + - major permissions: contents: write @@ -20,10 +31,12 @@ jobs: echo "event=${GITHUB_EVENT_NAME}" echo "ref=${GITHUB_REF}" echo "actor=${GITHUB_ACTOR}" + echo "default_branch=${{ github.event.repository.default_branch }}" + echo "release_type=${{ github.event.inputs.release_type || 'auto' }}" - uses: actions/checkout@v4 with: - ref: main + ref: ${{ github.event.repository.default_branch }} fetch-depth: 0 submodules: recursive @@ -48,10 +61,16 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: uv run --no-project --with python-semantic-release==9.21.1 semantic-release version + RELEASE_TYPE: ${{ github.event.inputs.release_type || 'auto' }} + run: | + if [ "${RELEASE_TYPE}" = "auto" ]; then + uv run --no-project --with python-semantic-release==9.21.1 semantic-release version --no-vcs-release + else + uv run --no-project --with python-semantic-release==9.21.1 semantic-release version --no-vcs-release --"${RELEASE_TYPE}" + fi - name: Push release commit and tags - run: git push --follow-tags origin HEAD:main + run: git push --follow-tags origin HEAD:${{ github.event.repository.default_branch }} - name: Capture release result id: release_result @@ -71,6 +90,7 @@ jobs: if [ "${after_sha}" = "${{ steps.baseline.outputs.sha }}" ] && [ "${after_tag}" = "${{ steps.baseline.outputs.tag }}" ]; then echo "released=false" >> "$GITHUB_OUTPUT" echo "No new release generated in this run." + echo "Tip: use release_type=patch/minor/major to force a release when needed." else echo "released=true" >> "$GITHUB_OUTPUT" echo "Release generated. Latest tag: ${after_tag:-none}" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ad4eee..3b2fd5d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,11 +90,12 @@ Include: ## Release Flow Overview - Release is executed manually from GitHub Actions using the `Semantic Release` workflow (`workflow_dispatch`). -- Semantic release evaluates Conventional Commits already present in `main` (from PR merges or direct pushes). +- Semantic release evaluates Conventional Commits already present in the repository default branch (from PR merges or direct pushes). - If commits qualify (`feat`, `fix`, `perf`, or breaking), version and changelog are updated and a new tag (`vX.Y.Z`) is created. - If commits do not qualify (for example docs/chore only), release is a no-op and no publish is triggered. - After a tag is created, GitHub Release notes are generated automatically. -- CI is then triggered on that tag to build artifacts and publish to PyPI. +- CI release pipeline is tag-driven (`vX.Y.Z`) to build artifacts and publish to PyPI. +- Workflow dispatch is kept only as internal fallback trigger from `Semantic Release` automation. ## Simple Trigger Guide @@ -107,11 +108,12 @@ Use this rule of thumb for automatic versioning: How to trigger semantic release until publish to PyPI: -1. Push commits to `main` (direct push or merged PR), using Conventional Commit messages. -2. Open GitHub Actions and run `Semantic Release` on `main`. -3. Workflow evaluates commits and creates tag `vX.Y.Z` when releasable commits exist. -4. Workflow creates the corresponding GitHub Release. -5. CI workflow runs on that tag and publishes artifacts to PyPI. +1. Push commits to default branch (direct push or merged PR), using Conventional Commit messages. +2. Open GitHub Actions and run `Semantic Release` on the default branch. +3. Choose `release_type`: `auto` (default) for commit-based bump, or `patch`/`minor`/`major` to force bump manually. +4. Workflow evaluates commits and creates tag `vX.Y.Z` when releasable commits exist. +5. Workflow creates the corresponding GitHub Release. +6. CI workflow runs on that tag and publishes artifacts to PyPI. Manual fallback (if needed): From 3bb0cb250dd8281a27707e39a181731ff6d2b3f2 Mon Sep 17 00:00:00 2001 From: krypton-byte Date: Wed, 1 Apr 2026 20:16:56 +0700 Subject: [PATCH 02/11] fix(release): update default branch references in workflow and documentation --- .github/workflows/release.yml | 3 ++- CONTRIBUTING.md | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d3f5e2..f74906e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,10 +32,10 @@ jobs: echo "ref=${GITHUB_REF}" echo "actor=${GITHUB_ACTOR}" echo "default_branch=${{ github.event.repository.default_branch }}" - echo "release_type=${{ github.event.inputs.release_type || 'auto' }}" - uses: actions/checkout@v4 with: + ref: ${{ github.event.repository.default_branch }} ref: ${{ github.event.repository.default_branch }} fetch-depth: 0 submodules: recursive @@ -71,6 +71,7 @@ jobs: - name: Push release commit and tags run: git push --follow-tags origin HEAD:${{ github.event.repository.default_branch }} + run: git push --follow-tags origin HEAD:${{ github.event.repository.default_branch }} - name: Capture release result id: release_result diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3b2fd5d..5d8e871 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -91,6 +91,7 @@ Include: - Release is executed manually from GitHub Actions using the `Semantic Release` workflow (`workflow_dispatch`). - Semantic release evaluates Conventional Commits already present in the repository default branch (from PR merges or direct pushes). +- Semantic release evaluates Conventional Commits already present in the repository default branch (from PR merges or direct pushes). - If commits qualify (`feat`, `fix`, `perf`, or breaking), version and changelog are updated and a new tag (`vX.Y.Z`) is created. - If commits do not qualify (for example docs/chore only), release is a no-op and no publish is triggered. - After a tag is created, GitHub Release notes are generated automatically. @@ -109,11 +110,10 @@ Use this rule of thumb for automatic versioning: How to trigger semantic release until publish to PyPI: 1. Push commits to default branch (direct push or merged PR), using Conventional Commit messages. -2. Open GitHub Actions and run `Semantic Release` on the default branch. -3. Choose `release_type`: `auto` (default) for commit-based bump, or `patch`/`minor`/`major` to force bump manually. -4. Workflow evaluates commits and creates tag `vX.Y.Z` when releasable commits exist. -5. Workflow creates the corresponding GitHub Release. -6. CI workflow runs on that tag and publishes artifacts to PyPI. +2. Open GitHub Actions and run `Semantic Release` on default branch. +3. Workflow evaluates commits and creates tag `vX.Y.Z` when releasable commits exist. +4. Workflow creates the corresponding GitHub Release. +5. CI workflow runs on that tag and publishes artifacts to PyPI. Manual fallback (if needed): From ee1a1b65c8ed03b8b6bf75aa8ed0900dc1176501 Mon Sep 17 00:00:00 2001 From: semantic-release Date: Wed, 1 Apr 2026 13:22:51 +0000 Subject: [PATCH 03/11] 0.2.0 Automatically generated by python-semantic-release --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ Cargo.toml | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c7aea1..77f123c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,36 @@ # CHANGELOG +## v0.2.0 (2026-04-01) + +### Bug Fixes + +- Remove RELEASE_PUSH_TOKEN reference from contributing guidelines + ([`f92bd1d`](https://github.com/krypton-byte/tryx/commit/f92bd1dedf734ca59c5a0ed45293fbe4a63f26ee)) + +- **release**: Update CI workflow dependencies and improve error handling for dispatch trigger + ([`b1acd07`](https://github.com/krypton-byte/tryx/commit/b1acd07befffdb69f0dbcbb3e256bc7e0608b3fb)) + +- **release**: Update default branch references in workflow and documentation + ([`bc5a5cc`](https://github.com/krypton-byte/tryx/commit/bc5a5ccc1cb037cf813998d0ad865d66c30c6ae5)) + +- **test**: Update workflows for commit message validation and release automation + ([`b940d91`](https://github.com/krypton-byte/tryx/commit/b940d91d89969590af84b56a52316803174c4f65)) + +### Documentation + +- Update contributing guidelines to clarify release automation and required secrets + ([`cea622c`](https://github.com/krypton-byte/tryx/commit/cea622c1905aee8f461ff87625bddd18ab9b5ec3)) + +- Update section title in contributing guidelines for clarity + ([`ef04047`](https://github.com/krypton-byte/tryx/commit/ef040477453e2d24ffcb384138c7d4b2250d116a)) + +### Features + +- **test**: Test + ([`3bc6c04`](https://github.com/krypton-byte/tryx/commit/3bc6c04f8ce84802947c45ad9e9b8735ec615918)) + + ## v0.1.0 (2026-04-01) ### Bug Fixes diff --git a/Cargo.toml b/Cargo.toml index 3a1c668..0da301e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tryx" -version = "0.1.0" +version = "0.2.0" edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From bb74fd227019c298853fe8bc038bb7424eba1d58 Mon Sep 17 00:00:00 2001 From: krypton-byte Date: Wed, 1 Apr 2026 21:13:12 +0700 Subject: [PATCH 04/11] feat(ci): reintroduce Linux and Windows wheel builds with updated configurations --- .github/workflows/CI.yml | 232 +++++++++++++++++++-------------------- 1 file changed, 116 insertions(+), 116 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 07e0bba..633a3be 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -33,49 +33,49 @@ jobs: - name: Validate stub parity run: uv run python scripts/check_stub_parity.py - # linux: - # name: Linux manylinux wheels - # needs: quality - # runs-on: ${{ matrix.platform.runner }} - # strategy: - # fail-fast: false - # matrix: - # platform: - # - runner: ubuntu-22.04 - # target: x86_64 - # - runner: ubuntu-22.04 - # target: x86 - # - runner: ubuntu-22.04 - # target: aarch64 - # - runner: ubuntu-22.04 - # target: armv7 - # steps: - # - uses: actions/checkout@v4 - # with: - # submodules: recursive - # - uses: actions/setup-python@v5 - # with: - # python-version: "3.12" - # - name: Workaround ring ARM asm macro in cross builds - # if: matrix.platform.target == 'aarch64' || matrix.platform.target == 'armv7' - # run: | - # if [ "${{ matrix.platform.target }}" = "aarch64" ]; then - # echo "CFLAGS_aarch64_unknown_linux_gnu=-D__ARM_ARCH=8" >> "$GITHUB_ENV" - # else - # echo "CFLAGS_armv7_unknown_linux_gnueabihf=-D__ARM_ARCH=7" >> "$GITHUB_ENV" - # fi - # - name: Build wheels - # uses: PyO3/maturin-action@v1 - # with: - # target: ${{ matrix.platform.target }} - # args: --release --out dist --find-interpreter - # sccache: ${{ !startsWith(github.ref, 'refs/tags/') && matrix.platform.target != 'aarch64' && matrix.platform.target != 'armv7' }} - # manylinux: auto - # - name: Upload wheels - # uses: actions/upload-artifact@v4 - # with: - # name: wheels-linux-${{ matrix.platform.target }} - # path: dist + linux: + name: Linux manylinux wheels + needs: quality + runs-on: ${{ matrix.platform.runner }} + strategy: + fail-fast: false + matrix: + platform: + - runner: ubuntu-22.04 + target: x86_64 + - runner: ubuntu-22.04 + target: x86 + - runner: ubuntu-22.04 + target: aarch64 + - runner: ubuntu-22.04 + target: armv7 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Workaround ring ARM asm macro in cross builds + if: matrix.platform.target == 'aarch64' || matrix.platform.target == 'armv7' + run: | + if [ "${{ matrix.platform.target }}" = "aarch64" ]; then + echo "CFLAGS_aarch64_unknown_linux_gnu=-D__ARM_ARCH=8" >> "$GITHUB_ENV" + else + echo "CFLAGS_armv7_unknown_linux_gnueabihf=-D__ARM_ARCH=7" >> "$GITHUB_ENV" + fi + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: ${{ !startsWith(github.ref, 'refs/tags/') && matrix.platform.target != 'aarch64' && matrix.platform.target != 'armv7' }} + manylinux: auto + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-linux-${{ matrix.platform.target }} + path: dist musllinux: name: Linux musllinux wheels @@ -87,12 +87,12 @@ jobs: platform: - runner: ubuntu-22.04 target: x86_64 - # - runner: ubuntu-22.04 - # target: x86 - # - runner: ubuntu-22.04 - # target: aarch64 - # - runner: ubuntu-22.04 - # target: armv7 + - runner: ubuntu-22.04 + target: x86 + - runner: ubuntu-22.04 + target: aarch64 + - runner: ubuntu-22.04 + target: armv7 steps: - uses: actions/checkout@v4 with: @@ -121,73 +121,73 @@ jobs: name: wheels-musllinux-${{ matrix.platform.target }} path: dist - # windows: - # name: Windows wheels - # needs: quality - # runs-on: ${{ matrix.platform.runner }} - # strategy: - # fail-fast: false - # matrix: - # platform: - # - runner: windows-latest - # target: x64 - # python_arch: x64 - # - runner: windows-latest - # target: x86 - # python_arch: x86 - # - runner: windows-11-arm - # target: aarch64 - # python_arch: arm64 - # steps: - # - uses: actions/checkout@v4 - # with: - # submodules: recursive - # - uses: actions/setup-python@v5 - # with: - # python-version: "3.12" - # architecture: ${{ matrix.platform.python_arch }} - # - name: Build wheels - # uses: PyO3/maturin-action@v1 - # with: - # target: ${{ matrix.platform.target }} - # args: --release --out dist --find-interpreter - # sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} - # - name: Upload wheels - # uses: actions/upload-artifact@v4 - # with: - # name: wheels-windows-${{ matrix.platform.target }} - # path: dist + windows: + name: Windows wheels + needs: quality + runs-on: ${{ matrix.platform.runner }} + strategy: + fail-fast: false + matrix: + platform: + - runner: windows-latest + target: x64 + python_arch: x64 + - runner: windows-latest + target: x86 + python_arch: x86 + - runner: windows-11-arm + target: aarch64 + python_arch: arm64 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + architecture: ${{ matrix.platform.python_arch }} + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-windows-${{ matrix.platform.target }} + path: dist - # macos: - # name: macOS wheels - # needs: quality - # runs-on: ${{ matrix.platform.runner }} - # strategy: - # fail-fast: false - # matrix: - # platform: - # - runner: macos-15-intel - # target: x86_64 - # - runner: macos-latest - # target: aarch64 - # steps: - # - uses: actions/checkout@v4 - # with: - # submodules: recursive - # - uses: actions/setup-python@v5 - # with: - # python-version: "3.12" - # - name: Build wheels - # uses: PyO3/maturin-action@v1 - # with: - # target: ${{ matrix.platform.target }} - # args: --release --out dist --find-interpreter - # sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} - # - name: Upload wheels - # uses: actions/upload-artifact@v4 - # with: - # name: wheels-macos-${{ matrix.platform.target }} - # path: dist + macos: + name: macOS wheels + needs: quality + runs-on: ${{ matrix.platform.runner }} + strategy: + fail-fast: false + matrix: + platform: + - runner: macos-15-intel + target: x86_64 + - runner: macos-latest + target: aarch64 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-macos-${{ matrix.platform.target }} + path: dist sdist: name: Source distribution @@ -211,7 +211,7 @@ jobs: release: name: Publish to PyPI if: ${{ startsWith(github.ref, 'refs/tags/v') }} - needs: [musllinux, sdist] + needs: [musllinux, linux, windows, macos, sdist] runs-on: ubuntu-latest permissions: id-token: write From 93bcdc28d2d3cb7d9e5ed7f5b6d9963e17f4c03a Mon Sep 17 00:00:00 2001 From: semantic-release Date: Wed, 1 Apr 2026 14:13:57 +0000 Subject: [PATCH 05/11] 0.3.0 Automatically generated by python-semantic-release --- CHANGELOG.md | 8 ++++++++ Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77f123c..82786c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # CHANGELOG +## v0.3.0 (2026-04-01) + +### Features + +- **ci**: Reintroduce Linux and Windows wheel builds with updated configurations + ([`b30808f`](https://github.com/krypton-byte/tryx/commit/b30808fea71d0e95fa4c9de5ae7a3b2190eb6949)) + + ## v0.2.0 (2026-04-01) ### Bug Fixes diff --git a/Cargo.toml b/Cargo.toml index 0da301e..5e8fe9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tryx" -version = "0.2.0" +version = "0.3.0" edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 26baf5e1131f6bc06e28404fd01807ff632f3f9c Mon Sep 17 00:00:00 2001 From: krypton-byte Date: Wed, 1 Apr 2026 21:16:38 +0700 Subject: [PATCH 06/11] Refactor code structure and remove redundant code blocks for improved readability and maintainability --- Cargo.lock | 2 +- site/404.html | 1873 ----- site/api/blocking/index.html | 2102 ------ site/api/chat-actions/index.html | 2185 ------ site/api/chatstate/index.html | 2108 ------ site/api/client/index.html | 2216 ------ site/api/community/index.html | 2128 ------ site/api/contact/index.html | 2151 ------ site/api/events/index.html | 2352 ------ site/api/groups/index.html | 2117 ------ site/api/helpers/index.html | 2298 ------ site/api/newsletter/index.html | 2147 ------ site/api/polls/index.html | 2128 ------ site/api/presence/index.html | 2127 ------ site/api/privacy/index.html | 2209 ------ site/api/profile/index.html | 2124 ------ site/api/status/index.html | 2123 ------ site/api/types/index.html | 2201 ------ site/api/wacore/index.html | 2046 ----- site/assets/images/favicon.png | Bin 1870 -> 0 bytes .../javascripts/lunr/min/lunr.ar.min.js | 1 - .../javascripts/lunr/min/lunr.da.min.js | 18 - .../javascripts/lunr/min/lunr.de.min.js | 18 - .../javascripts/lunr/min/lunr.du.min.js | 18 - .../javascripts/lunr/min/lunr.el.min.js | 1 - .../javascripts/lunr/min/lunr.es.min.js | 18 - .../javascripts/lunr/min/lunr.fi.min.js | 18 - .../javascripts/lunr/min/lunr.fr.min.js | 18 - .../javascripts/lunr/min/lunr.he.min.js | 1 - .../javascripts/lunr/min/lunr.hi.min.js | 1 - .../javascripts/lunr/min/lunr.hu.min.js | 18 - .../javascripts/lunr/min/lunr.hy.min.js | 1 - .../javascripts/lunr/min/lunr.it.min.js | 18 - .../javascripts/lunr/min/lunr.ja.min.js | 1 - .../javascripts/lunr/min/lunr.jp.min.js | 1 - .../javascripts/lunr/min/lunr.kn.min.js | 1 - .../javascripts/lunr/min/lunr.ko.min.js | 1 - .../javascripts/lunr/min/lunr.multi.min.js | 1 - .../javascripts/lunr/min/lunr.nl.min.js | 18 - .../javascripts/lunr/min/lunr.no.min.js | 18 - .../javascripts/lunr/min/lunr.pt.min.js | 18 - .../javascripts/lunr/min/lunr.ro.min.js | 18 - .../javascripts/lunr/min/lunr.ru.min.js | 18 - .../javascripts/lunr/min/lunr.sa.min.js | 1 - .../lunr/min/lunr.stemmer.support.min.js | 1 - .../javascripts/lunr/min/lunr.sv.min.js | 18 - .../javascripts/lunr/min/lunr.ta.min.js | 1 - .../javascripts/lunr/min/lunr.te.min.js | 1 - .../javascripts/lunr/min/lunr.th.min.js | 1 - .../javascripts/lunr/min/lunr.tr.min.js | 18 - .../javascripts/lunr/min/lunr.vi.min.js | 1 - .../javascripts/lunr/min/lunr.zh.min.js | 1 - site/assets/javascripts/lunr/tinyseg.js | 206 - site/assets/javascripts/lunr/wordcut.js | 6708 ----------------- site/assets/stylesheets/extra.css | 145 - site/core-concepts/architecture/index.html | 2198 ------ site/core-concepts/event-model/index.html | 2174 ------ site/core-concepts/type-system/index.html | 2156 ------ site/faq/qna/index.html | 2683 ------- .../getting-started/authentication/index.html | 2181 ------ site/getting-started/installation/index.html | 2221 ------ site/getting-started/quickstart/index.html | 2147 ------ site/index.html | 2137 ------ site/operations/deployment/index.html | 2088 ----- site/operations/performance/index.html | 2126 ------ site/operations/reliability/index.html | 2108 ------ site/operations/security/index.html | 2170 ------ site/operations/troubleshooting/index.html | 2189 ------ site/reference/changelog/index.html | 2053 ----- site/reference/error-handling/index.html | 2139 ------ site/reference/glossary/index.html | 2151 ------ site/reference/roadmap/index.html | 2049 ----- site/search/search_index.json | 1 - site/sitemap.xml | 3 - site/sitemap.xml.gz | Bin 127 -> 0 bytes site/tutorials/command-bot/index.html | 2166 ------ site/tutorials/group-automation/index.html | 2116 ------ site/tutorials/media-workflows/index.html | 2130 ------ site/tutorials/poll-survey/index.html | 2109 ------ site/tutorials/profile-privacy/index.html | 2121 ------ 80 files changed, 1 insertion(+), 93598 deletions(-) delete mode 100644 site/404.html delete mode 100644 site/api/blocking/index.html delete mode 100644 site/api/chat-actions/index.html delete mode 100644 site/api/chatstate/index.html delete mode 100644 site/api/client/index.html delete mode 100644 site/api/community/index.html delete mode 100644 site/api/contact/index.html delete mode 100644 site/api/events/index.html delete mode 100644 site/api/groups/index.html delete mode 100644 site/api/helpers/index.html delete mode 100644 site/api/newsletter/index.html delete mode 100644 site/api/polls/index.html delete mode 100644 site/api/presence/index.html delete mode 100644 site/api/privacy/index.html delete mode 100644 site/api/profile/index.html delete mode 100644 site/api/status/index.html delete mode 100644 site/api/types/index.html delete mode 100644 site/api/wacore/index.html delete mode 100644 site/assets/images/favicon.png delete mode 100644 site/assets/javascripts/lunr/min/lunr.ar.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.da.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.de.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.du.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.el.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.es.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.fi.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.fr.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.he.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.hi.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.hu.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.hy.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.it.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.ja.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.jp.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.kn.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.ko.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.multi.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.nl.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.no.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.pt.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.ro.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.ru.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.sa.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.sv.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.ta.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.te.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.th.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.tr.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.vi.min.js delete mode 100644 site/assets/javascripts/lunr/min/lunr.zh.min.js delete mode 100644 site/assets/javascripts/lunr/tinyseg.js delete mode 100644 site/assets/javascripts/lunr/wordcut.js delete mode 100644 site/assets/stylesheets/extra.css delete mode 100644 site/core-concepts/architecture/index.html delete mode 100644 site/core-concepts/event-model/index.html delete mode 100644 site/core-concepts/type-system/index.html delete mode 100644 site/faq/qna/index.html delete mode 100644 site/getting-started/authentication/index.html delete mode 100644 site/getting-started/installation/index.html delete mode 100644 site/getting-started/quickstart/index.html delete mode 100644 site/index.html delete mode 100644 site/operations/deployment/index.html delete mode 100644 site/operations/performance/index.html delete mode 100644 site/operations/reliability/index.html delete mode 100644 site/operations/security/index.html delete mode 100644 site/operations/troubleshooting/index.html delete mode 100644 site/reference/changelog/index.html delete mode 100644 site/reference/error-handling/index.html delete mode 100644 site/reference/glossary/index.html delete mode 100644 site/reference/roadmap/index.html delete mode 100644 site/search/search_index.json delete mode 100644 site/sitemap.xml delete mode 100644 site/sitemap.xml.gz delete mode 100644 site/tutorials/command-bot/index.html delete mode 100644 site/tutorials/group-automation/index.html delete mode 100644 site/tutorials/media-workflows/index.html delete mode 100644 site/tutorials/poll-survey/index.html delete mode 100644 site/tutorials/profile-privacy/index.html diff --git a/Cargo.lock b/Cargo.lock index 512d902..9e157f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "tryx" -version = "0.1.0" +version = "0.2.0" dependencies = [ "async-trait", "chrono", diff --git a/site/404.html b/site/404.html deleted file mode 100644 index d45ddef..0000000 --- a/site/404.html +++ /dev/null @@ -1,1873 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- -

404 - Not found

- -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/blocking/index.html b/site/api/blocking/index.html deleted file mode 100644 index 28eab1e..0000000 --- a/site/api/blocking/index.html +++ /dev/null @@ -1,2102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Blocking Namespace - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
- -
-
- - - -
-
- - - - - - - - -

Blocking Namespace (client.blocking)

-

Manage blocklist lifecycle and block-state checks.

-

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodOutputNotes
block(jid)NoneBlock one user
unblock(jid)NoneRemove block
get_blocklist()list[BlocklistEntry]Includes timestamp metadata
is_blocked(jid)boolFast single-user check
-

Runnable Example: Auto-Quarantine

-
spam_hits: dict[str, int] = {}
-LIMIT = 5
-
-
-@bot.on(EvMessage)
-async def anti_spam(client, event):
-    sender = event.data.message_info.source.sender
-    key = sender.user
-
-    spam_hits[key] = spam_hits.get(key, 0) + 1
-    if spam_hits[key] < LIMIT:
-        return
-
-    await client.blocking.block(sender)
-    await client.send_text(event.data.message_info.source.chat, "User has been blocked")
-    spam_hits.pop(key, None)
-
-

Runnable Example: Time-boxed Blocklist Cleanup

-
from datetime import datetime, timedelta
-
-
-async def cleanup_blocklist(client):
-    blocklist = await client.blocking.get_blocklist()
-    cutoff = datetime.utcnow() - timedelta(days=30)
-
-    for row in blocklist:
-        if row.timestamp is None:
-            continue
-        when = datetime.utcfromtimestamp(row.timestamp / 1000)
-        if when < cutoff:
-            await client.blocking.unblock(row.jid)
-
-
-

Identity checks

-

Pair is_blocked with BlockingHelpers.same_user(...) if you work with multiple server variants of the same user identity.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/chat-actions/index.html b/site/api/chat-actions/index.html deleted file mode 100644 index 01bdeb6..0000000 --- a/site/api/chat-actions/index.html +++ /dev/null @@ -1,2185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Chat Actions Namespace - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Chat Actions Namespace (client.chat_actions)

-

client.chat_actions manages chat state transitions and message-level actions (edit, revoke, react, star, archive, mute).

-
-

Why this namespace matters

-

Many WhatsApp state changes are synchronization events. If your bot writes chat state, subscribe to related events so your local view stays consistent.

-
-

Builder Helpers

-

build_message_key(id, remote_jid, from_me, participant=None)

-

Build a canonical MessageKey used by advanced sync actions.

-

build_message_range(last_message_timestamp, last_system_message_timestamp, messages)

-

Build SyncActionMessageRange for operations that need explicit message windows.

-

Method Groups

-
-
-
-
    -
  • archive_chat(jid, message_range=None)
  • -
  • unarchive_chat(jid, message_range=None)
  • -
  • pin_chat(jid)
  • -
  • unpin_chat(jid)
  • -
  • mute_chat(jid)
  • -
  • mute_chat_until(jid, mute_end_timestamp_ms)
  • -
  • unmute_chat(jid)
  • -
  • mark_chat_as_read(jid, read, message_range=None)
  • -
  • delete_chat(jid, delete_media, message_range=None)
  • -
-
-
-
    -
  • star_message(chat_jid, participant_jid, message_id, from_me)
  • -
  • unstar_message(chat_jid, participant_jid, message_id, from_me)
  • -
  • delete_message_for_me(chat_jid, participant_jid, message_id, from_me, delete_media, message_timestamp=None)
  • -
  • edit_message(chat_jid, original_id, new_message)
  • -
  • revoke_message(chat_jid, message_id, original_sender=None)
  • -
  • react_message(chat_jid, message_id, reaction, from_me=False, participant_jid=None)
  • -
-
-
-
-

Runnable Example: Moderation Utility

-
from tryx.events import EvMessage
-
-
-@bot.on(EvMessage)
-async def moderation_actions(client, event):
-    text = (event.data.get_text() or "").strip()
-    chat = event.data.message_info.source.chat
-
-    if text == "/pin":
-        await client.chat_actions.pin_chat(chat)
-        await client.send_text(chat, "Chat pinned")
-    elif text == "/unpin":
-        await client.chat_actions.unpin_chat(chat)
-        await client.send_text(chat, "Chat unpinned")
-
-

Runnable Example: React + Revoke Flow

-
async def resolve_ticket(client, chat_jid, msg_id):
-    await client.chat_actions.react_message(chat_jid, msg_id, "✅")
-    # Optional follow-up: revoke a stale bot message
-    await client.chat_actions.revoke_message(chat_jid, msg_id)
-
-

Operational Guidance

-
-

Idempotent wrappers

-

Wrap mutation methods in idempotent helpers in case your handler retries after transient errors.

-
-
-

Message identity

-

For group messages, include participant identity when needed. Wrong (message_id, participant) combinations may lead to no-op operations.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/chatstate/index.html b/site/api/chatstate/index.html deleted file mode 100644 index 997ea70..0000000 --- a/site/api/chatstate/index.html +++ /dev/null @@ -1,2108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Chatstate Namespace - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
- -
-
- - - -
-
- - - - - - - - -

Chatstate Namespace (client.chatstate)

-

Use chatstate signals to indicate user-facing activity such as typing or recording.

-

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - -
MethodPurpose
send(to, state)Send explicit ChatStateType
send_composing(to)Typing indicator
send_recording(to)Recording indicator
send_paused(to)Pause/stop indicator
-

State Values

-
    -
  • ChatStateType.Composing
  • -
  • ChatStateType.Recording
  • -
  • ChatStateType.Paused
  • -
-

Runnable Example: Latency-Hiding Reply

-
@bot.on(EvMessage)
-async def smart_reply(client, event):
-    chat = event.data.message_info.source.chat
-
-    await client.chatstate.send_composing(chat)
-    try:
-        answer = await expensive_lookup(event.data.get_text() or "")
-    finally:
-        await client.chatstate.send_paused(chat)
-
-    await client.send_text(chat, answer, quoted=event)
-
-

Runnable Example: Voice Pipeline

-
async def send_voice(client, chat, audio_bytes):
-    await client.chatstate.send_recording(chat)
-    await client.send_audio(chat, audio_bytes, ptt=True)
-    await client.chatstate.send_paused(chat)
-
-
-

Signal hygiene

-

If your handler crashes after sending composing/recording, the UX signal may look stale. -Wrap long operations in try/finally and always send paused.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/client/index.html b/site/api/client/index.html deleted file mode 100644 index 33510ff..0000000 --- a/site/api/client/index.html +++ /dev/null @@ -1,2216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Client API Gateway - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - -

Client API Gateway

-

TryxClient is the runtime facade passed to every handler, and it exposes a root messaging surface plus 12 namespace clients.

-
-

How To Read This Section

-
    -
  1. Start with this gateway page.
  2. -
  3. Open the namespace page that matches your task.
  4. -
  5. Jump to Events API for event contracts and Types API for enum/value-object constraints.
  6. -
-
-

Client Topology

-
flowchart TD
-    A[TryxClient] --> B[Root send/download/upload methods]
-    A --> C[contact]
-    A --> D[chat_actions]
-    A --> E[community]
-    A --> F[newsletter]
-    A --> G[groups]
-    A --> H[status]
-    A --> I[chatstate]
-    A --> J[blocking]
-    A --> K[polls]
-    A --> L[presence]
-    A --> M[privacy]
-    A --> N[profile]
-
-

Namespace Router

- -

Root Transport Methods

-

These methods stay on TryxClient directly because they are cross-domain primitives.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodPurposeTypical usage
is_connected() -> boolConnection health checkGuard before sends in long-running jobs
download_media(message) -> bytesDownload media blob from message proto media nodeSave image/audio/document payloads
upload_file(path, media_type) -> UploadResponseUpload file path for later message/status usageStatus media workflows
upload(data, media_type) -> UploadResponseUpload in-memory bytesTransform pipelines
send_message(to, message) -> SendResultRaw protobuf message sendAdvanced custom payloads
send_text(...) -> SendResultText helperMost command handlers
send_photo(...) -> SendResultImage helperBot replies with screenshots/posters
send_document(...) -> SendResultFile helperReports, exports, invoices
send_audio(...) -> SendResultAudio helperVoice notes / TTS
send_video(...) -> SendResultVideo helperClips, demos
send_gif(...) -> SendResultGIF helperMotion responses
send_sticker(...) -> SendResultSticker helperLightweight reactions
request_media_reupload(...) -> MediaReuploadResultRecover stale media referencesRetry failed media downloads
-
-

Reconnect-safe Pattern

-

Avoid caching TryxClient on global module state across runtime restarts. -Always use the client object injected in the current handler call.

-
-

Practical Flow By Goal

-
-
-
-

Use root send methods + chat_actions + chatstate.

-
    -
  1. Parse incoming event.
  2. -
  3. Signal typing with client.chatstate.send_composing(chat).
  4. -
  5. Send reply with client.send_text(...).
  6. -
  7. Optional message edit/revoke via client.chat_actions.
  8. -
-
-
-

Use groups, blocking, privacy.

-
    -
  1. Resolve sender via Types API.
  2. -
  3. Apply participant actions (promote, remove, approve request).
  4. -
  5. Enforce policy with blocklist/privacy settings.
  6. -
-
-
-

Use status, newsletter, polls.

-
    -
  1. Upload content or build text payload.
  2. -
  3. Publish status/newsletter message.
  4. -
  5. Track engagement using polls and reactions.
  6. -
-
-
-
-

Cross-References

- - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/community/index.html b/site/api/community/index.html deleted file mode 100644 index 9ab8ad7..0000000 --- a/site/api/community/index.html +++ /dev/null @@ -1,2128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Community Namespace - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - -

Community Namespace (client.community)

-

Use client.community to create and manage communities, link subgroups, and query topology details.

-
-

Data model

-

Community operations are graph-like: one parent community can own multiple linked groups with different participant sets.

-
-

Method Matrix

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodPurpose
classify_group(metadata)Determine logical group type
create(options)Create a community
deactivate(community_jid)Deactivate community
link_subgroups(community_jid, subgroup_jids)Attach existing groups
unlink_subgroups(community_jid, subgroup_jids, remove_orphan_members)Detach linked groups
get_subgroups(community_jid)List linked subgroup metadata
get_subgroup_participant_counts(community_jid)Participant count by subgroup
query_linked_group(community_jid, subgroup_jid)Query one linked subgroup
join_subgroup(community_jid, subgroup_jid)Join a subgroup through community context
get_linked_groups_participants(community_jid)Aggregate participants
- -
from tryx.client import CreateCommunityOptions
-
-
-async def bootstrap_community(client, subgroup_jids):
-    options = CreateCommunityOptions(
-        name="Engineering Org",
-        description="Platform and Product teams",
-        closed=False,
-        allow_non_admin_sub_group_creation=False,
-        create_general_chat=True,
-    )
-
-    created = await client.community.create(options)
-    result = await client.community.link_subgroups(created.gid, subgroup_jids)
-    return created.gid, result.linked_jids, result.failed_groups
-
-

Runnable Example: Topology Audit

-
async def audit_topology(client, community_jid):
-    groups = await client.community.get_subgroups(community_jid)
-    counts = await client.community.get_subgroup_participant_counts(community_jid)
-    by_jid = {jid.user: count for jid, count in counts}
-
-    report = []
-    for group in groups:
-        report.append(
-            {
-                "id": group.id.user,
-                "subject": group.subject,
-                "participants": by_jid.get(group.id.user, group.participant_count),
-                "is_general": group.is_general_chat,
-            }
-        )
-    return report
-
-
-

Link failures

-

LinkSubgroupsResult.failed_groups and UnlinkSubgroupsResult.failed_groups are first-class outcomes. -Always inspect them and avoid assuming all subgroup operations succeeded.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/contact/index.html b/site/api/contact/index.html deleted file mode 100644 index 862fcf2..0000000 --- a/site/api/contact/index.html +++ /dev/null @@ -1,2151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Contact Namespace - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Contact Namespace (client.contact)

-

Use this namespace for user discovery, registration checks, and profile picture metadata.

-
-

When to use this namespace

-

Use client.contact before sending high-value outbound messages so you can validate registration and enrich context.

-
-

Method Matrix

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodInputOutputNotes
get_info(phones)list[str] (phone numbers)list[ContactInfo]Batch phone lookup
get_user_info(jid)JIDdict[JID, UserInfo]Rich user profile map
get_profile_picture(jid, preview)JID, boolProfilePicturePreview/full modes
is_on_whatsapp(jids)list[JID]list[IsOnWhatsAppResult]Registration verification
-

Technical Notes

-
-
-
-
    -
  • Keep phone values normalized (E.164-style digits without separators where possible).
  • -
  • Use JID(user="<phone>", server="s.whatsapp.net") for direct identity checks.
  • -
  • Batch operations are better than one-by-one calls for throughput.
  • -
-
-
-
    -
  • ContactInfo may include status and business flags.
  • -
  • UserInfo returns richer metadata and can include lid mappings.
  • -
  • ProfilePicture may contain URLs and identifier metadata; treat missing fields as valid state.
  • -
-
-
-
-

Runnable Example: Registration Gate

-
from tryx.events import EvMessage
-from tryx.types import JID
-
-
-@bot.on(EvMessage)
-async def on_lookup(client, event):
-    text = (event.data.get_text() or "").strip()
-    if not text.startswith("/check "):
-        return
-
-    phone = text.split(maxsplit=1)[1]
-    target = JID(user=phone, server="s.whatsapp.net")
-
-    result = await client.contact.is_on_whatsapp([target])
-    row = result[0]
-
-    chat = event.data.message_info.source.chat
-    if row.is_registered:
-        await client.send_text(chat, f"{phone} is registered")
-    else:
-        await client.send_text(chat, f"{phone} is not registered")
-
-

Advanced Example: Enrichment Before Outreach

-
async def enrich_contacts(client, phones: list[str]) -> dict[str, str]:
-    rows = await client.contact.get_info(phones)
-    out = {}
-    for row in rows:
-        kind = "business" if row.is_business else "personal"
-        out[row.jid.user] = f"{kind} | status={row.status or '-'}"
-    return out
-
-
-

Common Pitfalls

-
    -
  • Do not assume every lookup returns a profile picture.
  • -
  • Avoid repeated single-item calls in loops; use batch methods.
  • -
  • Treat optional fields (status, picture_id, lid) as nullable.
  • -
-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/events/index.html b/site/api/events/index.html deleted file mode 100644 index 541c3dd..0000000 --- a/site/api/events/index.html +++ /dev/null @@ -1,2352 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Events API - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Events API

-

This page maps event classes in tryx.events to practical handler strategies.

-

Dispatcher Contract

-

Dispatcher is used internally by Tryx and by @bot.on(EventClass) registration.

-
@bot.on(EvMessage)
-async def on_message(client, event):
-    ...
-
-
-

Handler model

-

Keep handlers small, push expensive work into background tasks, and treat incoming event payloads as typed contracts.

-
-

Event Taxonomy

-

Lifecycle

-
    -
  • EvConnected
  • -
  • EvDisconnected
  • -
  • EvLoggedOut
  • -
  • EvStreamReplaced
  • -
  • EvClientOutDated
  • -
-

Pairing

-
    -
  • EvPairingQrCode
  • -
  • EvPairingCode
  • -
  • EvPairSuccess
  • -
  • EvPairError
  • -
-

Messaging

-
    -
  • EvMessage
  • -
  • EvReceipt
  • -
  • EvUndecryptableMessage
  • -
  • EvNotification
  • -
-

Sync Actions

-
    -
  • EvPinUpdate
  • -
  • EvMuteUpdate
  • -
  • EvArchiveUpdate
  • -
  • EvMarkChatAsReadUpdate
  • -
  • EvDeleteChatUpdate
  • -
  • EvDeleteMessageForMeUpdate
  • -
  • EvStarUpdate
  • -
  • EvContactUpdate
  • -
-

Contact, Profile, Presence

-
    -
  • EvPushNameUpdate
  • -
  • EvSelfPushNameUpdated
  • -
  • EvUserAboutUpdate
  • -
  • EvPictureUpdate
  • -
  • EvPresence
  • -
  • EvChatPresence
  • -
  • EvContactUpdated
  • -
  • EvContactNumberChanged
  • -
  • EvContactSyncRequested
  • -
-

Device and Business

-
    -
  • EvDeviceListUpdate
  • -
  • EvBusinessStatusUpdate
  • -
-

Group and Newsletter

-
    -
  • EvJoinedGroup
  • -
  • EvGroupInfoUpdate
  • -
  • EvGroupUpdate
  • -
  • EvNewsletterLiveUpdate
  • -
-

Event-to-Namespace Mapping

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Event familyNamespace actions usually paired
MessagingChat Actions, Contact, root send methods
Group updatesGroups, Community
Newsletter updatesNewsletter, Polls
Presence updatesPresence, Chatstate
Profile updatesProfile, Privacy
-

Payload Discipline

-
-
-
-
    -
  • Read typed fields from event.data.
  • -
  • Guard optional values (None) before usage.
  • -
  • Log identity metadata (chat_jid, sender, message_id) for observability.
  • -
-
-
-
    -
  • Parsing raw protobuf bytes when typed fields already exist.
  • -
  • Long blocking work inside handler coroutine.
  • -
  • Assuming strict order between unrelated event classes.
  • -
-
-
-
-

Example: Safe Event Router

-
from tryx.events import EvMessage, EvPresence
-
-
-@bot.on(EvMessage)
-async def on_message(client, event):
-    chat = event.data.message_info.source.chat
-    text = event.data.get_text() or ""
-    if text == "/ping":
-        await client.send_text(chat, "pong", quoted=event)
-
-
-@bot.on(EvPresence)
-async def on_presence(client, event):
-    # keep side effects minimal; enqueue heavy processing
-    pass
-
-

Enum-like Support Types

-

Common reason/state classes used by event payloads:

-
    -
  • TempBanReason
  • -
  • ReceiptType
  • -
  • UnavailableType
  • -
  • DecryptFailMode
  • -
  • ChatPresence, ChatPresenceMedia
  • -
  • DeviceListUpdateType
  • -
  • BusinessStatusUpdateType
  • -
  • GroupNotificationAction
  • -
-
-

Reliability

-

Treat sync events as convergence signals, not anomalies. They are expected in multi-device behavior.

-
- - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/groups/index.html b/site/api/groups/index.html deleted file mode 100644 index 2b96ce6..0000000 --- a/site/api/groups/index.html +++ /dev/null @@ -1,2117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Groups Namespace - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Groups Namespace (client.groups)

-

client.groups covers group lifecycle, membership controls, invite flows, and moderation primitives.

-
-

Scope

-

Use this namespace for normal groups. For community-parent orchestration, pair this page with Community Namespace.

-
-

Method Families

-
-
-
-
    -
  • create_group(options)
  • -
  • leave(jid)
  • -
  • query_info(jid)
  • -
  • get_participating()
  • -
  • get_metadata(jid)
  • -
-
-
-
    -
  • set_subject(jid, subject)
  • -
  • set_description(jid, description=None, prev=None)
  • -
  • set_locked(jid, locked)
  • -
  • set_announce(jid, announce)
  • -
  • set_ephemeral(jid, expiration)
  • -
  • set_member_add_mode(jid, mode)
  • -
  • set_membership_approval(jid, mode)
  • -
-
-
-
    -
  • add_participants(jid, participants)
  • -
  • remove_participants(jid, participants)
  • -
  • promote_participants(jid, participants)
  • -
  • demote_participants(jid, participants)
  • -
  • get_membership_requests(jid)
  • -
  • approve_membership_requests(jid, participants)
  • -
  • reject_membership_requests(jid, participants)
  • -
-
-
-
    -
  • get_invite_link(jid, reset)
  • -
  • join_with_invite_code(code)
  • -
  • join_with_invite_v4(group_jid, code, expiration, admin_jid)
  • -
  • get_invite_info(code)
  • -
-
-
-
-

Runnable Example: Group Setup Playbook

-
from tryx.client import CreateGroupOptions, GroupParticipantOptions, MembershipApprovalMode
-
-
-async def setup_group(client, title, member_jids):
-    participants = [GroupParticipantOptions(jid=jid) for jid in member_jids]
-    options = CreateGroupOptions(subject=title, participants=participants)
-
-    created = await client.groups.create_group(options)
-    gid = created.gid
-
-    await client.groups.set_announce(gid, True)
-    await client.groups.set_membership_approval(gid, MembershipApprovalMode.On)
-    await client.groups.set_ephemeral(gid, 604800)
-    return gid
-
-

Runnable Example: Membership Queue Handler

-
async def process_requests(client, group_jid):
-    pending = await client.groups.get_membership_requests(group_jid)
-    if not pending:
-        return {"approved": 0, "rejected": 0}
-
-    approve = [row.jid for row in pending[:10]]
-    reject = [row.jid for row in pending[10:]]
-
-    await client.groups.approve_membership_requests(group_jid, approve)
-    if reject:
-        await client.groups.reject_membership_requests(group_jid, reject)
-
-    return {"approved": len(approve), "rejected": len(reject)}
-
-
-

Partial success is valid

-

Participant mutations can return per-user status via ParticipantChangeResponse. -Always inspect each response item and do not treat list-returning calls as all-or-nothing.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/helpers/index.html b/site/api/helpers/index.html deleted file mode 100644 index 05b5ed6..0000000 --- a/site/api/helpers/index.html +++ /dev/null @@ -1,2298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Helpers API - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
- -
- - - -
-
- - - - - - - - -

Helpers API

-

Helpers in tryx.helpers are stateless utility surfaces for builders, enum defaults, and payload conversion.

-
-

Design intent

-

Use helpers for deterministic object construction and conversion logic. Keep side effects in client namespace calls.

-
-

NewsletterHelpers

- - - - - - - - - - - - - - - - - - - - - -
MethodReturn
parse_message(data)MessageProto
serialize_message(message)bytes
build_text_message(text)MessageProto
-
from tryx.helpers import NewsletterHelpers
-
-proto = NewsletterHelpers.build_text_message("Release update")
-blob = NewsletterHelpers.serialize_message(proto)
-restored = NewsletterHelpers.parse_message(blob)
-
-

GroupsHelpers

- - - - - - - - - - - - - - - - - - - - - -
MethodPurpose
strip_invite_url(code)Normalize invite URL/code
build_participant(...)Build GroupParticipantOptions
build_create_options(...)Build CreateGroupOptions
-
from tryx.helpers import GroupsHelpers
-
-participant = GroupsHelpers.build_participant(jid=target_jid)
-opts = GroupsHelpers.build_create_options(subject="Ops Room", participants=[participant])
-result = await client.groups.create_group(opts)
-
-

StatusHelpers

- - - - - - - - - - - - - - - - - -
MethodReturn
build_send_options(privacy=...)StatusSendOptions
default_privacy()StatusPrivacySetting
-
from tryx.helpers import StatusHelpers
-
-options = StatusHelpers.build_send_options()
-await client.status.send_text("status", 0xFF1F9D86, 1, recipients, options=options)
-
-

ChatstateHelpers

- - - - - - - - - - - - - - - - - - - - - -
MethodReturn
composing()ChatStateType.Composing
recording()ChatStateType.Recording
paused()ChatStateType.Paused
-
from tryx.helpers import ChatstateHelpers
-
-await client.chatstate.send(chat_jid, ChatstateHelpers.composing())
-
-

BlockingHelpers

- - - - - - - - - - - - - -
MethodReturn
same_user(a, b)bool
-
from tryx.helpers import BlockingHelpers
-
-if BlockingHelpers.same_user(a, b):
-    print("Equivalent identity")
-
-

PollsHelpers

- - - - - - - - - - - - - - - - - -
MethodReturn
decrypt_vote(...)list[bytes]
aggregate_votes(...)list[PollOptionResult]
-
from tryx.helpers import PollsHelpers
-
-decoded = PollsHelpers.decrypt_vote(enc_payload, enc_iv, secret, poll_id, creator_jid, voter_jid)
-
-

PresenceHelpers

- - - - - - - - - - - - - -
MethodReturn
default_status()PresenceStatus
-
from tryx.helpers import PresenceHelpers
-
-await client.presence.set(PresenceHelpers.default_status())
-
-

Integration Map

-
-
-
-

Use helpers before calling: -- Groups Namespace -- Status Namespace

-
-
-

Use helpers with: -- Polls Namespace -- Newsletter Namespace

-
-
-

Use helpers with: -- Chatstate Namespace -- Presence Namespace

-
-
-
-
-

Avoid mixing concerns

-

Helpers should not replace runtime validation. Keep business rules in handler/service layers.

-
- - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/newsletter/index.html b/site/api/newsletter/index.html deleted file mode 100644 index be609dd..0000000 --- a/site/api/newsletter/index.html +++ /dev/null @@ -1,2147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Newsletter Namespace - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Newsletter Namespace (client.newsletter)

-

client.newsletter manages newsletter/channel discovery, join/leave, messaging, reactions, and message history.

-

Method Matrix

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodPurpose
list_subscribed()List subscriptions
get_metadata(jid)Metadata by newsletter JID
get_metadata_by_invite(invite_code)Metadata via invite code
create(name, description=None)Create a newsletter
join(jid) / leave(jid)Membership lifecycle
update(jid, name=None, description=None)Edit metadata
subscribe_live_updates(jid)Enable live updates stream
send_message(jid, message)Publish message
send_reaction(jid, server_id, reaction)React to a message
get_messages(jid, count, before=None)Fetch history window
-

Runnable Example: Subscribe and Post

-
from tryx.helpers import NewsletterHelpers
-
-
-async def post_update(client, invite_code: str, text: str):
-    metadata = await client.newsletter.get_metadata_by_invite(invite_code)
-    await client.newsletter.join(metadata.jid)
-
-    message = NewsletterHelpers.build_text_message(text)
-    server_message_id = await client.newsletter.send_message(metadata.jid, message)
-    return metadata.name, server_message_id
-
-

Runnable Example: History Query Window

-
async def pull_recent(client, newsletter_jid, count=20):
-    rows = await client.newsletter.get_messages(newsletter_jid, count)
-    return [
-        {
-            "server_id": row.server_id,
-            "type": row.message_type,
-            "timestamp": row.timestamp,
-        }
-        for row in rows
-    ]
-
-

Technical Guidance

-
-
-
-
    -
  • Build protobuf messages using Helpers API when possible.
  • -
  • Keep content idempotent if handlers might retry.
  • -
-
-
-
    -
  • Use before cursor for backfill pagination.
  • -
  • Treat message type variants as dynamic; not every row is plain text.
  • -
-
-
-
-
-

Live updates

-

Pair subscribe_live_updates with event handlers so your process can react to new newsletter activity without polling loops.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/polls/index.html b/site/api/polls/index.html deleted file mode 100644 index f87bac7..0000000 --- a/site/api/polls/index.html +++ /dev/null @@ -1,2128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Polls Namespace - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Polls Namespace (client.polls)

-

client.polls supports encrypted poll workflows: create, vote, decrypt, and aggregate.

-
-

Crypto lifecycle

-

create(...) returns (poll_msg_id, message_secret). Persist both values if you plan to decrypt and aggregate votes later.

-
-

Method Matrix

- - - - - - - - - - - - - - - - - - - - - - - - - -
MethodPurpose
create(to, name, options, selectable_count)Create poll and return secret
vote(chat_jid, poll_msg_id, poll_creator_jid, message_secret, option_names)Submit encrypted vote
decrypt_vote(...)Decrypt one encrypted vote payload
aggregate_votes(...)Compute per-option tally from encrypted vote rows
-

Runnable Example: Create + Vote

-
from tryx.types import JID
-
-
-async def create_poll(client, chat: JID):
-    poll_id, secret = await client.polls.create(
-        to=chat,
-        name="Deploy window?",
-        options=["Tonight", "Tomorrow", "Next week"],
-        selectable_count=1,
-    )
-    return poll_id, secret
-
-
-async def cast_vote(client, chat, poll_id, creator_jid, secret):
-    return await client.polls.vote(
-        chat_jid=chat,
-        poll_msg_id=poll_id,
-        poll_creator_jid=creator_jid,
-        message_secret=secret,
-        option_names=["Tomorrow"],
-    )
-
-

Runnable Example: Aggregate Encrypted Votes

-
from tryx.types import JID
-
-
-async def tally(client, poll_options, encrypted_rows, secret, poll_id, creator_jid: JID):
-    # encrypted_rows: list[tuple[JID, bytes, bytes]]
-    return client.polls.aggregate_votes(
-        poll_options=poll_options,
-        votes=encrypted_rows,
-        message_secret=secret,
-        poll_msg_id=poll_id,
-        poll_creator_jid=creator_jid,
-    )
-
-

Pitfalls and Controls

-
-

Secret management

-

If message_secret is lost, vote decryption and tallying are no longer possible for that poll.

-
-
-

Storage strategy

-

Store (poll_msg_id, message_secret) in durable backend storage keyed by chat and poll creator identity.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/presence/index.html b/site/api/presence/index.html deleted file mode 100644 index c4db5e8..0000000 --- a/site/api/presence/index.html +++ /dev/null @@ -1,2127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Presence Namespace - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
- -
-
- - - -
-
- - - - - - - - -

Presence Namespace (client.presence)

-

client.presence publishes your presence state and subscribes to contact presence updates.

-

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodPurpose
set(status)Explicitly set PresenceStatus
set_available()Shortcut to available
set_unavailable()Shortcut to unavailable
subscribe(jid)Subscribe to one user's presence
unsubscribe(jid)Stop receiving presence updates
-

Presence Status Values

-
    -
  • PresenceStatus.Available
  • -
  • PresenceStatus.Unavailable
  • -
-

Runnable Example: Presence Monitoring

-
from tryx.events import EvMessage
-from tryx.types import JID
-
-
-@bot.on(EvMessage)
-async def monitor_presence(client, event):
-    text = (event.data.get_text() or "").strip()
-    chat = event.data.message_info.source.chat
-
-    if text.startswith("/presence watch "):
-        phone = text.split(maxsplit=2)[2]
-        target = JID(user=phone, server="s.whatsapp.net")
-        await client.presence.subscribe(target)
-        await client.send_text(chat, f"Subscribed to {phone} presence")
-    elif text.startswith("/presence unwatch "):
-        phone = text.split(maxsplit=2)[2]
-        target = JID(user=phone, server="s.whatsapp.net")
-        await client.presence.unsubscribe(target)
-        await client.send_text(chat, f"Unsubscribed {phone}")
-
-

Operational Guidance

-
-
-
-

Set your own baseline status explicitly on service start.

-
await client.presence.set_available()
-
-
-
-

Mark unavailable during graceful shutdown to reduce stale online state.

-
await client.presence.set_unavailable()
-
-
-
-
-
-

Subscription lifecycle

-

Reconnect flows can invalidate active subscriptions. Re-apply subscriptions after connection restoration.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/privacy/index.html b/site/api/privacy/index.html deleted file mode 100644 index 3e75130..0000000 --- a/site/api/privacy/index.html +++ /dev/null @@ -1,2209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Privacy Namespace - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Privacy Namespace (client.privacy)

-

Use client.privacy to read and mutate account privacy categories, disallowed lists, and default disappearing mode.

-

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - -
MethodPurpose
fetch_settings()Retrieve privacy category/value pairs
set_setting(category, value)Set one category privacy mode
set_disallowed_list(category, update)Add/remove disallowed users
set_default_disappearing_mode(duration_seconds)Set default disappearing timer
-

Core Enums

-

PrivacyCategory

-

Last, Online, Profile, Status, GroupAdd, ReadReceipts, CallAdd, Messages, DefenseMode, Other

-

PrivacyValue

-

All, Contacts, None_, ContactBlacklist, MatchLastSeen, Known, Off, OnStandard, Other

-

DisallowedListAction

-

Add, Remove

-

Runnable Example: Fetch and Render

-
async def dump_privacy(client):
-    rows = await client.privacy.fetch_settings()
-    return {str(row.category): str(row.value) for row in rows}
-
-

Runnable Example: Category + Disallowed Update

-
from tryx.client import DisallowedListAction, DisallowedListUpdate, DisallowedListUserEntry
-
-
-async def hide_status_from(client, target_jid):
-    await client.privacy.set_setting(category=PrivacyCategory.Status, value=PrivacyValue.ContactBlacklist)
-
-    update = DisallowedListUpdate(
-        dhash="",
-        users=[
-            DisallowedListUserEntry(
-                action=DisallowedListAction.Add,
-                jid=target_jid,
-            )
-        ],
-    )
-    await client.privacy.set_disallowed_list(PrivacyCategory.Status, update)
-
-

Runnable Example: Default Disappearing Mode

-
# 0 = off, 86400 = 1 day, 604800 = 1 week, 7776000 = 90 days
-await client.privacy.set_default_disappearing_mode(604800)
-
-
-

Race-safe updates

-

Keep track of list versioning strategy (dhash) in your own domain logic when doing frequent disallowed-list writes.

-
-
-

Do not hardcode assumptions

-

Category/value compatibility can evolve. Validate behavior in staging before broad production rollout.

-
-
-Advanced: dhash handling strategy -

For high-frequency disallowed-list writes, keep the latest successful dhash per PrivacyCategory. -If server-side conflict appears, refresh settings and retry once with an updated list snapshot.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/profile/index.html b/site/api/profile/index.html deleted file mode 100644 index 24e8b35..0000000 --- a/site/api/profile/index.html +++ /dev/null @@ -1,2124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Profile Namespace - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Profile Namespace (client.profile)

-

client.profile controls account-facing profile presentation.

-

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - -
MethodPurpose
set_push_name(name)Update display/push name
set_status_text(text)Update profile status/about text
set_profile_picture(image_data)Upload and set profile picture
remove_profile_picture()Remove profile picture
-

Runnable Example: Admin Profile Commands

-
from tryx.events import EvMessage
-
-
-@bot.on(EvMessage)
-async def profile_admin(client, event):
-    text = (event.data.get_text() or "").strip()
-    chat = event.data.message_info.source.chat
-
-    if text.startswith("/profile name "):
-        value = text.split(maxsplit=2)[2]
-        await client.profile.set_push_name(value)
-        await client.send_text(chat, "Push name updated")
-
-    elif text.startswith("/profile status "):
-        value = text.split(maxsplit=2)[2]
-        await client.profile.set_status_text(value)
-        await client.send_text(chat, "Status text updated")
-
-

Runnable Example: Picture Rotation

-
async def rotate_profile_picture(client, image_bytes):
-    pic_id = await client.profile.set_profile_picture(image_bytes)
-    return {"picture_id": pic_id}
-
-

Operational Notes

-
-
-
-
    -
  1. Read desired profile state from config.
  2. -
  3. Apply updates during startup.
  4. -
  5. Use explicit admin commands for runtime changes.
  6. -
-
-
-
    -
  • Keep raw image bytes validated and size-limited before upload.
  • -
  • Log profile mutations with operator identity.
  • -
-
-
-
-
-

Consistency

-

Couple profile changes with privacy policy reviews if your bot identity is user-facing.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/status/index.html b/site/api/status/index.html deleted file mode 100644 index 736526c..0000000 --- a/site/api/status/index.html +++ /dev/null @@ -1,2123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Status Namespace - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
- -
- - - -
-
- - - - - - - - -

Status Namespace (client.status)

-

Use client.status to publish ephemeral status content and control audience privacy.

-

Core Types

-
    -
  • StatusPrivacySetting: Contacts, AllowList, DenyList
  • -
  • StatusSendOptions(privacy=...)
  • -
-

Method Matrix

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodPurpose
send_text(text, background_argb, font, recipients, options=None)Publish text status
send_image(upload, thumbnail, recipients, caption=None, options=None)Publish image status
send_video(upload, thumbnail, duration_seconds, recipients, caption=None, options=None)Publish video status
send_raw(message, recipients, options=None)Publish custom raw message payload
revoke(message_id, recipients, options=None)Revoke previously published status
default_privacy()Default privacy helper
-

Runnable Example: Text Status Broadcast

-
from tryx.client import StatusSendOptions, StatusPrivacySetting
-
-
-async def publish_status(client, recipients, text):
-    options = StatusSendOptions(privacy=StatusPrivacySetting.Contacts)
-    message_id = await client.status.send_text(
-        text=text,
-        background_argb=0xFF1F9D86,
-        font=1,
-        recipients=recipients,
-        options=options,
-    )
-    return message_id
-
-

Runnable Example: Media Status

-
from tryx.wacore import MediaType
-
-
-async def publish_image_status(client, recipients, image_path, thumbnail_bytes):
-    upload = await client.upload_file(image_path, MediaType.Image)
-    return await client.status.send_image(
-        upload=upload,
-        thumbnail=thumbnail_bytes,
-        recipients=recipients,
-        caption="Weekly update",
-    )
-
-
-

Privacy-first workflow

-

Fetch and enforce your privacy model before status publication, especially in mixed audiences.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/types/index.html b/site/api/types/index.html deleted file mode 100644 index a51d970..0000000 --- a/site/api/types/index.html +++ /dev/null @@ -1,2201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Types API - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Types API

-

Core value objects in tryx.types define identity, message metadata, and result contracts used across client namespaces.

-

Identity and Source Types

-

JID

-

Canonical WhatsApp identifier:

-
    -
  • user: account or group numeric/opaque id
  • -
  • server: domain segment (s.whatsapp.net, g.us, etc.)
  • -
-

MessageSource

-

Routing context for a message:

-
    -
  • sender identity
  • -
  • target chat identity
  • -
  • from-me and group flags
  • -
  • alternate identity hints for multi-device routing
  • -
-

MessageInfo

-

Message metadata envelope:

-
    -
  • id
  • -
  • type
  • -
  • timestamp
  • -
  • source
  • -
  • edit and verification metadata
  • -
-

Send and Media Result Types

- - - - - - - - - - - - - - - - - - - - - - - - - -
TypeProduced by
UploadResponseupload, upload_file
SendResultsend_* methods
MediaReuploadResultrequest_media_reupload
ProfilePictureclient.contact.get_profile_picture
-

Advanced Metadata Types

-
    -
  • MsgBotInfo
  • -
  • MsgMetaInfo
  • -
  • DeviceSentMeta
  • -
-

These are useful when building sync-aware systems and diagnostics.

-

Practical Typed Patterns

-
-
-
-
from tryx.events import EvMessage
-from tryx.types import JID
-
-
-def source_chat(event: EvMessage) -> JID:
-    return event.data.message_info.source.chat
-
-
-
-
async def send_with_audit(client, chat, text):
-    result = await client.send_text(chat, text)
-    return {"message_id": result.id, "ts": result.timestamp}
-
-
-
-
-

Privacy Type Bridge

-

Privacy and status workflows (documented in Privacy Namespace and Status Namespace) rely on typed enums from the client surface, including:

-
    -
  • PrivacyCategory
  • -
  • PrivacyValue
  • -
  • DisallowedListAction
  • -
  • StatusPrivacySetting
  • -
-
-

Type-first architecture

-

Keep handler boundaries typed. Convert external payloads into typed objects early, and keep business logic free of ad-hoc dict parsing.

-
- - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/api/wacore/index.html b/site/api/wacore/index.html deleted file mode 100644 index d9b5ed6..0000000 --- a/site/api/wacore/index.html +++ /dev/null @@ -1,2046 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - WACore API - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - -

WACore API

-

tryx.wacore exposes lower-level protocol-facing types.

-

MediaType

-

Enum for media upload/download classification.

-

Node Tree Types

-
    -
  • NodeValue
  • -
  • NodeContent
  • -
  • Attrs
  • -
  • Node
  • -
-

These are useful for advanced debugging or when you need access to protocol node shape in events such as stream errors or notifications.

-

Business and Key Metadata

-
    -
  • KeyIndexInfo
  • -
  • BusinessSubscription
  • -
-

These appear in device/business sync event payloads.

-

When to Use WACore Types

-

Use these types only when high-level client/event abstractions are not enough. -For normal bot logic, prefer typed event payload objects and client namespace methods.

- - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/assets/images/favicon.png b/site/assets/images/favicon.png deleted file mode 100644 index 1cf13b9f9d978896599290a74f77d5dbe7d1655c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1870 zcmV-U2eJ5xP)Gc)JR9QMau)O=X#!i9;T z37kk-upj^(fsR36MHs_+1RCI)NNu9}lD0S{B^g8PN?Ww(5|~L#Ng*g{WsqleV}|#l zz8@ri&cTzw_h33bHI+12+kK6WN$h#n5cD8OQt`5kw6p~9H3()bUQ8OS4Q4HTQ=1Ol z_JAocz`fLbT2^{`8n~UAo=#AUOf=SOq4pYkt;XbC&f#7lb$*7=$na!mWCQ`dBQsO0 zLFBSPj*N?#u5&pf2t4XjEGH|=pPQ8xh7tpx;US5Cx_Ju;!O`ya-yF`)b%TEt5>eP1ZX~}sjjA%FJF?h7cX8=b!DZl<6%Cv z*G0uvvU+vmnpLZ2paivG-(cd*y3$hCIcsZcYOGh{$&)A6*XX&kXZd3G8m)G$Zz-LV z^GF3VAW^Mdv!)4OM8EgqRiz~*Cji;uzl2uC9^=8I84vNp;ltJ|q-*uQwGp2ma6cY7 z;`%`!9UXO@fr&Ebapfs34OmS9^u6$)bJxrucutf>`dKPKT%%*d3XlFVKunp9 zasduxjrjs>f8V=D|J=XNZp;_Zy^WgQ$9WDjgY=z@stwiEBm9u5*|34&1Na8BMjjgf3+SHcr`5~>oz1Y?SW^=K z^bTyO6>Gar#P_W2gEMwq)ot3; zREHn~U&Dp0l6YT0&k-wLwYjb?5zGK`W6S2v+K>AM(95m2C20L|3m~rN8dprPr@t)5lsk9Hu*W z?pS990s;Ez=+Rj{x7p``4>+c0G5^pYnB1^!TL=(?HLHZ+HicG{~4F1d^5Awl_2!1jICM-!9eoLhbbT^;yHcefyTAaqRcY zmuctDopPT!%k+}x%lZRKnzykr2}}XfG_ne?nRQO~?%hkzo;@RN{P6o`&mMUWBYMTe z6i8ChtjX&gXl`nvrU>jah)2iNM%JdjqoaeaU%yVn!^70x-flljp6Q5tK}5}&X8&&G zX3fpb3E(!rH=zVI_9Gjl45w@{(ITqngWFe7@9{mX;tO25Z_8 zQHEpI+FkTU#4xu>RkN>b3Tnc3UpWzPXWm#o55GKF09j^Mh~)K7{QqbO_~(@CVq! zS<8954|P8mXN2MRs86xZ&Q4EfM@JB94b=(YGuk)s&^jiSF=t3*oNK3`rD{H`yQ?d; ztE=laAUoZx5?RC8*WKOj`%LXEkgDd>&^Q4M^z`%u0rg-It=hLCVsq!Z%^6eB-OvOT zFZ28TN&cRmgU}Elrnk43)!>Z1FCPL2K$7}gwzIc48NX}#!A1BpJP?#v5wkNprhV** z?Cpalt1oH&{r!o3eSKc&ap)iz2BTn_VV`4>9M^b3;(YY}4>#ML6{~(4mH+?%07*qo IM6N<$f(jP3KmY&$ diff --git a/site/assets/javascripts/lunr/min/lunr.ar.min.js b/site/assets/javascripts/lunr/min/lunr.ar.min.js deleted file mode 100644 index 9b06c26..0000000 --- a/site/assets/javascripts/lunr/min/lunr.ar.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ar=function(){this.pipeline.reset(),this.pipeline.add(e.ar.trimmer,e.ar.stopWordFilter,e.ar.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ar.stemmer))},e.ar.wordCharacters="ء-ٛٱـ",e.ar.trimmer=e.trimmerSupport.generateTrimmer(e.ar.wordCharacters),e.Pipeline.registerFunction(e.ar.trimmer,"trimmer-ar"),e.ar.stemmer=function(){var e=this;return e.result=!1,e.preRemoved=!1,e.sufRemoved=!1,e.pre={pre1:"ف ك ب و س ل ن ا ي ت",pre2:"ال لل",pre3:"بال وال فال تال كال ولل",pre4:"فبال كبال وبال وكال"},e.suf={suf1:"ه ك ت ن ا ي",suf2:"نك نه ها وك يا اه ون ين تن تم نا وا ان كم كن ني نن ما هم هن تك ته ات يه",suf3:"تين كهم نيه نهم ونه وها يهم ونا ونك وني وهم تكم تنا تها تني تهم كما كها ناه نكم هنا تان يها",suf4:"كموه ناها ونني ونهم تكما تموه تكاه كماه ناكم ناهم نيها وننا"},e.patterns=JSON.parse('{"pt43":[{"pt":[{"c":"ا","l":1}]},{"pt":[{"c":"ا,ت,ن,ي","l":0}],"mPt":[{"c":"ف","l":0,"m":1},{"c":"ع","l":1,"m":2},{"c":"ل","l":2,"m":3}]},{"pt":[{"c":"و","l":2}],"mPt":[{"c":"ف","l":0,"m":0},{"c":"ع","l":1,"m":1},{"c":"ل","l":2,"m":3}]},{"pt":[{"c":"ا","l":2}]},{"pt":[{"c":"ي","l":2}],"mPt":[{"c":"ف","l":0,"m":0},{"c":"ع","l":1,"m":1},{"c":"ا","l":2},{"c":"ل","l":3,"m":3}]},{"pt":[{"c":"م","l":0}]}],"pt53":[{"pt":[{"c":"ت","l":0},{"c":"ا","l":2}]},{"pt":[{"c":"ا,ن,ت,ي","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":0},{"c":"ا","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":3},{"c":"ل","l":3,"m":4},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":0},{"c":"ا","l":3}],"mPt":[{"c":"ف","l":0,"m":1},{"c":"ع","l":1,"m":2},{"c":"ل","l":2,"m":4}]},{"pt":[{"c":"ا","l":3},{"c":"ن","l":4}]},{"pt":[{"c":"ت","l":0},{"c":"ي","l":3}]},{"pt":[{"c":"م","l":0},{"c":"و","l":3}]},{"pt":[{"c":"ا","l":1},{"c":"و","l":3}]},{"pt":[{"c":"و","l":1},{"c":"ا","l":2}]},{"pt":[{"c":"م","l":0},{"c":"ا","l":3}]},{"pt":[{"c":"م","l":0},{"c":"ي","l":3}]},{"pt":[{"c":"ا","l":2},{"c":"ن","l":3}]},{"pt":[{"c":"م","l":0},{"c":"ن","l":1}],"mPt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ف","l":2,"m":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"م","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"م","l":0},{"c":"ا","l":2}]},{"pt":[{"c":"م","l":1},{"c":"ا","l":3}]},{"pt":[{"c":"ي,ت,ا,ن","l":0},{"c":"ت","l":1}],"mPt":[{"c":"ف","l":0,"m":2},{"c":"ع","l":1,"m":3},{"c":"ا","l":2},{"c":"ل","l":3,"m":4}]},{"pt":[{"c":"ت,ي,ا,ن","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":2},{"c":"ي","l":3}]},{"pt":[{"c":"ا,ي,ت,ن","l":0},{"c":"ن","l":1}],"mPt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ف","l":2,"m":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":3},{"c":"ء","l":4}]}],"pt63":[{"pt":[{"c":"ا","l":0},{"c":"ت","l":2},{"c":"ا","l":4}]},{"pt":[{"c":"ا,ت,ن,ي","l":0},{"c":"س","l":1},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ف","l":3,"m":3},{"c":"ع","l":4,"m":4},{"c":"ا","l":5},{"c":"ل","l":6,"m":5}]},{"pt":[{"c":"ا,ن,ت,ي","l":0},{"c":"و","l":3}]},{"pt":[{"c":"م","l":0},{"c":"س","l":1},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ف","l":3,"m":3},{"c":"ع","l":4,"m":4},{"c":"ا","l":5},{"c":"ل","l":6,"m":5}]},{"pt":[{"c":"ي","l":1},{"c":"ي","l":3},{"c":"ا","l":4},{"c":"ء","l":5}]},{"pt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ا","l":4}]}],"pt54":[{"pt":[{"c":"ت","l":0}]},{"pt":[{"c":"ا,ي,ت,ن","l":0}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":2},{"c":"ل","l":3,"m":3},{"c":"ر","l":4,"m":4},{"c":"ا","l":5},{"c":"ر","l":6,"m":4}]},{"pt":[{"c":"م","l":0}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":2},{"c":"ل","l":3,"m":3},{"c":"ر","l":4,"m":4},{"c":"ا","l":5},{"c":"ر","l":6,"m":4}]},{"pt":[{"c":"ا","l":2}]},{"pt":[{"c":"ا","l":0},{"c":"ن","l":2}]}],"pt64":[{"pt":[{"c":"ا","l":0},{"c":"ا","l":4}]},{"pt":[{"c":"م","l":0},{"c":"ت","l":1}]}],"pt73":[{"pt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ا","l":5}]}],"pt75":[{"pt":[{"c":"ا","l":0},{"c":"ا","l":5}]}]}'),e.execArray=["cleanWord","removeDiacritics","cleanAlef","removeStopWords","normalizeHamzaAndAlef","removeStartWaw","removePre432","removeEndTaa","wordCheck"],e.stem=function(){var r=0;for(e.result=!1,e.preRemoved=!1,e.sufRemoved=!1;r=0)return!0},e.normalizeHamzaAndAlef=function(){return e.word=e.word.replace("ؤ","ء"),e.word=e.word.replace("ئ","ء"),e.word=e.word.replace(/([\u0627])\1+/gi,"ا"),!1},e.removeEndTaa=function(){return!(e.word.length>2)||(e.word=e.word.replace(/[\u0627]$/,""),e.word=e.word.replace("ة",""),!1)},e.removeStartWaw=function(){return e.word.length>3&&"و"==e.word[0]&&"و"==e.word[1]&&(e.word=e.word.slice(1)),!1},e.removePre432=function(){var r=e.word;if(e.word.length>=7){var t=new RegExp("^("+e.pre.pre4.split(" ").join("|")+")");e.word=e.word.replace(t,"")}if(e.word==r&&e.word.length>=6){var c=new RegExp("^("+e.pre.pre3.split(" ").join("|")+")");e.word=e.word.replace(c,"")}if(e.word==r&&e.word.length>=5){var l=new RegExp("^("+e.pre.pre2.split(" ").join("|")+")");e.word=e.word.replace(l,"")}return r!=e.word&&(e.preRemoved=!0),!1},e.patternCheck=function(r){for(var t=0;t3){var t=new RegExp("^("+e.pre.pre1.split(" ").join("|")+")");e.word=e.word.replace(t,"")}return r!=e.word&&(e.preRemoved=!0),!1},e.removeSuf1=function(){var r=e.word;if(0==e.sufRemoved&&e.word.length>3){var t=new RegExp("("+e.suf.suf1.split(" ").join("|")+")$");e.word=e.word.replace(t,"")}return r!=e.word&&(e.sufRemoved=!0),!1},e.removeSuf432=function(){var r=e.word;if(e.word.length>=6){var t=new RegExp("("+e.suf.suf4.split(" ").join("|")+")$");e.word=e.word.replace(t,"")}if(e.word==r&&e.word.length>=5){var c=new RegExp("("+e.suf.suf3.split(" ").join("|")+")$");e.word=e.word.replace(c,"")}if(e.word==r&&e.word.length>=4){var l=new RegExp("("+e.suf.suf2.split(" ").join("|")+")$");e.word=e.word.replace(l,"")}return r!=e.word&&(e.sufRemoved=!0),!1},e.wordCheck=function(){for(var r=(e.word,[e.removeSuf432,e.removeSuf1,e.removePre1]),t=0,c=!1;e.word.length>=7&&!e.result&&t=f.limit)return;f.cursor++}for(;!f.out_grouping(w,97,248);){if(f.cursor>=f.limit)return;f.cursor++}d=f.cursor,d=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(c,32),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del();break;case 2:f.in_grouping_b(p,97,229)&&f.slice_del()}}function t(){var e,r=f.limit-f.cursor;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.find_among_b(l,4)?(f.bra=f.cursor,f.limit_backward=e,f.cursor=f.limit-r,f.cursor>f.limit_backward&&(f.cursor--,f.bra=f.cursor,f.slice_del())):f.limit_backward=e)}function s(){var e,r,i,n=f.limit-f.cursor;if(f.ket=f.cursor,f.eq_s_b(2,"st")&&(f.bra=f.cursor,f.eq_s_b(2,"ig")&&f.slice_del()),f.cursor=f.limit-n,f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(m,5),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del(),i=f.limit-f.cursor,t(),f.cursor=f.limit-i;break;case 2:f.slice_from("løs")}}function o(){var e;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.out_grouping_b(w,97,248)?(f.bra=f.cursor,u=f.slice_to(u),f.limit_backward=e,f.eq_v_b(u)&&f.slice_del()):f.limit_backward=e)}var a,d,u,c=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],l=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],w=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],p=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],f=new i;this.setCurrent=function(e){f.setCurrent(e)},this.getCurrent=function(){return f.getCurrent()},this.stem=function(){var r=f.cursor;return e(),f.limit_backward=r,f.cursor=f.limit,n(),f.cursor=f.limit,t(),f.cursor=f.limit,s(),f.cursor=f.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.de.min.js b/site/assets/javascripts/lunr/min/lunr.de.min.js deleted file mode 100644 index f3b5c10..0000000 --- a/site/assets/javascripts/lunr/min/lunr.de.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Lunr languages, `German` language - * https://github.com/MihaiValentin/lunr-languages - * - * Copyright 2014, Mihai Valentin - * http://www.mozilla.org/MPL/ - */ -/*! - * based on - * Snowball JavaScript Library v0.3 - * http://code.google.com/p/urim/ - * http://snowball.tartarus.org/ - * - * Copyright 2010, Oleg Mazko - * http://www.mozilla.org/MPL/ - */ - -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.de=function(){this.pipeline.reset(),this.pipeline.add(e.de.trimmer,e.de.stopWordFilter,e.de.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.de.stemmer))},e.de.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.de.trimmer=e.trimmerSupport.generateTrimmer(e.de.wordCharacters),e.Pipeline.registerFunction(e.de.trimmer,"trimmer-de"),e.de.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(e,r,n){return!(!v.eq_s(1,e)||(v.ket=v.cursor,!v.in_grouping(p,97,252)))&&(v.slice_from(r),v.cursor=n,!0)}function i(){for(var r,n,i,s,t=v.cursor;;)if(r=v.cursor,v.bra=r,v.eq_s(1,"ß"))v.ket=v.cursor,v.slice_from("ss");else{if(r>=v.limit)break;v.cursor=r+1}for(v.cursor=t;;)for(n=v.cursor;;){if(i=v.cursor,v.in_grouping(p,97,252)){if(s=v.cursor,v.bra=s,e("u","U",i))break;if(v.cursor=s,e("y","Y",i))break}if(i>=v.limit)return void(v.cursor=n);v.cursor=i+1}}function s(){for(;!v.in_grouping(p,97,252);){if(v.cursor>=v.limit)return!0;v.cursor++}for(;!v.out_grouping(p,97,252);){if(v.cursor>=v.limit)return!0;v.cursor++}return!1}function t(){m=v.limit,l=m;var e=v.cursor+3;0<=e&&e<=v.limit&&(d=e,s()||(m=v.cursor,m=v.limit)return;v.cursor++}}}function c(){return m<=v.cursor}function u(){return l<=v.cursor}function a(){var e,r,n,i,s=v.limit-v.cursor;if(v.ket=v.cursor,(e=v.find_among_b(w,7))&&(v.bra=v.cursor,c()))switch(e){case 1:v.slice_del();break;case 2:v.slice_del(),v.ket=v.cursor,v.eq_s_b(1,"s")&&(v.bra=v.cursor,v.eq_s_b(3,"nis")&&v.slice_del());break;case 3:v.in_grouping_b(g,98,116)&&v.slice_del()}if(v.cursor=v.limit-s,v.ket=v.cursor,(e=v.find_among_b(f,4))&&(v.bra=v.cursor,c()))switch(e){case 1:v.slice_del();break;case 2:if(v.in_grouping_b(k,98,116)){var t=v.cursor-3;v.limit_backward<=t&&t<=v.limit&&(v.cursor=t,v.slice_del())}}if(v.cursor=v.limit-s,v.ket=v.cursor,(e=v.find_among_b(_,8))&&(v.bra=v.cursor,u()))switch(e){case 1:v.slice_del(),v.ket=v.cursor,v.eq_s_b(2,"ig")&&(v.bra=v.cursor,r=v.limit-v.cursor,v.eq_s_b(1,"e")||(v.cursor=v.limit-r,u()&&v.slice_del()));break;case 2:n=v.limit-v.cursor,v.eq_s_b(1,"e")||(v.cursor=v.limit-n,v.slice_del());break;case 3:if(v.slice_del(),v.ket=v.cursor,i=v.limit-v.cursor,!v.eq_s_b(2,"er")&&(v.cursor=v.limit-i,!v.eq_s_b(2,"en")))break;v.bra=v.cursor,c()&&v.slice_del();break;case 4:v.slice_del(),v.ket=v.cursor,e=v.find_among_b(b,2),e&&(v.bra=v.cursor,u()&&1==e&&v.slice_del())}}var d,l,m,h=[new r("",-1,6),new r("U",0,2),new r("Y",0,1),new r("ä",0,3),new r("ö",0,4),new r("ü",0,5)],w=[new r("e",-1,2),new r("em",-1,1),new r("en",-1,2),new r("ern",-1,1),new r("er",-1,1),new r("s",-1,3),new r("es",5,2)],f=[new r("en",-1,1),new r("er",-1,1),new r("st",-1,2),new r("est",2,1)],b=[new r("ig",-1,1),new r("lich",-1,1)],_=[new r("end",-1,1),new r("ig",-1,2),new r("ung",-1,1),new r("lich",-1,3),new r("isch",-1,2),new r("ik",-1,2),new r("heit",-1,3),new r("keit",-1,4)],p=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32,8],g=[117,30,5],k=[117,30,4],v=new n;this.setCurrent=function(e){v.setCurrent(e)},this.getCurrent=function(){return v.getCurrent()},this.stem=function(){var e=v.cursor;return i(),v.cursor=e,t(),v.limit_backward=e,v.cursor=v.limit,a(),v.cursor=v.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.de.stemmer,"stemmer-de"),e.de.stopWordFilter=e.generateStopWordFilter("aber alle allem allen aller alles als also am an ander andere anderem anderen anderer anderes anderm andern anderr anders auch auf aus bei bin bis bist da damit dann das dasselbe dazu daß dein deine deinem deinen deiner deines dem demselben den denn denselben der derer derselbe derselben des desselben dessen dich die dies diese dieselbe dieselben diesem diesen dieser dieses dir doch dort du durch ein eine einem einen einer eines einig einige einigem einigen einiger einiges einmal er es etwas euch euer eure eurem euren eurer eures für gegen gewesen hab habe haben hat hatte hatten hier hin hinter ich ihm ihn ihnen ihr ihre ihrem ihren ihrer ihres im in indem ins ist jede jedem jeden jeder jedes jene jenem jenen jener jenes jetzt kann kein keine keinem keinen keiner keines können könnte machen man manche manchem manchen mancher manches mein meine meinem meinen meiner meines mich mir mit muss musste nach nicht nichts noch nun nur ob oder ohne sehr sein seine seinem seinen seiner seines selbst sich sie sind so solche solchem solchen solcher solches soll sollte sondern sonst um und uns unse unsem unsen unser unses unter viel vom von vor war waren warst was weg weil weiter welche welchem welchen welcher welches wenn werde werden wie wieder will wir wird wirst wo wollen wollte während würde würden zu zum zur zwar zwischen über".split(" ")),e.Pipeline.registerFunction(e.de.stopWordFilter,"stopWordFilter-de")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.du.min.js b/site/assets/javascripts/lunr/min/lunr.du.min.js deleted file mode 100644 index 49a0f3f..0000000 --- a/site/assets/javascripts/lunr/min/lunr.du.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Lunr languages, `Dutch` language - * https://github.com/MihaiValentin/lunr-languages - * - * Copyright 2014, Mihai Valentin - * http://www.mozilla.org/MPL/ - */ -/*! - * based on - * Snowball JavaScript Library v0.3 - * http://code.google.com/p/urim/ - * http://snowball.tartarus.org/ - * - * Copyright 2010, Oleg Mazko - * http://www.mozilla.org/MPL/ - */ - -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");console.warn('[Lunr Languages] Please use the "nl" instead of the "du". The "nl" code is the standard code for Dutch language, and "du" will be removed in the next major versions.'),e.du=function(){this.pipeline.reset(),this.pipeline.add(e.du.trimmer,e.du.stopWordFilter,e.du.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.du.stemmer))},e.du.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.du.trimmer=e.trimmerSupport.generateTrimmer(e.du.wordCharacters),e.Pipeline.registerFunction(e.du.trimmer,"trimmer-du"),e.du.stemmer=function(){var r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){function e(){for(var e,r,i,o=C.cursor;;){if(C.bra=C.cursor,e=C.find_among(b,11))switch(C.ket=C.cursor,e){case 1:C.slice_from("a");continue;case 2:C.slice_from("e");continue;case 3:C.slice_from("i");continue;case 4:C.slice_from("o");continue;case 5:C.slice_from("u");continue;case 6:if(C.cursor>=C.limit)break;C.cursor++;continue}break}for(C.cursor=o,C.bra=o,C.eq_s(1,"y")?(C.ket=C.cursor,C.slice_from("Y")):C.cursor=o;;)if(r=C.cursor,C.in_grouping(q,97,232)){if(i=C.cursor,C.bra=i,C.eq_s(1,"i"))C.ket=C.cursor,C.in_grouping(q,97,232)&&(C.slice_from("I"),C.cursor=r);else if(C.cursor=i,C.eq_s(1,"y"))C.ket=C.cursor,C.slice_from("Y"),C.cursor=r;else if(n(r))break}else if(n(r))break}function n(e){return C.cursor=e,e>=C.limit||(C.cursor++,!1)}function o(){_=C.limit,f=_,t()||(_=C.cursor,_<3&&(_=3),t()||(f=C.cursor))}function t(){for(;!C.in_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}for(;!C.out_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}return!1}function s(){for(var e;;)if(C.bra=C.cursor,e=C.find_among(p,3))switch(C.ket=C.cursor,e){case 1:C.slice_from("y");break;case 2:C.slice_from("i");break;case 3:if(C.cursor>=C.limit)return;C.cursor++}}function u(){return _<=C.cursor}function c(){return f<=C.cursor}function a(){var e=C.limit-C.cursor;C.find_among_b(g,3)&&(C.cursor=C.limit-e,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del()))}function l(){var e;w=!1,C.ket=C.cursor,C.eq_s_b(1,"e")&&(C.bra=C.cursor,u()&&(e=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-e,C.slice_del(),w=!0,a())))}function m(){var e;u()&&(e=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-e,C.eq_s_b(3,"gem")||(C.cursor=C.limit-e,C.slice_del(),a())))}function d(){var e,r,i,n,o,t,s=C.limit-C.cursor;if(C.ket=C.cursor,e=C.find_among_b(h,5))switch(C.bra=C.cursor,e){case 1:u()&&C.slice_from("heid");break;case 2:m();break;case 3:u()&&C.out_grouping_b(z,97,232)&&C.slice_del()}if(C.cursor=C.limit-s,l(),C.cursor=C.limit-s,C.ket=C.cursor,C.eq_s_b(4,"heid")&&(C.bra=C.cursor,c()&&(r=C.limit-C.cursor,C.eq_s_b(1,"c")||(C.cursor=C.limit-r,C.slice_del(),C.ket=C.cursor,C.eq_s_b(2,"en")&&(C.bra=C.cursor,m())))),C.cursor=C.limit-s,C.ket=C.cursor,e=C.find_among_b(k,6))switch(C.bra=C.cursor,e){case 1:if(c()){if(C.slice_del(),i=C.limit-C.cursor,C.ket=C.cursor,C.eq_s_b(2,"ig")&&(C.bra=C.cursor,c()&&(n=C.limit-C.cursor,!C.eq_s_b(1,"e")))){C.cursor=C.limit-n,C.slice_del();break}C.cursor=C.limit-i,a()}break;case 2:c()&&(o=C.limit-C.cursor,C.eq_s_b(1,"e")||(C.cursor=C.limit-o,C.slice_del()));break;case 3:c()&&(C.slice_del(),l());break;case 4:c()&&C.slice_del();break;case 5:c()&&w&&C.slice_del()}C.cursor=C.limit-s,C.out_grouping_b(j,73,232)&&(t=C.limit-C.cursor,C.find_among_b(v,4)&&C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-t,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del())))}var f,_,w,b=[new r("",-1,6),new r("á",0,1),new r("ä",0,1),new r("é",0,2),new r("ë",0,2),new r("í",0,3),new r("ï",0,3),new r("ó",0,4),new r("ö",0,4),new r("ú",0,5),new r("ü",0,5)],p=[new r("",-1,3),new r("I",0,2),new r("Y",0,1)],g=[new r("dd",-1,-1),new r("kk",-1,-1),new r("tt",-1,-1)],h=[new r("ene",-1,2),new r("se",-1,3),new r("en",-1,2),new r("heden",2,1),new r("s",-1,3)],k=[new r("end",-1,1),new r("ig",-1,2),new r("ing",-1,1),new r("lijk",-1,3),new r("baar",-1,4),new r("bar",-1,5)],v=[new r("aa",-1,-1),new r("ee",-1,-1),new r("oo",-1,-1),new r("uu",-1,-1)],q=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],j=[1,0,0,17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],z=[17,67,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],C=new i;this.setCurrent=function(e){C.setCurrent(e)},this.getCurrent=function(){return C.getCurrent()},this.stem=function(){var r=C.cursor;return e(),C.cursor=r,o(),C.limit_backward=r,C.cursor=C.limit,d(),C.cursor=C.limit_backward,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.du.stemmer,"stemmer-du"),e.du.stopWordFilter=e.generateStopWordFilter(" aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou".split(" ")),e.Pipeline.registerFunction(e.du.stopWordFilter,"stopWordFilter-du")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.el.min.js b/site/assets/javascripts/lunr/min/lunr.el.min.js deleted file mode 100644 index ace017b..0000000 --- a/site/assets/javascripts/lunr/min/lunr.el.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.el=function(){this.pipeline.reset(),void 0===this.searchPipeline&&this.pipeline.add(e.el.trimmer,e.el.normilizer),this.pipeline.add(e.el.stopWordFilter,e.el.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.el.stemmer))},e.el.wordCharacters="A-Za-zΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκΛλΜμΝνΞξΟοΠπΡρΣσςΤτΥυΦφΧχΨψΩωΆάΈέΉήΊίΌόΎύΏώΪΐΫΰΐΰ",e.el.trimmer=e.trimmerSupport.generateTrimmer(e.el.wordCharacters),e.Pipeline.registerFunction(e.el.trimmer,"trimmer-el"),e.el.stemmer=function(){function e(e){return s.test(e)}function t(e){return/[ΑΕΗΙΟΥΩ]$/.test(e)}function r(e){return/[ΑΕΗΙΟΩ]$/.test(e)}function n(n){var s=n;if(n.length<3)return s;if(!e(n))return s;if(i.indexOf(n)>=0)return s;var u=new RegExp("(.*)("+Object.keys(l).join("|")+")$"),o=u.exec(s);return null!==o&&(s=o[1]+l[o[2]]),null!==(o=/^(.+?)(ΑΔΕΣ|ΑΔΩΝ)$/.exec(s))&&(s=o[1],/(ΟΚ|ΜΑΜ|ΜΑΝ|ΜΠΑΜΠ|ΠΑΤΕΡ|ΓΙΑΓΙ|ΝΤΑΝΤ|ΚΥΡ|ΘΕΙ|ΠΕΘΕΡ|ΜΟΥΣΑΜ|ΚΑΠΛΑΜ|ΠΑΡ|ΨΑΡ|ΤΖΟΥΡ|ΤΑΜΠΟΥΡ|ΓΑΛΑΤ|ΦΑΦΛΑΤ)$/.test(o[1])||(s+="ΑΔ")),null!==(o=/^(.+?)(ΕΔΕΣ|ΕΔΩΝ)$/.exec(s))&&(s=o[1],/(ΟΠ|ΙΠ|ΕΜΠ|ΥΠ|ΓΗΠ|ΔΑΠ|ΚΡΑΣΠ|ΜΙΛ)$/.test(o[1])&&(s+="ΕΔ")),null!==(o=/^(.+?)(ΟΥΔΕΣ|ΟΥΔΩΝ)$/.exec(s))&&(s=o[1],/(ΑΡΚ|ΚΑΛΙΑΚ|ΠΕΤΑΛ|ΛΙΧ|ΠΛΕΞ|ΣΚ|Σ|ΦΛ|ΦΡ|ΒΕΛ|ΛΟΥΛ|ΧΝ|ΣΠ|ΤΡΑΓ|ΦΕ)$/.test(o[1])&&(s+="ΟΥΔ")),null!==(o=/^(.+?)(ΕΩΣ|ΕΩΝ|ΕΑΣ|ΕΑ)$/.exec(s))&&(s=o[1],/^(Θ|Δ|ΕΛ|ΓΑΛ|Ν|Π|ΙΔ|ΠΑΡ|ΣΤΕΡ|ΟΡΦ|ΑΝΔΡ|ΑΝΤΡ)$/.test(o[1])&&(s+="Ε")),null!==(o=/^(.+?)(ΕΙΟ|ΕΙΟΣ|ΕΙΟΙ|ΕΙΑ|ΕΙΑΣ|ΕΙΕΣ|ΕΙΟΥ|ΕΙΟΥΣ|ΕΙΩΝ)$/.exec(s))&&o[1].length>4&&(s=o[1]),null!==(o=/^(.+?)(ΙΟΥΣ|ΙΑΣ|ΙΕΣ|ΙΟΣ|ΙΟΥ|ΙΟΙ|ΙΩΝ|ΙΟΝ|ΙΑ|ΙΟ)$/.exec(s))&&(s=o[1],(t(s)||s.length<2||/^(ΑΓ|ΑΓΓΕΛ|ΑΓΡ|ΑΕΡ|ΑΘΛ|ΑΚΟΥΣ|ΑΞ|ΑΣ|Β|ΒΙΒΛ|ΒΥΤ|Γ|ΓΙΑΓ|ΓΩΝ|Δ|ΔΑΝ|ΔΗΛ|ΔΗΜ|ΔΟΚΙΜ|ΕΛ|ΖΑΧΑΡ|ΗΛ|ΗΠ|ΙΔ|ΙΣΚ|ΙΣΤ|ΙΟΝ|ΙΩΝ|ΚΙΜΩΛ|ΚΟΛΟΝ|ΚΟΡ|ΚΤΗΡ|ΚΥΡ|ΛΑΓ|ΛΟΓ|ΜΑΓ|ΜΠΑΝ|ΜΠΡ|ΝΑΥΤ|ΝΟΤ|ΟΠΑΛ|ΟΞ|ΟΡ|ΟΣ|ΠΑΝΑΓ|ΠΑΤΡ|ΠΗΛ|ΠΗΝ|ΠΛΑΙΣ|ΠΟΝΤ|ΡΑΔ|ΡΟΔ|ΣΚ|ΣΚΟΡΠ|ΣΟΥΝ|ΣΠΑΝ|ΣΤΑΔ|ΣΥΡ|ΤΗΛ|ΤΙΜ|ΤΟΚ|ΤΟΠ|ΤΡΟΧ|ΦΙΛ|ΦΩΤ|Χ|ΧΙΛ|ΧΡΩΜ|ΧΩΡ)$/.test(o[1]))&&(s+="Ι"),/^(ΠΑΛ)$/.test(o[1])&&(s+="ΑΙ")),null!==(o=/^(.+?)(ΙΚΟΣ|ΙΚΟΝ|ΙΚΕΙΣ|ΙΚΟΙ|ΙΚΕΣ|ΙΚΟΥΣ|ΙΚΗ|ΙΚΗΣ|ΙΚΟ|ΙΚΑ|ΙΚΟΥ|ΙΚΩΝ|ΙΚΩΣ)$/.exec(s))&&(s=o[1],(t(s)||/^(ΑΔ|ΑΛ|ΑΜΑΝ|ΑΜΕΡ|ΑΜΜΟΧΑΛ|ΑΝΗΘ|ΑΝΤΙΔ|ΑΠΛ|ΑΤΤ|ΑΦΡ|ΒΑΣ|ΒΡΩΜ|ΓΕΝ|ΓΕΡ|Δ|ΔΙΚΑΝ|ΔΥΤ|ΕΙΔ|ΕΝΔ|ΕΞΩΔ|ΗΘ|ΘΕΤ|ΚΑΛΛΙΝ|ΚΑΛΠ|ΚΑΤΑΔ|ΚΟΥΖΙΝ|ΚΡ|ΚΩΔ|ΛΟΓ|Μ|ΜΕΡ|ΜΟΝΑΔ|ΜΟΥΛ|ΜΟΥΣ|ΜΠΑΓΙΑΤ|ΜΠΑΝ|ΜΠΟΛ|ΜΠΟΣ|ΜΥΣΤ|Ν|ΝΙΤ|ΞΙΚ|ΟΠΤ|ΠΑΝ|ΠΕΤΣ|ΠΙΚΑΝΤ|ΠΙΤΣ|ΠΛΑΣΤ|ΠΛΙΑΤΣ|ΠΟΝΤ|ΠΟΣΤΕΛΝ|ΠΡΩΤΟΔ|ΣΕΡΤ|ΣΗΜΑΝΤ|ΣΤΑΤ|ΣΥΝΑΔ|ΣΥΝΟΜΗΛ|ΤΕΛ|ΤΕΧΝ|ΤΡΟΠ|ΤΣΑΜ|ΥΠΟΔ|Φ|ΦΙΛΟΝ|ΦΥΛΟΔ|ΦΥΣ|ΧΑΣ)$/.test(o[1])||/(ΦΟΙΝ)$/.test(o[1]))&&(s+="ΙΚ")),"ΑΓΑΜΕ"===s&&(s="ΑΓΑΜ"),null!==(o=/^(.+?)(ΑΓΑΜΕ|ΗΣΑΜΕ|ΟΥΣΑΜΕ|ΗΚΑΜΕ|ΗΘΗΚΑΜΕ)$/.exec(s))&&(s=o[1]),null!==(o=/^(.+?)(ΑΜΕ)$/.exec(s))&&(s=o[1],/^(ΑΝΑΠ|ΑΠΟΘ|ΑΠΟΚ|ΑΠΟΣΤ|ΒΟΥΒ|ΞΕΘ|ΟΥΛ|ΠΕΘ|ΠΙΚΡ|ΠΟΤ|ΣΙΧ|Χ)$/.test(o[1])&&(s+="ΑΜ")),null!==(o=/^(.+?)(ΑΓΑΝΕ|ΗΣΑΝΕ|ΟΥΣΑΝΕ|ΙΟΝΤΑΝΕ|ΙΟΤΑΝΕ|ΙΟΥΝΤΑΝΕ|ΟΝΤΑΝΕ|ΟΤΑΝΕ|ΟΥΝΤΑΝΕ|ΗΚΑΝΕ|ΗΘΗΚΑΝΕ)$/.exec(s))&&(s=o[1],/^(ΤΡ|ΤΣ)$/.test(o[1])&&(s+="ΑΓΑΝ")),null!==(o=/^(.+?)(ΑΝΕ)$/.exec(s))&&(s=o[1],(r(s)||/^(ΒΕΤΕΡ|ΒΟΥΛΚ|ΒΡΑΧΜ|Γ|ΔΡΑΔΟΥΜ|Θ|ΚΑΛΠΟΥΖ|ΚΑΣΤΕΛ|ΚΟΡΜΟΡ|ΛΑΟΠΛ|ΜΩΑΜΕΘ|Μ|ΜΟΥΣΟΥΛΜΑΝ|ΟΥΛ|Π|ΠΕΛΕΚ|ΠΛ|ΠΟΛΙΣ|ΠΟΡΤΟΛ|ΣΑΡΑΚΑΤΣ|ΣΟΥΛΤ|ΤΣΑΡΛΑΤ|ΟΡΦ|ΤΣΙΓΓ|ΤΣΟΠ|ΦΩΤΟΣΤΕΦ|Χ|ΨΥΧΟΠΛ|ΑΓ|ΟΡΦ|ΓΑΛ|ΓΕΡ|ΔΕΚ|ΔΙΠΛ|ΑΜΕΡΙΚΑΝ|ΟΥΡ|ΠΙΘ|ΠΟΥΡΙΤ|Σ|ΖΩΝΤ|ΙΚ|ΚΑΣΤ|ΚΟΠ|ΛΙΧ|ΛΟΥΘΗΡ|ΜΑΙΝΤ|ΜΕΛ|ΣΙΓ|ΣΠ|ΣΤΕΓ|ΤΡΑΓ|ΤΣΑΓ|Φ|ΕΡ|ΑΔΑΠ|ΑΘΙΓΓ|ΑΜΗΧ|ΑΝΙΚ|ΑΝΟΡΓ|ΑΠΗΓ|ΑΠΙΘ|ΑΤΣΙΓΓ|ΒΑΣ|ΒΑΣΚ|ΒΑΘΥΓΑΛ|ΒΙΟΜΗΧ|ΒΡΑΧΥΚ|ΔΙΑΤ|ΔΙΑΦ|ΕΝΟΡΓ|ΘΥΣ|ΚΑΠΝΟΒΙΟΜΗΧ|ΚΑΤΑΓΑΛ|ΚΛΙΒ|ΚΟΙΛΑΡΦ|ΛΙΒ|ΜΕΓΛΟΒΙΟΜΗΧ|ΜΙΚΡΟΒΙΟΜΗΧ|ΝΤΑΒ|ΞΗΡΟΚΛΙΒ|ΟΛΙΓΟΔΑΜ|ΟΛΟΓΑΛ|ΠΕΝΤΑΡΦ|ΠΕΡΗΦ|ΠΕΡΙΤΡ|ΠΛΑΤ|ΠΟΛΥΔΑΠ|ΠΟΛΥΜΗΧ|ΣΤΕΦ|ΤΑΒ|ΤΕΤ|ΥΠΕΡΗΦ|ΥΠΟΚΟΠ|ΧΑΜΗΛΟΔΑΠ|ΨΗΛΟΤΑΒ)$/.test(o[1]))&&(s+="ΑΝ")),null!==(o=/^(.+?)(ΗΣΕΤΕ)$/.exec(s))&&(s=o[1]),null!==(o=/^(.+?)(ΕΤΕ)$/.exec(s))&&(s=o[1],(r(s)||/(ΟΔ|ΑΙΡ|ΦΟΡ|ΤΑΘ|ΔΙΑΘ|ΣΧ|ΕΝΔ|ΕΥΡ|ΤΙΘ|ΥΠΕΡΘ|ΡΑΘ|ΕΝΘ|ΡΟΘ|ΣΘ|ΠΥΡ|ΑΙΝ|ΣΥΝΔ|ΣΥΝ|ΣΥΝΘ|ΧΩΡ|ΠΟΝ|ΒΡ|ΚΑΘ|ΕΥΘ|ΕΚΘ|ΝΕΤ|ΡΟΝ|ΑΡΚ|ΒΑΡ|ΒΟΛ|ΩΦΕΛ)$/.test(o[1])||/^(ΑΒΑΡ|ΒΕΝ|ΕΝΑΡ|ΑΒΡ|ΑΔ|ΑΘ|ΑΝ|ΑΠΛ|ΒΑΡΟΝ|ΝΤΡ|ΣΚ|ΚΟΠ|ΜΠΟΡ|ΝΙΦ|ΠΑΓ|ΠΑΡΑΚΑΛ|ΣΕΡΠ|ΣΚΕΛ|ΣΥΡΦ|ΤΟΚ|Υ|Δ|ΕΜ|ΘΑΡΡ|Θ)$/.test(o[1]))&&(s+="ΕΤ")),null!==(o=/^(.+?)(ΟΝΤΑΣ|ΩΝΤΑΣ)$/.exec(s))&&(s=o[1],/^ΑΡΧ$/.test(o[1])&&(s+="ΟΝΤ"),/ΚΡΕ$/.test(o[1])&&(s+="ΩΝΤ")),null!==(o=/^(.+?)(ΟΜΑΣΤΕ|ΙΟΜΑΣΤΕ)$/.exec(s))&&(s=o[1],/^ΟΝ$/.test(o[1])&&(s+="ΟΜΑΣΤ")),null!==(o=/^(.+?)(ΙΕΣΤΕ)$/.exec(s))&&(s=o[1],/^(Π|ΑΠ|ΣΥΜΠ|ΑΣΥΜΠ|ΑΚΑΤΑΠ|ΑΜΕΤΑΜΦ)$/.test(o[1])&&(s+="ΙΕΣΤ")),null!==(o=/^(.+?)(ΕΣΤΕ)$/.exec(s))&&(s=o[1],/^(ΑΛ|ΑΡ|ΕΚΤΕΛ|Ζ|Μ|Ξ|ΠΑΡΑΚΑΛ|ΠΡΟ|ΝΙΣ)$/.test(o[1])&&(s+="ΕΣΤ")),null!==(o=/^(.+?)(ΗΘΗΚΑ|ΗΘΗΚΕΣ|ΗΘΗΚΕ)$/.exec(s))&&(s=o[1]),null!==(o=/^(.+?)(ΗΚΑ|ΗΚΕΣ|ΗΚΕ)$/.exec(s))&&(s=o[1],(/(ΣΚΩΛ|ΣΚΟΥΛ|ΝΑΡΘ|ΣΦ|ΟΘ|ΠΙΘ)$/.test(o[1])||/^(ΔΙΑΘ|Θ|ΠΑΡΑΚΑΤΑΘ|ΠΡΟΣΘ|ΣΥΝΘ)$/.test(o[1]))&&(s+="ΗΚ")),null!==(o=/^(.+?)(ΟΥΣΑ|ΟΥΣΕΣ|ΟΥΣΕ)$/.exec(s))&&(s=o[1],(t(s)||/^(ΦΑΡΜΑΚ|ΧΑΔ|ΑΓΚ|ΑΝΑΡΡ|ΒΡΟΜ|ΕΚΛΙΠ|ΛΑΜΠΙΔ|ΛΕΧ|Μ|ΠΑΤ|Ρ|Λ|ΜΕΔ|ΜΕΣΑΖ|ΥΠΟΤΕΙΝ|ΑΜ|ΑΙΘ|ΑΝΗΚ|ΔΕΣΠΟΖ|ΕΝΔΙΑΦΕΡ)$/.test(o[1])||/(ΠΟΔΑΡ|ΒΛΕΠ|ΠΑΝΤΑΧ|ΦΡΥΔ|ΜΑΝΤΙΛ|ΜΑΛΛ|ΚΥΜΑΤ|ΛΑΧ|ΛΗΓ|ΦΑΓ|ΟΜ|ΠΡΩΤ)$/.test(o[1]))&&(s+="ΟΥΣ")),null!==(o=/^(.+?)(ΑΓΑ|ΑΓΕΣ|ΑΓΕ)$/.exec(s))&&(s=o[1],(/^(ΑΒΑΣΤ|ΠΟΛΥΦ|ΑΔΗΦ|ΠΑΜΦ|Ρ|ΑΣΠ|ΑΦ|ΑΜΑΛ|ΑΜΑΛΛΙ|ΑΝΥΣΤ|ΑΠΕΡ|ΑΣΠΑΡ|ΑΧΑΡ|ΔΕΡΒΕΝ|ΔΡΟΣΟΠ|ΞΕΦ|ΝΕΟΠ|ΝΟΜΟΤ|ΟΛΟΠ|ΟΜΟΤ|ΠΡΟΣΤ|ΠΡΟΣΩΠΟΠ|ΣΥΜΠ|ΣΥΝΤ|Τ|ΥΠΟΤ|ΧΑΡ|ΑΕΙΠ|ΑΙΜΟΣΤ|ΑΝΥΠ|ΑΠΟΤ|ΑΡΤΙΠ|ΔΙΑΤ|ΕΝ|ΕΠΙΤ|ΚΡΟΚΑΛΟΠ|ΣΙΔΗΡΟΠ|Λ|ΝΑΥ|ΟΥΛΑΜ|ΟΥΡ|Π|ΤΡ|Μ)$/.test(o[1])||/(ΟΦ|ΠΕΛ|ΧΟΡΤ|ΛΛ|ΣΦ|ΡΠ|ΦΡ|ΠΡ|ΛΟΧ|ΣΜΗΝ)$/.test(o[1])&&!/^(ΨΟΦ|ΝΑΥΛΟΧ)$/.test(o[1])||/(ΚΟΛΛ)$/.test(o[1]))&&(s+="ΑΓ")),null!==(o=/^(.+?)(ΗΣΕ|ΗΣΟΥ|ΗΣΑ)$/.exec(s))&&(s=o[1],/^(Ν|ΧΕΡΣΟΝ|ΔΩΔΕΚΑΝ|ΕΡΗΜΟΝ|ΜΕΓΑΛΟΝ|ΕΠΤΑΝ|Ι)$/.test(o[1])&&(s+="ΗΣ")),null!==(o=/^(.+?)(ΗΣΤΕ)$/.exec(s))&&(s=o[1],/^(ΑΣΒ|ΣΒ|ΑΧΡ|ΧΡ|ΑΠΛ|ΑΕΙΜΝ|ΔΥΣΧΡ|ΕΥΧΡ|ΚΟΙΝΟΧΡ|ΠΑΛΙΜΨ)$/.test(o[1])&&(s+="ΗΣΤ")),null!==(o=/^(.+?)(ΟΥΝΕ|ΗΣΟΥΝΕ|ΗΘΟΥΝΕ)$/.exec(s))&&(s=o[1],/^(Ν|Ρ|ΣΠΙ|ΣΤΡΑΒΟΜΟΥΤΣ|ΚΑΚΟΜΟΥΤΣ|ΕΞΩΝ)$/.test(o[1])&&(s+="ΟΥΝ")),null!==(o=/^(.+?)(ΟΥΜΕ|ΗΣΟΥΜΕ|ΗΘΟΥΜΕ)$/.exec(s))&&(s=o[1],/^(ΠΑΡΑΣΟΥΣ|Φ|Χ|ΩΡΙΟΠΛ|ΑΖ|ΑΛΛΟΣΟΥΣ|ΑΣΟΥΣ)$/.test(o[1])&&(s+="ΟΥΜ")),null!=(o=/^(.+?)(ΜΑΤΟΙ|ΜΑΤΟΥΣ|ΜΑΤΟ|ΜΑΤΑ|ΜΑΤΩΣ|ΜΑΤΩΝ|ΜΑΤΟΣ|ΜΑΤΕΣ|ΜΑΤΗ|ΜΑΤΗΣ|ΜΑΤΟΥ)$/.exec(s))&&(s=o[1]+"Μ",/^(ΓΡΑΜ)$/.test(o[1])?s+="Α":/^(ΓΕ|ΣΤΑ)$/.test(o[1])&&(s+="ΑΤ")),null!==(o=/^(.+?)(ΟΥΑ)$/.exec(s))&&(s=o[1]+"ΟΥ"),n.length===s.length&&null!==(o=/^(.+?)(Α|ΑΓΑΤΕ|ΑΓΑΝ|ΑΕΙ|ΑΜΑΙ|ΑΝ|ΑΣ|ΑΣΑΙ|ΑΤΑΙ|ΑΩ|Ε|ΕΙ|ΕΙΣ|ΕΙΤΕ|ΕΣΑΙ|ΕΣ|ΕΤΑΙ|Ι|ΙΕΜΑΙ|ΙΕΜΑΣΤΕ|ΙΕΤΑΙ|ΙΕΣΑΙ|ΙΕΣΑΣΤΕ|ΙΟΜΑΣΤΑΝ|ΙΟΜΟΥΝ|ΙΟΜΟΥΝΑ|ΙΟΝΤΑΝ|ΙΟΝΤΟΥΣΑΝ|ΙΟΣΑΣΤΑΝ|ΙΟΣΑΣΤΕ|ΙΟΣΟΥΝ|ΙΟΣΟΥΝΑ|ΙΟΤΑΝ|ΙΟΥΜΑ|ΙΟΥΜΑΣΤΕ|ΙΟΥΝΤΑΙ|ΙΟΥΝΤΑΝ|Η|ΗΔΕΣ|ΗΔΩΝ|ΗΘΕΙ|ΗΘΕΙΣ|ΗΘΕΙΤΕ|ΗΘΗΚΑΤΕ|ΗΘΗΚΑΝ|ΗΘΟΥΝ|ΗΘΩ|ΗΚΑΤΕ|ΗΚΑΝ|ΗΣ|ΗΣΑΝ|ΗΣΑΤΕ|ΗΣΕΙ|ΗΣΕΣ|ΗΣΟΥΝ|ΗΣΩ|Ο|ΟΙ|ΟΜΑΙ|ΟΜΑΣΤΑΝ|ΟΜΟΥΝ|ΟΜΟΥΝΑ|ΟΝΤΑΙ|ΟΝΤΑΝ|ΟΝΤΟΥΣΑΝ|ΟΣ|ΟΣΑΣΤΑΝ|ΟΣΑΣΤΕ|ΟΣΟΥΝ|ΟΣΟΥΝΑ|ΟΤΑΝ|ΟΥ|ΟΥΜΑΙ|ΟΥΜΑΣΤΕ|ΟΥΝ|ΟΥΝΤΑΙ|ΟΥΝΤΑΝ|ΟΥΣ|ΟΥΣΑΝ|ΟΥΣΑΤΕ|Υ||ΥΑ|ΥΣ|Ω|ΩΝ|ΟΙΣ)$/.exec(s))&&(s=o[1]),null!=(o=/^(.+?)(ΕΣΤΕΡ|ΕΣΤΑΤ|ΟΤΕΡ|ΟΤΑΤ|ΥΤΕΡ|ΥΤΑΤ|ΩΤΕΡ|ΩΤΑΤ)$/.exec(s))&&(/^(ΕΞ|ΕΣ|ΑΝ|ΚΑΤ|Κ|ΠΡ)$/.test(o[1])||(s=o[1]),/^(ΚΑ|Μ|ΕΛΕ|ΛΕ|ΔΕ)$/.test(o[1])&&(s+="ΥΤ")),s}var l={"ΦΑΓΙΑ":"ΦΑ","ΦΑΓΙΟΥ":"ΦΑ","ΦΑΓΙΩΝ":"ΦΑ","ΣΚΑΓΙΑ":"ΣΚΑ","ΣΚΑΓΙΟΥ":"ΣΚΑ","ΣΚΑΓΙΩΝ":"ΣΚΑ","ΣΟΓΙΟΥ":"ΣΟ","ΣΟΓΙΑ":"ΣΟ","ΣΟΓΙΩΝ":"ΣΟ","ΤΑΤΟΓΙΑ":"ΤΑΤΟ","ΤΑΤΟΓΙΟΥ":"ΤΑΤΟ","ΤΑΤΟΓΙΩΝ":"ΤΑΤΟ","ΚΡΕΑΣ":"ΚΡΕ","ΚΡΕΑΤΟΣ":"ΚΡΕ","ΚΡΕΑΤΑ":"ΚΡΕ","ΚΡΕΑΤΩΝ":"ΚΡΕ","ΠΕΡΑΣ":"ΠΕΡ","ΠΕΡΑΤΟΣ":"ΠΕΡ","ΠΕΡΑΤΑ":"ΠΕΡ","ΠΕΡΑΤΩΝ":"ΠΕΡ","ΤΕΡΑΣ":"ΤΕΡ","ΤΕΡΑΤΟΣ":"ΤΕΡ","ΤΕΡΑΤΑ":"ΤΕΡ","ΤΕΡΑΤΩΝ":"ΤΕΡ","ΦΩΣ":"ΦΩ","ΦΩΤΟΣ":"ΦΩ","ΦΩΤΑ":"ΦΩ","ΦΩΤΩΝ":"ΦΩ","ΚΑΘΕΣΤΩΣ":"ΚΑΘΕΣΤ","ΚΑΘΕΣΤΩΤΟΣ":"ΚΑΘΕΣΤ","ΚΑΘΕΣΤΩΤΑ":"ΚΑΘΕΣΤ","ΚΑΘΕΣΤΩΤΩΝ":"ΚΑΘΕΣΤ","ΓΕΓΟΝΟΣ":"ΓΕΓΟΝ","ΓΕΓΟΝΟΤΟΣ":"ΓΕΓΟΝ","ΓΕΓΟΝΟΤΑ":"ΓΕΓΟΝ","ΓΕΓΟΝΟΤΩΝ":"ΓΕΓΟΝ","ΕΥΑ":"ΕΥ"},i=["ΑΚΡΙΒΩΣ","ΑΛΑ","ΑΛΛΑ","ΑΛΛΙΩΣ","ΑΛΛΟΤΕ","ΑΜΑ","ΑΝΩ","ΑΝΑ","ΑΝΑΜΕΣΑ","ΑΝΑΜΕΤΑΞΥ","ΑΝΕΥ","ΑΝΤΙ","ΑΝΤΙΠΕΡΑ","ΑΝΤΙΟ","ΑΞΑΦΝΑ","ΑΠΟ","ΑΠΟΨΕ","ΑΡΑ","ΑΡΑΓΕ","ΑΥΡΙΟ","ΑΦΟΙ","ΑΦΟΥ","ΑΦΟΤΟΥ","ΒΡΕ","ΓΕΙΑ","ΓΙΑ","ΓΙΑΤΙ","ΓΡΑΜΜΑ","ΔΕΗ","ΔΕΝ","ΔΗΛΑΔΗ","ΔΙΧΩΣ","ΔΥΟ","ΕΑΝ","ΕΓΩ","ΕΔΩ","ΕΔΑ","ΕΙΘΕ","ΕΙΜΑΙ","ΕΙΜΑΣΤΕ","ΕΙΣΑΙ","ΕΙΣΑΣΤΕ","ΕΙΝΑΙ","ΕΙΣΤΕ","ΕΙΤΕ","ΕΚΕΙ","ΕΚΟ","ΕΛΑ","ΕΜΑΣ","ΕΜΕΙΣ","ΕΝΤΕΛΩΣ","ΕΝΤΟΣ","ΕΝΤΩΜΕΤΑΞΥ","ΕΝΩ","ΕΞΙ","ΕΞΙΣΟΥ","ΕΞΗΣ","ΕΞΩ","ΕΟΚ","ΕΠΑΝΩ","ΕΠΕΙΔΗ","ΕΠΕΙΤΑ","ΕΠΙ","ΕΠΙΣΗΣ","ΕΠΟΜΕΝΩΣ","ΕΠΤΑ","ΕΣΑΣ","ΕΣΕΙΣ","ΕΣΤΩ","ΕΣΥ","ΕΣΩ","ΕΤΣΙ","ΕΥΓΕ","ΕΦΕ","ΕΦΕΞΗΣ","ΕΧΤΕΣ","ΕΩΣ","ΗΔΗ","ΗΜΙ","ΗΠΑ","ΗΤΟΙ","ΘΕΣ","ΙΔΙΩΣ","ΙΔΗ","ΙΚΑ","ΙΣΩΣ","ΚΑΘΕ","ΚΑΘΕΤΙ","ΚΑΘΟΛΟΥ","ΚΑΘΩΣ","ΚΑΙ","ΚΑΝ","ΚΑΠΟΤΕ","ΚΑΠΟΥ","ΚΑΤΑ","ΚΑΤΙ","ΚΑΤΟΠΙΝ","ΚΑΤΩ","ΚΕΙ","ΚΙΧ","ΚΚΕ","ΚΟΛΑΝ","ΚΥΡΙΩΣ","ΚΩΣ","ΜΑΚΑΡΙ","ΜΑΛΙΣΤΑ","ΜΑΛΛΟΝ","ΜΑΙ","ΜΑΟ","ΜΑΟΥΣ","ΜΑΣ","ΜΕΘΑΥΡΙΟ","ΜΕΣ","ΜΕΣΑ","ΜΕΤΑ","ΜΕΤΑΞΥ","ΜΕΧΡΙ","ΜΗΔΕ","ΜΗΝ","ΜΗΠΩΣ","ΜΗΤΕ","ΜΙΑ","ΜΙΑΣ","ΜΙΣ","ΜΜΕ","ΜΟΛΟΝΟΤΙ","ΜΟΥ","ΜΠΑ","ΜΠΑΣ","ΜΠΟΥΦΑΝ","ΜΠΡΟΣ","ΝΑΙ","ΝΕΣ","ΝΤΑ","ΝΤΕ","ΞΑΝΑ","ΟΗΕ","ΟΚΤΩ","ΟΜΩΣ","ΟΝΕ","ΟΠΑ","ΟΠΟΥ","ΟΠΩΣ","ΟΣΟ","ΟΤΑΝ","ΟΤΕ","ΟΤΙ","ΟΥΤΕ","ΟΧΙ","ΠΑΛΙ","ΠΑΝ","ΠΑΝΟ","ΠΑΝΤΟΤΕ","ΠΑΝΤΟΥ","ΠΑΝΤΩΣ","ΠΑΝΩ","ΠΑΡΑ","ΠΕΡΑ","ΠΕΡΙ","ΠΕΡΙΠΟΥ","ΠΙΑ","ΠΙΟ","ΠΙΣΩ","ΠΛΑΙ","ΠΛΕΟΝ","ΠΛΗΝ","ΠΟΤΕ","ΠΟΥ","ΠΡΟ","ΠΡΟΣ","ΠΡΟΧΤΕΣ","ΠΡΟΧΘΕΣ","ΡΟΔΙ","ΠΩΣ","ΣΑΙ","ΣΑΣ","ΣΑΝ","ΣΕΙΣ","ΣΙΑ","ΣΚΙ","ΣΟΙ","ΣΟΥ","ΣΡΙ","ΣΥΝ","ΣΥΝΑΜΑ","ΣΧΕΔΟΝ","ΤΑΔΕ","ΤΑΞΙ","ΤΑΧΑ","ΤΕΙ","ΤΗΝ","ΤΗΣ","ΤΙΠΟΤΑ","ΤΙΠΟΤΕ","ΤΙΣ","ΤΟΝ","ΤΟΤΕ","ΤΟΥ","ΤΟΥΣ","ΤΣΑ","ΤΣΕ","ΤΣΙ","ΤΣΟΥ","ΤΩΝ","ΥΠΟ","ΥΠΟΨΗ","ΥΠΟΨΙΝ","ΥΣΤΕΡΑ","ΦΕΤΟΣ","ΦΙΣ","ΦΠΑ","ΧΑΦ","ΧΘΕΣ","ΧΤΕΣ","ΧΩΡΙΣ","ΩΣ","ΩΣΑΝ","ΩΣΟΤΟΥ","ΩΣΠΟΥ","ΩΣΤΕ","ΩΣΤΟΣΟ"],s=new RegExp("^[ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ]+$");return function(e){return"function"==typeof e.update?e.update(function(e){return n(e.toUpperCase()).toLowerCase()}):n(e.toUpperCase()).toLowerCase()}}(),e.Pipeline.registerFunction(e.el.stemmer,"stemmer-el"),e.el.stopWordFilter=e.generateStopWordFilter("αλλα αν αντι απο αυτα αυτεσ αυτη αυτο αυτοι αυτοσ αυτουσ αυτων για δε δεν εαν ειμαι ειμαστε ειναι εισαι ειστε εκεινα εκεινεσ εκεινη εκεινο εκεινοι εκεινοσ εκεινουσ εκεινων ενω επι η θα ισωσ κ και κατα κι μα με μετα μη μην να ο οι ομωσ οπωσ οσο οτι παρα ποια ποιεσ ποιο ποιοι ποιοσ ποιουσ ποιων που προσ πωσ σε στη στην στο στον τα την τησ το τον τοτε του των ωσ".split(" ")),e.Pipeline.registerFunction(e.el.stopWordFilter,"stopWordFilter-el"),e.el.normilizer=function(){var e={"Ά":"Α","ά":"α","Έ":"Ε","έ":"ε","Ή":"Η","ή":"η","Ί":"Ι","ί":"ι","Ό":"Ο","ο":"ο","Ύ":"Υ","ύ":"υ","Ώ":"Ω","ώ":"ω","Ϊ":"Ι","ϊ":"ι","Ϋ":"Υ","ϋ":"υ","ΐ":"ι","ΰ":"υ"};return function(t){if("function"==typeof t.update)return t.update(function(t){for(var r="",n=0;n=A.limit)return!0;A.cursor++}return!1}return!0}function n(){if(A.in_grouping(x,97,252)){var s=A.cursor;if(e()){if(A.cursor=s,!A.in_grouping(x,97,252))return!0;for(;!A.out_grouping(x,97,252);){if(A.cursor>=A.limit)return!0;A.cursor++}}return!1}return!0}function i(){var s,r=A.cursor;if(n()){if(A.cursor=r,!A.out_grouping(x,97,252))return;if(s=A.cursor,e()){if(A.cursor=s,!A.in_grouping(x,97,252)||A.cursor>=A.limit)return;A.cursor++}}g=A.cursor}function a(){for(;!A.in_grouping(x,97,252);){if(A.cursor>=A.limit)return!1;A.cursor++}for(;!A.out_grouping(x,97,252);){if(A.cursor>=A.limit)return!1;A.cursor++}return!0}function t(){var e=A.cursor;g=A.limit,p=g,v=g,i(),A.cursor=e,a()&&(p=A.cursor,a()&&(v=A.cursor))}function o(){for(var e;;){if(A.bra=A.cursor,e=A.find_among(k,6))switch(A.ket=A.cursor,e){case 1:A.slice_from("a");continue;case 2:A.slice_from("e");continue;case 3:A.slice_from("i");continue;case 4:A.slice_from("o");continue;case 5:A.slice_from("u");continue;case 6:if(A.cursor>=A.limit)break;A.cursor++;continue}break}}function u(){return g<=A.cursor}function w(){return p<=A.cursor}function c(){return v<=A.cursor}function m(){var e;if(A.ket=A.cursor,A.find_among_b(y,13)&&(A.bra=A.cursor,(e=A.find_among_b(q,11))&&u()))switch(e){case 1:A.bra=A.cursor,A.slice_from("iendo");break;case 2:A.bra=A.cursor,A.slice_from("ando");break;case 3:A.bra=A.cursor,A.slice_from("ar");break;case 4:A.bra=A.cursor,A.slice_from("er");break;case 5:A.bra=A.cursor,A.slice_from("ir");break;case 6:A.slice_del();break;case 7:A.eq_s_b(1,"u")&&A.slice_del()}}function l(e,s){if(!c())return!0;A.slice_del(),A.ket=A.cursor;var r=A.find_among_b(e,s);return r&&(A.bra=A.cursor,1==r&&c()&&A.slice_del()),!1}function d(e){return!c()||(A.slice_del(),A.ket=A.cursor,A.eq_s_b(2,e)&&(A.bra=A.cursor,c()&&A.slice_del()),!1)}function b(){var e;if(A.ket=A.cursor,e=A.find_among_b(S,46)){switch(A.bra=A.cursor,e){case 1:if(!c())return!1;A.slice_del();break;case 2:if(d("ic"))return!1;break;case 3:if(!c())return!1;A.slice_from("log");break;case 4:if(!c())return!1;A.slice_from("u");break;case 5:if(!c())return!1;A.slice_from("ente");break;case 6:if(!w())return!1;A.slice_del(),A.ket=A.cursor,e=A.find_among_b(C,4),e&&(A.bra=A.cursor,c()&&(A.slice_del(),1==e&&(A.ket=A.cursor,A.eq_s_b(2,"at")&&(A.bra=A.cursor,c()&&A.slice_del()))));break;case 7:if(l(P,3))return!1;break;case 8:if(l(F,3))return!1;break;case 9:if(d("at"))return!1}return!0}return!1}function f(){var e,s;if(A.cursor>=g&&(s=A.limit_backward,A.limit_backward=g,A.ket=A.cursor,e=A.find_among_b(W,12),A.limit_backward=s,e)){if(A.bra=A.cursor,1==e){if(!A.eq_s_b(1,"u"))return!1;A.slice_del()}return!0}return!1}function _(){var e,s,r,n;if(A.cursor>=g&&(s=A.limit_backward,A.limit_backward=g,A.ket=A.cursor,e=A.find_among_b(L,96),A.limit_backward=s,e))switch(A.bra=A.cursor,e){case 1:r=A.limit-A.cursor,A.eq_s_b(1,"u")?(n=A.limit-A.cursor,A.eq_s_b(1,"g")?A.cursor=A.limit-n:A.cursor=A.limit-r):A.cursor=A.limit-r,A.bra=A.cursor;case 2:A.slice_del()}}function h(){var e,s;if(A.ket=A.cursor,e=A.find_among_b(z,8))switch(A.bra=A.cursor,e){case 1:u()&&A.slice_del();break;case 2:u()&&(A.slice_del(),A.ket=A.cursor,A.eq_s_b(1,"u")&&(A.bra=A.cursor,s=A.limit-A.cursor,A.eq_s_b(1,"g")&&(A.cursor=A.limit-s,u()&&A.slice_del())))}}var v,p,g,k=[new s("",-1,6),new s("á",0,1),new s("é",0,2),new s("í",0,3),new s("ó",0,4),new s("ú",0,5)],y=[new s("la",-1,-1),new s("sela",0,-1),new s("le",-1,-1),new s("me",-1,-1),new s("se",-1,-1),new s("lo",-1,-1),new s("selo",5,-1),new s("las",-1,-1),new s("selas",7,-1),new s("les",-1,-1),new s("los",-1,-1),new s("selos",10,-1),new s("nos",-1,-1)],q=[new s("ando",-1,6),new s("iendo",-1,6),new s("yendo",-1,7),new s("ándo",-1,2),new s("iéndo",-1,1),new s("ar",-1,6),new s("er",-1,6),new s("ir",-1,6),new s("ár",-1,3),new s("ér",-1,4),new s("ír",-1,5)],C=[new s("ic",-1,-1),new s("ad",-1,-1),new s("os",-1,-1),new s("iv",-1,1)],P=[new s("able",-1,1),new s("ible",-1,1),new s("ante",-1,1)],F=[new s("ic",-1,1),new s("abil",-1,1),new s("iv",-1,1)],S=[new s("ica",-1,1),new s("ancia",-1,2),new s("encia",-1,5),new s("adora",-1,2),new s("osa",-1,1),new s("ista",-1,1),new s("iva",-1,9),new s("anza",-1,1),new s("logía",-1,3),new s("idad",-1,8),new s("able",-1,1),new s("ible",-1,1),new s("ante",-1,2),new s("mente",-1,7),new s("amente",13,6),new s("ación",-1,2),new s("ución",-1,4),new s("ico",-1,1),new s("ismo",-1,1),new s("oso",-1,1),new s("amiento",-1,1),new s("imiento",-1,1),new s("ivo",-1,9),new s("ador",-1,2),new s("icas",-1,1),new s("ancias",-1,2),new s("encias",-1,5),new s("adoras",-1,2),new s("osas",-1,1),new s("istas",-1,1),new s("ivas",-1,9),new s("anzas",-1,1),new s("logías",-1,3),new s("idades",-1,8),new s("ables",-1,1),new s("ibles",-1,1),new s("aciones",-1,2),new s("uciones",-1,4),new s("adores",-1,2),new s("antes",-1,2),new s("icos",-1,1),new s("ismos",-1,1),new s("osos",-1,1),new s("amientos",-1,1),new s("imientos",-1,1),new s("ivos",-1,9)],W=[new s("ya",-1,1),new s("ye",-1,1),new s("yan",-1,1),new s("yen",-1,1),new s("yeron",-1,1),new s("yendo",-1,1),new s("yo",-1,1),new s("yas",-1,1),new s("yes",-1,1),new s("yais",-1,1),new s("yamos",-1,1),new s("yó",-1,1)],L=[new s("aba",-1,2),new s("ada",-1,2),new s("ida",-1,2),new s("ara",-1,2),new s("iera",-1,2),new s("ía",-1,2),new s("aría",5,2),new s("ería",5,2),new s("iría",5,2),new s("ad",-1,2),new s("ed",-1,2),new s("id",-1,2),new s("ase",-1,2),new s("iese",-1,2),new s("aste",-1,2),new s("iste",-1,2),new s("an",-1,2),new s("aban",16,2),new s("aran",16,2),new s("ieran",16,2),new s("ían",16,2),new s("arían",20,2),new s("erían",20,2),new s("irían",20,2),new s("en",-1,1),new s("asen",24,2),new s("iesen",24,2),new s("aron",-1,2),new s("ieron",-1,2),new s("arán",-1,2),new s("erán",-1,2),new s("irán",-1,2),new s("ado",-1,2),new s("ido",-1,2),new s("ando",-1,2),new s("iendo",-1,2),new s("ar",-1,2),new s("er",-1,2),new s("ir",-1,2),new s("as",-1,2),new s("abas",39,2),new s("adas",39,2),new s("idas",39,2),new s("aras",39,2),new s("ieras",39,2),new s("ías",39,2),new s("arías",45,2),new s("erías",45,2),new s("irías",45,2),new s("es",-1,1),new s("ases",49,2),new s("ieses",49,2),new s("abais",-1,2),new s("arais",-1,2),new s("ierais",-1,2),new s("íais",-1,2),new s("aríais",55,2),new s("eríais",55,2),new s("iríais",55,2),new s("aseis",-1,2),new s("ieseis",-1,2),new s("asteis",-1,2),new s("isteis",-1,2),new s("áis",-1,2),new s("éis",-1,1),new s("aréis",64,2),new s("eréis",64,2),new s("iréis",64,2),new s("ados",-1,2),new s("idos",-1,2),new s("amos",-1,2),new s("ábamos",70,2),new s("áramos",70,2),new s("iéramos",70,2),new s("íamos",70,2),new s("aríamos",74,2),new s("eríamos",74,2),new s("iríamos",74,2),new s("emos",-1,1),new s("aremos",78,2),new s("eremos",78,2),new s("iremos",78,2),new s("ásemos",78,2),new s("iésemos",78,2),new s("imos",-1,2),new s("arás",-1,2),new s("erás",-1,2),new s("irás",-1,2),new s("ís",-1,2),new s("ará",-1,2),new s("erá",-1,2),new s("irá",-1,2),new s("aré",-1,2),new s("eré",-1,2),new s("iré",-1,2),new s("ió",-1,2)],z=[new s("a",-1,1),new s("e",-1,2),new s("o",-1,1),new s("os",-1,1),new s("á",-1,1),new s("é",-1,2),new s("í",-1,1),new s("ó",-1,1)],x=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,1,17,4,10],A=new r;this.setCurrent=function(e){A.setCurrent(e)},this.getCurrent=function(){return A.getCurrent()},this.stem=function(){var e=A.cursor;return t(),A.limit_backward=e,A.cursor=A.limit,m(),A.cursor=A.limit,b()||(A.cursor=A.limit,f()||(A.cursor=A.limit,_())),A.cursor=A.limit,h(),A.cursor=A.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.es.stemmer,"stemmer-es"),e.es.stopWordFilter=e.generateStopWordFilter("a al algo algunas algunos ante antes como con contra cual cuando de del desde donde durante e el ella ellas ellos en entre era erais eran eras eres es esa esas ese eso esos esta estaba estabais estaban estabas estad estada estadas estado estados estamos estando estar estaremos estará estarán estarás estaré estaréis estaría estaríais estaríamos estarían estarías estas este estemos esto estos estoy estuve estuviera estuvierais estuvieran estuvieras estuvieron estuviese estuvieseis estuviesen estuvieses estuvimos estuviste estuvisteis estuviéramos estuviésemos estuvo está estábamos estáis están estás esté estéis estén estés fue fuera fuerais fueran fueras fueron fuese fueseis fuesen fueses fui fuimos fuiste fuisteis fuéramos fuésemos ha habida habidas habido habidos habiendo habremos habrá habrán habrás habré habréis habría habríais habríamos habrían habrías habéis había habíais habíamos habían habías han has hasta hay haya hayamos hayan hayas hayáis he hemos hube hubiera hubierais hubieran hubieras hubieron hubiese hubieseis hubiesen hubieses hubimos hubiste hubisteis hubiéramos hubiésemos hubo la las le les lo los me mi mis mucho muchos muy más mí mía mías mío míos nada ni no nos nosotras nosotros nuestra nuestras nuestro nuestros o os otra otras otro otros para pero poco por porque que quien quienes qué se sea seamos sean seas seremos será serán serás seré seréis sería seríais seríamos serían serías seáis sido siendo sin sobre sois somos son soy su sus suya suyas suyo suyos sí también tanto te tendremos tendrá tendrán tendrás tendré tendréis tendría tendríais tendríamos tendrían tendrías tened tenemos tenga tengamos tengan tengas tengo tengáis tenida tenidas tenido tenidos teniendo tenéis tenía teníais teníamos tenían tenías ti tiene tienen tienes todo todos tu tus tuve tuviera tuvierais tuvieran tuvieras tuvieron tuviese tuvieseis tuviesen tuvieses tuvimos tuviste tuvisteis tuviéramos tuviésemos tuvo tuya tuyas tuyo tuyos tú un una uno unos vosotras vosotros vuestra vuestras vuestro vuestros y ya yo él éramos".split(" ")),e.Pipeline.registerFunction(e.es.stopWordFilter,"stopWordFilter-es")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.fi.min.js b/site/assets/javascripts/lunr/min/lunr.fi.min.js deleted file mode 100644 index 29f5dfc..0000000 --- a/site/assets/javascripts/lunr/min/lunr.fi.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Lunr languages, `Finnish` language - * https://github.com/MihaiValentin/lunr-languages - * - * Copyright 2014, Mihai Valentin - * http://www.mozilla.org/MPL/ - */ -/*! - * based on - * Snowball JavaScript Library v0.3 - * http://code.google.com/p/urim/ - * http://snowball.tartarus.org/ - * - * Copyright 2010, Oleg Mazko - * http://www.mozilla.org/MPL/ - */ - -!function(i,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():e()(i.lunr)}(this,function(){return function(i){if(void 0===i)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===i.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");i.fi=function(){this.pipeline.reset(),this.pipeline.add(i.fi.trimmer,i.fi.stopWordFilter,i.fi.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(i.fi.stemmer))},i.fi.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",i.fi.trimmer=i.trimmerSupport.generateTrimmer(i.fi.wordCharacters),i.Pipeline.registerFunction(i.fi.trimmer,"trimmer-fi"),i.fi.stemmer=function(){var e=i.stemmerSupport.Among,r=i.stemmerSupport.SnowballProgram,n=new function(){function i(){f=A.limit,d=f,n()||(f=A.cursor,n()||(d=A.cursor))}function n(){for(var i;;){if(i=A.cursor,A.in_grouping(W,97,246))break;if(A.cursor=i,i>=A.limit)return!0;A.cursor++}for(A.cursor=i;!A.out_grouping(W,97,246);){if(A.cursor>=A.limit)return!0;A.cursor++}return!1}function t(){return d<=A.cursor}function s(){var i,e;if(A.cursor>=f)if(e=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,i=A.find_among_b(h,10)){switch(A.bra=A.cursor,A.limit_backward=e,i){case 1:if(!A.in_grouping_b(x,97,246))return;break;case 2:if(!t())return}A.slice_del()}else A.limit_backward=e}function o(){var i,e,r;if(A.cursor>=f)if(e=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,i=A.find_among_b(v,9))switch(A.bra=A.cursor,A.limit_backward=e,i){case 1:r=A.limit-A.cursor,A.eq_s_b(1,"k")||(A.cursor=A.limit-r,A.slice_del());break;case 2:A.slice_del(),A.ket=A.cursor,A.eq_s_b(3,"kse")&&(A.bra=A.cursor,A.slice_from("ksi"));break;case 3:A.slice_del();break;case 4:A.find_among_b(p,6)&&A.slice_del();break;case 5:A.find_among_b(g,6)&&A.slice_del();break;case 6:A.find_among_b(j,2)&&A.slice_del()}else A.limit_backward=e}function l(){return A.find_among_b(q,7)}function a(){return A.eq_s_b(1,"i")&&A.in_grouping_b(L,97,246)}function u(){var i,e,r;if(A.cursor>=f)if(e=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,i=A.find_among_b(C,30)){switch(A.bra=A.cursor,A.limit_backward=e,i){case 1:if(!A.eq_s_b(1,"a"))return;break;case 2:case 9:if(!A.eq_s_b(1,"e"))return;break;case 3:if(!A.eq_s_b(1,"i"))return;break;case 4:if(!A.eq_s_b(1,"o"))return;break;case 5:if(!A.eq_s_b(1,"ä"))return;break;case 6:if(!A.eq_s_b(1,"ö"))return;break;case 7:if(r=A.limit-A.cursor,!l()&&(A.cursor=A.limit-r,!A.eq_s_b(2,"ie"))){A.cursor=A.limit-r;break}if(A.cursor=A.limit-r,A.cursor<=A.limit_backward){A.cursor=A.limit-r;break}A.cursor--,A.bra=A.cursor;break;case 8:if(!A.in_grouping_b(W,97,246)||!A.out_grouping_b(W,97,246))return}A.slice_del(),k=!0}else A.limit_backward=e}function c(){var i,e,r;if(A.cursor>=d)if(e=A.limit_backward,A.limit_backward=d,A.ket=A.cursor,i=A.find_among_b(P,14)){if(A.bra=A.cursor,A.limit_backward=e,1==i){if(r=A.limit-A.cursor,A.eq_s_b(2,"po"))return;A.cursor=A.limit-r}A.slice_del()}else A.limit_backward=e}function m(){var i;A.cursor>=f&&(i=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,A.find_among_b(F,2)?(A.bra=A.cursor,A.limit_backward=i,A.slice_del()):A.limit_backward=i)}function w(){var i,e,r,n,t,s;if(A.cursor>=f){if(e=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,A.eq_s_b(1,"t")&&(A.bra=A.cursor,r=A.limit-A.cursor,A.in_grouping_b(W,97,246)&&(A.cursor=A.limit-r,A.slice_del(),A.limit_backward=e,n=A.limit-A.cursor,A.cursor>=d&&(A.cursor=d,t=A.limit_backward,A.limit_backward=A.cursor,A.cursor=A.limit-n,A.ket=A.cursor,i=A.find_among_b(S,2))))){if(A.bra=A.cursor,A.limit_backward=t,1==i){if(s=A.limit-A.cursor,A.eq_s_b(2,"po"))return;A.cursor=A.limit-s}return void A.slice_del()}A.limit_backward=e}}function _(){var i,e,r,n;if(A.cursor>=f){for(i=A.limit_backward,A.limit_backward=f,e=A.limit-A.cursor,l()&&(A.cursor=A.limit-e,A.ket=A.cursor,A.cursor>A.limit_backward&&(A.cursor--,A.bra=A.cursor,A.slice_del())),A.cursor=A.limit-e,A.ket=A.cursor,A.in_grouping_b(y,97,228)&&(A.bra=A.cursor,A.out_grouping_b(W,97,246)&&A.slice_del()),A.cursor=A.limit-e,A.ket=A.cursor,A.eq_s_b(1,"j")&&(A.bra=A.cursor,r=A.limit-A.cursor,A.eq_s_b(1,"o")?A.slice_del():(A.cursor=A.limit-r,A.eq_s_b(1,"u")&&A.slice_del())),A.cursor=A.limit-e,A.ket=A.cursor,A.eq_s_b(1,"o")&&(A.bra=A.cursor,A.eq_s_b(1,"j")&&A.slice_del()),A.cursor=A.limit-e,A.limit_backward=i;;){if(n=A.limit-A.cursor,A.out_grouping_b(W,97,246)){A.cursor=A.limit-n;break}if(A.cursor=A.limit-n,A.cursor<=A.limit_backward)return;A.cursor--}A.ket=A.cursor,A.cursor>A.limit_backward&&(A.cursor--,A.bra=A.cursor,b=A.slice_to(),A.eq_v_b(b)&&A.slice_del())}}var k,b,d,f,h=[new e("pa",-1,1),new e("sti",-1,2),new e("kaan",-1,1),new e("han",-1,1),new e("kin",-1,1),new e("hän",-1,1),new e("kään",-1,1),new e("ko",-1,1),new e("pä",-1,1),new e("kö",-1,1)],p=[new e("lla",-1,-1),new e("na",-1,-1),new e("ssa",-1,-1),new e("ta",-1,-1),new e("lta",3,-1),new e("sta",3,-1)],g=[new e("llä",-1,-1),new e("nä",-1,-1),new e("ssä",-1,-1),new e("tä",-1,-1),new e("ltä",3,-1),new e("stä",3,-1)],j=[new e("lle",-1,-1),new e("ine",-1,-1)],v=[new e("nsa",-1,3),new e("mme",-1,3),new e("nne",-1,3),new e("ni",-1,2),new e("si",-1,1),new e("an",-1,4),new e("en",-1,6),new e("än",-1,5),new e("nsä",-1,3)],q=[new e("aa",-1,-1),new e("ee",-1,-1),new e("ii",-1,-1),new e("oo",-1,-1),new e("uu",-1,-1),new e("ää",-1,-1),new e("öö",-1,-1)],C=[new e("a",-1,8),new e("lla",0,-1),new e("na",0,-1),new e("ssa",0,-1),new e("ta",0,-1),new e("lta",4,-1),new e("sta",4,-1),new e("tta",4,9),new e("lle",-1,-1),new e("ine",-1,-1),new e("ksi",-1,-1),new e("n",-1,7),new e("han",11,1),new e("den",11,-1,a),new e("seen",11,-1,l),new e("hen",11,2),new e("tten",11,-1,a),new e("hin",11,3),new e("siin",11,-1,a),new e("hon",11,4),new e("hän",11,5),new e("hön",11,6),new e("ä",-1,8),new e("llä",22,-1),new e("nä",22,-1),new e("ssä",22,-1),new e("tä",22,-1),new e("ltä",26,-1),new e("stä",26,-1),new e("ttä",26,9)],P=[new e("eja",-1,-1),new e("mma",-1,1),new e("imma",1,-1),new e("mpa",-1,1),new e("impa",3,-1),new e("mmi",-1,1),new e("immi",5,-1),new e("mpi",-1,1),new e("impi",7,-1),new e("ejä",-1,-1),new e("mmä",-1,1),new e("immä",10,-1),new e("mpä",-1,1),new e("impä",12,-1)],F=[new e("i",-1,-1),new e("j",-1,-1)],S=[new e("mma",-1,1),new e("imma",0,-1)],y=[17,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8],W=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32],L=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32],x=[17,97,24,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32],A=new r;this.setCurrent=function(i){A.setCurrent(i)},this.getCurrent=function(){return A.getCurrent()},this.stem=function(){var e=A.cursor;return i(),k=!1,A.limit_backward=e,A.cursor=A.limit,s(),A.cursor=A.limit,o(),A.cursor=A.limit,u(),A.cursor=A.limit,c(),A.cursor=A.limit,k?(m(),A.cursor=A.limit):(A.cursor=A.limit,w(),A.cursor=A.limit),_(),!0}};return function(i){return"function"==typeof i.update?i.update(function(i){return n.setCurrent(i),n.stem(),n.getCurrent()}):(n.setCurrent(i),n.stem(),n.getCurrent())}}(),i.Pipeline.registerFunction(i.fi.stemmer,"stemmer-fi"),i.fi.stopWordFilter=i.generateStopWordFilter("ei eivät emme en et ette että he heidän heidät heihin heille heillä heiltä heissä heistä heitä hän häneen hänelle hänellä häneltä hänen hänessä hänestä hänet häntä itse ja johon joiden joihin joiksi joilla joille joilta joina joissa joista joita joka joksi jolla jolle jolta jona jonka jos jossa josta jota jotka kanssa keiden keihin keiksi keille keillä keiltä keinä keissä keistä keitä keneen keneksi kenelle kenellä keneltä kenen kenenä kenessä kenestä kenet ketkä ketkä ketä koska kuin kuka kun me meidän meidät meihin meille meillä meiltä meissä meistä meitä mihin miksi mikä mille millä miltä minkä minkä minua minulla minulle minulta minun minussa minusta minut minuun minä minä missä mistä mitkä mitä mukaan mutta ne niiden niihin niiksi niille niillä niiltä niin niin niinä niissä niistä niitä noiden noihin noiksi noilla noille noilta noin noina noissa noista noita nuo nyt näiden näihin näiksi näille näillä näiltä näinä näissä näistä näitä nämä ole olemme olen olet olette oli olimme olin olisi olisimme olisin olisit olisitte olisivat olit olitte olivat olla olleet ollut on ovat poikki se sekä sen siihen siinä siitä siksi sille sillä sillä siltä sinua sinulla sinulle sinulta sinun sinussa sinusta sinut sinuun sinä sinä sitä tai te teidän teidät teihin teille teillä teiltä teissä teistä teitä tuo tuohon tuoksi tuolla tuolle tuolta tuon tuona tuossa tuosta tuota tähän täksi tälle tällä tältä tämä tämän tänä tässä tästä tätä vaan vai vaikka yli".split(" ")),i.Pipeline.registerFunction(i.fi.stopWordFilter,"stopWordFilter-fi")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.fr.min.js b/site/assets/javascripts/lunr/min/lunr.fr.min.js deleted file mode 100644 index 68cd009..0000000 --- a/site/assets/javascripts/lunr/min/lunr.fr.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Lunr languages, `French` language - * https://github.com/MihaiValentin/lunr-languages - * - * Copyright 2014, Mihai Valentin - * http://www.mozilla.org/MPL/ - */ -/*! - * based on - * Snowball JavaScript Library v0.3 - * http://code.google.com/p/urim/ - * http://snowball.tartarus.org/ - * - * Copyright 2010, Oleg Mazko - * http://www.mozilla.org/MPL/ - */ - -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.fr=function(){this.pipeline.reset(),this.pipeline.add(e.fr.trimmer,e.fr.stopWordFilter,e.fr.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.fr.stemmer))},e.fr.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.fr.trimmer=e.trimmerSupport.generateTrimmer(e.fr.wordCharacters),e.Pipeline.registerFunction(e.fr.trimmer,"trimmer-fr"),e.fr.stemmer=function(){var r=e.stemmerSupport.Among,s=e.stemmerSupport.SnowballProgram,i=new function(){function e(e,r,s){return!(!W.eq_s(1,e)||(W.ket=W.cursor,!W.in_grouping(F,97,251)))&&(W.slice_from(r),W.cursor=s,!0)}function i(e,r,s){return!!W.eq_s(1,e)&&(W.ket=W.cursor,W.slice_from(r),W.cursor=s,!0)}function n(){for(var r,s;;){if(r=W.cursor,W.in_grouping(F,97,251)){if(W.bra=W.cursor,s=W.cursor,e("u","U",r))continue;if(W.cursor=s,e("i","I",r))continue;if(W.cursor=s,i("y","Y",r))continue}if(W.cursor=r,W.bra=r,!e("y","Y",r)){if(W.cursor=r,W.eq_s(1,"q")&&(W.bra=W.cursor,i("u","U",r)))continue;if(W.cursor=r,r>=W.limit)return;W.cursor++}}}function t(){for(;!W.in_grouping(F,97,251);){if(W.cursor>=W.limit)return!0;W.cursor++}for(;!W.out_grouping(F,97,251);){if(W.cursor>=W.limit)return!0;W.cursor++}return!1}function u(){var e=W.cursor;if(q=W.limit,g=q,p=q,W.in_grouping(F,97,251)&&W.in_grouping(F,97,251)&&W.cursor=W.limit){W.cursor=q;break}W.cursor++}while(!W.in_grouping(F,97,251))}q=W.cursor,W.cursor=e,t()||(g=W.cursor,t()||(p=W.cursor))}function o(){for(var e,r;;){if(r=W.cursor,W.bra=r,!(e=W.find_among(h,4)))break;switch(W.ket=W.cursor,e){case 1:W.slice_from("i");break;case 2:W.slice_from("u");break;case 3:W.slice_from("y");break;case 4:if(W.cursor>=W.limit)return;W.cursor++}}}function c(){return q<=W.cursor}function a(){return g<=W.cursor}function l(){return p<=W.cursor}function w(){var e,r;if(W.ket=W.cursor,e=W.find_among_b(C,43)){switch(W.bra=W.cursor,e){case 1:if(!l())return!1;W.slice_del();break;case 2:if(!l())return!1;W.slice_del(),W.ket=W.cursor,W.eq_s_b(2,"ic")&&(W.bra=W.cursor,l()?W.slice_del():W.slice_from("iqU"));break;case 3:if(!l())return!1;W.slice_from("log");break;case 4:if(!l())return!1;W.slice_from("u");break;case 5:if(!l())return!1;W.slice_from("ent");break;case 6:if(!c())return!1;if(W.slice_del(),W.ket=W.cursor,e=W.find_among_b(z,6))switch(W.bra=W.cursor,e){case 1:l()&&(W.slice_del(),W.ket=W.cursor,W.eq_s_b(2,"at")&&(W.bra=W.cursor,l()&&W.slice_del()));break;case 2:l()?W.slice_del():a()&&W.slice_from("eux");break;case 3:l()&&W.slice_del();break;case 4:c()&&W.slice_from("i")}break;case 7:if(!l())return!1;if(W.slice_del(),W.ket=W.cursor,e=W.find_among_b(y,3))switch(W.bra=W.cursor,e){case 1:l()?W.slice_del():W.slice_from("abl");break;case 2:l()?W.slice_del():W.slice_from("iqU");break;case 3:l()&&W.slice_del()}break;case 8:if(!l())return!1;if(W.slice_del(),W.ket=W.cursor,W.eq_s_b(2,"at")&&(W.bra=W.cursor,l()&&(W.slice_del(),W.ket=W.cursor,W.eq_s_b(2,"ic")))){W.bra=W.cursor,l()?W.slice_del():W.slice_from("iqU");break}break;case 9:W.slice_from("eau");break;case 10:if(!a())return!1;W.slice_from("al");break;case 11:if(l())W.slice_del();else{if(!a())return!1;W.slice_from("eux")}break;case 12:if(!a()||!W.out_grouping_b(F,97,251))return!1;W.slice_del();break;case 13:return c()&&W.slice_from("ant"),!1;case 14:return c()&&W.slice_from("ent"),!1;case 15:return r=W.limit-W.cursor,W.in_grouping_b(F,97,251)&&c()&&(W.cursor=W.limit-r,W.slice_del()),!1}return!0}return!1}function f(){var e,r;if(W.cursor=q){if(s=W.limit_backward,W.limit_backward=q,W.ket=W.cursor,e=W.find_among_b(P,7))switch(W.bra=W.cursor,e){case 1:if(l()){if(i=W.limit-W.cursor,!W.eq_s_b(1,"s")&&(W.cursor=W.limit-i,!W.eq_s_b(1,"t")))break;W.slice_del()}break;case 2:W.slice_from("i");break;case 3:W.slice_del();break;case 4:W.eq_s_b(2,"gu")&&W.slice_del()}W.limit_backward=s}}function b(){var e=W.limit-W.cursor;W.find_among_b(U,5)&&(W.cursor=W.limit-e,W.ket=W.cursor,W.cursor>W.limit_backward&&(W.cursor--,W.bra=W.cursor,W.slice_del()))}function d(){for(var e,r=1;W.out_grouping_b(F,97,251);)r--;if(r<=0){if(W.ket=W.cursor,e=W.limit-W.cursor,!W.eq_s_b(1,"é")&&(W.cursor=W.limit-e,!W.eq_s_b(1,"è")))return;W.bra=W.cursor,W.slice_from("e")}}function k(){if(!w()&&(W.cursor=W.limit,!f()&&(W.cursor=W.limit,!m())))return W.cursor=W.limit,void _();W.cursor=W.limit,W.ket=W.cursor,W.eq_s_b(1,"Y")?(W.bra=W.cursor,W.slice_from("i")):(W.cursor=W.limit,W.eq_s_b(1,"ç")&&(W.bra=W.cursor,W.slice_from("c")))}var p,g,q,v=[new r("col",-1,-1),new r("par",-1,-1),new r("tap",-1,-1)],h=[new r("",-1,4),new r("I",0,1),new r("U",0,2),new r("Y",0,3)],z=[new r("iqU",-1,3),new r("abl",-1,3),new r("Ièr",-1,4),new r("ièr",-1,4),new r("eus",-1,2),new r("iv",-1,1)],y=[new r("ic",-1,2),new r("abil",-1,1),new r("iv",-1,3)],C=[new r("iqUe",-1,1),new r("atrice",-1,2),new r("ance",-1,1),new r("ence",-1,5),new r("logie",-1,3),new r("able",-1,1),new r("isme",-1,1),new r("euse",-1,11),new r("iste",-1,1),new r("ive",-1,8),new r("if",-1,8),new r("usion",-1,4),new r("ation",-1,2),new r("ution",-1,4),new r("ateur",-1,2),new r("iqUes",-1,1),new r("atrices",-1,2),new r("ances",-1,1),new r("ences",-1,5),new r("logies",-1,3),new r("ables",-1,1),new r("ismes",-1,1),new r("euses",-1,11),new r("istes",-1,1),new r("ives",-1,8),new r("ifs",-1,8),new r("usions",-1,4),new r("ations",-1,2),new r("utions",-1,4),new r("ateurs",-1,2),new r("ments",-1,15),new r("ements",30,6),new r("issements",31,12),new r("ités",-1,7),new r("ment",-1,15),new r("ement",34,6),new r("issement",35,12),new r("amment",34,13),new r("emment",34,14),new r("aux",-1,10),new r("eaux",39,9),new r("eux",-1,1),new r("ité",-1,7)],x=[new r("ira",-1,1),new r("ie",-1,1),new r("isse",-1,1),new r("issante",-1,1),new r("i",-1,1),new r("irai",4,1),new r("ir",-1,1),new r("iras",-1,1),new r("ies",-1,1),new r("îmes",-1,1),new r("isses",-1,1),new r("issantes",-1,1),new r("îtes",-1,1),new r("is",-1,1),new r("irais",13,1),new r("issais",13,1),new r("irions",-1,1),new r("issions",-1,1),new r("irons",-1,1),new r("issons",-1,1),new r("issants",-1,1),new r("it",-1,1),new r("irait",21,1),new r("issait",21,1),new r("issant",-1,1),new r("iraIent",-1,1),new r("issaIent",-1,1),new r("irent",-1,1),new r("issent",-1,1),new r("iront",-1,1),new r("ît",-1,1),new r("iriez",-1,1),new r("issiez",-1,1),new r("irez",-1,1),new r("issez",-1,1)],I=[new r("a",-1,3),new r("era",0,2),new r("asse",-1,3),new r("ante",-1,3),new r("ée",-1,2),new r("ai",-1,3),new r("erai",5,2),new r("er",-1,2),new r("as",-1,3),new r("eras",8,2),new r("âmes",-1,3),new r("asses",-1,3),new r("antes",-1,3),new r("âtes",-1,3),new r("ées",-1,2),new r("ais",-1,3),new r("erais",15,2),new r("ions",-1,1),new r("erions",17,2),new r("assions",17,3),new r("erons",-1,2),new r("ants",-1,3),new r("és",-1,2),new r("ait",-1,3),new r("erait",23,2),new r("ant",-1,3),new r("aIent",-1,3),new r("eraIent",26,2),new r("èrent",-1,2),new r("assent",-1,3),new r("eront",-1,2),new r("ât",-1,3),new r("ez",-1,2),new r("iez",32,2),new r("eriez",33,2),new r("assiez",33,3),new r("erez",32,2),new r("é",-1,2)],P=[new r("e",-1,3),new r("Ière",0,2),new r("ière",0,2),new r("ion",-1,1),new r("Ier",-1,2),new r("ier",-1,2),new r("ë",-1,4)],U=[new r("ell",-1,-1),new r("eill",-1,-1),new r("enn",-1,-1),new r("onn",-1,-1),new r("ett",-1,-1)],F=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,128,130,103,8,5],S=[1,65,20,0,0,0,0,0,0,0,0,0,0,0,0,0,128],W=new s;this.setCurrent=function(e){W.setCurrent(e)},this.getCurrent=function(){return W.getCurrent()},this.stem=function(){var e=W.cursor;return n(),W.cursor=e,u(),W.limit_backward=e,W.cursor=W.limit,k(),W.cursor=W.limit,b(),W.cursor=W.limit,d(),W.cursor=W.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.fr.stemmer,"stemmer-fr"),e.fr.stopWordFilter=e.generateStopWordFilter("ai aie aient aies ait as au aura aurai auraient aurais aurait auras aurez auriez aurions aurons auront aux avaient avais avait avec avez aviez avions avons ayant ayez ayons c ce ceci celà ces cet cette d dans de des du elle en es est et eu eue eues eurent eus eusse eussent eusses eussiez eussions eut eux eûmes eût eûtes furent fus fusse fussent fusses fussiez fussions fut fûmes fût fûtes ici il ils j je l la le les leur leurs lui m ma mais me mes moi mon même n ne nos notre nous on ont ou par pas pour qu que quel quelle quelles quels qui s sa sans se sera serai seraient serais serait seras serez seriez serions serons seront ses soi soient sois soit sommes son sont soyez soyons suis sur t ta te tes toi ton tu un une vos votre vous y à étaient étais était étant étiez étions été étée étées étés êtes".split(" ")),e.Pipeline.registerFunction(e.fr.stopWordFilter,"stopWordFilter-fr")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.he.min.js b/site/assets/javascripts/lunr/min/lunr.he.min.js deleted file mode 100644 index b863d3e..0000000 --- a/site/assets/javascripts/lunr/min/lunr.he.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.he=function(){this.pipeline.reset(),this.pipeline.add(e.he.trimmer,e.he.stopWordFilter,e.he.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.he.stemmer))},e.he.wordCharacters="֑-״א-תa-zA-Za-zA-Z0-90-9",e.he.trimmer=e.trimmerSupport.generateTrimmer(e.he.wordCharacters),e.Pipeline.registerFunction(e.he.trimmer,"trimmer-he"),e.he.stemmer=function(){var e=this;return e.result=!1,e.preRemoved=!1,e.sufRemoved=!1,e.pre={pre1:"ה ו י ת",pre2:"ב כ ל מ ש כש",pre3:"הב הכ הל המ הש בש לכ",pre4:"וב וכ ול ומ וש",pre5:"מה שה כל",pre6:"מב מכ מל ממ מש",pre7:"בה בו בי בת כה כו כי כת לה לו לי לת",pre8:"ובה ובו ובי ובת וכה וכו וכי וכת ולה ולו ולי ולת"},e.suf={suf1:"ך כ ם ן נ",suf2:"ים ות וך וכ ום ון ונ הם הן יכ יך ינ ים",suf3:"תי תך תכ תם תן תנ",suf4:"ותי ותך ותכ ותם ותן ותנ",suf5:"נו כם כן הם הן",suf6:"ונו וכם וכן והם והן",suf7:"תכם תכן תנו תהם תהן",suf8:"הוא היא הם הן אני אתה את אנו אתם אתן",suf9:"ני נו כי כו כם כן תי תך תכ תם תן",suf10:"י ך כ ם ן נ ת"},e.patterns=JSON.parse('{"hebrewPatterns": [{"pt1": [{"c": "ה", "l": 0}]}, {"pt2": [{"c": "ו", "l": 0}]}, {"pt3": [{"c": "י", "l": 0}]}, {"pt4": [{"c": "ת", "l": 0}]}, {"pt5": [{"c": "מ", "l": 0}]}, {"pt6": [{"c": "ל", "l": 0}]}, {"pt7": [{"c": "ב", "l": 0}]}, {"pt8": [{"c": "כ", "l": 0}]}, {"pt9": [{"c": "ש", "l": 0}]}, {"pt10": [{"c": "כש", "l": 0}]}, {"pt11": [{"c": "בה", "l": 0}]}, {"pt12": [{"c": "וב", "l": 0}]}, {"pt13": [{"c": "וכ", "l": 0}]}, {"pt14": [{"c": "ול", "l": 0}]}, {"pt15": [{"c": "ומ", "l": 0}]}, {"pt16": [{"c": "וש", "l": 0}]}, {"pt17": [{"c": "הב", "l": 0}]}, {"pt18": [{"c": "הכ", "l": 0}]}, {"pt19": [{"c": "הל", "l": 0}]}, {"pt20": [{"c": "המ", "l": 0}]}, {"pt21": [{"c": "הש", "l": 0}]}, {"pt22": [{"c": "מה", "l": 0}]}, {"pt23": [{"c": "שה", "l": 0}]}, {"pt24": [{"c": "כל", "l": 0}]}]}'),e.execArray=["cleanWord","removeDiacritics","removeStopWords","normalizeHebrewCharacters"],e.stem=function(){var r=0;for(e.result=!1,e.preRemoved=!1,e.sufRemoved=!1;r=0)return!0},e.normalizeHebrewCharacters=function(){return e.word=e.word.replace("ך","כ"),e.word=e.word.replace("ם","מ"),e.word=e.word.replace("ן","נ"),e.word=e.word.replace("ף","פ"),e.word=e.word.replace("ץ","צ"),!1},function(r){return"function"==typeof r.update?r.update(function(r){return e.setCurrent(r),e.stem(),e.getCurrent()}):(e.setCurrent(r),e.stem(),e.getCurrent())}}(),e.Pipeline.registerFunction(e.he.stemmer,"stemmer-he"),e.he.stopWordFilter=e.generateStopWordFilter("אבל או אולי אותו אותי אותך אותם אותן אותנו אז אחר אחרות אחרי אחריכן אחרים אחרת אי איזה איך אין איפה אל אלה אלו אם אנחנו אני אף אפשר את אתה אתכם אתכן אתם אתן באיזה באיזו בגלל בין בלבד בעבור בעזרת בכל בכן בלי במידה במקום שבו ברוב בשביל בשעה ש בתוך גם דרך הוא היא היה היי היכן היתה היתי הם הן הנה הסיבה שבגללה הרי ואילו ואת זאת זה זות יהיה יוכל יוכלו יותר מדי יכול יכולה יכולות יכולים יכל יכלה יכלו יש כאן כאשר כולם כולן כזה כי כיצד כך כל כלל כמו כן כפי כש לא לאו לאיזותך לאן לבין לה להיות להם להן לו לזה לזות לי לך לכם לכן למה למעלה למעלה מ למטה למטה מ למעט למקום שבו למרות לנו לעבר לעיכן לפיכך לפני מאד מאחורי מאיזו סיבה מאין מאיפה מבלי מבעד מדוע מה מהיכן מול מחוץ מי מידע מכאן מכל מכן מלבד מן מנין מסוגל מעט מעטים מעל מצד מקום בו מתחת מתי נגד נגר נו עד עז על עלי עליו עליה עליהם עליך עלינו עם עצמה עצמהם עצמהן עצמו עצמי עצמם עצמן עצמנו פה רק שוב של שלה שלהם שלהן שלו שלי שלך שלכה שלכם שלכן שלנו שם תהיה תחת".split(" ")),e.Pipeline.registerFunction(e.he.stopWordFilter,"stopWordFilter-he")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.hi.min.js b/site/assets/javascripts/lunr/min/lunr.hi.min.js deleted file mode 100644 index 7dbc414..0000000 --- a/site/assets/javascripts/lunr/min/lunr.hi.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hi=function(){this.pipeline.reset(),this.pipeline.add(e.hi.trimmer,e.hi.stopWordFilter,e.hi.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.hi.stemmer))},e.hi.wordCharacters="ऀ-ःऄ-एऐ-टठ-यर-िी-ॏॐ-य़ॠ-९॰-ॿa-zA-Za-zA-Z0-90-9",e.hi.trimmer=e.trimmerSupport.generateTrimmer(e.hi.wordCharacters),e.Pipeline.registerFunction(e.hi.trimmer,"trimmer-hi"),e.hi.stopWordFilter=e.generateStopWordFilter("अत अपना अपनी अपने अभी अंदर आदि आप इत्यादि इन इनका इन्हीं इन्हें इन्हों इस इसका इसकी इसके इसमें इसी इसे उन उनका उनकी उनके उनको उन्हीं उन्हें उन्हों उस उसके उसी उसे एक एवं एस ऐसे और कई कर करता करते करना करने करें कहते कहा का काफ़ी कि कितना किन्हें किन्हों किया किर किस किसी किसे की कुछ कुल के को कोई कौन कौनसा गया घर जब जहाँ जा जितना जिन जिन्हें जिन्हों जिस जिसे जीधर जैसा जैसे जो तक तब तरह तिन तिन्हें तिन्हों तिस तिसे तो था थी थे दबारा दिया दुसरा दूसरे दो द्वारा न नके नहीं ना निहायत नीचे ने पर पहले पूरा पे फिर बनी बही बहुत बाद बाला बिलकुल भी भीतर मगर मानो मे में यदि यह यहाँ यही या यिह ये रखें रहा रहे ऱ्वासा लिए लिये लेकिन व वग़ैरह वर्ग वह वहाँ वहीं वाले वुह वे वो सकता सकते सबसे सभी साथ साबुत साभ सारा से सो संग ही हुआ हुई हुए है हैं हो होता होती होते होना होने".split(" ")),e.hi.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var r=e.wordcut;r.init(),e.hi.tokenizer=function(i){if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(r){return isLunr2?new e.Token(r.toLowerCase()):r.toLowerCase()});var t=i.toString().toLowerCase().replace(/^\s+/,"");return r.cut(t).split("|")},e.Pipeline.registerFunction(e.hi.stemmer,"stemmer-hi"),e.Pipeline.registerFunction(e.hi.stopWordFilter,"stopWordFilter-hi")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.hu.min.js b/site/assets/javascripts/lunr/min/lunr.hu.min.js deleted file mode 100644 index ed9d909..0000000 --- a/site/assets/javascripts/lunr/min/lunr.hu.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Lunr languages, `Hungarian` language - * https://github.com/MihaiValentin/lunr-languages - * - * Copyright 2014, Mihai Valentin - * http://www.mozilla.org/MPL/ - */ -/*! - * based on - * Snowball JavaScript Library v0.3 - * http://code.google.com/p/urim/ - * http://snowball.tartarus.org/ - * - * Copyright 2010, Oleg Mazko - * http://www.mozilla.org/MPL/ - */ - -!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n():n()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hu=function(){this.pipeline.reset(),this.pipeline.add(e.hu.trimmer,e.hu.stopWordFilter,e.hu.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.hu.stemmer))},e.hu.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.hu.trimmer=e.trimmerSupport.generateTrimmer(e.hu.wordCharacters),e.Pipeline.registerFunction(e.hu.trimmer,"trimmer-hu"),e.hu.stemmer=function(){var n=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,n=L.cursor;if(d=L.limit,L.in_grouping(W,97,252))for(;;){if(e=L.cursor,L.out_grouping(W,97,252))return L.cursor=e,L.find_among(g,8)||(L.cursor=e,e=L.limit)return void(d=e);L.cursor++}if(L.cursor=n,L.out_grouping(W,97,252)){for(;!L.in_grouping(W,97,252);){if(L.cursor>=L.limit)return;L.cursor++}d=L.cursor}}function i(){return d<=L.cursor}function a(){var e;if(L.ket=L.cursor,(e=L.find_among_b(h,2))&&(L.bra=L.cursor,i()))switch(e){case 1:L.slice_from("a");break;case 2:L.slice_from("e")}}function t(){var e=L.limit-L.cursor;return!!L.find_among_b(p,23)&&(L.cursor=L.limit-e,!0)}function s(){if(L.cursor>L.limit_backward){L.cursor--,L.ket=L.cursor;var e=L.cursor-1;L.limit_backward<=e&&e<=L.limit&&(L.cursor=e,L.bra=e,L.slice_del())}}function c(){var e;if(L.ket=L.cursor,(e=L.find_among_b(_,2))&&(L.bra=L.cursor,i())){if((1==e||2==e)&&!t())return;L.slice_del(),s()}}function o(){L.ket=L.cursor,L.find_among_b(v,44)&&(L.bra=L.cursor,i()&&(L.slice_del(),a()))}function w(){var e;if(L.ket=L.cursor,(e=L.find_among_b(z,3))&&(L.bra=L.cursor,i()))switch(e){case 1:L.slice_from("e");break;case 2:case 3:L.slice_from("a")}}function l(){var e;if(L.ket=L.cursor,(e=L.find_among_b(y,6))&&(L.bra=L.cursor,i()))switch(e){case 1:case 2:L.slice_del();break;case 3:L.slice_from("a");break;case 4:L.slice_from("e")}}function u(){var e;if(L.ket=L.cursor,(e=L.find_among_b(j,2))&&(L.bra=L.cursor,i())){if((1==e||2==e)&&!t())return;L.slice_del(),s()}}function m(){var e;if(L.ket=L.cursor,(e=L.find_among_b(C,7))&&(L.bra=L.cursor,i()))switch(e){case 1:L.slice_from("a");break;case 2:L.slice_from("e");break;case 3:case 4:case 5:case 6:case 7:L.slice_del()}}function k(){var e;if(L.ket=L.cursor,(e=L.find_among_b(P,12))&&(L.bra=L.cursor,i()))switch(e){case 1:case 4:case 7:case 9:L.slice_del();break;case 2:case 5:case 8:L.slice_from("e");break;case 3:case 6:L.slice_from("a")}}function f(){var e;if(L.ket=L.cursor,(e=L.find_among_b(F,31))&&(L.bra=L.cursor,i()))switch(e){case 1:case 4:case 7:case 8:case 9:case 12:case 13:case 16:case 17:case 18:L.slice_del();break;case 2:case 5:case 10:case 14:case 19:L.slice_from("a");break;case 3:case 6:case 11:case 15:case 20:L.slice_from("e")}}function b(){var e;if(L.ket=L.cursor,(e=L.find_among_b(S,42))&&(L.bra=L.cursor,i()))switch(e){case 1:case 4:case 5:case 6:case 9:case 10:case 11:case 14:case 15:case 16:case 17:case 20:case 21:case 24:case 25:case 26:case 29:L.slice_del();break;case 2:case 7:case 12:case 18:case 22:case 27:L.slice_from("a");break;case 3:case 8:case 13:case 19:case 23:case 28:L.slice_from("e")}}var d,g=[new n("cs",-1,-1),new n("dzs",-1,-1),new n("gy",-1,-1),new n("ly",-1,-1),new n("ny",-1,-1),new n("sz",-1,-1),new n("ty",-1,-1),new n("zs",-1,-1)],h=[new n("á",-1,1),new n("é",-1,2)],p=[new n("bb",-1,-1),new n("cc",-1,-1),new n("dd",-1,-1),new n("ff",-1,-1),new n("gg",-1,-1),new n("jj",-1,-1),new n("kk",-1,-1),new n("ll",-1,-1),new n("mm",-1,-1),new n("nn",-1,-1),new n("pp",-1,-1),new n("rr",-1,-1),new n("ccs",-1,-1),new n("ss",-1,-1),new n("zzs",-1,-1),new n("tt",-1,-1),new n("vv",-1,-1),new n("ggy",-1,-1),new n("lly",-1,-1),new n("nny",-1,-1),new n("tty",-1,-1),new n("ssz",-1,-1),new n("zz",-1,-1)],_=[new n("al",-1,1),new n("el",-1,2)],v=[new n("ba",-1,-1),new n("ra",-1,-1),new n("be",-1,-1),new n("re",-1,-1),new n("ig",-1,-1),new n("nak",-1,-1),new n("nek",-1,-1),new n("val",-1,-1),new n("vel",-1,-1),new n("ul",-1,-1),new n("nál",-1,-1),new n("nél",-1,-1),new n("ból",-1,-1),new n("ról",-1,-1),new n("tól",-1,-1),new n("bõl",-1,-1),new n("rõl",-1,-1),new n("tõl",-1,-1),new n("ül",-1,-1),new n("n",-1,-1),new n("an",19,-1),new n("ban",20,-1),new n("en",19,-1),new n("ben",22,-1),new n("képpen",22,-1),new n("on",19,-1),new n("ön",19,-1),new n("képp",-1,-1),new n("kor",-1,-1),new n("t",-1,-1),new n("at",29,-1),new n("et",29,-1),new n("ként",29,-1),new n("anként",32,-1),new n("enként",32,-1),new n("onként",32,-1),new n("ot",29,-1),new n("ért",29,-1),new n("öt",29,-1),new n("hez",-1,-1),new n("hoz",-1,-1),new n("höz",-1,-1),new n("vá",-1,-1),new n("vé",-1,-1)],z=[new n("án",-1,2),new n("én",-1,1),new n("ánként",-1,3)],y=[new n("stul",-1,2),new n("astul",0,1),new n("ástul",0,3),new n("stül",-1,2),new n("estül",3,1),new n("éstül",3,4)],j=[new n("á",-1,1),new n("é",-1,2)],C=[new n("k",-1,7),new n("ak",0,4),new n("ek",0,6),new n("ok",0,5),new n("ák",0,1),new n("ék",0,2),new n("ök",0,3)],P=[new n("éi",-1,7),new n("áéi",0,6),new n("ééi",0,5),new n("é",-1,9),new n("ké",3,4),new n("aké",4,1),new n("eké",4,1),new n("oké",4,1),new n("áké",4,3),new n("éké",4,2),new n("öké",4,1),new n("éé",3,8)],F=[new n("a",-1,18),new n("ja",0,17),new n("d",-1,16),new n("ad",2,13),new n("ed",2,13),new n("od",2,13),new n("ád",2,14),new n("éd",2,15),new n("öd",2,13),new n("e",-1,18),new n("je",9,17),new n("nk",-1,4),new n("unk",11,1),new n("ánk",11,2),new n("énk",11,3),new n("ünk",11,1),new n("uk",-1,8),new n("juk",16,7),new n("ájuk",17,5),new n("ük",-1,8),new n("jük",19,7),new n("éjük",20,6),new n("m",-1,12),new n("am",22,9),new n("em",22,9),new n("om",22,9),new n("ám",22,10),new n("ém",22,11),new n("o",-1,18),new n("á",-1,19),new n("é",-1,20)],S=[new n("id",-1,10),new n("aid",0,9),new n("jaid",1,6),new n("eid",0,9),new n("jeid",3,6),new n("áid",0,7),new n("éid",0,8),new n("i",-1,15),new n("ai",7,14),new n("jai",8,11),new n("ei",7,14),new n("jei",10,11),new n("ái",7,12),new n("éi",7,13),new n("itek",-1,24),new n("eitek",14,21),new n("jeitek",15,20),new n("éitek",14,23),new n("ik",-1,29),new n("aik",18,26),new n("jaik",19,25),new n("eik",18,26),new n("jeik",21,25),new n("áik",18,27),new n("éik",18,28),new n("ink",-1,20),new n("aink",25,17),new n("jaink",26,16),new n("eink",25,17),new n("jeink",28,16),new n("áink",25,18),new n("éink",25,19),new n("aitok",-1,21),new n("jaitok",32,20),new n("áitok",-1,22),new n("im",-1,5),new n("aim",35,4),new n("jaim",36,1),new n("eim",35,4),new n("jeim",38,1),new n("áim",35,2),new n("éim",35,3)],W=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,1,17,52,14],L=new r;this.setCurrent=function(e){L.setCurrent(e)},this.getCurrent=function(){return L.getCurrent()},this.stem=function(){var n=L.cursor;return e(),L.limit_backward=n,L.cursor=L.limit,c(),L.cursor=L.limit,o(),L.cursor=L.limit,w(),L.cursor=L.limit,l(),L.cursor=L.limit,u(),L.cursor=L.limit,k(),L.cursor=L.limit,f(),L.cursor=L.limit,b(),L.cursor=L.limit,m(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.hu.stemmer,"stemmer-hu"),e.hu.stopWordFilter=e.generateStopWordFilter("a abban ahhoz ahogy ahol aki akik akkor alatt amely amelyek amelyekben amelyeket amelyet amelynek ami amikor amit amolyan amíg annak arra arról az azok azon azonban azt aztán azután azzal azért be belül benne bár cikk cikkek cikkeket csak de e ebben eddig egy egyes egyetlen egyik egyre egyéb egész ehhez ekkor el ellen elsõ elég elõ elõször elõtt emilyen ennek erre ez ezek ezen ezt ezzel ezért fel felé hanem hiszen hogy hogyan igen ill ill. illetve ilyen ilyenkor ismét ison itt jobban jó jól kell kellett keressünk keresztül ki kívül között közül legalább legyen lehet lehetett lenne lenni lesz lett maga magát majd majd meg mellett mely melyek mert mi mikor milyen minden mindenki mindent mindig mint mintha mit mivel miért most már más másik még míg nagy nagyobb nagyon ne nekem neki nem nincs néha néhány nélkül olyan ott pedig persze rá s saját sem semmi sok sokat sokkal szemben szerint szinte számára talán tehát teljes tovább továbbá több ugyanis utolsó után utána vagy vagyis vagyok valaki valami valamint való van vannak vele vissza viszont volna volt voltak voltam voltunk által általában át én éppen és így õ õk õket össze úgy új újabb újra".split(" ")),e.Pipeline.registerFunction(e.hu.stopWordFilter,"stopWordFilter-hu")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.hy.min.js b/site/assets/javascripts/lunr/min/lunr.hy.min.js deleted file mode 100644 index b37f792..0000000 --- a/site/assets/javascripts/lunr/min/lunr.hy.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hy=function(){this.pipeline.reset(),this.pipeline.add(e.hy.trimmer,e.hy.stopWordFilter)},e.hy.wordCharacters="[A-Za-z԰-֏ff-ﭏ]",e.hy.trimmer=e.trimmerSupport.generateTrimmer(e.hy.wordCharacters),e.Pipeline.registerFunction(e.hy.trimmer,"trimmer-hy"),e.hy.stopWordFilter=e.generateStopWordFilter("դու և եք էիր էիք հետո նաև նրանք որը վրա է որ պիտի են այս մեջ ն իր ու ի այդ որոնք այն կամ էր մի ես համար այլ իսկ էին ենք հետ ին թ էինք մենք նրա նա դուք եմ էի ըստ որպես ում".split(" ")),e.Pipeline.registerFunction(e.hy.stopWordFilter,"stopWordFilter-hy"),e.hy.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}(),e.Pipeline.registerFunction(e.hy.stemmer,"stemmer-hy")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.it.min.js b/site/assets/javascripts/lunr/min/lunr.it.min.js deleted file mode 100644 index 344b6a3..0000000 --- a/site/assets/javascripts/lunr/min/lunr.it.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Lunr languages, `Italian` language - * https://github.com/MihaiValentin/lunr-languages - * - * Copyright 2014, Mihai Valentin - * http://www.mozilla.org/MPL/ - */ -/*! - * based on - * Snowball JavaScript Library v0.3 - * http://code.google.com/p/urim/ - * http://snowball.tartarus.org/ - * - * Copyright 2010, Oleg Mazko - * http://www.mozilla.org/MPL/ - */ - -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.it=function(){this.pipeline.reset(),this.pipeline.add(e.it.trimmer,e.it.stopWordFilter,e.it.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.it.stemmer))},e.it.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.it.trimmer=e.trimmerSupport.generateTrimmer(e.it.wordCharacters),e.Pipeline.registerFunction(e.it.trimmer,"trimmer-it"),e.it.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(e,r,n){return!(!x.eq_s(1,e)||(x.ket=x.cursor,!x.in_grouping(L,97,249)))&&(x.slice_from(r),x.cursor=n,!0)}function i(){for(var r,n,i,o,t=x.cursor;;){if(x.bra=x.cursor,r=x.find_among(h,7))switch(x.ket=x.cursor,r){case 1:x.slice_from("à");continue;case 2:x.slice_from("è");continue;case 3:x.slice_from("ì");continue;case 4:x.slice_from("ò");continue;case 5:x.slice_from("ù");continue;case 6:x.slice_from("qU");continue;case 7:if(x.cursor>=x.limit)break;x.cursor++;continue}break}for(x.cursor=t;;)for(n=x.cursor;;){if(i=x.cursor,x.in_grouping(L,97,249)){if(x.bra=x.cursor,o=x.cursor,e("u","U",i))break;if(x.cursor=o,e("i","I",i))break}if(x.cursor=i,x.cursor>=x.limit)return void(x.cursor=n);x.cursor++}}function o(e){if(x.cursor=e,!x.in_grouping(L,97,249))return!1;for(;!x.out_grouping(L,97,249);){if(x.cursor>=x.limit)return!1;x.cursor++}return!0}function t(){if(x.in_grouping(L,97,249)){var e=x.cursor;if(x.out_grouping(L,97,249)){for(;!x.in_grouping(L,97,249);){if(x.cursor>=x.limit)return o(e);x.cursor++}return!0}return o(e)}return!1}function s(){var e,r=x.cursor;if(!t()){if(x.cursor=r,!x.out_grouping(L,97,249))return;if(e=x.cursor,x.out_grouping(L,97,249)){for(;!x.in_grouping(L,97,249);){if(x.cursor>=x.limit)return x.cursor=e,void(x.in_grouping(L,97,249)&&x.cursor=x.limit)return;x.cursor++}k=x.cursor}function a(){for(;!x.in_grouping(L,97,249);){if(x.cursor>=x.limit)return!1;x.cursor++}for(;!x.out_grouping(L,97,249);){if(x.cursor>=x.limit)return!1;x.cursor++}return!0}function u(){var e=x.cursor;k=x.limit,p=k,g=k,s(),x.cursor=e,a()&&(p=x.cursor,a()&&(g=x.cursor))}function c(){for(var e;;){if(x.bra=x.cursor,!(e=x.find_among(q,3)))break;switch(x.ket=x.cursor,e){case 1:x.slice_from("i");break;case 2:x.slice_from("u");break;case 3:if(x.cursor>=x.limit)return;x.cursor++}}}function w(){return k<=x.cursor}function l(){return p<=x.cursor}function m(){return g<=x.cursor}function f(){var e;if(x.ket=x.cursor,x.find_among_b(C,37)&&(x.bra=x.cursor,(e=x.find_among_b(z,5))&&w()))switch(e){case 1:x.slice_del();break;case 2:x.slice_from("e")}}function v(){var e;if(x.ket=x.cursor,!(e=x.find_among_b(S,51)))return!1;switch(x.bra=x.cursor,e){case 1:if(!m())return!1;x.slice_del();break;case 2:if(!m())return!1;x.slice_del(),x.ket=x.cursor,x.eq_s_b(2,"ic")&&(x.bra=x.cursor,m()&&x.slice_del());break;case 3:if(!m())return!1;x.slice_from("log");break;case 4:if(!m())return!1;x.slice_from("u");break;case 5:if(!m())return!1;x.slice_from("ente");break;case 6:if(!w())return!1;x.slice_del();break;case 7:if(!l())return!1;x.slice_del(),x.ket=x.cursor,e=x.find_among_b(P,4),e&&(x.bra=x.cursor,m()&&(x.slice_del(),1==e&&(x.ket=x.cursor,x.eq_s_b(2,"at")&&(x.bra=x.cursor,m()&&x.slice_del()))));break;case 8:if(!m())return!1;x.slice_del(),x.ket=x.cursor,e=x.find_among_b(F,3),e&&(x.bra=x.cursor,1==e&&m()&&x.slice_del());break;case 9:if(!m())return!1;x.slice_del(),x.ket=x.cursor,x.eq_s_b(2,"at")&&(x.bra=x.cursor,m()&&(x.slice_del(),x.ket=x.cursor,x.eq_s_b(2,"ic")&&(x.bra=x.cursor,m()&&x.slice_del())))}return!0}function b(){var e,r;x.cursor>=k&&(r=x.limit_backward,x.limit_backward=k,x.ket=x.cursor,e=x.find_among_b(W,87),e&&(x.bra=x.cursor,1==e&&x.slice_del()),x.limit_backward=r)}function d(){var e=x.limit-x.cursor;if(x.ket=x.cursor,x.in_grouping_b(y,97,242)&&(x.bra=x.cursor,w()&&(x.slice_del(),x.ket=x.cursor,x.eq_s_b(1,"i")&&(x.bra=x.cursor,w()))))return void x.slice_del();x.cursor=x.limit-e}function _(){d(),x.ket=x.cursor,x.eq_s_b(1,"h")&&(x.bra=x.cursor,x.in_grouping_b(U,99,103)&&w()&&x.slice_del())}var g,p,k,h=[new r("",-1,7),new r("qu",0,6),new r("á",0,1),new r("é",0,2),new r("í",0,3),new r("ó",0,4),new r("ú",0,5)],q=[new r("",-1,3),new r("I",0,1),new r("U",0,2)],C=[new r("la",-1,-1),new r("cela",0,-1),new r("gliela",0,-1),new r("mela",0,-1),new r("tela",0,-1),new r("vela",0,-1),new r("le",-1,-1),new r("cele",6,-1),new r("gliele",6,-1),new r("mele",6,-1),new r("tele",6,-1),new r("vele",6,-1),new r("ne",-1,-1),new r("cene",12,-1),new r("gliene",12,-1),new r("mene",12,-1),new r("sene",12,-1),new r("tene",12,-1),new r("vene",12,-1),new r("ci",-1,-1),new r("li",-1,-1),new r("celi",20,-1),new r("glieli",20,-1),new r("meli",20,-1),new r("teli",20,-1),new r("veli",20,-1),new r("gli",20,-1),new r("mi",-1,-1),new r("si",-1,-1),new r("ti",-1,-1),new r("vi",-1,-1),new r("lo",-1,-1),new r("celo",31,-1),new r("glielo",31,-1),new r("melo",31,-1),new r("telo",31,-1),new r("velo",31,-1)],z=[new r("ando",-1,1),new r("endo",-1,1),new r("ar",-1,2),new r("er",-1,2),new r("ir",-1,2)],P=[new r("ic",-1,-1),new r("abil",-1,-1),new r("os",-1,-1),new r("iv",-1,1)],F=[new r("ic",-1,1),new r("abil",-1,1),new r("iv",-1,1)],S=[new r("ica",-1,1),new r("logia",-1,3),new r("osa",-1,1),new r("ista",-1,1),new r("iva",-1,9),new r("anza",-1,1),new r("enza",-1,5),new r("ice",-1,1),new r("atrice",7,1),new r("iche",-1,1),new r("logie",-1,3),new r("abile",-1,1),new r("ibile",-1,1),new r("usione",-1,4),new r("azione",-1,2),new r("uzione",-1,4),new r("atore",-1,2),new r("ose",-1,1),new r("ante",-1,1),new r("mente",-1,1),new r("amente",19,7),new r("iste",-1,1),new r("ive",-1,9),new r("anze",-1,1),new r("enze",-1,5),new r("ici",-1,1),new r("atrici",25,1),new r("ichi",-1,1),new r("abili",-1,1),new r("ibili",-1,1),new r("ismi",-1,1),new r("usioni",-1,4),new r("azioni",-1,2),new r("uzioni",-1,4),new r("atori",-1,2),new r("osi",-1,1),new r("anti",-1,1),new r("amenti",-1,6),new r("imenti",-1,6),new r("isti",-1,1),new r("ivi",-1,9),new r("ico",-1,1),new r("ismo",-1,1),new r("oso",-1,1),new r("amento",-1,6),new r("imento",-1,6),new r("ivo",-1,9),new r("ità",-1,8),new r("istà",-1,1),new r("istè",-1,1),new r("istì",-1,1)],W=[new r("isca",-1,1),new r("enda",-1,1),new r("ata",-1,1),new r("ita",-1,1),new r("uta",-1,1),new r("ava",-1,1),new r("eva",-1,1),new r("iva",-1,1),new r("erebbe",-1,1),new r("irebbe",-1,1),new r("isce",-1,1),new r("ende",-1,1),new r("are",-1,1),new r("ere",-1,1),new r("ire",-1,1),new r("asse",-1,1),new r("ate",-1,1),new r("avate",16,1),new r("evate",16,1),new r("ivate",16,1),new r("ete",-1,1),new r("erete",20,1),new r("irete",20,1),new r("ite",-1,1),new r("ereste",-1,1),new r("ireste",-1,1),new r("ute",-1,1),new r("erai",-1,1),new r("irai",-1,1),new r("isci",-1,1),new r("endi",-1,1),new r("erei",-1,1),new r("irei",-1,1),new r("assi",-1,1),new r("ati",-1,1),new r("iti",-1,1),new r("eresti",-1,1),new r("iresti",-1,1),new r("uti",-1,1),new r("avi",-1,1),new r("evi",-1,1),new r("ivi",-1,1),new r("isco",-1,1),new r("ando",-1,1),new r("endo",-1,1),new r("Yamo",-1,1),new r("iamo",-1,1),new r("avamo",-1,1),new r("evamo",-1,1),new r("ivamo",-1,1),new r("eremo",-1,1),new r("iremo",-1,1),new r("assimo",-1,1),new r("ammo",-1,1),new r("emmo",-1,1),new r("eremmo",54,1),new r("iremmo",54,1),new r("immo",-1,1),new r("ano",-1,1),new r("iscano",58,1),new r("avano",58,1),new r("evano",58,1),new r("ivano",58,1),new r("eranno",-1,1),new r("iranno",-1,1),new r("ono",-1,1),new r("iscono",65,1),new r("arono",65,1),new r("erono",65,1),new r("irono",65,1),new r("erebbero",-1,1),new r("irebbero",-1,1),new r("assero",-1,1),new r("essero",-1,1),new r("issero",-1,1),new r("ato",-1,1),new r("ito",-1,1),new r("uto",-1,1),new r("avo",-1,1),new r("evo",-1,1),new r("ivo",-1,1),new r("ar",-1,1),new r("ir",-1,1),new r("erà",-1,1),new r("irà",-1,1),new r("erò",-1,1),new r("irò",-1,1)],L=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,128,128,8,2,1],y=[17,65,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,8,2],U=[17],x=new n;this.setCurrent=function(e){x.setCurrent(e)},this.getCurrent=function(){return x.getCurrent()},this.stem=function(){var e=x.cursor;return i(),x.cursor=e,u(),x.limit_backward=e,x.cursor=x.limit,f(),x.cursor=x.limit,v()||(x.cursor=x.limit,b()),x.cursor=x.limit,_(),x.cursor=x.limit_backward,c(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.it.stemmer,"stemmer-it"),e.it.stopWordFilter=e.generateStopWordFilter("a abbia abbiamo abbiano abbiate ad agl agli ai al all alla alle allo anche avemmo avendo avesse avessero avessi avessimo aveste avesti avete aveva avevamo avevano avevate avevi avevo avrai avranno avrebbe avrebbero avrei avremmo avremo avreste avresti avrete avrà avrò avuta avute avuti avuto c che chi ci coi col come con contro cui da dagl dagli dai dal dall dalla dalle dallo degl degli dei del dell della delle dello di dov dove e ebbe ebbero ebbi ed era erano eravamo eravate eri ero essendo faccia facciamo facciano facciate faccio facemmo facendo facesse facessero facessi facessimo faceste facesti faceva facevamo facevano facevate facevi facevo fai fanno farai faranno farebbe farebbero farei faremmo faremo fareste faresti farete farà farò fece fecero feci fosse fossero fossi fossimo foste fosti fu fui fummo furono gli ha hai hanno ho i il in io l la le lei li lo loro lui ma mi mia mie miei mio ne negl negli nei nel nell nella nelle nello noi non nostra nostre nostri nostro o per perché più quale quanta quante quanti quanto quella quelle quelli quello questa queste questi questo sarai saranno sarebbe sarebbero sarei saremmo saremo sareste saresti sarete sarà sarò se sei si sia siamo siano siate siete sono sta stai stando stanno starai staranno starebbe starebbero starei staremmo staremo stareste staresti starete starà starò stava stavamo stavano stavate stavi stavo stemmo stesse stessero stessi stessimo steste stesti stette stettero stetti stia stiamo stiano stiate sto su sua sue sugl sugli sui sul sull sulla sulle sullo suo suoi ti tra tu tua tue tuo tuoi tutti tutto un una uno vi voi vostra vostre vostri vostro è".split(" ")),e.Pipeline.registerFunction(e.it.stopWordFilter,"stopWordFilter-it")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.ja.min.js b/site/assets/javascripts/lunr/min/lunr.ja.min.js deleted file mode 100644 index 5f254eb..0000000 --- a/site/assets/javascripts/lunr/min/lunr.ja.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.ja=function(){this.pipeline.reset(),this.pipeline.add(e.ja.trimmer,e.ja.stopWordFilter,e.ja.stemmer),r?this.tokenizer=e.ja.tokenizer:(e.tokenizer&&(e.tokenizer=e.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.ja.tokenizer))};var t=new e.TinySegmenter;e.ja.tokenizer=function(i){var n,o,s,p,a,u,m,l,c,f;if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(o=i.toString().toLowerCase().replace(/^\s+/,""),n=o.length-1;n>=0;n--)if(/\S/.test(o.charAt(n))){o=o.substring(0,n+1);break}for(a=[],s=o.length,c=0,l=0;c<=s;c++)if(u=o.charAt(c),m=c-l,u.match(/\s/)||c==s){if(m>0)for(p=t.segment(o.slice(l,c)).filter(function(e){return!!e}),f=l,n=0;n=C.limit)break;C.cursor++;continue}break}for(C.cursor=o,C.bra=o,C.eq_s(1,"y")?(C.ket=C.cursor,C.slice_from("Y")):C.cursor=o;;)if(e=C.cursor,C.in_grouping(q,97,232)){if(i=C.cursor,C.bra=i,C.eq_s(1,"i"))C.ket=C.cursor,C.in_grouping(q,97,232)&&(C.slice_from("I"),C.cursor=e);else if(C.cursor=i,C.eq_s(1,"y"))C.ket=C.cursor,C.slice_from("Y"),C.cursor=e;else if(n(e))break}else if(n(e))break}function n(r){return C.cursor=r,r>=C.limit||(C.cursor++,!1)}function o(){_=C.limit,d=_,t()||(_=C.cursor,_<3&&(_=3),t()||(d=C.cursor))}function t(){for(;!C.in_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}for(;!C.out_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}return!1}function s(){for(var r;;)if(C.bra=C.cursor,r=C.find_among(p,3))switch(C.ket=C.cursor,r){case 1:C.slice_from("y");break;case 2:C.slice_from("i");break;case 3:if(C.cursor>=C.limit)return;C.cursor++}}function u(){return _<=C.cursor}function c(){return d<=C.cursor}function a(){var r=C.limit-C.cursor;C.find_among_b(g,3)&&(C.cursor=C.limit-r,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del()))}function l(){var r;w=!1,C.ket=C.cursor,C.eq_s_b(1,"e")&&(C.bra=C.cursor,u()&&(r=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-r,C.slice_del(),w=!0,a())))}function m(){var r;u()&&(r=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-r,C.eq_s_b(3,"gem")||(C.cursor=C.limit-r,C.slice_del(),a())))}function f(){var r,e,i,n,o,t,s=C.limit-C.cursor;if(C.ket=C.cursor,r=C.find_among_b(h,5))switch(C.bra=C.cursor,r){case 1:u()&&C.slice_from("heid");break;case 2:m();break;case 3:u()&&C.out_grouping_b(j,97,232)&&C.slice_del()}if(C.cursor=C.limit-s,l(),C.cursor=C.limit-s,C.ket=C.cursor,C.eq_s_b(4,"heid")&&(C.bra=C.cursor,c()&&(e=C.limit-C.cursor,C.eq_s_b(1,"c")||(C.cursor=C.limit-e,C.slice_del(),C.ket=C.cursor,C.eq_s_b(2,"en")&&(C.bra=C.cursor,m())))),C.cursor=C.limit-s,C.ket=C.cursor,r=C.find_among_b(k,6))switch(C.bra=C.cursor,r){case 1:if(c()){if(C.slice_del(),i=C.limit-C.cursor,C.ket=C.cursor,C.eq_s_b(2,"ig")&&(C.bra=C.cursor,c()&&(n=C.limit-C.cursor,!C.eq_s_b(1,"e")))){C.cursor=C.limit-n,C.slice_del();break}C.cursor=C.limit-i,a()}break;case 2:c()&&(o=C.limit-C.cursor,C.eq_s_b(1,"e")||(C.cursor=C.limit-o,C.slice_del()));break;case 3:c()&&(C.slice_del(),l());break;case 4:c()&&C.slice_del();break;case 5:c()&&w&&C.slice_del()}C.cursor=C.limit-s,C.out_grouping_b(z,73,232)&&(t=C.limit-C.cursor,C.find_among_b(v,4)&&C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-t,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del())))}var d,_,w,b=[new e("",-1,6),new e("á",0,1),new e("ä",0,1),new e("é",0,2),new e("ë",0,2),new e("í",0,3),new e("ï",0,3),new e("ó",0,4),new e("ö",0,4),new e("ú",0,5),new e("ü",0,5)],p=[new e("",-1,3),new e("I",0,2),new e("Y",0,1)],g=[new e("dd",-1,-1),new e("kk",-1,-1),new e("tt",-1,-1)],h=[new e("ene",-1,2),new e("se",-1,3),new e("en",-1,2),new e("heden",2,1),new e("s",-1,3)],k=[new e("end",-1,1),new e("ig",-1,2),new e("ing",-1,1),new e("lijk",-1,3),new e("baar",-1,4),new e("bar",-1,5)],v=[new e("aa",-1,-1),new e("ee",-1,-1),new e("oo",-1,-1),new e("uu",-1,-1)],q=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],z=[1,0,0,17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],j=[17,67,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],C=new i;this.setCurrent=function(r){C.setCurrent(r)},this.getCurrent=function(){return C.getCurrent()},this.stem=function(){var e=C.cursor;return r(),C.cursor=e,o(),C.limit_backward=e,C.cursor=C.limit,f(),C.cursor=C.limit_backward,s(),!0}};return function(r){return"function"==typeof r.update?r.update(function(r){return n.setCurrent(r),n.stem(),n.getCurrent()}):(n.setCurrent(r),n.stem(),n.getCurrent())}}(),r.Pipeline.registerFunction(r.nl.stemmer,"stemmer-nl"),r.nl.stopWordFilter=r.generateStopWordFilter(" aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou".split(" ")),r.Pipeline.registerFunction(r.nl.stopWordFilter,"stopWordFilter-nl")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.no.min.js b/site/assets/javascripts/lunr/min/lunr.no.min.js deleted file mode 100644 index 92bc7e4..0000000 --- a/site/assets/javascripts/lunr/min/lunr.no.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Lunr languages, `Norwegian` language - * https://github.com/MihaiValentin/lunr-languages - * - * Copyright 2014, Mihai Valentin - * http://www.mozilla.org/MPL/ - */ -/*! - * based on - * Snowball JavaScript Library v0.3 - * http://code.google.com/p/urim/ - * http://snowball.tartarus.org/ - * - * Copyright 2010, Oleg Mazko - * http://www.mozilla.org/MPL/ - */ - -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,r=w.cursor+3;if(a=w.limit,0<=r||r<=w.limit){for(s=r;;){if(e=w.cursor,w.in_grouping(d,97,248)){w.cursor=e;break}if(e>=w.limit)return;w.cursor=e+1}for(;!w.out_grouping(d,97,248);){if(w.cursor>=w.limit)return;w.cursor++}a=w.cursor,a=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(m,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(u,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(l,11),e?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,m=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],u=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.pt.min.js b/site/assets/javascripts/lunr/min/lunr.pt.min.js deleted file mode 100644 index 6c16996..0000000 --- a/site/assets/javascripts/lunr/min/lunr.pt.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Lunr languages, `Portuguese` language - * https://github.com/MihaiValentin/lunr-languages - * - * Copyright 2014, Mihai Valentin - * http://www.mozilla.org/MPL/ - */ -/*! - * based on - * Snowball JavaScript Library v0.3 - * http://code.google.com/p/urim/ - * http://snowball.tartarus.org/ - * - * Copyright 2010, Oleg Mazko - * http://www.mozilla.org/MPL/ - */ - -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.pt=function(){this.pipeline.reset(),this.pipeline.add(e.pt.trimmer,e.pt.stopWordFilter,e.pt.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.pt.stemmer))},e.pt.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.pt.trimmer=e.trimmerSupport.generateTrimmer(e.pt.wordCharacters),e.Pipeline.registerFunction(e.pt.trimmer,"trimmer-pt"),e.pt.stemmer=function(){var r=e.stemmerSupport.Among,s=e.stemmerSupport.SnowballProgram,n=new function(){function e(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(k,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("a~");continue;case 2:z.slice_from("o~");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function n(){if(z.out_grouping(y,97,250)){for(;!z.in_grouping(y,97,250);){if(z.cursor>=z.limit)return!0;z.cursor++}return!1}return!0}function i(){if(z.in_grouping(y,97,250))for(;!z.out_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return g=z.cursor,!0}function o(){var e,r,s=z.cursor;if(z.in_grouping(y,97,250))if(e=z.cursor,n()){if(z.cursor=e,i())return}else g=z.cursor;if(z.cursor=s,z.out_grouping(y,97,250)){if(r=z.cursor,n()){if(z.cursor=r,!z.in_grouping(y,97,250)||z.cursor>=z.limit)return;z.cursor++}g=z.cursor}}function t(){for(;!z.in_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}for(;!z.out_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return!0}function a(){var e=z.cursor;g=z.limit,b=g,h=g,o(),z.cursor=e,t()&&(b=z.cursor,t()&&(h=z.cursor))}function u(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(q,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("ã");continue;case 2:z.slice_from("õ");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function w(){return g<=z.cursor}function m(){return b<=z.cursor}function c(){return h<=z.cursor}function l(){var e;if(z.ket=z.cursor,!(e=z.find_among_b(F,45)))return!1;switch(z.bra=z.cursor,e){case 1:if(!c())return!1;z.slice_del();break;case 2:if(!c())return!1;z.slice_from("log");break;case 3:if(!c())return!1;z.slice_from("u");break;case 4:if(!c())return!1;z.slice_from("ente");break;case 5:if(!m())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(j,4),e&&(z.bra=z.cursor,c()&&(z.slice_del(),1==e&&(z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del()))));break;case 6:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(C,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 7:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(P,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 8:if(!c())return!1;z.slice_del(),z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del());break;case 9:if(!w()||!z.eq_s_b(1,"e"))return!1;z.slice_from("ir")}return!0}function f(){var e,r;if(z.cursor>=g){if(r=z.limit_backward,z.limit_backward=g,z.ket=z.cursor,e=z.find_among_b(S,120))return z.bra=z.cursor,1==e&&z.slice_del(),z.limit_backward=r,!0;z.limit_backward=r}return!1}function d(){var e;z.ket=z.cursor,(e=z.find_among_b(W,7))&&(z.bra=z.cursor,1==e&&w()&&z.slice_del())}function v(e,r){if(z.eq_s_b(1,e)){z.bra=z.cursor;var s=z.limit-z.cursor;if(z.eq_s_b(1,r))return z.cursor=z.limit-s,w()&&z.slice_del(),!1}return!0}function p(){var e;if(z.ket=z.cursor,e=z.find_among_b(L,4))switch(z.bra=z.cursor,e){case 1:w()&&(z.slice_del(),z.ket=z.cursor,z.limit-z.cursor,v("u","g")&&v("i","c"));break;case 2:z.slice_from("c")}}function _(){if(!l()&&(z.cursor=z.limit,!f()))return z.cursor=z.limit,void d();z.cursor=z.limit,z.ket=z.cursor,z.eq_s_b(1,"i")&&(z.bra=z.cursor,z.eq_s_b(1,"c")&&(z.cursor=z.limit,w()&&z.slice_del()))}var h,b,g,k=[new r("",-1,3),new r("ã",0,1),new r("õ",0,2)],q=[new r("",-1,3),new r("a~",0,1),new r("o~",0,2)],j=[new r("ic",-1,-1),new r("ad",-1,-1),new r("os",-1,-1),new r("iv",-1,1)],C=[new r("ante",-1,1),new r("avel",-1,1),new r("ível",-1,1)],P=[new r("ic",-1,1),new r("abil",-1,1),new r("iv",-1,1)],F=[new r("ica",-1,1),new r("ância",-1,1),new r("ência",-1,4),new r("ira",-1,9),new r("adora",-1,1),new r("osa",-1,1),new r("ista",-1,1),new r("iva",-1,8),new r("eza",-1,1),new r("logía",-1,2),new r("idade",-1,7),new r("ante",-1,1),new r("mente",-1,6),new r("amente",12,5),new r("ável",-1,1),new r("ível",-1,1),new r("ución",-1,3),new r("ico",-1,1),new r("ismo",-1,1),new r("oso",-1,1),new r("amento",-1,1),new r("imento",-1,1),new r("ivo",-1,8),new r("aça~o",-1,1),new r("ador",-1,1),new r("icas",-1,1),new r("ências",-1,4),new r("iras",-1,9),new r("adoras",-1,1),new r("osas",-1,1),new r("istas",-1,1),new r("ivas",-1,8),new r("ezas",-1,1),new r("logías",-1,2),new r("idades",-1,7),new r("uciones",-1,3),new r("adores",-1,1),new r("antes",-1,1),new r("aço~es",-1,1),new r("icos",-1,1),new r("ismos",-1,1),new r("osos",-1,1),new r("amentos",-1,1),new r("imentos",-1,1),new r("ivos",-1,8)],S=[new r("ada",-1,1),new r("ida",-1,1),new r("ia",-1,1),new r("aria",2,1),new r("eria",2,1),new r("iria",2,1),new r("ara",-1,1),new r("era",-1,1),new r("ira",-1,1),new r("ava",-1,1),new r("asse",-1,1),new r("esse",-1,1),new r("isse",-1,1),new r("aste",-1,1),new r("este",-1,1),new r("iste",-1,1),new r("ei",-1,1),new r("arei",16,1),new r("erei",16,1),new r("irei",16,1),new r("am",-1,1),new r("iam",20,1),new r("ariam",21,1),new r("eriam",21,1),new r("iriam",21,1),new r("aram",20,1),new r("eram",20,1),new r("iram",20,1),new r("avam",20,1),new r("em",-1,1),new r("arem",29,1),new r("erem",29,1),new r("irem",29,1),new r("assem",29,1),new r("essem",29,1),new r("issem",29,1),new r("ado",-1,1),new r("ido",-1,1),new r("ando",-1,1),new r("endo",-1,1),new r("indo",-1,1),new r("ara~o",-1,1),new r("era~o",-1,1),new r("ira~o",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("ir",-1,1),new r("as",-1,1),new r("adas",47,1),new r("idas",47,1),new r("ias",47,1),new r("arias",50,1),new r("erias",50,1),new r("irias",50,1),new r("aras",47,1),new r("eras",47,1),new r("iras",47,1),new r("avas",47,1),new r("es",-1,1),new r("ardes",58,1),new r("erdes",58,1),new r("irdes",58,1),new r("ares",58,1),new r("eres",58,1),new r("ires",58,1),new r("asses",58,1),new r("esses",58,1),new r("isses",58,1),new r("astes",58,1),new r("estes",58,1),new r("istes",58,1),new r("is",-1,1),new r("ais",71,1),new r("eis",71,1),new r("areis",73,1),new r("ereis",73,1),new r("ireis",73,1),new r("áreis",73,1),new r("éreis",73,1),new r("íreis",73,1),new r("ásseis",73,1),new r("ésseis",73,1),new r("ísseis",73,1),new r("áveis",73,1),new r("íeis",73,1),new r("aríeis",84,1),new r("eríeis",84,1),new r("iríeis",84,1),new r("ados",-1,1),new r("idos",-1,1),new r("amos",-1,1),new r("áramos",90,1),new r("éramos",90,1),new r("íramos",90,1),new r("ávamos",90,1),new r("íamos",90,1),new r("aríamos",95,1),new r("eríamos",95,1),new r("iríamos",95,1),new r("emos",-1,1),new r("aremos",99,1),new r("eremos",99,1),new r("iremos",99,1),new r("ássemos",99,1),new r("êssemos",99,1),new r("íssemos",99,1),new r("imos",-1,1),new r("armos",-1,1),new r("ermos",-1,1),new r("irmos",-1,1),new r("ámos",-1,1),new r("arás",-1,1),new r("erás",-1,1),new r("irás",-1,1),new r("eu",-1,1),new r("iu",-1,1),new r("ou",-1,1),new r("ará",-1,1),new r("erá",-1,1),new r("irá",-1,1)],W=[new r("a",-1,1),new r("i",-1,1),new r("o",-1,1),new r("os",-1,1),new r("á",-1,1),new r("í",-1,1),new r("ó",-1,1)],L=[new r("e",-1,1),new r("ç",-1,2),new r("é",-1,1),new r("ê",-1,1)],y=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,3,19,12,2],z=new s;this.setCurrent=function(e){z.setCurrent(e)},this.getCurrent=function(){return z.getCurrent()},this.stem=function(){var r=z.cursor;return e(),z.cursor=r,a(),z.limit_backward=r,z.cursor=z.limit,_(),z.cursor=z.limit,p(),z.cursor=z.limit_backward,u(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.pt.stemmer,"stemmer-pt"),e.pt.stopWordFilter=e.generateStopWordFilter("a ao aos aquela aquelas aquele aqueles aquilo as até com como da das de dela delas dele deles depois do dos e ela elas ele eles em entre era eram essa essas esse esses esta estamos estas estava estavam este esteja estejam estejamos estes esteve estive estivemos estiver estivera estiveram estiverem estivermos estivesse estivessem estivéramos estivéssemos estou está estávamos estão eu foi fomos for fora foram forem formos fosse fossem fui fôramos fôssemos haja hajam hajamos havemos hei houve houvemos houver houvera houveram houverei houverem houveremos houveria houveriam houvermos houverá houverão houveríamos houvesse houvessem houvéramos houvéssemos há hão isso isto já lhe lhes mais mas me mesmo meu meus minha minhas muito na nas nem no nos nossa nossas nosso nossos num numa não nós o os ou para pela pelas pelo pelos por qual quando que quem se seja sejam sejamos sem serei seremos seria seriam será serão seríamos seu seus somos sou sua suas são só também te tem temos tenha tenham tenhamos tenho terei teremos teria teriam terá terão teríamos teu teus teve tinha tinham tive tivemos tiver tivera tiveram tiverem tivermos tivesse tivessem tivéramos tivéssemos tu tua tuas tém tínhamos um uma você vocês vos à às éramos".split(" ")),e.Pipeline.registerFunction(e.pt.stopWordFilter,"stopWordFilter-pt")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.ro.min.js b/site/assets/javascripts/lunr/min/lunr.ro.min.js deleted file mode 100644 index 7277140..0000000 --- a/site/assets/javascripts/lunr/min/lunr.ro.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Lunr languages, `Romanian` language - * https://github.com/MihaiValentin/lunr-languages - * - * Copyright 2014, Mihai Valentin - * http://www.mozilla.org/MPL/ - */ -/*! - * based on - * Snowball JavaScript Library v0.3 - * http://code.google.com/p/urim/ - * http://snowball.tartarus.org/ - * - * Copyright 2010, Oleg Mazko - * http://www.mozilla.org/MPL/ - */ - -!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ro=function(){this.pipeline.reset(),this.pipeline.add(e.ro.trimmer,e.ro.stopWordFilter,e.ro.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ro.stemmer))},e.ro.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.ro.trimmer=e.trimmerSupport.generateTrimmer(e.ro.wordCharacters),e.Pipeline.registerFunction(e.ro.trimmer,"trimmer-ro"),e.ro.stemmer=function(){var i=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,n=new function(){function e(e,i){L.eq_s(1,e)&&(L.ket=L.cursor,L.in_grouping(W,97,259)&&L.slice_from(i))}function n(){for(var i,r;;){if(i=L.cursor,L.in_grouping(W,97,259)&&(r=L.cursor,L.bra=r,e("u","U"),L.cursor=r,e("i","I")),L.cursor=i,L.cursor>=L.limit)break;L.cursor++}}function t(){if(L.out_grouping(W,97,259)){for(;!L.in_grouping(W,97,259);){if(L.cursor>=L.limit)return!0;L.cursor++}return!1}return!0}function a(){if(L.in_grouping(W,97,259))for(;!L.out_grouping(W,97,259);){if(L.cursor>=L.limit)return!0;L.cursor++}return!1}function o(){var e,i,r=L.cursor;if(L.in_grouping(W,97,259)){if(e=L.cursor,!t())return void(h=L.cursor);if(L.cursor=e,!a())return void(h=L.cursor)}L.cursor=r,L.out_grouping(W,97,259)&&(i=L.cursor,t()&&(L.cursor=i,L.in_grouping(W,97,259)&&L.cursor=L.limit)return!1;L.cursor++}for(;!L.out_grouping(W,97,259);){if(L.cursor>=L.limit)return!1;L.cursor++}return!0}function c(){var e=L.cursor;h=L.limit,k=h,g=h,o(),L.cursor=e,u()&&(k=L.cursor,u()&&(g=L.cursor))}function s(){for(var e;;){if(L.bra=L.cursor,e=L.find_among(z,3))switch(L.ket=L.cursor,e){case 1:L.slice_from("i");continue;case 2:L.slice_from("u");continue;case 3:if(L.cursor>=L.limit)break;L.cursor++;continue}break}}function w(){return h<=L.cursor}function m(){return k<=L.cursor}function l(){return g<=L.cursor}function f(){var e,i;if(L.ket=L.cursor,(e=L.find_among_b(C,16))&&(L.bra=L.cursor,m()))switch(e){case 1:L.slice_del();break;case 2:L.slice_from("a");break;case 3:L.slice_from("e");break;case 4:L.slice_from("i");break;case 5:i=L.limit-L.cursor,L.eq_s_b(2,"ab")||(L.cursor=L.limit-i,L.slice_from("i"));break;case 6:L.slice_from("at");break;case 7:L.slice_from("aţi")}}function p(){var e,i=L.limit-L.cursor;if(L.ket=L.cursor,(e=L.find_among_b(P,46))&&(L.bra=L.cursor,m())){switch(e){case 1:L.slice_from("abil");break;case 2:L.slice_from("ibil");break;case 3:L.slice_from("iv");break;case 4:L.slice_from("ic");break;case 5:L.slice_from("at");break;case 6:L.slice_from("it")}return _=!0,L.cursor=L.limit-i,!0}return!1}function d(){var e,i;for(_=!1;;)if(i=L.limit-L.cursor,!p()){L.cursor=L.limit-i;break}if(L.ket=L.cursor,(e=L.find_among_b(F,62))&&(L.bra=L.cursor,l())){switch(e){case 1:L.slice_del();break;case 2:L.eq_s_b(1,"ţ")&&(L.bra=L.cursor,L.slice_from("t"));break;case 3:L.slice_from("ist")}_=!0}}function b(){var e,i,r;if(L.cursor>=h){if(i=L.limit_backward,L.limit_backward=h,L.ket=L.cursor,e=L.find_among_b(q,94))switch(L.bra=L.cursor,e){case 1:if(r=L.limit-L.cursor,!L.out_grouping_b(W,97,259)&&(L.cursor=L.limit-r,!L.eq_s_b(1,"u")))break;case 2:L.slice_del()}L.limit_backward=i}}function v(){var e;L.ket=L.cursor,(e=L.find_among_b(S,5))&&(L.bra=L.cursor,w()&&1==e&&L.slice_del())}var _,g,k,h,z=[new i("",-1,3),new i("I",0,1),new i("U",0,2)],C=[new i("ea",-1,3),new i("aţia",-1,7),new i("aua",-1,2),new i("iua",-1,4),new i("aţie",-1,7),new i("ele",-1,3),new i("ile",-1,5),new i("iile",6,4),new i("iei",-1,4),new i("atei",-1,6),new i("ii",-1,4),new i("ului",-1,1),new i("ul",-1,1),new i("elor",-1,3),new i("ilor",-1,4),new i("iilor",14,4)],P=[new i("icala",-1,4),new i("iciva",-1,4),new i("ativa",-1,5),new i("itiva",-1,6),new i("icale",-1,4),new i("aţiune",-1,5),new i("iţiune",-1,6),new i("atoare",-1,5),new i("itoare",-1,6),new i("ătoare",-1,5),new i("icitate",-1,4),new i("abilitate",-1,1),new i("ibilitate",-1,2),new i("ivitate",-1,3),new i("icive",-1,4),new i("ative",-1,5),new i("itive",-1,6),new i("icali",-1,4),new i("atori",-1,5),new i("icatori",18,4),new i("itori",-1,6),new i("ători",-1,5),new i("icitati",-1,4),new i("abilitati",-1,1),new i("ivitati",-1,3),new i("icivi",-1,4),new i("ativi",-1,5),new i("itivi",-1,6),new i("icităi",-1,4),new i("abilităi",-1,1),new i("ivităi",-1,3),new i("icităţi",-1,4),new i("abilităţi",-1,1),new i("ivităţi",-1,3),new i("ical",-1,4),new i("ator",-1,5),new i("icator",35,4),new i("itor",-1,6),new i("ător",-1,5),new i("iciv",-1,4),new i("ativ",-1,5),new i("itiv",-1,6),new i("icală",-1,4),new i("icivă",-1,4),new i("ativă",-1,5),new i("itivă",-1,6)],F=[new i("ica",-1,1),new i("abila",-1,1),new i("ibila",-1,1),new i("oasa",-1,1),new i("ata",-1,1),new i("ita",-1,1),new i("anta",-1,1),new i("ista",-1,3),new i("uta",-1,1),new i("iva",-1,1),new i("ic",-1,1),new i("ice",-1,1),new i("abile",-1,1),new i("ibile",-1,1),new i("isme",-1,3),new i("iune",-1,2),new i("oase",-1,1),new i("ate",-1,1),new i("itate",17,1),new i("ite",-1,1),new i("ante",-1,1),new i("iste",-1,3),new i("ute",-1,1),new i("ive",-1,1),new i("ici",-1,1),new i("abili",-1,1),new i("ibili",-1,1),new i("iuni",-1,2),new i("atori",-1,1),new i("osi",-1,1),new i("ati",-1,1),new i("itati",30,1),new i("iti",-1,1),new i("anti",-1,1),new i("isti",-1,3),new i("uti",-1,1),new i("işti",-1,3),new i("ivi",-1,1),new i("ităi",-1,1),new i("oşi",-1,1),new i("ităţi",-1,1),new i("abil",-1,1),new i("ibil",-1,1),new i("ism",-1,3),new i("ator",-1,1),new i("os",-1,1),new i("at",-1,1),new i("it",-1,1),new i("ant",-1,1),new i("ist",-1,3),new i("ut",-1,1),new i("iv",-1,1),new i("ică",-1,1),new i("abilă",-1,1),new i("ibilă",-1,1),new i("oasă",-1,1),new i("ată",-1,1),new i("ită",-1,1),new i("antă",-1,1),new i("istă",-1,3),new i("ută",-1,1),new i("ivă",-1,1)],q=[new i("ea",-1,1),new i("ia",-1,1),new i("esc",-1,1),new i("ăsc",-1,1),new i("ind",-1,1),new i("ând",-1,1),new i("are",-1,1),new i("ere",-1,1),new i("ire",-1,1),new i("âre",-1,1),new i("se",-1,2),new i("ase",10,1),new i("sese",10,2),new i("ise",10,1),new i("use",10,1),new i("âse",10,1),new i("eşte",-1,1),new i("ăşte",-1,1),new i("eze",-1,1),new i("ai",-1,1),new i("eai",19,1),new i("iai",19,1),new i("sei",-1,2),new i("eşti",-1,1),new i("ăşti",-1,1),new i("ui",-1,1),new i("ezi",-1,1),new i("âi",-1,1),new i("aşi",-1,1),new i("seşi",-1,2),new i("aseşi",29,1),new i("seseşi",29,2),new i("iseşi",29,1),new i("useşi",29,1),new i("âseşi",29,1),new i("işi",-1,1),new i("uşi",-1,1),new i("âşi",-1,1),new i("aţi",-1,2),new i("eaţi",38,1),new i("iaţi",38,1),new i("eţi",-1,2),new i("iţi",-1,2),new i("âţi",-1,2),new i("arăţi",-1,1),new i("serăţi",-1,2),new i("aserăţi",45,1),new i("seserăţi",45,2),new i("iserăţi",45,1),new i("userăţi",45,1),new i("âserăţi",45,1),new i("irăţi",-1,1),new i("urăţi",-1,1),new i("ârăţi",-1,1),new i("am",-1,1),new i("eam",54,1),new i("iam",54,1),new i("em",-1,2),new i("asem",57,1),new i("sesem",57,2),new i("isem",57,1),new i("usem",57,1),new i("âsem",57,1),new i("im",-1,2),new i("âm",-1,2),new i("ăm",-1,2),new i("arăm",65,1),new i("serăm",65,2),new i("aserăm",67,1),new i("seserăm",67,2),new i("iserăm",67,1),new i("userăm",67,1),new i("âserăm",67,1),new i("irăm",65,1),new i("urăm",65,1),new i("ârăm",65,1),new i("au",-1,1),new i("eau",76,1),new i("iau",76,1),new i("indu",-1,1),new i("ându",-1,1),new i("ez",-1,1),new i("ească",-1,1),new i("ară",-1,1),new i("seră",-1,2),new i("aseră",84,1),new i("seseră",84,2),new i("iseră",84,1),new i("useră",84,1),new i("âseră",84,1),new i("iră",-1,1),new i("ură",-1,1),new i("âră",-1,1),new i("ează",-1,1)],S=[new i("a",-1,1),new i("e",-1,1),new i("ie",1,1),new i("i",-1,1),new i("ă",-1,1)],W=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,2,32,0,0,4],L=new r;this.setCurrent=function(e){L.setCurrent(e)},this.getCurrent=function(){return L.getCurrent()},this.stem=function(){var e=L.cursor;return n(),L.cursor=e,c(),L.limit_backward=e,L.cursor=L.limit,f(),L.cursor=L.limit,d(),L.cursor=L.limit,_||(L.cursor=L.limit,b(),L.cursor=L.limit),v(),L.cursor=L.limit_backward,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.ro.stemmer,"stemmer-ro"),e.ro.stopWordFilter=e.generateStopWordFilter("acea aceasta această aceea acei aceia acel acela acele acelea acest acesta aceste acestea aceşti aceştia acolo acord acum ai aia aibă aici al ale alea altceva altcineva am ar are asemenea asta astea astăzi asupra au avea avem aveţi azi aş aşadar aţi bine bucur bună ca care caut ce cel ceva chiar cinci cine cineva contra cu cum cumva curând curînd când cât câte câtva câţi cînd cît cîte cîtva cîţi că căci cărei căror cărui către da dacă dar datorită dată dau de deci deja deoarece departe deşi din dinaintea dintr- dintre doi doilea două drept după dă ea ei el ele eram este eu eşti face fata fi fie fiecare fii fim fiu fiţi frumos fără graţie halbă iar ieri la le li lor lui lângă lîngă mai mea mei mele mereu meu mi mie mine mult multă mulţi mulţumesc mâine mîine mă ne nevoie nici nicăieri nimeni nimeri nimic nişte noastre noastră noi noroc nostru nouă noştri nu opt ori oricare orice oricine oricum oricând oricât oricînd oricît oriunde patra patru patrulea pe pentru peste pic poate pot prea prima primul prin puţin puţina puţină până pînă rog sa sale sau se spate spre sub sunt suntem sunteţi sută sînt sîntem sînteţi să săi său ta tale te timp tine toate toată tot totuşi toţi trei treia treilea tu tăi tău un una unde undeva unei uneia unele uneori unii unor unora unu unui unuia unul vi voastre voastră voi vostru vouă voştri vreme vreo vreun vă zece zero zi zice îi îl îmi împotriva în înainte înaintea încotro încât încît între întrucât întrucît îţi ăla ălea ăsta ăstea ăştia şapte şase şi ştiu ţi ţie".split(" ")),e.Pipeline.registerFunction(e.ro.stopWordFilter,"stopWordFilter-ro")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.ru.min.js b/site/assets/javascripts/lunr/min/lunr.ru.min.js deleted file mode 100644 index 186cc48..0000000 --- a/site/assets/javascripts/lunr/min/lunr.ru.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Lunr languages, `Russian` language - * https://github.com/MihaiValentin/lunr-languages - * - * Copyright 2014, Mihai Valentin - * http://www.mozilla.org/MPL/ - */ -/*! - * based on - * Snowball JavaScript Library v0.3 - * http://code.google.com/p/urim/ - * http://snowball.tartarus.org/ - * - * Copyright 2010, Oleg Mazko - * http://www.mozilla.org/MPL/ - */ - -!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n():n()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ru=function(){this.pipeline.reset(),this.pipeline.add(e.ru.trimmer,e.ru.stopWordFilter,e.ru.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ru.stemmer))},e.ru.wordCharacters="Ѐ-҄҇-ԯᴫᵸⷠ-ⷿꙀ-ꚟ︮︯",e.ru.trimmer=e.trimmerSupport.generateTrimmer(e.ru.wordCharacters),e.Pipeline.registerFunction(e.ru.trimmer,"trimmer-ru"),e.ru.stemmer=function(){var n=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,t=new function(){function e(){for(;!W.in_grouping(S,1072,1103);){if(W.cursor>=W.limit)return!1;W.cursor++}return!0}function t(){for(;!W.out_grouping(S,1072,1103);){if(W.cursor>=W.limit)return!1;W.cursor++}return!0}function w(){b=W.limit,_=b,e()&&(b=W.cursor,t()&&e()&&t()&&(_=W.cursor))}function i(){return _<=W.cursor}function u(e,n){var r,t;if(W.ket=W.cursor,r=W.find_among_b(e,n)){switch(W.bra=W.cursor,r){case 1:if(t=W.limit-W.cursor,!W.eq_s_b(1,"а")&&(W.cursor=W.limit-t,!W.eq_s_b(1,"я")))return!1;case 2:W.slice_del()}return!0}return!1}function o(){return u(h,9)}function s(e,n){var r;return W.ket=W.cursor,!!(r=W.find_among_b(e,n))&&(W.bra=W.cursor,1==r&&W.slice_del(),!0)}function c(){return s(g,26)}function m(){return!!c()&&(u(C,8),!0)}function f(){return s(k,2)}function l(){return u(P,46)}function a(){s(v,36)}function p(){var e;W.ket=W.cursor,(e=W.find_among_b(F,2))&&(W.bra=W.cursor,i()&&1==e&&W.slice_del())}function d(){var e;if(W.ket=W.cursor,e=W.find_among_b(q,4))switch(W.bra=W.cursor,e){case 1:if(W.slice_del(),W.ket=W.cursor,!W.eq_s_b(1,"н"))break;W.bra=W.cursor;case 2:if(!W.eq_s_b(1,"н"))break;case 3:W.slice_del()}}var _,b,h=[new n("в",-1,1),new n("ив",0,2),new n("ыв",0,2),new n("вши",-1,1),new n("ивши",3,2),new n("ывши",3,2),new n("вшись",-1,1),new n("ившись",6,2),new n("ывшись",6,2)],g=[new n("ее",-1,1),new n("ие",-1,1),new n("ое",-1,1),new n("ые",-1,1),new n("ими",-1,1),new n("ыми",-1,1),new n("ей",-1,1),new n("ий",-1,1),new n("ой",-1,1),new n("ый",-1,1),new n("ем",-1,1),new n("им",-1,1),new n("ом",-1,1),new n("ым",-1,1),new n("его",-1,1),new n("ого",-1,1),new n("ему",-1,1),new n("ому",-1,1),new n("их",-1,1),new n("ых",-1,1),new n("ею",-1,1),new n("ою",-1,1),new n("ую",-1,1),new n("юю",-1,1),new n("ая",-1,1),new n("яя",-1,1)],C=[new n("ем",-1,1),new n("нн",-1,1),new n("вш",-1,1),new n("ивш",2,2),new n("ывш",2,2),new n("щ",-1,1),new n("ющ",5,1),new n("ующ",6,2)],k=[new n("сь",-1,1),new n("ся",-1,1)],P=[new n("ла",-1,1),new n("ила",0,2),new n("ыла",0,2),new n("на",-1,1),new n("ена",3,2),new n("ете",-1,1),new n("ите",-1,2),new n("йте",-1,1),new n("ейте",7,2),new n("уйте",7,2),new n("ли",-1,1),new n("или",10,2),new n("ыли",10,2),new n("й",-1,1),new n("ей",13,2),new n("уй",13,2),new n("л",-1,1),new n("ил",16,2),new n("ыл",16,2),new n("ем",-1,1),new n("им",-1,2),new n("ым",-1,2),new n("н",-1,1),new n("ен",22,2),new n("ло",-1,1),new n("ило",24,2),new n("ыло",24,2),new n("но",-1,1),new n("ено",27,2),new n("нно",27,1),new n("ет",-1,1),new n("ует",30,2),new n("ит",-1,2),new n("ыт",-1,2),new n("ют",-1,1),new n("уют",34,2),new n("ят",-1,2),new n("ны",-1,1),new n("ены",37,2),new n("ть",-1,1),new n("ить",39,2),new n("ыть",39,2),new n("ешь",-1,1),new n("ишь",-1,2),new n("ю",-1,2),new n("ую",44,2)],v=[new n("а",-1,1),new n("ев",-1,1),new n("ов",-1,1),new n("е",-1,1),new n("ие",3,1),new n("ье",3,1),new n("и",-1,1),new n("еи",6,1),new n("ии",6,1),new n("ами",6,1),new n("ями",6,1),new n("иями",10,1),new n("й",-1,1),new n("ей",12,1),new n("ией",13,1),new n("ий",12,1),new n("ой",12,1),new n("ам",-1,1),new n("ем",-1,1),new n("ием",18,1),new n("ом",-1,1),new n("ям",-1,1),new n("иям",21,1),new n("о",-1,1),new n("у",-1,1),new n("ах",-1,1),new n("ях",-1,1),new n("иях",26,1),new n("ы",-1,1),new n("ь",-1,1),new n("ю",-1,1),new n("ию",30,1),new n("ью",30,1),new n("я",-1,1),new n("ия",33,1),new n("ья",33,1)],F=[new n("ост",-1,1),new n("ость",-1,1)],q=[new n("ейше",-1,1),new n("н",-1,2),new n("ейш",-1,1),new n("ь",-1,3)],S=[33,65,8,232],W=new r;this.setCurrent=function(e){W.setCurrent(e)},this.getCurrent=function(){return W.getCurrent()},this.stem=function(){return w(),W.cursor=W.limit,!(W.cursor=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},in_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},out_grouping:function(t,i,s){if(this.cursors||e>3]&1<<(7&e)))return this.cursor++,!0}return!1},out_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e>s||e>3]&1<<(7&e)))return this.cursor--,!0}return!1},eq_s:function(t,i){if(this.limit-this.cursor>1),f=0,l=o0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n+_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n+_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},find_among_b:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit_backward,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o=0;m--){if(n-l==u){f=-1;break}if(f=r.charCodeAt(n-1-l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n-_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n-_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},replace_s:function(t,i,s){var e=s.length-(i-t),n=r.substring(0,t),u=r.substring(i);return r=n+s+u,this.limit+=e,this.cursor>=i?this.cursor+=e:this.cursor>t&&(this.cursor=t),e},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>r.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),r.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.sv.min.js b/site/assets/javascripts/lunr/min/lunr.sv.min.js deleted file mode 100644 index 3e5eb64..0000000 --- a/site/assets/javascripts/lunr/min/lunr.sv.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Lunr languages, `Swedish` language - * https://github.com/MihaiValentin/lunr-languages - * - * Copyright 2014, Mihai Valentin - * http://www.mozilla.org/MPL/ - */ -/*! - * based on - * Snowball JavaScript Library v0.3 - * http://code.google.com/p/urim/ - * http://snowball.tartarus.org/ - * - * Copyright 2010, Oleg Mazko - * http://www.mozilla.org/MPL/ - */ - -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){function e(){var e,r=w.cursor+3;if(o=w.limit,0<=r||r<=w.limit){for(a=r;;){if(e=w.cursor,w.in_grouping(l,97,246)){w.cursor=e;break}if(w.cursor=e,w.cursor>=w.limit)return;w.cursor++}for(;!w.out_grouping(l,97,246);){if(w.cursor>=w.limit)return;w.cursor++}o=w.cursor,o=o&&(w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(u,37),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.in_grouping_b(d,98,121)&&w.slice_del()}}function i(){var e=w.limit_backward;w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.find_among_b(c,7)&&(w.cursor=w.limit,w.ket=w.cursor,w.cursor>w.limit_backward&&(w.bra=--w.cursor,w.slice_del())),w.limit_backward=e)}function s(){var e,r;if(w.cursor>=o){if(r=w.limit_backward,w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(m,5))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.slice_from("lös");break;case 3:w.slice_from("full")}w.limit_backward=r}}var a,o,u=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],c=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],l=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],d=[119,127,149],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,t(),w.cursor=w.limit,i(),w.cursor=w.limit,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.ta.min.js b/site/assets/javascripts/lunr/min/lunr.ta.min.js deleted file mode 100644 index a644bed..0000000 --- a/site/assets/javascripts/lunr/min/lunr.ta.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ta=function(){this.pipeline.reset(),this.pipeline.add(e.ta.trimmer,e.ta.stopWordFilter,e.ta.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ta.stemmer))},e.ta.wordCharacters="஀-உஊ-ஏஐ-ஙச-ட஠-னப-யர-ஹ஺-ிீ-௉ொ-௏ௐ-௙௚-௟௠-௩௪-௯௰-௹௺-௿a-zA-Za-zA-Z0-90-9",e.ta.trimmer=e.trimmerSupport.generateTrimmer(e.ta.wordCharacters),e.Pipeline.registerFunction(e.ta.trimmer,"trimmer-ta"),e.ta.stopWordFilter=e.generateStopWordFilter("அங்கு அங்கே அது அதை அந்த அவர் அவர்கள் அவள் அவன் அவை ஆக ஆகவே ஆகையால் ஆதலால் ஆதலினால் ஆனாலும் ஆனால் இங்கு இங்கே இது இதை இந்த இப்படி இவர் இவர்கள் இவள் இவன் இவை இவ்வளவு உனக்கு உனது உன் உன்னால் எங்கு எங்கே எது எதை எந்த எப்படி எவர் எவர்கள் எவள் எவன் எவை எவ்வளவு எனக்கு எனது எனவே என் என்ன என்னால் ஏது ஏன் தனது தன்னால் தானே தான் நாங்கள் நாம் நான் நீ நீங்கள்".split(" ")),e.ta.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var t=e.wordcut;t.init(),e.ta.tokenizer=function(r){if(!arguments.length||null==r||void 0==r)return[];if(Array.isArray(r))return r.map(function(t){return isLunr2?new e.Token(t.toLowerCase()):t.toLowerCase()});var i=r.toString().toLowerCase().replace(/^\s+/,"");return t.cut(i).split("|")},e.Pipeline.registerFunction(e.ta.stemmer,"stemmer-ta"),e.Pipeline.registerFunction(e.ta.stopWordFilter,"stopWordFilter-ta")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.te.min.js b/site/assets/javascripts/lunr/min/lunr.te.min.js deleted file mode 100644 index 9fa7a93..0000000 --- a/site/assets/javascripts/lunr/min/lunr.te.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.te=function(){this.pipeline.reset(),this.pipeline.add(e.te.trimmer,e.te.stopWordFilter,e.te.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.te.stemmer))},e.te.wordCharacters="ఀ-ఄఅ-ఔక-హా-ౌౕ-ౖౘ-ౚౠ-ౡౢ-ౣ౦-౯౸-౿఼ఽ్ౝ౷౤౥",e.te.trimmer=e.trimmerSupport.generateTrimmer(e.te.wordCharacters),e.Pipeline.registerFunction(e.te.trimmer,"trimmer-te"),e.te.stopWordFilter=e.generateStopWordFilter("అందరూ అందుబాటులో అడగండి అడగడం అడ్డంగా అనుగుణంగా అనుమతించు అనుమతిస్తుంది అయితే ఇప్పటికే ఉన్నారు ఎక్కడైనా ఎప్పుడు ఎవరైనా ఎవరో ఏ ఏదైనా ఏమైనప్పటికి ఒక ఒకరు కనిపిస్తాయి కాదు కూడా గా గురించి చుట్టూ చేయగలిగింది తగిన తర్వాత దాదాపు దూరంగా నిజంగా పై ప్రకారం ప్రక్కన మధ్య మరియు మరొక మళ్ళీ మాత్రమే మెచ్చుకో వద్ద వెంట వేరుగా వ్యతిరేకంగా సంబంధం".split(" ")),e.te.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var t=e.wordcut;t.init(),e.te.tokenizer=function(r){if(!arguments.length||null==r||void 0==r)return[];if(Array.isArray(r))return r.map(function(t){return isLunr2?new e.Token(t.toLowerCase()):t.toLowerCase()});var i=r.toString().toLowerCase().replace(/^\s+/,"");return t.cut(i).split("|")},e.Pipeline.registerFunction(e.te.stemmer,"stemmer-te"),e.Pipeline.registerFunction(e.te.stopWordFilter,"stopWordFilter-te")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.th.min.js b/site/assets/javascripts/lunr/min/lunr.th.min.js deleted file mode 100644 index dee3aac..0000000 --- a/site/assets/javascripts/lunr/min/lunr.th.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.th=function(){this.pipeline.reset(),this.pipeline.add(e.th.trimmer),r?this.tokenizer=e.th.tokenizer:(e.tokenizer&&(e.tokenizer=e.th.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.th.tokenizer))},e.th.wordCharacters="[฀-๿]",e.th.trimmer=e.trimmerSupport.generateTrimmer(e.th.wordCharacters),e.Pipeline.registerFunction(e.th.trimmer,"trimmer-th");var t=e.wordcut;t.init(),e.th.tokenizer=function(i){if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t):t});var n=i.toString().replace(/^\s+/,"");return t.cut(n).split("|")}}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.tr.min.js b/site/assets/javascripts/lunr/min/lunr.tr.min.js deleted file mode 100644 index 563f6ec..0000000 --- a/site/assets/javascripts/lunr/min/lunr.tr.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Lunr languages, `Turkish` language - * https://github.com/MihaiValentin/lunr-languages - * - * Copyright 2014, Mihai Valentin - * http://www.mozilla.org/MPL/ - */ -/*! - * based on - * Snowball JavaScript Library v0.3 - * http://code.google.com/p/urim/ - * http://snowball.tartarus.org/ - * - * Copyright 2010, Oleg Mazko - * http://www.mozilla.org/MPL/ - */ - -!function(r,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(r.lunr)}(this,function(){return function(r){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");r.tr=function(){this.pipeline.reset(),this.pipeline.add(r.tr.trimmer,r.tr.stopWordFilter,r.tr.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(r.tr.stemmer))},r.tr.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",r.tr.trimmer=r.trimmerSupport.generateTrimmer(r.tr.wordCharacters),r.Pipeline.registerFunction(r.tr.trimmer,"trimmer-tr"),r.tr.stemmer=function(){var i=r.stemmerSupport.Among,e=r.stemmerSupport.SnowballProgram,n=new function(){function r(r,i,e){for(;;){var n=Dr.limit-Dr.cursor;if(Dr.in_grouping_b(r,i,e)){Dr.cursor=Dr.limit-n;break}if(Dr.cursor=Dr.limit-n,Dr.cursor<=Dr.limit_backward)return!1;Dr.cursor--}return!0}function n(){var i,e;i=Dr.limit-Dr.cursor,r(Wr,97,305);for(var n=0;nDr.limit_backward&&(Dr.cursor--,e=Dr.limit-Dr.cursor,i()))?(Dr.cursor=Dr.limit-e,!0):(Dr.cursor=Dr.limit-n,r()?(Dr.cursor=Dr.limit-n,!1):(Dr.cursor=Dr.limit-n,!(Dr.cursor<=Dr.limit_backward)&&(Dr.cursor--,!!i()&&(Dr.cursor=Dr.limit-n,!0))))}function u(r){return t(r,function(){return Dr.in_grouping_b(Wr,97,305)})}function o(){return u(function(){return Dr.eq_s_b(1,"n")})}function s(){return u(function(){return Dr.eq_s_b(1,"s")})}function c(){return u(function(){return Dr.eq_s_b(1,"y")})}function l(){return t(function(){return Dr.in_grouping_b(Lr,105,305)},function(){return Dr.out_grouping_b(Wr,97,305)})}function a(){return Dr.find_among_b(ur,10)&&l()}function m(){return n()&&Dr.in_grouping_b(Lr,105,305)&&s()}function d(){return Dr.find_among_b(or,2)}function f(){return n()&&Dr.in_grouping_b(Lr,105,305)&&c()}function b(){return n()&&Dr.find_among_b(sr,4)}function w(){return n()&&Dr.find_among_b(cr,4)&&o()}function _(){return n()&&Dr.find_among_b(lr,2)&&c()}function k(){return n()&&Dr.find_among_b(ar,2)}function p(){return n()&&Dr.find_among_b(mr,4)}function g(){return n()&&Dr.find_among_b(dr,2)}function y(){return n()&&Dr.find_among_b(fr,4)}function z(){return n()&&Dr.find_among_b(br,2)}function v(){return n()&&Dr.find_among_b(wr,2)&&c()}function h(){return Dr.eq_s_b(2,"ki")}function q(){return n()&&Dr.find_among_b(_r,2)&&o()}function C(){return n()&&Dr.find_among_b(kr,4)&&c()}function P(){return n()&&Dr.find_among_b(pr,4)}function F(){return n()&&Dr.find_among_b(gr,4)&&c()}function S(){return Dr.find_among_b(yr,4)}function W(){return n()&&Dr.find_among_b(zr,2)}function L(){return n()&&Dr.find_among_b(vr,4)}function x(){return n()&&Dr.find_among_b(hr,8)}function A(){return Dr.find_among_b(qr,2)}function E(){return n()&&Dr.find_among_b(Cr,32)&&c()}function j(){return Dr.find_among_b(Pr,8)&&c()}function T(){return n()&&Dr.find_among_b(Fr,4)&&c()}function Z(){return Dr.eq_s_b(3,"ken")&&c()}function B(){var r=Dr.limit-Dr.cursor;return!(T()||(Dr.cursor=Dr.limit-r,E()||(Dr.cursor=Dr.limit-r,j()||(Dr.cursor=Dr.limit-r,Z()))))}function D(){if(A()){var r=Dr.limit-Dr.cursor;if(S()||(Dr.cursor=Dr.limit-r,W()||(Dr.cursor=Dr.limit-r,C()||(Dr.cursor=Dr.limit-r,P()||(Dr.cursor=Dr.limit-r,F()||(Dr.cursor=Dr.limit-r))))),T())return!1}return!0}function G(){if(W()){Dr.bra=Dr.cursor,Dr.slice_del();var r=Dr.limit-Dr.cursor;return Dr.ket=Dr.cursor,x()||(Dr.cursor=Dr.limit-r,E()||(Dr.cursor=Dr.limit-r,j()||(Dr.cursor=Dr.limit-r,T()||(Dr.cursor=Dr.limit-r)))),nr=!1,!1}return!0}function H(){if(!L())return!0;var r=Dr.limit-Dr.cursor;return!E()&&(Dr.cursor=Dr.limit-r,!j())}function I(){var r,i=Dr.limit-Dr.cursor;return!(S()||(Dr.cursor=Dr.limit-i,F()||(Dr.cursor=Dr.limit-i,P()||(Dr.cursor=Dr.limit-i,C()))))||(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,T()||(Dr.cursor=Dr.limit-r),!1)}function J(){var r,i=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,nr=!0,B()&&(Dr.cursor=Dr.limit-i,D()&&(Dr.cursor=Dr.limit-i,G()&&(Dr.cursor=Dr.limit-i,H()&&(Dr.cursor=Dr.limit-i,I()))))){if(Dr.cursor=Dr.limit-i,!x())return;Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,r=Dr.limit-Dr.cursor,S()||(Dr.cursor=Dr.limit-r,W()||(Dr.cursor=Dr.limit-r,C()||(Dr.cursor=Dr.limit-r,P()||(Dr.cursor=Dr.limit-r,F()||(Dr.cursor=Dr.limit-r))))),T()||(Dr.cursor=Dr.limit-r)}Dr.bra=Dr.cursor,Dr.slice_del()}function K(){var r,i,e,n;if(Dr.ket=Dr.cursor,h()){if(r=Dr.limit-Dr.cursor,p())return Dr.bra=Dr.cursor,Dr.slice_del(),i=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,W()?(Dr.bra=Dr.cursor,Dr.slice_del(),K()):(Dr.cursor=Dr.limit-i,a()&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()))),!0;if(Dr.cursor=Dr.limit-r,w()){if(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,e=Dr.limit-Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else{if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,!a()&&(Dr.cursor=Dr.limit-e,!m()&&(Dr.cursor=Dr.limit-e,!K())))return!0;Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())}return!0}if(Dr.cursor=Dr.limit-r,g()){if(n=Dr.limit-Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else if(Dr.cursor=Dr.limit-n,m())Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K());else if(Dr.cursor=Dr.limit-n,!K())return!1;return!0}}return!1}function M(r){if(Dr.ket=Dr.cursor,!g()&&(Dr.cursor=Dr.limit-r,!k()))return!1;var i=Dr.limit-Dr.cursor;if(d())Dr.bra=Dr.cursor,Dr.slice_del();else if(Dr.cursor=Dr.limit-i,m())Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K());else if(Dr.cursor=Dr.limit-i,!K())return!1;return!0}function N(r){if(Dr.ket=Dr.cursor,!z()&&(Dr.cursor=Dr.limit-r,!b()))return!1;var i=Dr.limit-Dr.cursor;return!(!m()&&(Dr.cursor=Dr.limit-i,!d()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()),!0)}function O(){var r,i=Dr.limit-Dr.cursor;return Dr.ket=Dr.cursor,!(!w()&&(Dr.cursor=Dr.limit-i,!v()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,!(!W()||(Dr.bra=Dr.cursor,Dr.slice_del(),!K()))||(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!(a()||(Dr.cursor=Dr.limit-r,m()||(Dr.cursor=Dr.limit-r,K())))||(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()),!0)))}function Q(){var r,i,e=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,!p()&&(Dr.cursor=Dr.limit-e,!f()&&(Dr.cursor=Dr.limit-e,!_())))return!1;if(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,r=Dr.limit-Dr.cursor,a())Dr.bra=Dr.cursor,Dr.slice_del(),i=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,W()||(Dr.cursor=Dr.limit-i);else if(Dr.cursor=Dr.limit-r,!W())return!0;return Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,K(),!0}function R(){var r,i,e=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,W())return Dr.bra=Dr.cursor,Dr.slice_del(),void K();if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,q())if(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else{if(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!a()&&(Dr.cursor=Dr.limit-r,!m())){if(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!W())return;if(Dr.bra=Dr.cursor,Dr.slice_del(),!K())return}Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())}else if(Dr.cursor=Dr.limit-e,!M(e)&&(Dr.cursor=Dr.limit-e,!N(e))){if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,y())return Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,i=Dr.limit-Dr.cursor,void(a()?(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())):(Dr.cursor=Dr.limit-i,W()?(Dr.bra=Dr.cursor,Dr.slice_del(),K()):(Dr.cursor=Dr.limit-i,K())));if(Dr.cursor=Dr.limit-e,!O()){if(Dr.cursor=Dr.limit-e,d())return Dr.bra=Dr.cursor,void Dr.slice_del();Dr.cursor=Dr.limit-e,K()||(Dr.cursor=Dr.limit-e,Q()||(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,(a()||(Dr.cursor=Dr.limit-e,m()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()))))}}}function U(){var r;if(Dr.ket=Dr.cursor,r=Dr.find_among_b(Sr,4))switch(Dr.bra=Dr.cursor,r){case 1:Dr.slice_from("p");break;case 2:Dr.slice_from("ç");break;case 3:Dr.slice_from("t");break;case 4:Dr.slice_from("k")}}function V(){for(;;){var r=Dr.limit-Dr.cursor;if(Dr.in_grouping_b(Wr,97,305)){Dr.cursor=Dr.limit-r;break}if(Dr.cursor=Dr.limit-r,Dr.cursor<=Dr.limit_backward)return!1;Dr.cursor--}return!0}function X(r,i,e){if(Dr.cursor=Dr.limit-r,V()){var n=Dr.limit-Dr.cursor;if(!Dr.eq_s_b(1,i)&&(Dr.cursor=Dr.limit-n,!Dr.eq_s_b(1,e)))return!0;Dr.cursor=Dr.limit-r;var t=Dr.cursor;return Dr.insert(Dr.cursor,Dr.cursor,e),Dr.cursor=t,!1}return!0}function Y(){var r=Dr.limit-Dr.cursor;(Dr.eq_s_b(1,"d")||(Dr.cursor=Dr.limit-r,Dr.eq_s_b(1,"g")))&&X(r,"a","ı")&&X(r,"e","i")&&X(r,"o","u")&&X(r,"ö","ü")}function $(){for(var r,i=Dr.cursor,e=2;;){for(r=Dr.cursor;!Dr.in_grouping(Wr,97,305);){if(Dr.cursor>=Dr.limit)return Dr.cursor=r,!(e>0)&&(Dr.cursor=i,!0);Dr.cursor++}e--}}function rr(r,i,e){for(;!Dr.eq_s(i,e);){if(Dr.cursor>=Dr.limit)return!0;Dr.cursor++}return(tr=i)!=Dr.limit||(Dr.cursor=r,!1)}function ir(){var r=Dr.cursor;return!rr(r,2,"ad")||(Dr.cursor=r,!rr(r,5,"soyad"))}function er(){var r=Dr.cursor;return!ir()&&(Dr.limit_backward=r,Dr.cursor=Dr.limit,Y(),Dr.cursor=Dr.limit,U(),!0)}var nr,tr,ur=[new i("m",-1,-1),new i("n",-1,-1),new i("miz",-1,-1),new i("niz",-1,-1),new i("muz",-1,-1),new i("nuz",-1,-1),new i("müz",-1,-1),new i("nüz",-1,-1),new i("mız",-1,-1),new i("nız",-1,-1)],or=[new i("leri",-1,-1),new i("ları",-1,-1)],sr=[new i("ni",-1,-1),new i("nu",-1,-1),new i("nü",-1,-1),new i("nı",-1,-1)],cr=[new i("in",-1,-1),new i("un",-1,-1),new i("ün",-1,-1),new i("ın",-1,-1)],lr=[new i("a",-1,-1),new i("e",-1,-1)],ar=[new i("na",-1,-1),new i("ne",-1,-1)],mr=[new i("da",-1,-1),new i("ta",-1,-1),new i("de",-1,-1),new i("te",-1,-1)],dr=[new i("nda",-1,-1),new i("nde",-1,-1)],fr=[new i("dan",-1,-1),new i("tan",-1,-1),new i("den",-1,-1),new i("ten",-1,-1)],br=[new i("ndan",-1,-1),new i("nden",-1,-1)],wr=[new i("la",-1,-1),new i("le",-1,-1)],_r=[new i("ca",-1,-1),new i("ce",-1,-1)],kr=[new i("im",-1,-1),new i("um",-1,-1),new i("üm",-1,-1),new i("ım",-1,-1)],pr=[new i("sin",-1,-1),new i("sun",-1,-1),new i("sün",-1,-1),new i("sın",-1,-1)],gr=[new i("iz",-1,-1),new i("uz",-1,-1),new i("üz",-1,-1),new i("ız",-1,-1)],yr=[new i("siniz",-1,-1),new i("sunuz",-1,-1),new i("sünüz",-1,-1),new i("sınız",-1,-1)],zr=[new i("lar",-1,-1),new i("ler",-1,-1)],vr=[new i("niz",-1,-1),new i("nuz",-1,-1),new i("nüz",-1,-1),new i("nız",-1,-1)],hr=[new i("dir",-1,-1),new i("tir",-1,-1),new i("dur",-1,-1),new i("tur",-1,-1),new i("dür",-1,-1),new i("tür",-1,-1),new i("dır",-1,-1),new i("tır",-1,-1)],qr=[new i("casına",-1,-1),new i("cesine",-1,-1)],Cr=[new i("di",-1,-1),new i("ti",-1,-1),new i("dik",-1,-1),new i("tik",-1,-1),new i("duk",-1,-1),new i("tuk",-1,-1),new i("dük",-1,-1),new i("tük",-1,-1),new i("dık",-1,-1),new i("tık",-1,-1),new i("dim",-1,-1),new i("tim",-1,-1),new i("dum",-1,-1),new i("tum",-1,-1),new i("düm",-1,-1),new i("tüm",-1,-1),new i("dım",-1,-1),new i("tım",-1,-1),new i("din",-1,-1),new i("tin",-1,-1),new i("dun",-1,-1),new i("tun",-1,-1),new i("dün",-1,-1),new i("tün",-1,-1),new i("dın",-1,-1),new i("tın",-1,-1),new i("du",-1,-1),new i("tu",-1,-1),new i("dü",-1,-1),new i("tü",-1,-1),new i("dı",-1,-1),new i("tı",-1,-1)],Pr=[new i("sa",-1,-1),new i("se",-1,-1),new i("sak",-1,-1),new i("sek",-1,-1),new i("sam",-1,-1),new i("sem",-1,-1),new i("san",-1,-1),new i("sen",-1,-1)],Fr=[new i("miş",-1,-1),new i("muş",-1,-1),new i("müş",-1,-1),new i("mış",-1,-1)],Sr=[new i("b",-1,1),new i("c",-1,2),new i("d",-1,3),new i("ğ",-1,4)],Wr=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,8,0,0,0,0,0,0,1],Lr=[1,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,1],xr=[1,64,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],Ar=[17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130],Er=[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],jr=[17],Tr=[65],Zr=[65],Br=[["a",xr,97,305],["e",Ar,101,252],["ı",Er,97,305],["i",jr,101,105],["o",Tr,111,117],["ö",Zr,246,252],["u",Tr,111,117]],Dr=new e;this.setCurrent=function(r){Dr.setCurrent(r)},this.getCurrent=function(){return Dr.getCurrent()},this.stem=function(){return!!($()&&(Dr.limit_backward=Dr.cursor,Dr.cursor=Dr.limit,J(),Dr.cursor=Dr.limit,nr&&(R(),Dr.cursor=Dr.limit_backward,er())))}};return function(r){return"function"==typeof r.update?r.update(function(r){return n.setCurrent(r),n.stem(),n.getCurrent()}):(n.setCurrent(r),n.stem(),n.getCurrent())}}(),r.Pipeline.registerFunction(r.tr.stemmer,"stemmer-tr"),r.tr.stopWordFilter=r.generateStopWordFilter("acaba altmış altı ama ancak arada aslında ayrıca bana bazı belki ben benden beni benim beri beş bile bin bir biri birkaç birkez birçok birşey birşeyi biz bizden bize bizi bizim bu buna bunda bundan bunlar bunları bunların bunu bunun burada böyle böylece da daha dahi de defa değil diye diğer doksan dokuz dolayı dolayısıyla dört edecek eden ederek edilecek ediliyor edilmesi ediyor elli en etmesi etti ettiği ettiğini eğer gibi göre halen hangi hatta hem henüz hep hepsi her herhangi herkesin hiç hiçbir iki ile ilgili ise itibaren itibariyle için işte kadar karşın katrilyon kendi kendilerine kendini kendisi kendisine kendisini kez ki kim kimden kime kimi kimse kırk milyar milyon mu mü mı nasıl ne neden nedenle nerde nerede nereye niye niçin o olan olarak oldu olduklarını olduğu olduğunu olmadı olmadığı olmak olması olmayan olmaz olsa olsun olup olur olursa oluyor on ona ondan onlar onlardan onları onların onu onun otuz oysa pek rağmen sadece sanki sekiz seksen sen senden seni senin siz sizden sizi sizin tarafından trilyon tüm var vardı ve veya ya yani yapacak yapmak yaptı yaptıkları yaptığı yaptığını yapılan yapılması yapıyor yedi yerine yetmiş yine yirmi yoksa yüz zaten çok çünkü öyle üzere üç şey şeyden şeyi şeyler şu şuna şunda şundan şunları şunu şöyle".split(" ")),r.Pipeline.registerFunction(r.tr.stopWordFilter,"stopWordFilter-tr")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.vi.min.js b/site/assets/javascripts/lunr/min/lunr.vi.min.js deleted file mode 100644 index 22aed28..0000000 --- a/site/assets/javascripts/lunr/min/lunr.vi.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.vi=function(){this.pipeline.reset(),this.pipeline.add(e.vi.stopWordFilter,e.vi.trimmer)},e.vi.wordCharacters="[A-Za-ẓ̀͐́͑̉̃̓ÂâÊêÔôĂ-ăĐ-đƠ-ơƯ-ư]",e.vi.trimmer=e.trimmerSupport.generateTrimmer(e.vi.wordCharacters),e.Pipeline.registerFunction(e.vi.trimmer,"trimmer-vi"),e.vi.stopWordFilter=e.generateStopWordFilter("là cái nhưng mà".split(" "))}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/min/lunr.zh.min.js b/site/assets/javascripts/lunr/min/lunr.zh.min.js deleted file mode 100644 index fda66e9..0000000 --- a/site/assets/javascripts/lunr/min/lunr.zh.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r(require("@node-rs/jieba")):r()(e.lunr)}(this,function(e){return function(r,t){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var i="2"==r.version[0];r.zh=function(){this.pipeline.reset(),this.pipeline.add(r.zh.trimmer,r.zh.stopWordFilter,r.zh.stemmer),i?this.tokenizer=r.zh.tokenizer:(r.tokenizer&&(r.tokenizer=r.zh.tokenizer),this.tokenizerFn&&(this.tokenizerFn=r.zh.tokenizer))},r.zh.tokenizer=function(n){if(!arguments.length||null==n||void 0==n)return[];if(Array.isArray(n))return n.map(function(e){return i?new r.Token(e.toLowerCase()):e.toLowerCase()});t&&e.load(t);var o=n.toString().trim().toLowerCase(),s=[];e.cut(o,!0).forEach(function(e){s=s.concat(e.split(" "))}),s=s.filter(function(e){return!!e});var u=0;return s.map(function(e,t){if(i){var n=o.indexOf(e,u),s={};return s.position=[n,e.length],s.index=t,u=n,new r.Token(e,s)}return e})},r.zh.wordCharacters="\\w一-龥",r.zh.trimmer=r.trimmerSupport.generateTrimmer(r.zh.wordCharacters),r.Pipeline.registerFunction(r.zh.trimmer,"trimmer-zh"),r.zh.stemmer=function(){return function(e){return e}}(),r.Pipeline.registerFunction(r.zh.stemmer,"stemmer-zh"),r.zh.stopWordFilter=r.generateStopWordFilter("的 一 不 在 人 有 是 为 為 以 于 於 上 他 而 后 後 之 来 來 及 了 因 下 可 到 由 这 這 与 與 也 此 但 并 並 个 個 其 已 无 無 小 我 们 們 起 最 再 今 去 好 只 又 或 很 亦 某 把 那 你 乃 它 吧 被 比 别 趁 当 當 从 從 得 打 凡 儿 兒 尔 爾 该 該 各 给 給 跟 和 何 还 還 即 几 幾 既 看 据 據 距 靠 啦 另 么 麽 每 嘛 拿 哪 您 凭 憑 且 却 卻 让 讓 仍 啥 如 若 使 谁 誰 虽 雖 随 隨 同 所 她 哇 嗡 往 些 向 沿 哟 喲 用 咱 则 則 怎 曾 至 致 着 著 诸 諸 自".split(" ")),r.Pipeline.registerFunction(r.zh.stopWordFilter,"stopWordFilter-zh")}}); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/tinyseg.js b/site/assets/javascripts/lunr/tinyseg.js deleted file mode 100644 index 167fa6d..0000000 --- a/site/assets/javascripts/lunr/tinyseg.js +++ /dev/null @@ -1,206 +0,0 @@ -/** - * export the module via AMD, CommonJS or as a browser global - * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js - */ -;(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(factory) - } else if (typeof exports === 'object') { - /** - * Node. Does not work with strict CommonJS, but - * only CommonJS-like environments that support module.exports, - * like Node. - */ - module.exports = factory() - } else { - // Browser globals (root is window) - factory()(root.lunr); - } -}(this, function () { - /** - * Just return a value to define the module export. - * This example returns an object, but the module - * can return a function as the exported value. - */ - - return function(lunr) { - // TinySegmenter 0.1 -- Super compact Japanese tokenizer in Javascript - // (c) 2008 Taku Kudo - // TinySegmenter is freely distributable under the terms of a new BSD licence. - // For details, see http://chasen.org/~taku/software/TinySegmenter/LICENCE.txt - - function TinySegmenter() { - var patterns = { - "[一二三四五六七八九十百千万億兆]":"M", - "[一-龠々〆ヵヶ]":"H", - "[ぁ-ん]":"I", - "[ァ-ヴーア-ン゙ー]":"K", - "[a-zA-Za-zA-Z]":"A", - "[0-90-9]":"N" - } - this.chartype_ = []; - for (var i in patterns) { - var regexp = new RegExp(i); - this.chartype_.push([regexp, patterns[i]]); - } - - this.BIAS__ = -332 - this.BC1__ = {"HH":6,"II":2461,"KH":406,"OH":-1378}; - this.BC2__ = {"AA":-3267,"AI":2744,"AN":-878,"HH":-4070,"HM":-1711,"HN":4012,"HO":3761,"IA":1327,"IH":-1184,"II":-1332,"IK":1721,"IO":5492,"KI":3831,"KK":-8741,"MH":-3132,"MK":3334,"OO":-2920}; - this.BC3__ = {"HH":996,"HI":626,"HK":-721,"HN":-1307,"HO":-836,"IH":-301,"KK":2762,"MK":1079,"MM":4034,"OA":-1652,"OH":266}; - this.BP1__ = {"BB":295,"OB":304,"OO":-125,"UB":352}; - this.BP2__ = {"BO":60,"OO":-1762}; - this.BQ1__ = {"BHH":1150,"BHM":1521,"BII":-1158,"BIM":886,"BMH":1208,"BNH":449,"BOH":-91,"BOO":-2597,"OHI":451,"OIH":-296,"OKA":1851,"OKH":-1020,"OKK":904,"OOO":2965}; - this.BQ2__ = {"BHH":118,"BHI":-1159,"BHM":466,"BIH":-919,"BKK":-1720,"BKO":864,"OHH":-1139,"OHM":-181,"OIH":153,"UHI":-1146}; - this.BQ3__ = {"BHH":-792,"BHI":2664,"BII":-299,"BKI":419,"BMH":937,"BMM":8335,"BNN":998,"BOH":775,"OHH":2174,"OHM":439,"OII":280,"OKH":1798,"OKI":-793,"OKO":-2242,"OMH":-2402,"OOO":11699}; - this.BQ4__ = {"BHH":-3895,"BIH":3761,"BII":-4654,"BIK":1348,"BKK":-1806,"BMI":-3385,"BOO":-12396,"OAH":926,"OHH":266,"OHK":-2036,"ONN":-973}; - this.BW1__ = {",と":660,",同":727,"B1あ":1404,"B1同":542,"、と":660,"、同":727,"」と":1682,"あっ":1505,"いう":1743,"いっ":-2055,"いる":672,"うし":-4817,"うん":665,"から":3472,"がら":600,"こう":-790,"こと":2083,"こん":-1262,"さら":-4143,"さん":4573,"した":2641,"して":1104,"すで":-3399,"そこ":1977,"それ":-871,"たち":1122,"ため":601,"った":3463,"つい":-802,"てい":805,"てき":1249,"でき":1127,"です":3445,"では":844,"とい":-4915,"とみ":1922,"どこ":3887,"ない":5713,"なっ":3015,"など":7379,"なん":-1113,"にし":2468,"には":1498,"にも":1671,"に対":-912,"の一":-501,"の中":741,"ませ":2448,"まで":1711,"まま":2600,"まる":-2155,"やむ":-1947,"よっ":-2565,"れた":2369,"れで":-913,"をし":1860,"を見":731,"亡く":-1886,"京都":2558,"取り":-2784,"大き":-2604,"大阪":1497,"平方":-2314,"引き":-1336,"日本":-195,"本当":-2423,"毎日":-2113,"目指":-724,"B1あ":1404,"B1同":542,"」と":1682}; - this.BW2__ = {"..":-11822,"11":-669,"――":-5730,"−−":-13175,"いう":-1609,"うか":2490,"かし":-1350,"かも":-602,"から":-7194,"かれ":4612,"がい":853,"がら":-3198,"きた":1941,"くな":-1597,"こと":-8392,"この":-4193,"させ":4533,"され":13168,"さん":-3977,"しい":-1819,"しか":-545,"した":5078,"して":972,"しな":939,"その":-3744,"たい":-1253,"たた":-662,"ただ":-3857,"たち":-786,"たと":1224,"たは":-939,"った":4589,"って":1647,"っと":-2094,"てい":6144,"てき":3640,"てく":2551,"ては":-3110,"ても":-3065,"でい":2666,"でき":-1528,"でし":-3828,"です":-4761,"でも":-4203,"とい":1890,"とこ":-1746,"とと":-2279,"との":720,"とみ":5168,"とも":-3941,"ない":-2488,"なが":-1313,"など":-6509,"なの":2614,"なん":3099,"にお":-1615,"にし":2748,"にな":2454,"によ":-7236,"に対":-14943,"に従":-4688,"に関":-11388,"のか":2093,"ので":-7059,"のに":-6041,"のの":-6125,"はい":1073,"はが":-1033,"はず":-2532,"ばれ":1813,"まし":-1316,"まで":-6621,"まれ":5409,"めて":-3153,"もい":2230,"もの":-10713,"らか":-944,"らし":-1611,"らに":-1897,"りし":651,"りま":1620,"れた":4270,"れて":849,"れば":4114,"ろう":6067,"われ":7901,"を通":-11877,"んだ":728,"んな":-4115,"一人":602,"一方":-1375,"一日":970,"一部":-1051,"上が":-4479,"会社":-1116,"出て":2163,"分の":-7758,"同党":970,"同日":-913,"大阪":-2471,"委員":-1250,"少な":-1050,"年度":-8669,"年間":-1626,"府県":-2363,"手権":-1982,"新聞":-4066,"日新":-722,"日本":-7068,"日米":3372,"曜日":-601,"朝鮮":-2355,"本人":-2697,"東京":-1543,"然と":-1384,"社会":-1276,"立て":-990,"第に":-1612,"米国":-4268,"11":-669}; - this.BW3__ = {"あた":-2194,"あり":719,"ある":3846,"い.":-1185,"い。":-1185,"いい":5308,"いえ":2079,"いく":3029,"いた":2056,"いっ":1883,"いる":5600,"いわ":1527,"うち":1117,"うと":4798,"えと":1454,"か.":2857,"か。":2857,"かけ":-743,"かっ":-4098,"かに":-669,"から":6520,"かり":-2670,"が,":1816,"が、":1816,"がき":-4855,"がけ":-1127,"がっ":-913,"がら":-4977,"がり":-2064,"きた":1645,"けど":1374,"こと":7397,"この":1542,"ころ":-2757,"さい":-714,"さを":976,"し,":1557,"し、":1557,"しい":-3714,"した":3562,"して":1449,"しな":2608,"しま":1200,"す.":-1310,"す。":-1310,"する":6521,"ず,":3426,"ず、":3426,"ずに":841,"そう":428,"た.":8875,"た。":8875,"たい":-594,"たの":812,"たり":-1183,"たる":-853,"だ.":4098,"だ。":4098,"だっ":1004,"った":-4748,"って":300,"てい":6240,"てお":855,"ても":302,"です":1437,"でに":-1482,"では":2295,"とう":-1387,"とし":2266,"との":541,"とも":-3543,"どう":4664,"ない":1796,"なく":-903,"など":2135,"に,":-1021,"に、":-1021,"にし":1771,"にな":1906,"には":2644,"の,":-724,"の、":-724,"の子":-1000,"は,":1337,"は、":1337,"べき":2181,"まし":1113,"ます":6943,"まっ":-1549,"まで":6154,"まれ":-793,"らし":1479,"られ":6820,"るる":3818,"れ,":854,"れ、":854,"れた":1850,"れて":1375,"れば":-3246,"れる":1091,"われ":-605,"んだ":606,"んで":798,"カ月":990,"会議":860,"入り":1232,"大会":2217,"始め":1681,"市":965,"新聞":-5055,"日,":974,"日、":974,"社会":2024,"カ月":990}; - this.TC1__ = {"AAA":1093,"HHH":1029,"HHM":580,"HII":998,"HOH":-390,"HOM":-331,"IHI":1169,"IOH":-142,"IOI":-1015,"IOM":467,"MMH":187,"OOI":-1832}; - this.TC2__ = {"HHO":2088,"HII":-1023,"HMM":-1154,"IHI":-1965,"KKH":703,"OII":-2649}; - this.TC3__ = {"AAA":-294,"HHH":346,"HHI":-341,"HII":-1088,"HIK":731,"HOH":-1486,"IHH":128,"IHI":-3041,"IHO":-1935,"IIH":-825,"IIM":-1035,"IOI":-542,"KHH":-1216,"KKA":491,"KKH":-1217,"KOK":-1009,"MHH":-2694,"MHM":-457,"MHO":123,"MMH":-471,"NNH":-1689,"NNO":662,"OHO":-3393}; - this.TC4__ = {"HHH":-203,"HHI":1344,"HHK":365,"HHM":-122,"HHN":182,"HHO":669,"HIH":804,"HII":679,"HOH":446,"IHH":695,"IHO":-2324,"IIH":321,"III":1497,"IIO":656,"IOO":54,"KAK":4845,"KKA":3386,"KKK":3065,"MHH":-405,"MHI":201,"MMH":-241,"MMM":661,"MOM":841}; - this.TQ1__ = {"BHHH":-227,"BHHI":316,"BHIH":-132,"BIHH":60,"BIII":1595,"BNHH":-744,"BOHH":225,"BOOO":-908,"OAKK":482,"OHHH":281,"OHIH":249,"OIHI":200,"OIIH":-68}; - this.TQ2__ = {"BIHH":-1401,"BIII":-1033,"BKAK":-543,"BOOO":-5591}; - this.TQ3__ = {"BHHH":478,"BHHM":-1073,"BHIH":222,"BHII":-504,"BIIH":-116,"BIII":-105,"BMHI":-863,"BMHM":-464,"BOMH":620,"OHHH":346,"OHHI":1729,"OHII":997,"OHMH":481,"OIHH":623,"OIIH":1344,"OKAK":2792,"OKHH":587,"OKKA":679,"OOHH":110,"OOII":-685}; - this.TQ4__ = {"BHHH":-721,"BHHM":-3604,"BHII":-966,"BIIH":-607,"BIII":-2181,"OAAA":-2763,"OAKK":180,"OHHH":-294,"OHHI":2446,"OHHO":480,"OHIH":-1573,"OIHH":1935,"OIHI":-493,"OIIH":626,"OIII":-4007,"OKAK":-8156}; - this.TW1__ = {"につい":-4681,"東京都":2026}; - this.TW2__ = {"ある程":-2049,"いった":-1256,"ころが":-2434,"しょう":3873,"その後":-4430,"だって":-1049,"ていた":1833,"として":-4657,"ともに":-4517,"もので":1882,"一気に":-792,"初めて":-1512,"同時に":-8097,"大きな":-1255,"対して":-2721,"社会党":-3216}; - this.TW3__ = {"いただ":-1734,"してい":1314,"として":-4314,"につい":-5483,"にとっ":-5989,"に当た":-6247,"ので,":-727,"ので、":-727,"のもの":-600,"れから":-3752,"十二月":-2287}; - this.TW4__ = {"いう.":8576,"いう。":8576,"からな":-2348,"してい":2958,"たが,":1516,"たが、":1516,"ている":1538,"という":1349,"ました":5543,"ません":1097,"ようと":-4258,"よると":5865}; - this.UC1__ = {"A":484,"K":93,"M":645,"O":-505}; - this.UC2__ = {"A":819,"H":1059,"I":409,"M":3987,"N":5775,"O":646}; - this.UC3__ = {"A":-1370,"I":2311}; - this.UC4__ = {"A":-2643,"H":1809,"I":-1032,"K":-3450,"M":3565,"N":3876,"O":6646}; - this.UC5__ = {"H":313,"I":-1238,"K":-799,"M":539,"O":-831}; - this.UC6__ = {"H":-506,"I":-253,"K":87,"M":247,"O":-387}; - this.UP1__ = {"O":-214}; - this.UP2__ = {"B":69,"O":935}; - this.UP3__ = {"B":189}; - this.UQ1__ = {"BH":21,"BI":-12,"BK":-99,"BN":142,"BO":-56,"OH":-95,"OI":477,"OK":410,"OO":-2422}; - this.UQ2__ = {"BH":216,"BI":113,"OK":1759}; - this.UQ3__ = {"BA":-479,"BH":42,"BI":1913,"BK":-7198,"BM":3160,"BN":6427,"BO":14761,"OI":-827,"ON":-3212}; - this.UW1__ = {",":156,"、":156,"「":-463,"あ":-941,"う":-127,"が":-553,"き":121,"こ":505,"で":-201,"と":-547,"ど":-123,"に":-789,"の":-185,"は":-847,"も":-466,"や":-470,"よ":182,"ら":-292,"り":208,"れ":169,"を":-446,"ん":-137,"・":-135,"主":-402,"京":-268,"区":-912,"午":871,"国":-460,"大":561,"委":729,"市":-411,"日":-141,"理":361,"生":-408,"県":-386,"都":-718,"「":-463,"・":-135}; - this.UW2__ = {",":-829,"、":-829,"〇":892,"「":-645,"」":3145,"あ":-538,"い":505,"う":134,"お":-502,"か":1454,"が":-856,"く":-412,"こ":1141,"さ":878,"ざ":540,"し":1529,"す":-675,"せ":300,"そ":-1011,"た":188,"だ":1837,"つ":-949,"て":-291,"で":-268,"と":-981,"ど":1273,"な":1063,"に":-1764,"の":130,"は":-409,"ひ":-1273,"べ":1261,"ま":600,"も":-1263,"や":-402,"よ":1639,"り":-579,"る":-694,"れ":571,"を":-2516,"ん":2095,"ア":-587,"カ":306,"キ":568,"ッ":831,"三":-758,"不":-2150,"世":-302,"中":-968,"主":-861,"事":492,"人":-123,"会":978,"保":362,"入":548,"初":-3025,"副":-1566,"北":-3414,"区":-422,"大":-1769,"天":-865,"太":-483,"子":-1519,"学":760,"実":1023,"小":-2009,"市":-813,"年":-1060,"強":1067,"手":-1519,"揺":-1033,"政":1522,"文":-1355,"新":-1682,"日":-1815,"明":-1462,"最":-630,"朝":-1843,"本":-1650,"東":-931,"果":-665,"次":-2378,"民":-180,"気":-1740,"理":752,"発":529,"目":-1584,"相":-242,"県":-1165,"立":-763,"第":810,"米":509,"自":-1353,"行":838,"西":-744,"見":-3874,"調":1010,"議":1198,"込":3041,"開":1758,"間":-1257,"「":-645,"」":3145,"ッ":831,"ア":-587,"カ":306,"キ":568}; - this.UW3__ = {",":4889,"1":-800,"−":-1723,"、":4889,"々":-2311,"〇":5827,"」":2670,"〓":-3573,"あ":-2696,"い":1006,"う":2342,"え":1983,"お":-4864,"か":-1163,"が":3271,"く":1004,"け":388,"げ":401,"こ":-3552,"ご":-3116,"さ":-1058,"し":-395,"す":584,"せ":3685,"そ":-5228,"た":842,"ち":-521,"っ":-1444,"つ":-1081,"て":6167,"で":2318,"と":1691,"ど":-899,"な":-2788,"に":2745,"の":4056,"は":4555,"ひ":-2171,"ふ":-1798,"へ":1199,"ほ":-5516,"ま":-4384,"み":-120,"め":1205,"も":2323,"や":-788,"よ":-202,"ら":727,"り":649,"る":5905,"れ":2773,"わ":-1207,"を":6620,"ん":-518,"ア":551,"グ":1319,"ス":874,"ッ":-1350,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278,"・":-3794,"一":-1619,"下":-1759,"世":-2087,"両":3815,"中":653,"主":-758,"予":-1193,"二":974,"人":2742,"今":792,"他":1889,"以":-1368,"低":811,"何":4265,"作":-361,"保":-2439,"元":4858,"党":3593,"全":1574,"公":-3030,"六":755,"共":-1880,"円":5807,"再":3095,"分":457,"初":2475,"別":1129,"前":2286,"副":4437,"力":365,"動":-949,"務":-1872,"化":1327,"北":-1038,"区":4646,"千":-2309,"午":-783,"協":-1006,"口":483,"右":1233,"各":3588,"合":-241,"同":3906,"和":-837,"員":4513,"国":642,"型":1389,"場":1219,"外":-241,"妻":2016,"学":-1356,"安":-423,"実":-1008,"家":1078,"小":-513,"少":-3102,"州":1155,"市":3197,"平":-1804,"年":2416,"広":-1030,"府":1605,"度":1452,"建":-2352,"当":-3885,"得":1905,"思":-1291,"性":1822,"戸":-488,"指":-3973,"政":-2013,"教":-1479,"数":3222,"文":-1489,"新":1764,"日":2099,"旧":5792,"昨":-661,"時":-1248,"曜":-951,"最":-937,"月":4125,"期":360,"李":3094,"村":364,"東":-805,"核":5156,"森":2438,"業":484,"氏":2613,"民":-1694,"決":-1073,"法":1868,"海":-495,"無":979,"物":461,"特":-3850,"生":-273,"用":914,"町":1215,"的":7313,"直":-1835,"省":792,"県":6293,"知":-1528,"私":4231,"税":401,"立":-960,"第":1201,"米":7767,"系":3066,"約":3663,"級":1384,"統":-4229,"総":1163,"線":1255,"者":6457,"能":725,"自":-2869,"英":785,"見":1044,"調":-562,"財":-733,"費":1777,"車":1835,"軍":1375,"込":-1504,"通":-1136,"選":-681,"郎":1026,"郡":4404,"部":1200,"金":2163,"長":421,"開":-1432,"間":1302,"関":-1282,"雨":2009,"電":-1045,"非":2066,"駅":1620,"1":-800,"」":2670,"・":-3794,"ッ":-1350,"ア":551,"グ":1319,"ス":874,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278}; - this.UW4__ = {",":3930,".":3508,"―":-4841,"、":3930,"。":3508,"〇":4999,"「":1895,"」":3798,"〓":-5156,"あ":4752,"い":-3435,"う":-640,"え":-2514,"お":2405,"か":530,"が":6006,"き":-4482,"ぎ":-3821,"く":-3788,"け":-4376,"げ":-4734,"こ":2255,"ご":1979,"さ":2864,"し":-843,"じ":-2506,"す":-731,"ず":1251,"せ":181,"そ":4091,"た":5034,"だ":5408,"ち":-3654,"っ":-5882,"つ":-1659,"て":3994,"で":7410,"と":4547,"な":5433,"に":6499,"ぬ":1853,"ね":1413,"の":7396,"は":8578,"ば":1940,"ひ":4249,"び":-4134,"ふ":1345,"へ":6665,"べ":-744,"ほ":1464,"ま":1051,"み":-2082,"む":-882,"め":-5046,"も":4169,"ゃ":-2666,"や":2795,"ょ":-1544,"よ":3351,"ら":-2922,"り":-9726,"る":-14896,"れ":-2613,"ろ":-4570,"わ":-1783,"を":13150,"ん":-2352,"カ":2145,"コ":1789,"セ":1287,"ッ":-724,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637,"・":-4371,"ー":-11870,"一":-2069,"中":2210,"予":782,"事":-190,"井":-1768,"人":1036,"以":544,"会":950,"体":-1286,"作":530,"側":4292,"先":601,"党":-2006,"共":-1212,"内":584,"円":788,"初":1347,"前":1623,"副":3879,"力":-302,"動":-740,"務":-2715,"化":776,"区":4517,"協":1013,"参":1555,"合":-1834,"和":-681,"員":-910,"器":-851,"回":1500,"国":-619,"園":-1200,"地":866,"場":-1410,"塁":-2094,"士":-1413,"多":1067,"大":571,"子":-4802,"学":-1397,"定":-1057,"寺":-809,"小":1910,"屋":-1328,"山":-1500,"島":-2056,"川":-2667,"市":2771,"年":374,"庁":-4556,"後":456,"性":553,"感":916,"所":-1566,"支":856,"改":787,"政":2182,"教":704,"文":522,"方":-856,"日":1798,"時":1829,"最":845,"月":-9066,"木":-485,"来":-442,"校":-360,"業":-1043,"氏":5388,"民":-2716,"気":-910,"沢":-939,"済":-543,"物":-735,"率":672,"球":-1267,"生":-1286,"産":-1101,"田":-2900,"町":1826,"的":2586,"目":922,"省":-3485,"県":2997,"空":-867,"立":-2112,"第":788,"米":2937,"系":786,"約":2171,"経":1146,"統":-1169,"総":940,"線":-994,"署":749,"者":2145,"能":-730,"般":-852,"行":-792,"規":792,"警":-1184,"議":-244,"谷":-1000,"賞":730,"車":-1481,"軍":1158,"輪":-1433,"込":-3370,"近":929,"道":-1291,"選":2596,"郎":-4866,"都":1192,"野":-1100,"銀":-2213,"長":357,"間":-2344,"院":-2297,"際":-2604,"電":-878,"領":-1659,"題":-792,"館":-1984,"首":1749,"高":2120,"「":1895,"」":3798,"・":-4371,"ッ":-724,"ー":-11870,"カ":2145,"コ":1789,"セ":1287,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637}; - this.UW5__ = {",":465,".":-299,"1":-514,"E2":-32768,"]":-2762,"、":465,"。":-299,"「":363,"あ":1655,"い":331,"う":-503,"え":1199,"お":527,"か":647,"が":-421,"き":1624,"ぎ":1971,"く":312,"げ":-983,"さ":-1537,"し":-1371,"す":-852,"だ":-1186,"ち":1093,"っ":52,"つ":921,"て":-18,"で":-850,"と":-127,"ど":1682,"な":-787,"に":-1224,"の":-635,"は":-578,"べ":1001,"み":502,"め":865,"ゃ":3350,"ょ":854,"り":-208,"る":429,"れ":504,"わ":419,"を":-1264,"ん":327,"イ":241,"ル":451,"ン":-343,"中":-871,"京":722,"会":-1153,"党":-654,"務":3519,"区":-901,"告":848,"員":2104,"大":-1296,"学":-548,"定":1785,"嵐":-1304,"市":-2991,"席":921,"年":1763,"思":872,"所":-814,"挙":1618,"新":-1682,"日":218,"月":-4353,"査":932,"格":1356,"機":-1508,"氏":-1347,"田":240,"町":-3912,"的":-3149,"相":1319,"省":-1052,"県":-4003,"研":-997,"社":-278,"空":-813,"統":1955,"者":-2233,"表":663,"語":-1073,"議":1219,"選":-1018,"郎":-368,"長":786,"間":1191,"題":2368,"館":-689,"1":-514,"E2":-32768,"「":363,"イ":241,"ル":451,"ン":-343}; - this.UW6__ = {",":227,".":808,"1":-270,"E1":306,"、":227,"。":808,"あ":-307,"う":189,"か":241,"が":-73,"く":-121,"こ":-200,"じ":1782,"す":383,"た":-428,"っ":573,"て":-1014,"で":101,"と":-105,"な":-253,"に":-149,"の":-417,"は":-236,"も":-206,"り":187,"る":-135,"を":195,"ル":-673,"ン":-496,"一":-277,"中":201,"件":-800,"会":624,"前":302,"区":1792,"員":-1212,"委":798,"学":-960,"市":887,"広":-695,"後":535,"業":-697,"相":753,"社":-507,"福":974,"空":-822,"者":1811,"連":463,"郎":1082,"1":-270,"E1":306,"ル":-673,"ン":-496}; - - return this; - } - TinySegmenter.prototype.ctype_ = function(str) { - for (var i in this.chartype_) { - if (str.match(this.chartype_[i][0])) { - return this.chartype_[i][1]; - } - } - return "O"; - } - - TinySegmenter.prototype.ts_ = function(v) { - if (v) { return v; } - return 0; - } - - TinySegmenter.prototype.segment = function(input) { - if (input == null || input == undefined || input == "") { - return []; - } - var result = []; - var seg = ["B3","B2","B1"]; - var ctype = ["O","O","O"]; - var o = input.split(""); - for (i = 0; i < o.length; ++i) { - seg.push(o[i]); - ctype.push(this.ctype_(o[i])) - } - seg.push("E1"); - seg.push("E2"); - seg.push("E3"); - ctype.push("O"); - ctype.push("O"); - ctype.push("O"); - var word = seg[3]; - var p1 = "U"; - var p2 = "U"; - var p3 = "U"; - for (var i = 4; i < seg.length - 3; ++i) { - var score = this.BIAS__; - var w1 = seg[i-3]; - var w2 = seg[i-2]; - var w3 = seg[i-1]; - var w4 = seg[i]; - var w5 = seg[i+1]; - var w6 = seg[i+2]; - var c1 = ctype[i-3]; - var c2 = ctype[i-2]; - var c3 = ctype[i-1]; - var c4 = ctype[i]; - var c5 = ctype[i+1]; - var c6 = ctype[i+2]; - score += this.ts_(this.UP1__[p1]); - score += this.ts_(this.UP2__[p2]); - score += this.ts_(this.UP3__[p3]); - score += this.ts_(this.BP1__[p1 + p2]); - score += this.ts_(this.BP2__[p2 + p3]); - score += this.ts_(this.UW1__[w1]); - score += this.ts_(this.UW2__[w2]); - score += this.ts_(this.UW3__[w3]); - score += this.ts_(this.UW4__[w4]); - score += this.ts_(this.UW5__[w5]); - score += this.ts_(this.UW6__[w6]); - score += this.ts_(this.BW1__[w2 + w3]); - score += this.ts_(this.BW2__[w3 + w4]); - score += this.ts_(this.BW3__[w4 + w5]); - score += this.ts_(this.TW1__[w1 + w2 + w3]); - score += this.ts_(this.TW2__[w2 + w3 + w4]); - score += this.ts_(this.TW3__[w3 + w4 + w5]); - score += this.ts_(this.TW4__[w4 + w5 + w6]); - score += this.ts_(this.UC1__[c1]); - score += this.ts_(this.UC2__[c2]); - score += this.ts_(this.UC3__[c3]); - score += this.ts_(this.UC4__[c4]); - score += this.ts_(this.UC5__[c5]); - score += this.ts_(this.UC6__[c6]); - score += this.ts_(this.BC1__[c2 + c3]); - score += this.ts_(this.BC2__[c3 + c4]); - score += this.ts_(this.BC3__[c4 + c5]); - score += this.ts_(this.TC1__[c1 + c2 + c3]); - score += this.ts_(this.TC2__[c2 + c3 + c4]); - score += this.ts_(this.TC3__[c3 + c4 + c5]); - score += this.ts_(this.TC4__[c4 + c5 + c6]); - // score += this.ts_(this.TC5__[c4 + c5 + c6]); - score += this.ts_(this.UQ1__[p1 + c1]); - score += this.ts_(this.UQ2__[p2 + c2]); - score += this.ts_(this.UQ3__[p3 + c3]); - score += this.ts_(this.BQ1__[p2 + c2 + c3]); - score += this.ts_(this.BQ2__[p2 + c3 + c4]); - score += this.ts_(this.BQ3__[p3 + c2 + c3]); - score += this.ts_(this.BQ4__[p3 + c3 + c4]); - score += this.ts_(this.TQ1__[p2 + c1 + c2 + c3]); - score += this.ts_(this.TQ2__[p2 + c2 + c3 + c4]); - score += this.ts_(this.TQ3__[p3 + c1 + c2 + c3]); - score += this.ts_(this.TQ4__[p3 + c2 + c3 + c4]); - var p = "O"; - if (score > 0) { - result.push(word); - word = ""; - p = "B"; - } - p1 = p2; - p2 = p3; - p3 = p; - word += seg[i]; - } - result.push(word); - - return result; - } - - lunr.TinySegmenter = TinySegmenter; - }; - -})); \ No newline at end of file diff --git a/site/assets/javascripts/lunr/wordcut.js b/site/assets/javascripts/lunr/wordcut.js deleted file mode 100644 index 0d898c9..0000000 --- a/site/assets/javascripts/lunr/wordcut.js +++ /dev/null @@ -1,6708 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.lunr || (g.lunr = {})).wordcut = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1; - }) - this.addWords(words, false) - } - if(finalize){ - this.finalizeDict(); - } - }, - - dictSeek: function (l, r, ch, strOffset, pos) { - var ans = null; - while (l <= r) { - var m = Math.floor((l + r) / 2), - dict_item = this.dict[m], - len = dict_item.length; - if (len <= strOffset) { - l = m + 1; - } else { - var ch_ = dict_item[strOffset]; - if (ch_ < ch) { - l = m + 1; - } else if (ch_ > ch) { - r = m - 1; - } else { - ans = m; - if (pos == LEFT) { - r = m - 1; - } else { - l = m + 1; - } - } - } - } - return ans; - }, - - isFinal: function (acceptor) { - return this.dict[acceptor.l].length == acceptor.strOffset; - }, - - createAcceptor: function () { - return { - l: 0, - r: this.dict.length - 1, - strOffset: 0, - isFinal: false, - dict: this, - transit: function (ch) { - return this.dict.transit(this, ch); - }, - isError: false, - tag: "DICT", - w: 1, - type: "DICT" - }; - }, - - transit: function (acceptor, ch) { - var l = this.dictSeek(acceptor.l, - acceptor.r, - ch, - acceptor.strOffset, - LEFT); - if (l !== null) { - var r = this.dictSeek(l, - acceptor.r, - ch, - acceptor.strOffset, - RIGHT); - acceptor.l = l; - acceptor.r = r; - acceptor.strOffset++; - acceptor.isFinal = this.isFinal(acceptor); - } else { - acceptor.isError = true; - } - return acceptor; - }, - - sortuniq: function(a){ - return a.sort().filter(function(item, pos, arr){ - return !pos || item != arr[pos - 1]; - }) - }, - - flatten: function(a){ - //[[1,2],[3]] -> [1,2,3] - return [].concat.apply([], a); - } -}; -module.exports = WordcutDict; - -}).call(this,"/dist/tmp") -},{"glob":16,"path":22}],3:[function(require,module,exports){ -var WordRule = { - createAcceptor: function(tag) { - if (tag["WORD_RULE"]) - return null; - - return {strOffset: 0, - isFinal: false, - transit: function(ch) { - var lch = ch.toLowerCase(); - if (lch >= "a" && lch <= "z") { - this.isFinal = true; - this.strOffset++; - } else { - this.isError = true; - } - return this; - }, - isError: false, - tag: "WORD_RULE", - type: "WORD_RULE", - w: 1}; - } -}; - -var NumberRule = { - createAcceptor: function(tag) { - if (tag["NUMBER_RULE"]) - return null; - - return {strOffset: 0, - isFinal: false, - transit: function(ch) { - if (ch >= "0" && ch <= "9") { - this.isFinal = true; - this.strOffset++; - } else { - this.isError = true; - } - return this; - }, - isError: false, - tag: "NUMBER_RULE", - type: "NUMBER_RULE", - w: 1}; - } -}; - -var SpaceRule = { - tag: "SPACE_RULE", - createAcceptor: function(tag) { - - if (tag["SPACE_RULE"]) - return null; - - return {strOffset: 0, - isFinal: false, - transit: function(ch) { - if (ch == " " || ch == "\t" || ch == "\r" || ch == "\n" || - ch == "\u00A0" || ch=="\u2003"//nbsp and emsp - ) { - this.isFinal = true; - this.strOffset++; - } else { - this.isError = true; - } - return this; - }, - isError: false, - tag: SpaceRule.tag, - w: 1, - type: "SPACE_RULE"}; - } -} - -var SingleSymbolRule = { - tag: "SINSYM", - createAcceptor: function(tag) { - return {strOffset: 0, - isFinal: false, - transit: function(ch) { - if (this.strOffset == 0 && ch.match(/^[\@\(\)\/\,\-\."`]$/)) { - this.isFinal = true; - this.strOffset++; - } else { - this.isError = true; - } - return this; - }, - isError: false, - tag: "SINSYM", - w: 1, - type: "SINSYM"}; - } -} - - -var LatinRules = [WordRule, SpaceRule, SingleSymbolRule, NumberRule]; - -module.exports = LatinRules; - -},{}],4:[function(require,module,exports){ -var _ = require("underscore") - , WordcutCore = require("./wordcut_core"); -var PathInfoBuilder = { - - /* - buildByPartAcceptors: function(path, acceptors, i) { - var - var genInfos = partAcceptors.reduce(function(genInfos, acceptor) { - - }, []); - - return genInfos; - } - */ - - buildByAcceptors: function(path, finalAcceptors, i) { - var self = this; - var infos = finalAcceptors.map(function(acceptor) { - var p = i - acceptor.strOffset + 1 - , _info = path[p]; - - var info = {p: p, - mw: _info.mw + (acceptor.mw === undefined ? 0 : acceptor.mw), - w: acceptor.w + _info.w, - unk: (acceptor.unk ? acceptor.unk : 0) + _info.unk, - type: acceptor.type}; - - if (acceptor.type == "PART") { - for(var j = p + 1; j <= i; j++) { - path[j].merge = p; - } - info.merge = p; - } - - return info; - }); - return infos.filter(function(info) { return info; }); - }, - - fallback: function(path, leftBoundary, text, i) { - var _info = path[leftBoundary]; - if (text[i].match(/[\u0E48-\u0E4E]/)) { - if (leftBoundary != 0) - leftBoundary = path[leftBoundary].p; - return {p: leftBoundary, - mw: 0, - w: 1 + _info.w, - unk: 1 + _info.unk, - type: "UNK"}; -/* } else if(leftBoundary > 0 && path[leftBoundary].type !== "UNK") { - leftBoundary = path[leftBoundary].p; - return {p: leftBoundary, - w: 1 + _info.w, - unk: 1 + _info.unk, - type: "UNK"}; */ - } else { - return {p: leftBoundary, - mw: _info.mw, - w: 1 + _info.w, - unk: 1 + _info.unk, - type: "UNK"}; - } - }, - - build: function(path, finalAcceptors, i, leftBoundary, text) { - var basicPathInfos = this.buildByAcceptors(path, finalAcceptors, i); - if (basicPathInfos.length > 0) { - return basicPathInfos; - } else { - return [this.fallback(path, leftBoundary, text, i)]; - } - } -}; - -module.exports = function() { - return _.clone(PathInfoBuilder); -} - -},{"./wordcut_core":8,"underscore":25}],5:[function(require,module,exports){ -var _ = require("underscore"); - - -var PathSelector = { - selectPath: function(paths) { - var path = paths.reduce(function(selectedPath, path) { - if (selectedPath == null) { - return path; - } else { - if (path.unk < selectedPath.unk) - return path; - if (path.unk == selectedPath.unk) { - if (path.mw < selectedPath.mw) - return path - if (path.mw == selectedPath.mw) { - if (path.w < selectedPath.w) - return path; - } - } - return selectedPath; - } - }, null); - return path; - }, - - createPath: function() { - return [{p:null, w:0, unk:0, type: "INIT", mw:0}]; - } -}; - -module.exports = function() { - return _.clone(PathSelector); -}; - -},{"underscore":25}],6:[function(require,module,exports){ -function isMatch(pat, offset, ch) { - if (pat.length <= offset) - return false; - var _ch = pat[offset]; - return _ch == ch || - (_ch.match(/[กข]/) && ch.match(/[ก-ฮ]/)) || - (_ch.match(/[มบ]/) && ch.match(/[ก-ฮ]/)) || - (_ch.match(/\u0E49/) && ch.match(/[\u0E48-\u0E4B]/)); -} - -var Rule0 = { - pat: "เหก็ม", - createAcceptor: function(tag) { - return {strOffset: 0, - isFinal: false, - transit: function(ch) { - if (isMatch(Rule0.pat, this.strOffset,ch)) { - this.isFinal = (this.strOffset + 1 == Rule0.pat.length); - this.strOffset++; - } else { - this.isError = true; - } - return this; - }, - isError: false, - tag: "THAI_RULE", - type: "THAI_RULE", - w: 1}; - } -}; - -var PartRule = { - createAcceptor: function(tag) { - return {strOffset: 0, - patterns: [ - "แก", "เก", "ก้", "กก์", "กา", "กี", "กิ", "กืก" - ], - isFinal: false, - transit: function(ch) { - var offset = this.strOffset; - this.patterns = this.patterns.filter(function(pat) { - return isMatch(pat, offset, ch); - }); - - if (this.patterns.length > 0) { - var len = 1 + offset; - this.isFinal = this.patterns.some(function(pat) { - return pat.length == len; - }); - this.strOffset++; - } else { - this.isError = true; - } - return this; - }, - isError: false, - tag: "PART", - type: "PART", - unk: 1, - w: 1}; - } -}; - -var ThaiRules = [Rule0, PartRule]; - -module.exports = ThaiRules; - -},{}],7:[function(require,module,exports){ -var sys = require("sys") - , WordcutDict = require("./dict") - , WordcutCore = require("./wordcut_core") - , PathInfoBuilder = require("./path_info_builder") - , PathSelector = require("./path_selector") - , Acceptors = require("./acceptors") - , latinRules = require("./latin_rules") - , thaiRules = require("./thai_rules") - , _ = require("underscore"); - - -var Wordcut = Object.create(WordcutCore); -Wordcut.defaultPathInfoBuilder = PathInfoBuilder; -Wordcut.defaultPathSelector = PathSelector; -Wordcut.defaultAcceptors = Acceptors; -Wordcut.defaultLatinRules = latinRules; -Wordcut.defaultThaiRules = thaiRules; -Wordcut.defaultDict = WordcutDict; - - -Wordcut.initNoDict = function(dict_path) { - var self = this; - self.pathInfoBuilder = new self.defaultPathInfoBuilder; - self.pathSelector = new self.defaultPathSelector; - self.acceptors = new self.defaultAcceptors; - self.defaultLatinRules.forEach(function(rule) { - self.acceptors.creators.push(rule); - }); - self.defaultThaiRules.forEach(function(rule) { - self.acceptors.creators.push(rule); - }); -}; - -Wordcut.init = function(dict_path, withDefault, additionalWords) { - withDefault = withDefault || false; - this.initNoDict(); - var dict = _.clone(this.defaultDict); - dict.init(dict_path, withDefault, additionalWords); - this.acceptors.creators.push(dict); -}; - -module.exports = Wordcut; - -},{"./acceptors":1,"./dict":2,"./latin_rules":3,"./path_info_builder":4,"./path_selector":5,"./thai_rules":6,"./wordcut_core":8,"sys":28,"underscore":25}],8:[function(require,module,exports){ -var WordcutCore = { - - buildPath: function(text) { - var self = this - , path = self.pathSelector.createPath() - , leftBoundary = 0; - self.acceptors.reset(); - for (var i = 0; i < text.length; i++) { - var ch = text[i]; - self.acceptors.transit(ch); - - var possiblePathInfos = self - .pathInfoBuilder - .build(path, - self.acceptors.getFinalAcceptors(), - i, - leftBoundary, - text); - var selectedPath = self.pathSelector.selectPath(possiblePathInfos) - - path.push(selectedPath); - if (selectedPath.type !== "UNK") { - leftBoundary = i; - } - } - return path; - }, - - pathToRanges: function(path) { - var e = path.length - 1 - , ranges = []; - - while (e > 0) { - var info = path[e] - , s = info.p; - - if (info.merge !== undefined && ranges.length > 0) { - var r = ranges[ranges.length - 1]; - r.s = info.merge; - s = r.s; - } else { - ranges.push({s:s, e:e}); - } - e = s; - } - return ranges.reverse(); - }, - - rangesToText: function(text, ranges, delimiter) { - return ranges.map(function(r) { - return text.substring(r.s, r.e); - }).join(delimiter); - }, - - cut: function(text, delimiter) { - var path = this.buildPath(text) - , ranges = this.pathToRanges(path); - return this - .rangesToText(text, ranges, - (delimiter === undefined ? "|" : delimiter)); - }, - - cutIntoRanges: function(text, noText) { - var path = this.buildPath(text) - , ranges = this.pathToRanges(path); - - if (!noText) { - ranges.forEach(function(r) { - r.text = text.substring(r.s, r.e); - }); - } - return ranges; - }, - - cutIntoArray: function(text) { - var path = this.buildPath(text) - , ranges = this.pathToRanges(path); - - return ranges.map(function(r) { - return text.substring(r.s, r.e) - }); - } -}; - -module.exports = WordcutCore; - -},{}],9:[function(require,module,exports){ -// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 -// -// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! -// -// Originally from narwhal.js (http://narwhaljs.org) -// Copyright (c) 2009 Thomas Robinson <280north.com> -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the 'Software'), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -// when used in node, this will actually load the util module we depend on -// versus loading the builtin util module as happens otherwise -// this is a bug in node module loading as far as I am concerned -var util = require('util/'); - -var pSlice = Array.prototype.slice; -var hasOwn = Object.prototype.hasOwnProperty; - -// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. - -var assert = module.exports = ok; - -// 2. The AssertionError is defined in assert. -// new assert.AssertionError({ message: message, -// actual: actual, -// expected: expected }) - -assert.AssertionError = function AssertionError(options) { - this.name = 'AssertionError'; - this.actual = options.actual; - this.expected = options.expected; - this.operator = options.operator; - if (options.message) { - this.message = options.message; - this.generatedMessage = false; - } else { - this.message = getMessage(this); - this.generatedMessage = true; - } - var stackStartFunction = options.stackStartFunction || fail; - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, stackStartFunction); - } - else { - // non v8 browsers so we can have a stacktrace - var err = new Error(); - if (err.stack) { - var out = err.stack; - - // try to strip useless frames - var fn_name = stackStartFunction.name; - var idx = out.indexOf('\n' + fn_name); - if (idx >= 0) { - // once we have located the function frame - // we need to strip out everything before it (and its line) - var next_line = out.indexOf('\n', idx + 1); - out = out.substring(next_line + 1); - } - - this.stack = out; - } - } -}; - -// assert.AssertionError instanceof Error -util.inherits(assert.AssertionError, Error); - -function replacer(key, value) { - if (util.isUndefined(value)) { - return '' + value; - } - if (util.isNumber(value) && !isFinite(value)) { - return value.toString(); - } - if (util.isFunction(value) || util.isRegExp(value)) { - return value.toString(); - } - return value; -} - -function truncate(s, n) { - if (util.isString(s)) { - return s.length < n ? s : s.slice(0, n); - } else { - return s; - } -} - -function getMessage(self) { - return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' + - self.operator + ' ' + - truncate(JSON.stringify(self.expected, replacer), 128); -} - -// At present only the three keys mentioned above are used and -// understood by the spec. Implementations or sub modules can pass -// other keys to the AssertionError's constructor - they will be -// ignored. - -// 3. All of the following functions must throw an AssertionError -// when a corresponding condition is not met, with a message that -// may be undefined if not provided. All assertion methods provide -// both the actual and expected values to the assertion error for -// display purposes. - -function fail(actual, expected, message, operator, stackStartFunction) { - throw new assert.AssertionError({ - message: message, - actual: actual, - expected: expected, - operator: operator, - stackStartFunction: stackStartFunction - }); -} - -// EXTENSION! allows for well behaved errors defined elsewhere. -assert.fail = fail; - -// 4. Pure assertion tests whether a value is truthy, as determined -// by !!guard. -// assert.ok(guard, message_opt); -// This statement is equivalent to assert.equal(true, !!guard, -// message_opt);. To test strictly for the value true, use -// assert.strictEqual(true, guard, message_opt);. - -function ok(value, message) { - if (!value) fail(value, true, message, '==', assert.ok); -} -assert.ok = ok; - -// 5. The equality assertion tests shallow, coercive equality with -// ==. -// assert.equal(actual, expected, message_opt); - -assert.equal = function equal(actual, expected, message) { - if (actual != expected) fail(actual, expected, message, '==', assert.equal); -}; - -// 6. The non-equality assertion tests for whether two objects are not equal -// with != assert.notEqual(actual, expected, message_opt); - -assert.notEqual = function notEqual(actual, expected, message) { - if (actual == expected) { - fail(actual, expected, message, '!=', assert.notEqual); - } -}; - -// 7. The equivalence assertion tests a deep equality relation. -// assert.deepEqual(actual, expected, message_opt); - -assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected)) { - fail(actual, expected, message, 'deepEqual', assert.deepEqual); - } -}; - -function _deepEqual(actual, expected) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (util.isBuffer(actual) && util.isBuffer(expected)) { - if (actual.length != expected.length) return false; - - for (var i = 0; i < actual.length; i++) { - if (actual[i] !== expected[i]) return false; - } - - return true; - - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (util.isDate(actual) && util.isDate(expected)) { - return actual.getTime() === expected.getTime(); - - // 7.3 If the expected value is a RegExp object, the actual value is - // equivalent if it is also a RegExp object with the same source and - // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). - } else if (util.isRegExp(actual) && util.isRegExp(expected)) { - return actual.source === expected.source && - actual.global === expected.global && - actual.multiline === expected.multiline && - actual.lastIndex === expected.lastIndex && - actual.ignoreCase === expected.ignoreCase; - - // 7.4. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (!util.isObject(actual) && !util.isObject(expected)) { - return actual == expected; - - // 7.5 For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } -} - -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function objEquiv(a, b) { - if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - // if one is a primitive, the other must be same - if (util.isPrimitive(a) || util.isPrimitive(b)) { - return a === b; - } - var aIsArgs = isArguments(a), - bIsArgs = isArguments(b); - if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) - return false; - if (aIsArgs) { - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b); - } - var ka = objectKeys(a), - kb = objectKeys(b), - key, i; - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key])) return false; - } - return true; -} - -// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); - -assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected)) { - fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); - } -}; - -// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); - -assert.strictEqual = function strictEqual(actual, expected, message) { - if (actual !== expected) { - fail(actual, expected, message, '===', assert.strictEqual); - } -}; - -// 10. The strict non-equality assertion tests for strict inequality, as -// determined by !==. assert.notStrictEqual(actual, expected, message_opt); - -assert.notStrictEqual = function notStrictEqual(actual, expected, message) { - if (actual === expected) { - fail(actual, expected, message, '!==', assert.notStrictEqual); - } -}; - -function expectedException(actual, expected) { - if (!actual || !expected) { - return false; - } - - if (Object.prototype.toString.call(expected) == '[object RegExp]') { - return expected.test(actual); - } else if (actual instanceof expected) { - return true; - } else if (expected.call({}, actual) === true) { - return true; - } - - return false; -} - -function _throws(shouldThrow, block, expected, message) { - var actual; - - if (util.isString(expected)) { - message = expected; - expected = null; - } - - try { - block(); - } catch (e) { - actual = e; - } - - message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + - (message ? ' ' + message : '.'); - - if (shouldThrow && !actual) { - fail(actual, expected, 'Missing expected exception' + message); - } - - if (!shouldThrow && expectedException(actual, expected)) { - fail(actual, expected, 'Got unwanted exception' + message); - } - - if ((shouldThrow && actual && expected && - !expectedException(actual, expected)) || (!shouldThrow && actual)) { - throw actual; - } -} - -// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); - -assert.throws = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [true].concat(pSlice.call(arguments))); -}; - -// EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/message) { - _throws.apply(this, [false].concat(pSlice.call(arguments))); -}; - -assert.ifError = function(err) { if (err) {throw err;}}; - -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - if (hasOwn.call(obj, key)) keys.push(key); - } - return keys; -}; - -},{"util/":28}],10:[function(require,module,exports){ -'use strict'; -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} - -},{}],11:[function(require,module,exports){ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - - -},{"balanced-match":10,"concat-map":13}],12:[function(require,module,exports){ - -},{}],13:[function(require,module,exports){ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - -},{}],14:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -function EventEmitter() { - this._events = this._events || {}; - this._maxListeners = this._maxListeners || undefined; -} -module.exports = EventEmitter; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -EventEmitter.defaultMaxListeners = 10; - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function(n) { - if (!isNumber(n) || n < 0 || isNaN(n)) - throw TypeError('n must be a positive number'); - this._maxListeners = n; - return this; -}; - -EventEmitter.prototype.emit = function(type) { - var er, handler, len, args, i, listeners; - - if (!this._events) - this._events = {}; - - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events.error || - (isObject(this._events.error) && !this._events.error.length)) { - er = arguments[1]; - if (er instanceof Error) { - throw er; // Unhandled 'error' event - } - throw TypeError('Uncaught, unspecified "error" event.'); - } - } - - handler = this._events[type]; - - if (isUndefined(handler)) - return false; - - if (isFunction(handler)) { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - len = arguments.length; - args = new Array(len - 1); - for (i = 1; i < len; i++) - args[i - 1] = arguments[i]; - handler.apply(this, args); - } - } else if (isObject(handler)) { - len = arguments.length; - args = new Array(len - 1); - for (i = 1; i < len; i++) - args[i - 1] = arguments[i]; - - listeners = handler.slice(); - len = listeners.length; - for (i = 0; i < len; i++) - listeners[i].apply(this, args); - } - - return true; -}; - -EventEmitter.prototype.addListener = function(type, listener) { - var m; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events) - this._events = {}; - - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (this._events.newListener) - this.emit('newListener', type, - isFunction(listener.listener) ? - listener.listener : listener); - - if (!this._events[type]) - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - else if (isObject(this._events[type])) - // If we've already got an array, just append. - this._events[type].push(listener); - else - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - - // Check for listener leak - if (isObject(this._events[type]) && !this._events[type].warned) { - var m; - if (!isUndefined(this._maxListeners)) { - m = this._maxListeners; - } else { - m = EventEmitter.defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - if (typeof console.trace === 'function') { - // not supported in IE 10 - console.trace(); - } - } - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - var fired = false; - - function g() { - this.removeListener(type, g); - - if (!fired) { - fired = true; - listener.apply(this, arguments); - } - } - - g.listener = listener; - this.on(type, g); - - return this; -}; - -// emits a 'removeListener' event iff the listener was removed -EventEmitter.prototype.removeListener = function(type, listener) { - var list, position, length, i; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events || !this._events[type]) - return this; - - list = this._events[type]; - length = list.length; - position = -1; - - if (list === listener || - (isFunction(list.listener) && list.listener === listener)) { - delete this._events[type]; - if (this._events.removeListener) - this.emit('removeListener', type, listener); - - } else if (isObject(list)) { - for (i = length; i-- > 0;) { - if (list[i] === listener || - (list[i].listener && list[i].listener === listener)) { - position = i; - break; - } - } - - if (position < 0) - return this; - - if (list.length === 1) { - list.length = 0; - delete this._events[type]; - } else { - list.splice(position, 1); - } - - if (this._events.removeListener) - this.emit('removeListener', type, listener); - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - var key, listeners; - - if (!this._events) - return this; - - // not listening for removeListener, no need to emit - if (!this._events.removeListener) { - if (arguments.length === 0) - this._events = {}; - else if (this._events[type]) - delete this._events[type]; - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - for (key in this._events) { - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = {}; - return this; - } - - listeners = this._events[type]; - - if (isFunction(listeners)) { - this.removeListener(type, listeners); - } else { - // LIFO order - while (listeners.length) - this.removeListener(type, listeners[listeners.length - 1]); - } - delete this._events[type]; - - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - var ret; - if (!this._events || !this._events[type]) - ret = []; - else if (isFunction(this._events[type])) - ret = [this._events[type]]; - else - ret = this._events[type].slice(); - return ret; -}; - -EventEmitter.listenerCount = function(emitter, type) { - var ret; - if (!emitter._events || !emitter._events[type]) - ret = 0; - else if (isFunction(emitter._events[type])) - ret = 1; - else - ret = emitter._events[type].length; - return ret; -}; - -function isFunction(arg) { - return typeof arg === 'function'; -} - -function isNumber(arg) { - return typeof arg === 'number'; -} - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} - -function isUndefined(arg) { - return arg === void 0; -} - -},{}],15:[function(require,module,exports){ -(function (process){ -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var path = require("path") -var minimatch = require("minimatch") -var isAbsolute = require("path-is-absolute") -var Minimatch = minimatch.Minimatch - -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} - -function alphasort (a, b) { - return a.localeCompare(b) -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern) - } - - return { - matcher: new Minimatch(pattern), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = options.cwd - self.changedCwd = path.resolve(options.cwd) !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - self.nomount = !!options.nomount - - // disable comments and negation unless the user explicitly - // passes in false as the option. - options.nonegate = options.nonegate === false ? false : true - options.nocomment = options.nocomment === false ? false : true - deprecationWarning(options) - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -// TODO(isaacs): remove entirely in v6 -// exported to reset in tests -exports.deprecationWarned -function deprecationWarning(options) { - if (!options.nonegate || !options.nocomment) { - if (process.noDeprecation !== true && !exports.deprecationWarned) { - var msg = 'glob WARNING: comments and negation will be disabled in v6' - if (process.throwDeprecation) - throw new Error(msg) - else if (process.traceDeprecation) - console.trace(msg) - else - console.error(msg) - - exports.deprecationWarned = true - } - } -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - return !(/\/$/.test(e)) - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -}).call(this,require('_process')) -},{"_process":24,"minimatch":20,"path":22,"path-is-absolute":23}],16:[function(require,module,exports){ -(function (process){ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var globSync = require('./sync.js') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -glob.hasMagic = function (pattern, options_) { - var options = util._extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - var n = this.minimatch.set.length - this._processing = 0 - this.matches = new Array(n) - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - - function done () { - --self._processing - if (self._processing <= 0) - self._finish() - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - fs.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (this.matches[index][e]) - return - - if (isIgnored(this, e)) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = this._makeAbs(e) - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - if (this.mark) - e = this._mark(e) - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er) - return cb() - - var isSym = lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } - - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && !stat.isDirectory()) - return cb(null, false, stat) - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c !== 'DIR') - return cb() - - return cb(null, c, stat) -} - -}).call(this,require('_process')) -},{"./common.js":15,"./sync.js":17,"_process":24,"assert":9,"events":14,"fs":12,"inflight":18,"inherits":19,"minimatch":20,"once":21,"path":22,"path-is-absolute":23,"util":28}],17:[function(require,module,exports){ -(function (process){ -module.exports = globSync -globSync.GlobSync = GlobSync - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var Glob = require('./glob.js').Glob -var util = require('util') -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = fs.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this.matches[index][e] = true - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - var abs = this._makeAbs(e) - if (this.mark) - e = this._mark(e) - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[this._makeAbs(e)] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - // lstat failed, doesn't exist - return null - } - - var isSym = lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this.matches[index][prefix] = true -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - return false - } - - if (lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c !== 'DIR') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -}).call(this,require('_process')) -},{"./common.js":15,"./glob.js":16,"_process":24,"assert":9,"fs":12,"minimatch":20,"path":22,"path-is-absolute":23,"util":28}],18:[function(require,module,exports){ -(function (process){ -var wrappy = require('wrappy') -var reqs = Object.create(null) -var once = require('once') - -module.exports = wrappy(inflight) - -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) - } -} - -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) - - // XXX It's somewhat ambiguous whether a new callback added in this - // pass should be queued for later execution if something in the - // list of callbacks throws, or if it should just be discarded. - // However, it's such an edge case that it hardly matters, and either - // choice is likely as surprising as the other. - // As it happens, we do go ahead and schedule it for later execution. - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - } finally { - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] - } - } - }) -} - -function slice (args) { - var length = args.length - var array = [] - - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} - -}).call(this,require('_process')) -},{"_process":24,"once":21,"wrappy":29}],19:[function(require,module,exports){ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } -} - -},{}],20:[function(require,module,exports){ -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = require('path') -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') - -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new TypeError('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - if (pattern.length > 1024 * 64) { - throw new TypeError('pattern is too long') - } - - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} - -},{"brace-expansion":11,"path":22}],21:[function(require,module,exports){ -var wrappy = require('wrappy') -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) - - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} - -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} - -},{"wrappy":29}],22:[function(require,module,exports){ -(function (process){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// resolves . and .. elements in a path array with directory names there -// must be no slashes, empty elements, or device names (c:\) in the array -// (so also no leading and trailing slashes - it does not distinguish -// relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var splitPath = function(filename) { - return splitPathRe.exec(filename).slice(1); -}; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = substr(path, -1) === '/'; - - // Normalize the path - path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - -// posix version -exports.isAbsolute = function(path) { - return path.charAt(0) === '/'; -}; - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - if (typeof p !== 'string') { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - }).join('/')); -}; - - -// path.relative(from, to) -// posix version -exports.relative = function(from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); -}; - -exports.sep = '/'; -exports.delimiter = ':'; - -exports.dirname = function(path) { - var result = splitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -exports.basename = function(path, ext) { - var f = splitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPath(path)[3]; -}; - -function filter (xs, f) { - if (xs.filter) return xs.filter(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// String.prototype.substr - negative index don't work in IE8 -var substr = 'ab'.substr(-1) === 'b' - ? function (str, start, len) { return str.substr(start, len) } - : function (str, start, len) { - if (start < 0) start = str.length + start; - return str.substr(start, len); - } -; - -}).call(this,require('_process')) -},{"_process":24}],23:[function(require,module,exports){ -(function (process){ -'use strict'; - -function posix(path) { - return path.charAt(0) === '/'; -} - -function win32(path) { - // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path); - var device = result[1] || ''; - var isUnc = Boolean(device && device.charAt(1) !== ':'); - - // UNC paths are always absolute - return Boolean(result[2] || isUnc); -} - -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; - -}).call(this,require('_process')) -},{"_process":24}],24:[function(require,module,exports){ -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}],25:[function(require,module,exports){ -// Underscore.js 1.8.3 -// http://underscorejs.org -// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `exports` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var - push = ArrayProto.push, - slice = ArrayProto.slice, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind, - nativeCreate = Object.create; - - // Naked function reference for surrogate-prototype-swapping. - var Ctor = function(){}; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.8.3'; - - // Internal function that returns an efficient (for current engines) version - // of the passed-in callback, to be repeatedly applied in other Underscore - // functions. - var optimizeCb = function(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - case 2: return function(value, other) { - return func.call(context, value, other); - }; - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; - }; - - // A mostly-internal function to generate callbacks that can be applied - // to each element in a collection, returning the desired result — either - // identity, an arbitrary callback, a property matcher, or a property accessor. - var cb = function(value, context, argCount) { - if (value == null) return _.identity; - if (_.isFunction(value)) return optimizeCb(value, context, argCount); - if (_.isObject(value)) return _.matcher(value); - return _.property(value); - }; - _.iteratee = function(value, context) { - return cb(value, context, Infinity); - }; - - // An internal function for creating assigner functions. - var createAssigner = function(keysFunc, undefinedOnly) { - return function(obj) { - var length = arguments.length; - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - keys = keysFunc(source), - l = keys.length; - for (var i = 0; i < l; i++) { - var key = keys[i]; - if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key]; - } - } - return obj; - }; - }; - - // An internal function for creating a new object that inherits from another. - var baseCreate = function(prototype) { - if (!_.isObject(prototype)) return {}; - if (nativeCreate) return nativeCreate(prototype); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; - }; - - var property = function(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; - }; - }; - - // Helper for collection methods to determine whether a collection - // should be iterated as an array or as an object - // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength - // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 - var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; - var getLength = property('length'); - var isArrayLike = function(collection) { - var length = getLength(collection); - return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX; - }; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles raw objects in addition to array-likes. Treats all - // sparse array-likes as if they were dense. - _.each = _.forEach = function(obj, iteratee, context) { - iteratee = optimizeCb(iteratee, context); - var i, length; - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var keys = _.keys(obj); - for (i = 0, length = keys.length; i < length; i++) { - iteratee(obj[keys[i]], keys[i], obj); - } - } - return obj; - }; - - // Return the results of applying the iteratee to each element. - _.map = _.collect = function(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = keys ? keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - }; - - // Create a reducing function iterating left or right. - function createReduce(dir) { - // Optimized iterator function as using arguments.length - // in the main function will deoptimize the, see #1991. - function iterator(obj, iteratee, memo, keys, index, length) { - for (; index >= 0 && index < length; index += dir) { - var currentKey = keys ? keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - } - - return function(obj, iteratee, memo, context) { - iteratee = optimizeCb(iteratee, context, 4); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length, - index = dir > 0 ? 0 : length - 1; - // Determine the initial value if none is provided. - if (arguments.length < 3) { - memo = obj[keys ? keys[index] : index]; - index += dir; - } - return iterator(obj, iteratee, memo, keys, index, length); - }; - } - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. - _.reduce = _.foldl = _.inject = createReduce(1); - - // The right-associative version of reduce, also known as `foldr`. - _.reduceRight = _.foldr = createReduce(-1); - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, predicate, context) { - var key; - if (isArrayLike(obj)) { - key = _.findIndex(obj, predicate, context); - } else { - key = _.findKey(obj, predicate, context); - } - if (key !== void 0 && key !== -1) return obj[key]; - }; - - // Return all the elements that pass a truth test. - // Aliased as `select`. - _.filter = _.select = function(obj, predicate, context) { - var results = []; - predicate = cb(predicate, context); - _.each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, predicate, context) { - return _.filter(obj, _.negate(cb(predicate)), context); - }; - - // Determine whether all of the elements match a truth test. - // Aliased as `all`. - _.every = _.all = function(obj, predicate, context) { - predicate = cb(predicate, context); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = keys ? keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; - }; - - // Determine if at least one element in the object matches a truth test. - // Aliased as `any`. - _.some = _.any = function(obj, predicate, context) { - predicate = cb(predicate, context); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = keys ? keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; - }; - - // Determine if the array or object contains a given item (using `===`). - // Aliased as `includes` and `include`. - _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) { - if (!isArrayLike(obj)) obj = _.values(obj); - if (typeof fromIndex != 'number' || guard) fromIndex = 0; - return _.indexOf(obj, item, fromIndex) >= 0; - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - var func = isFunc ? method : value[method]; - return func == null ? func : func.apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, _.property(key)); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs) { - return _.filter(obj, _.matcher(attrs)); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.find(obj, _.matcher(attrs)); - }; - - // Return the maximum element (or element-based computation). - _.max = function(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null && obj != null) { - obj = isArrayLike(obj) ? obj : _.values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value > result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - _.each(obj, function(value, index, list) { - computed = iteratee(value, index, list); - if (computed > lastComputed || computed === -Infinity && result === -Infinity) { - result = value; - lastComputed = computed; - } - }); - } - return result; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null && obj != null) { - obj = isArrayLike(obj) ? obj : _.values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value < result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - _.each(obj, function(value, index, list) { - computed = iteratee(value, index, list); - if (computed < lastComputed || computed === Infinity && result === Infinity) { - result = value; - lastComputed = computed; - } - }); - } - return result; - }; - - // Shuffle a collection, using the modern version of the - // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - _.shuffle = function(obj) { - var set = isArrayLike(obj) ? obj : _.values(obj); - var length = set.length; - var shuffled = Array(length); - for (var index = 0, rand; index < length; index++) { - rand = _.random(0, index); - if (rand !== index) shuffled[index] = shuffled[rand]; - shuffled[rand] = set[index]; - } - return shuffled; - }; - - // Sample **n** random values from a collection. - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `map`. - _.sample = function(obj, n, guard) { - if (n == null || guard) { - if (!isArrayLike(obj)) obj = _.values(obj); - return obj[_.random(obj.length - 1)]; - } - return _.shuffle(obj).slice(0, Math.max(0, n)); - }; - - // Sort the object's values by a criterion produced by an iteratee. - _.sortBy = function(obj, iteratee, context) { - iteratee = cb(iteratee, context); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value: value, - index: index, - criteria: iteratee(value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(behavior) { - return function(obj, iteratee, context) { - var result = {}; - iteratee = cb(iteratee, context); - _.each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = group(function(result, value, key) { - if (_.has(result, key)) result[key].push(value); else result[key] = [value]; - }); - - // Indexes the object's values by a criterion, similar to `groupBy`, but for - // when you know that your index values will be unique. - _.indexBy = group(function(result, value, key) { - result[key] = value; - }); - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = group(function(result, value, key) { - if (_.has(result, key)) result[key]++; else result[key] = 1; - }); - - // Safely create a real, live array from anything iterable. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (isArrayLike(obj)) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return isArrayLike(obj) ? obj.length : _.keys(obj).length; - }; - - // Split a collection into two arrays: one whose elements all satisfy the given - // predicate, and one whose elements all do not satisfy the predicate. - _.partition = function(obj, predicate, context) { - predicate = cb(predicate, context); - var pass = [], fail = []; - _.each(obj, function(value, key, obj) { - (predicate(value, key, obj) ? pass : fail).push(value); - }); - return [pass, fail]; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - if (n == null || guard) return array[0]; - return _.initial(array, array.length - n); - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. - _.initial = function(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if (n == null || guard) return array[array.length - 1]; - return _.rest(array, Math.max(0, array.length - n)); - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, strict, startIndex) { - var output = [], idx = 0; - for (var i = startIndex || 0, length = getLength(input); i < length; i++) { - var value = input[i]; - if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) { - //flatten current level of array or arguments object - if (!shallow) value = flatten(value, shallow, strict); - var j = 0, len = value.length; - output.length += len; - while (j < len) { - output[idx++] = value[j++]; - } - } else if (!strict) { - output[idx++] = value; - } - } - return output; - }; - - // Flatten out an array, either recursively (by default), or just one level. - _.flatten = function(array, shallow) { - return flatten(array, shallow, false); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iteratee, context) { - if (!_.isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = getLength(array); i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!_.contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!_.contains(result, value)) { - result.push(value); - } - } - return result; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(flatten(arguments, true, true)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = getLength(array); i < length; i++) { - var item = array[i]; - if (_.contains(result, item)) continue; - for (var j = 1; j < argsLength; j++) { - if (!_.contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = flatten(arguments, true, true, 1); - return _.filter(array, function(value){ - return !_.contains(rest, value); - }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - return _.unzip(arguments); - }; - - // Complement of _.zip. Unzip accepts an array of arrays and groups - // each array's elements on shared indices - _.unzip = function(array) { - var length = array && _.max(array, getLength).length || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = _.pluck(array, index); - } - return result; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - var result = {}; - for (var i = 0, length = getLength(list); i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // Generator function to create the findIndex and findLastIndex functions - function createPredicateIndexFinder(dir) { - return function(array, predicate, context) { - predicate = cb(predicate, context); - var length = getLength(array); - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; - } - - // Returns the first index on an array-like that passes a predicate test - _.findIndex = createPredicateIndexFinder(1); - _.findLastIndex = createPredicateIndexFinder(-1); - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iteratee, context) { - iteratee = cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = getLength(array); - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; - }; - - // Generator function to create the indexOf and lastIndexOf functions - function createIndexFinder(dir, predicateFind, sortedIndex) { - return function(array, item, idx) { - var i = 0, length = getLength(array); - if (typeof idx == 'number') { - if (dir > 0) { - i = idx >= 0 ? idx : Math.max(idx + length, i); - } else { - length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; - } - } else if (sortedIndex && idx && length) { - idx = sortedIndex(array, item); - return array[idx] === item ? idx : -1; - } - if (item !== item) { - idx = predicateFind(slice.call(array, i, length), _.isNaN); - return idx >= 0 ? idx + i : -1; - } - for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { - if (array[idx] === item) return idx; - } - return -1; - }; - } - - // Return the position of the first occurrence of an item in an array, - // or -1 if the item is not included in the array. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex); - _.lastIndexOf = createIndexFinder(-1, _.findLastIndex); - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (stop == null) { - stop = start || 0; - start = 0; - } - step = step || 1; - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Determines whether to execute a function as a constructor - // or a normal function with the provided arguments - var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (_.isObject(result)) return result; - return self; - }; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); - var args = slice.call(arguments, 2); - var bound = function() { - return executeBound(func, bound, context, this, args.concat(slice.call(arguments))); - }; - return bound; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. _ acts - // as a placeholder, allowing any combination of arguments to be pre-filled. - _.partial = function(func) { - var boundArgs = slice.call(arguments, 1); - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return executeBound(func, bound, this, this, args); - }; - return bound; - }; - - // Bind a number of an object's methods to that object. Remaining arguments - // are the method names to be bound. Useful for ensuring that all callbacks - // defined on an object belong to it. - _.bindAll = function(obj) { - var i, length = arguments.length, key; - if (length <= 1) throw new Error('bindAll must be passed function names'); - for (i = 1; i < length; i++) { - key = arguments[i]; - obj[key] = _.bind(obj[key], obj); - } - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ - return func.apply(null, args); - }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = _.partial(_.delay, _, 1); - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. Normally, the throttled function will run - // as much as it can, without ever going more than once per `wait` duration; - // but if you'd like to disable the execution on the leading edge, pass - // `{leading: false}`. To disable execution on the trailing edge, ditto. - _.throttle = function(func, wait, options) { - var context, args, result; - var timeout = null; - var previous = 0; - if (!options) options = {}; - var later = function() { - previous = options.leading === false ? 0 : _.now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - return function() { - var now = _.now(); - if (!previous && options.leading === false) previous = now; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, args, context, timestamp, result; - - var later = function() { - var last = _.now() - timestamp; - - if (last < wait && last >= 0) { - timeout = setTimeout(later, wait - last); - } else { - timeout = null; - if (!immediate) { - result = func.apply(context, args); - if (!timeout) context = args = null; - } - } - }; - - return function() { - context = this; - args = arguments; - timestamp = _.now(); - var callNow = immediate && !timeout; - if (!timeout) timeout = setTimeout(later, wait); - if (callNow) { - result = func.apply(context, args); - context = args = null; - } - - return result; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return _.partial(wrapper, func); - }; - - // Returns a negated version of the passed-in predicate. - _.negate = function(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; - }; - - // Returns a function that will only be executed on and after the Nth call. - _.after = function(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Returns a function that will only be executed up to (but not including) the Nth call. - _.before = function(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = _.partial(_.before, 2); - - // Object Functions - // ---------------- - - // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. - var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); - var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - - function collectNonEnumProps(obj, keys) { - var nonEnumIdx = nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop); - - while (nonEnumIdx--) { - prop = nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) { - keys.push(prop); - } - } - } - - // Retrieve the names of an object's own properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = function(obj) { - if (!_.isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; - }; - - // Retrieve all the property names of an object. - _.allKeys = function(obj) { - if (!_.isObject(obj)) return []; - var keys = []; - for (var key in obj) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[keys[i]]; - } - return values; - }; - - // Returns the results of applying the iteratee to each element of the object - // In contrast to _.map it returns an object - _.mapObject = function(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var keys = _.keys(obj), - length = keys.length, - results = {}, - currentKey; - for (var index = 0; index < length; index++) { - currentKey = keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [keys[i], obj[keys[i]]]; - } - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - result[obj[keys[i]]] = keys[i]; - } - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = createAssigner(_.allKeys); - - // Assigns a given object with all the own properties in the passed-in object(s) - // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) - _.extendOwn = _.assign = createAssigner(_.keys); - - // Returns the first key on an object that passes a predicate test - _.findKey = function(obj, predicate, context) { - predicate = cb(predicate, context); - var keys = _.keys(obj), key; - for (var i = 0, length = keys.length; i < length; i++) { - key = keys[i]; - if (predicate(obj[key], key, obj)) return key; - } - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(object, oiteratee, context) { - var result = {}, obj = object, iteratee, keys; - if (obj == null) return result; - if (_.isFunction(oiteratee)) { - keys = _.allKeys(obj); - iteratee = optimizeCb(oiteratee, context); - } else { - keys = flatten(arguments, false, false, 1); - iteratee = function(value, key, obj) { return key in obj; }; - obj = Object(obj); - } - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj, iteratee, context) { - if (_.isFunction(iteratee)) { - iteratee = _.negate(iteratee); - } else { - var keys = _.map(flatten(arguments, false, false, 1), String); - iteratee = function(value, key) { - return !_.contains(keys, key); - }; - } - return _.pick(obj, iteratee, context); - }; - - // Fill in a given object with default properties. - _.defaults = createAssigner(_.allKeys, true); - - // Creates an object that inherits from the given prototype object. - // If additional properties are provided then they will be added to the - // created object. - _.create = function(prototype, props) { - var result = baseCreate(prototype); - if (props) _.extendOwn(result, props); - return result; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Returns whether an object has a given set of `key:value` pairs. - _.isMatch = function(object, attrs) { - var keys = _.keys(attrs), length = keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; - }; - - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className !== toString.call(b)) return false; - switch (className) { - // Strings, numbers, regular expressions, dates, and booleans are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - } - - var areArrays = className === '[object Array]'; - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && - _.isFunction(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var keys = _.keys(a), key; - length = keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (_.keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = keys[length]; - if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0; - return _.keys(obj).length === 0; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) === '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - var type = typeof obj; - return type === 'function' || type === 'object' && !!obj; - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. - _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) === '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE < 9), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return _.has(obj, 'callee'); - }; - } - - // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, - // IE 11 (#1621), and in Safari 8 (#1929). - if (typeof /./ != 'function' && typeof Int8Array != 'object') { - _.isFunction = function(obj) { - return typeof obj == 'function' || false; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj !== +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return obj != null && hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iteratees. - _.identity = function(value) { - return value; - }; - - // Predicate-generating functions. Often useful outside of Underscore. - _.constant = function(value) { - return function() { - return value; - }; - }; - - _.noop = function(){}; - - _.property = property; - - // Generates a function for a given object that returns a given property. - _.propertyOf = function(obj) { - return obj == null ? function(){} : function(key) { - return obj[key]; - }; - }; - - // Returns a predicate for checking whether an object has a given set of - // `key:value` pairs. - _.matcher = _.matches = function(attrs) { - attrs = _.extendOwn({}, attrs); - return function(obj) { - return _.isMatch(obj, attrs); - }; - }; - - // Run a function **n** times. - _.times = function(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // A (possibly faster) way to get the current timestamp as an integer. - _.now = Date.now || function() { - return new Date().getTime(); - }; - - // List of HTML entities for escaping. - var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - var unescapeMap = _.invert(escapeMap); - - // Functions for escaping and unescaping strings to/from HTML interpolation. - var createEscaper = function(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped - var source = '(?:' + _.keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; - }; - _.escape = createEscaper(escapeMap); - _.unescape = createEscaper(unescapeMap); - - // If the value of the named `property` is a function then invoke it with the - // `object` as context; otherwise, return it. - _.result = function(object, property, fallback) { - var value = object == null ? void 0 : object[property]; - if (value === void 0) { - value = fallback; - } - return _.isFunction(value) ? value.call(object) : value; - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\u2028|\u2029/g; - - var escapeChar = function(match) { - return '\\' + escapes[match]; - }; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - // NB: `oldSettings` only exists for backwards compatibility. - _.template = function(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escaper, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offest. - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - try { - var render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled source as a convenience for precompilation. - var argument = settings.variable || 'obj'; - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function. Start chaining a wrapped Underscore object. - _.chain = function(obj) { - var instance = _(obj); - instance._chain = true; - return instance; - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(instance, obj) { - return instance._chain ? _(obj).chain() : obj; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - _.each(_.functions(obj), function(name) { - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result(this, func.apply(_, args)); - }; - }); - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; - return result(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - _.each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result(this, method.apply(this._wrapped, arguments)); - }; - }); - - // Extracts the result from a wrapped and chained object. - _.prototype.value = function() { - return this._wrapped; - }; - - // Provide unwrapping proxy for some methods used in engine operations - // such as arithmetic and JSON stringification. - _.prototype.valueOf = _.prototype.toJSON = _.prototype.value; - - _.prototype.toString = function() { - return '' + this._wrapped; - }; - - // AMD registration happens at the end for compatibility with AMD loaders - // that may not enforce next-turn semantics on modules. Even though general - // practice for AMD registration is to be anonymous, underscore registers - // as a named module because, like jQuery, it is a base library that is - // popular enough to be bundled in a third party lib, but not be part of - // an AMD load request. Those cases could generate an error when an - // anonymous define() is called outside of a loader request. - if (typeof define === 'function' && define.amd) { - define('underscore', [], function() { - return _; - }); - } -}.call(this)); - -},{}],26:[function(require,module,exports){ -arguments[4][19][0].apply(exports,arguments) -},{"dup":19}],27:[function(require,module,exports){ -module.exports = function isBuffer(arg) { - return arg && typeof arg === 'object' - && typeof arg.copy === 'function' - && typeof arg.fill === 'function' - && typeof arg.readUInt8 === 'function'; -} -},{}],28:[function(require,module,exports){ -(function (process,global){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var formatRegExp = /%[sdj%]/g; -exports.format = function(f) { - if (!isString(f)) { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(inspect(arguments[i])); - } - return objects.join(' '); - } - - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': - try { - return JSON.stringify(args[i++]); - } catch (_) { - return '[Circular]'; - } - default: - return x; - } - }); - for (var x = args[i]; i < len; x = args[++i]) { - if (isNull(x) || !isObject(x)) { - str += ' ' + x; - } else { - str += ' ' + inspect(x); - } - } - return str; -}; - - -// Mark that a method should not be used. -// Returns a modified function which warns once by default. -// If --no-deprecation is set, then it is a no-op. -exports.deprecate = function(fn, msg) { - // Allow for deprecating things in the process of starting up. - if (isUndefined(global.process)) { - return function() { - return exports.deprecate(fn, msg).apply(this, arguments); - }; - } - - if (process.noDeprecation === true) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (process.throwDeprecation) { - throw new Error(msg); - } else if (process.traceDeprecation) { - console.trace(msg); - } else { - console.error(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -}; - - -var debugs = {}; -var debugEnviron; -exports.debuglog = function(set) { - if (isUndefined(debugEnviron)) - debugEnviron = process.env.NODE_DEBUG || ''; - set = set.toUpperCase(); - if (!debugs[set]) { - if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { - var pid = process.pid; - debugs[set] = function() { - var msg = exports.format.apply(exports, arguments); - console.error('%s %d: %s', set, pid, msg); - }; - } else { - debugs[set] = function() {}; - } - } - return debugs[set]; -}; - - -/** - * Echos the value of a value. Trys to print the value out - * in the best way possible given the different types. - * - * @param {Object} obj The object to print out. - * @param {Object} opts Optional options object that alters the output. - */ -/* legacy: obj, showHidden, depth, colors*/ -function inspect(obj, opts) { - // default options - var ctx = { - seen: [], - stylize: stylizeNoColor - }; - // legacy... - if (arguments.length >= 3) ctx.depth = arguments[2]; - if (arguments.length >= 4) ctx.colors = arguments[3]; - if (isBoolean(opts)) { - // legacy... - ctx.showHidden = opts; - } else if (opts) { - // got an "options" object - exports._extend(ctx, opts); - } - // set default options - if (isUndefined(ctx.showHidden)) ctx.showHidden = false; - if (isUndefined(ctx.depth)) ctx.depth = 2; - if (isUndefined(ctx.colors)) ctx.colors = false; - if (isUndefined(ctx.customInspect)) ctx.customInspect = true; - if (ctx.colors) ctx.stylize = stylizeWithColor; - return formatValue(ctx, obj, ctx.depth); -} -exports.inspect = inspect; - - -// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics -inspect.colors = { - 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] -}; - -// Don't use 'blue' not visible on cmd.exe -inspect.styles = { - 'special': 'cyan', - 'number': 'yellow', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' -}; - - -function stylizeWithColor(str, styleType) { - var style = inspect.styles[styleType]; - - if (style) { - return '\u001b[' + inspect.colors[style][0] + 'm' + str + - '\u001b[' + inspect.colors[style][1] + 'm'; - } else { - return str; - } -} - - -function stylizeNoColor(str, styleType) { - return str; -} - - -function arrayToHash(array) { - var hash = {}; - - array.forEach(function(val, idx) { - hash[val] = true; - }); - - return hash; -} - - -function formatValue(ctx, value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (ctx.customInspect && - value && - isFunction(value.inspect) && - // Filter out the util module, it's inspect function is special - value.inspect !== exports.inspect && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - var ret = value.inspect(recurseTimes, ctx); - if (!isString(ret)) { - ret = formatValue(ctx, ret, recurseTimes); - } - return ret; - } - - // Primitive types cannot have properties - var primitive = formatPrimitive(ctx, value); - if (primitive) { - return primitive; - } - - // Look up the keys of the object. - var keys = Object.keys(value); - var visibleKeys = arrayToHash(keys); - - if (ctx.showHidden) { - keys = Object.getOwnPropertyNames(value); - } - - // IE doesn't make error fields non-enumerable - // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx - if (isError(value) - && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { - return formatError(value); - } - - // Some type of object without properties can be shortcutted. - if (keys.length === 0) { - if (isFunction(value)) { - var name = value.name ? ': ' + value.name : ''; - return ctx.stylize('[Function' + name + ']', 'special'); - } - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } - if (isDate(value)) { - return ctx.stylize(Date.prototype.toString.call(value), 'date'); - } - if (isError(value)) { - return formatError(value); - } - } - - var base = '', array = false, braces = ['{', '}']; - - // Make Array say that they are Array - if (isArray(value)) { - array = true; - braces = ['[', ']']; - } - - // Make functions say that they are functions - if (isFunction(value)) { - var n = value.name ? ': ' + value.name : ''; - base = ' [Function' + n + ']'; - } - - // Make RegExps say that they are RegExps - if (isRegExp(value)) { - base = ' ' + RegExp.prototype.toString.call(value); - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + Date.prototype.toUTCString.call(value); - } - - // Make error with message first say the error - if (isError(value)) { - base = ' ' + formatError(value); - } - - if (keys.length === 0 && (!array || value.length == 0)) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } else { - return ctx.stylize('[Object]', 'special'); - } - } - - ctx.seen.push(value); - - var output; - if (array) { - output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); - } else { - output = keys.map(function(key) { - return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); - }); - } - - ctx.seen.pop(); - - return reduceToSingleString(output, base, braces); -} - - -function formatPrimitive(ctx, value) { - if (isUndefined(value)) - return ctx.stylize('undefined', 'undefined'); - if (isString(value)) { - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return ctx.stylize(simple, 'string'); - } - if (isNumber(value)) - return ctx.stylize('' + value, 'number'); - if (isBoolean(value)) - return ctx.stylize('' + value, 'boolean'); - // For some reason typeof null is "object", so special case here. - if (isNull(value)) - return ctx.stylize('null', 'null'); -} - - -function formatError(value) { - return '[' + Error.prototype.toString.call(value) + ']'; -} - - -function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { - var output = []; - for (var i = 0, l = value.length; i < l; ++i) { - if (hasOwnProperty(value, String(i))) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - String(i), true)); - } else { - output.push(''); - } - } - keys.forEach(function(key) { - if (!key.match(/^\d+$/)) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - key, true)); - } - }); - return output; -} - - -function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { - var name, str, desc; - desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; - if (desc.get) { - if (desc.set) { - str = ctx.stylize('[Getter/Setter]', 'special'); - } else { - str = ctx.stylize('[Getter]', 'special'); - } - } else { - if (desc.set) { - str = ctx.stylize('[Setter]', 'special'); - } - } - if (!hasOwnProperty(visibleKeys, key)) { - name = '[' + key + ']'; - } - if (!str) { - if (ctx.seen.indexOf(desc.value) < 0) { - if (isNull(recurseTimes)) { - str = formatValue(ctx, desc.value, null); - } else { - str = formatValue(ctx, desc.value, recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (array) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = ctx.stylize('[Circular]', 'special'); - } - } - if (isUndefined(name)) { - if (array && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = ctx.stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = ctx.stylize(name, 'string'); - } - } - - return name + ': ' + str; -} - - -function reduceToSingleString(output, base, braces) { - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; - }, 0); - - if (length > 60) { - return braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - } - - return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; -} - - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = require('./support/isBuffer'); - -function objectToString(o) { - return Object.prototype.toString.call(o); -} - - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - - -// log is just a thin wrapper to console.log that prepends a timestamp -exports.log = function() { - console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); -}; - - -/** - * Inherit the prototype methods from one constructor into another. - * - * The Function.prototype.inherits from lang.js rewritten as a standalone - * function (not on Function.prototype). NOTE: If this file is to be loaded - * during bootstrapping this function needs to be rewritten using some native - * functions as prototype setup using normal JavaScript does not work as - * expected during bootstrapping (see mirror.js in r114903). - * - * @param {function} ctor Constructor function which needs to inherit the - * prototype. - * @param {function} superCtor Constructor function to inherit prototype from. - */ -exports.inherits = require('inherits'); - -exports._extend = function(origin, add) { - // Don't do anything if add isn't an object - if (!add || !isObject(add)) return origin; - - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; -}; - -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":27,"_process":24,"inherits":26}],29:[function(require,module,exports){ -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) - - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') - - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) - - return wrapper - - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) - } - return ret - } -} - -},{}]},{},[7])(7) -}); \ No newline at end of file diff --git a/site/assets/stylesheets/extra.css b/site/assets/stylesheets/extra.css deleted file mode 100644 index 3ef659d..0000000 --- a/site/assets/stylesheets/extra.css +++ /dev/null @@ -1,145 +0,0 @@ -@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap"); - -:root { - --md-text-font: "Space Grotesk"; - --md-code-font: "JetBrains Mono"; - --tryx-bg-a: rgba(255, 193, 90, 0.18); - --tryx-bg-b: rgba(39, 189, 168, 0.14); - --tryx-hero-bg: radial-gradient(circle at 12% 18%, #c7f4e2 0%, #f6fcfa 35%, #fef6e8 100%); - --tryx-card-bg: rgba(255, 255, 255, 0.72); - --tryx-card-border: rgba(18, 127, 112, 0.16); - --tryx-card-shadow: 0 10px 28px rgba(20, 35, 40, 0.08); - --tryx-muted-border: rgba(0, 0, 0, 0.15); -} - -.md-main { - background: radial-gradient(circle at 85% 12%, var(--tryx-bg-a), transparent 32%), - radial-gradient(circle at 6% 80%, var(--tryx-bg-b), transparent 28%); -} - -[data-md-color-scheme="slate"] { - --tryx-bg-a: rgba(255, 184, 76, 0.08); - --tryx-bg-b: rgba(39, 189, 168, 0.08); - --tryx-hero-bg: linear-gradient(135deg, rgba(40, 53, 57, 0.9), rgba(24, 37, 39, 0.9)); - --tryx-card-bg: rgba(28, 41, 45, 0.74); - --tryx-card-border: rgba(88, 132, 125, 0.44); - --tryx-card-shadow: 0 12px 34px rgba(0, 0, 0, 0.35); - --tryx-muted-border: rgba(255, 255, 255, 0.24); -} - -.md-typeset h1, -.md-typeset h2, -.md-typeset h3 { - letter-spacing: -0.02em; -} - -.md-typeset h2 { - margin-top: 2rem; -} - -.tryx-hero { - border: 1px solid var(--tryx-card-border); - border-radius: 18px; - background: var(--tryx-hero-bg); - box-shadow: var(--tryx-card-shadow); - padding: 1.3rem 1.4rem; - margin-bottom: 1.3rem; -} - -.tryx-pill-row { - display: flex; - flex-wrap: wrap; - gap: 0.55rem; - margin-top: 0.9rem; -} - -.tryx-pill { - border: 1px solid var(--tryx-muted-border); - border-radius: 999px; - padding: 0.25rem 0.65rem; - font-size: 0.78rem; - background: rgba(255, 255, 255, 0.58); -} - -[data-md-color-scheme="slate"] .tryx-pill { - background: rgba(255, 255, 255, 0.06); -} - -.tryx-grid { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); - gap: 0.8rem; - margin-top: 0.8rem; -} - -.tryx-card { - border: 1px solid var(--tryx-card-border); - border-radius: 14px; - padding: 0.85rem; - background: var(--tryx-card-bg); - box-shadow: var(--tryx-card-shadow); -} - -.tryx-link-grid { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); - gap: 0.9rem; -} - -.tryx-link-grid a { - display: block; - border: 1px solid var(--tryx-card-border); - border-radius: 14px; - padding: 0.9rem; - text-decoration: none; - background: var(--tryx-card-bg); - box-shadow: var(--tryx-card-shadow); - transition: transform 0.18s ease, border-color 0.18s ease; -} - -.tryx-link-grid a:hover { - transform: translateY(-2px); - border-color: var(--md-accent-fg-color); -} - -.tryx-kbd { - border: 1px solid var(--tryx-muted-border); - border-bottom-width: 2px; - border-radius: 6px; - padding: 0.1rem 0.35rem; - font-family: var(--md-code-font); - font-size: 0.76rem; -} - -.md-typeset table:not([class]) { - border-radius: 10px; - overflow: hidden; -} - -.md-typeset .admonition { - border-radius: 12px; -} - -a:focus-visible, -button:focus-visible, -input:focus-visible, -summary:focus-visible { - outline: 2px solid var(--md-accent-fg-color); - outline-offset: 2px; - border-radius: 4px; -} - -.tryx-fade-up { - animation: tryxFadeUp 520ms ease-out both; -} - -@keyframes tryxFadeUp { - from { - opacity: 0; - transform: translateY(9px); - } - to { - opacity: 1; - transform: translateY(0); - } -} diff --git a/site/core-concepts/architecture/index.html b/site/core-concepts/architecture/index.html deleted file mode 100644 index b7527d6..0000000 --- a/site/core-concepts/architecture/index.html +++ /dev/null @@ -1,2198 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Architecture - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Architecture

-

Tryx intentionally splits protocol-heavy runtime responsibilities and Python-facing ergonomics.

-

Layered Design

-

Tryx uses a two-layer model:

-
    -
  1. Rust core layer
  2. -
  3. Python API layer
  4. -
-

Rust Core Layer

-

The Rust side handles:

-
    -
  • protocol parsing
  • -
  • transport/runtime state
  • -
  • heavy event transformations
  • -
  • media and protobuf conversions
  • -
-

Additional responsibilities:

-
    -
  • connection lifecycle and stream state
  • -
  • event normalization and serialization boundaries
  • -
  • low-level protocol node handling
  • -
-

Python API Layer

-

The Python side provides:

-
    -
  • ergonomic async API
  • -
  • namespace-based clients (contact, groups, privacy, etc.)
  • -
  • typed stubs for IDE and static analysis
  • -
  • callback registration via decorators
  • -
-

Additional responsibilities:

-
    -
  • namespace-driven domain APIs (client.groups, client.privacy, etc.)
  • -
  • handler orchestration and business logic composition
  • -
  • integration with third-party systems (DB, queues, APIs)
  • -
-

Why This Design Works

-
    -
  • Performance-sensitive logic stays in Rust.
  • -
  • Product logic stays simple in Python.
  • -
  • Event payloads are structured classes, not ad-hoc dicts.
  • -
-

Runtime Boundary Principle

-
-

Tip

-

Keep protocol assumptions in Rust-backed typed models and keep product/business policy in Python handlers.

-
-

Data Flow

-
flowchart LR
-    A[WhatsApp Stream] --> B[Rust Runtime]
-    B --> C[Event Conversion]
-    C --> D[PyO3 Classes]
-    D --> E[Python Handler]
-    E --> F[TryxClient API Calls]
-    F --> B
-
-

Module Map

-
    -
  • src/lib.rs: submodule registration and class exports
  • -
  • src/clients/*: client methods exposed to Python
  • -
  • src/events/*: event classes and dispatcher
  • -
  • src/types.rs: shared data classes (JID, MessageInfo, etc.)
  • -
  • src/wacore/*: low-level node and stanza models
  • -
  • python/tryx/*.py: runtime re-export wrappers
  • -
  • python/tryx/*.pyi: typed API contracts
  • -
-

Practical Implication

-

You can safely treat Python classes as stable contracts while trusting Rust internals for throughput and protocol-heavy work.

- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/core-concepts/event-model/index.html b/site/core-concepts/event-model/index.html deleted file mode 100644 index 21cc6ee..0000000 --- a/site/core-concepts/event-model/index.html +++ /dev/null @@ -1,2174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Event Model - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Event Model

-

Tryx emits typed event classes from tryx.events. Every event has a known payload shape.

-

Dispatch Contract

-

Handlers are registered by event class and receive (client, event).

-
-

Note

-

Event flow is asynchronous and stateful. Design handlers for retries and replay-like conditions.

-
-

Handler Registration

-
@bot.on(EvMessage)
-async def on_message(client: TryxClient, event: EvMessage) -> None:
-    ...
-
-

Event Categories

-
    -
  • Lifecycle: EvConnected, EvDisconnected, EvLoggedOut
  • -
  • Pairing: EvPairingQrCode, EvPairingCode, EvPairSuccess, EvPairError
  • -
  • Messaging: EvMessage, EvReceipt, EvUndecryptableMessage
  • -
  • Chat actions sync: archive, mute, mark-read, delete-chat, delete-for-me
  • -
  • Presence and profile: chat presence, availability, picture, push-name, about
  • -
  • Contact and device sync: contact update, device list update
  • -
  • Group and newsletter updates
  • -
-

For full taxonomy, see Events API.

-

Event Payload Pattern

-

Many events expose a lazy data property:

-
    -
  • event.data returns a rich typed object
  • -
  • conversion from Rust internals happens on demand
  • -
  • repeated access often reuses cached object instances
  • -
-

Important Reliability Notes

-
    -
  • Callback execution order is event-driven; do not assume strict timing between different event classes.
  • -
  • Keep handlers short and non-blocking.
  • -
  • For expensive work, queue to background tasks.
  • -
-
-

Ordering assumptions

-

Do not assume strict global ordering between all event types. Build idempotent handlers using message identifiers.

-
-

Best Practices

-
    -
  1. Validate optional fields before use.
  2. -
  3. Prefer exact event classes over broad dynamic checks.
  4. -
  5. Log enough metadata (jid, message_id, timestamps) for debugging.
  6. -
  7. Treat undecryptable and sync events as normal runtime states, not always errors.
  8. -
-

Event-to-Action Mapping

- - - - - - - - - - - - - - - - - - - - - - - - - -
Event ExampleTypical Namespace Follow-up
EvMessageroot send methods, Chat Actions
EvGroupUpdateGroups, Community
EvPresencePresence, Chatstate
EvNewsletterLiveUpdateNewsletter, Polls
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/core-concepts/type-system/index.html b/site/core-concepts/type-system/index.html deleted file mode 100644 index e63a19a..0000000 --- a/site/core-concepts/type-system/index.html +++ /dev/null @@ -1,2156 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Type System - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Type System

-

Tryx ships with .pyi stubs and py.typed, enabling full editor and type-checker support.

-
-

Why this matters

-

Typed contracts make event handling safer, API discovery faster, and refactors less risky.

-
-

Core Types

-
    -
  • JID: canonical address object
  • -
  • MessageSource: message origin and routing context
  • -
  • MessageInfo: metadata for message identity and attributes
  • -
  • UploadResponse: media upload output
  • -
  • SendResult: send operation result
  • -
  • MediaReuploadResult: media retry result
  • -
  • ProfilePicture: profile picture metadata
  • -
-

Event Types

-

Event classes define explicit payload contracts:

-
    -
  • no guessing with nested dict keys
  • -
  • discoverable through IDE autocomplete
  • -
  • easier static checks in large projects
  • -
-

Enum-heavy Domains

-

Key domains with enum-like constraints:

-
    -
  • privacy and disallowed-list management
  • -
  • status audience control
  • -
  • chatstate and presence signaling
  • -
  • group/community policy modes
  • -
-

Enum-Style Classes

-

Several Rust enums are exposed as Python classes with fixed attributes (for example status/privacy and event reason classes).

-

Suggested Typing Workflow

-
    -
  1. Keep handler function signatures explicit.
  2. -
  3. Annotate helper functions returning event-derived data.
  4. -
  5. Run static analysis in CI (mypy or pyright).
  6. -
-

Type Boundary Pattern

-
from tryx.events import EvMessage
-from tryx.types import JID
-
-
-def extract_sender(event: EvMessage) -> JID:
-    return event.data.message_info.source.sender
-
-

Then keep your service layer function signatures strictly typed as well.

-

Example

-
from tryx.events import EvMessage
-from tryx.types import JID
-
-
-def extract_chat(event: EvMessage) -> JID:
-    return event.data.message_info.source.chat
-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/faq/qna/index.html b/site/faq/qna/index.html deleted file mode 100644 index a422570..0000000 --- a/site/faq/qna/index.html +++ /dev/null @@ -1,2683 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - QnA - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - -

QnA

-

Use this page for quick decisions, then jump to linked technical pages for implementation details.

-

General

-

What is Tryx?

-

Tryx is a Rust-powered Python SDK for event-driven WhatsApp automation.

-

Why not pure Python?

-

Rust handles protocol-heavy runtime work for better throughput and lower overhead, while Python keeps app logic easy to write.

-

Is Tryx synchronous or asynchronous?

-

Both: async-first (await bot.run()), plus blocking convenience (bot.run_blocking()).

-

See Quick Start.

-

Pairing and Session

-

Do I need to pair every time?

-

No. If backend storage is preserved, session data is reused.

-

What does EvStreamReplaced mean?

-

Another session replaced your active stream. Re-check device/session ownership.

-

What should I do on EvLoggedOut?

-

Treat it as session invalidation. Re-pair and refresh persisted state.

-

See Authentication Flow.

-

Event Handling

-

Can I register multiple handlers for one event?

-

Yes. Dispatcher stores callbacks per event class.

-

Why does an event have data property instead of direct fields?

-

Many event payloads are lazily materialized for efficiency.

-

Should I process heavy logic directly in handlers?

-

Prefer short handlers that delegate expensive work to background tasks.

-

See Reliability and Performance.

-

Messaging and Media

-

Which media types can Tryx send?

-

Text, photo, document, audio, video, GIF, sticker, and protobuf-raw messages.

-

When should I call request_media_reupload?

-

When media direct path is stale or unavailable and normal download fails.

-

Can I quote a message in replies?

-

Yes, pass the original EvMessage to send helpers that support quoted.

-

See Media Workflows.

-

Groups and Privacy

-

Can I automate group moderation?

-

Yes, use client.groups.* and handle EvGroupUpdate for state feedback.

-

Can I modify privacy settings?

-

Yes, use client.privacy.fetch_settings() and set_setting(...).

-

See Privacy Namespace and Profile and Privacy Tutorial.

-

Deployment and Operations

-

What is the minimum production checklist?

-
    -
  1. durable backend/session storage
  2. -
  3. bounded retry strategy
  4. -
  5. idempotent message processing
  6. -
  7. basic security controls (admin-only commands, secret management)
  8. -
-

See Deployment Guide.

-

How do I troubleshoot reconnect loops quickly?

-

Use the connection decision tree in Troubleshooting and verify single-writer backend ownership.

-

Typing and Tooling

-

Are stubs complete?

-

Tryx ships .pyi stubs for public modules including events and low-level wacore types.

-

Can I use mypy or pyright?

-

Yes, the package includes py.typed for static analysis integration.

-

Reliability

-

How should I handle temporary bans?

-

Listen to EvTemporaryBan, pause high-frequency operations, and avoid aggressive retries.

-

How can I make my bot idempotent?

-

Store processed message IDs and guard side effects before calling external systems.

-

See Reliability.

-

Compatibility

-

Which Python versions are supported?

-

Python 3.8 and newer.

-

Does Tryx support Linux/macOS/Windows?

-

Yes, with proper Rust toolchain and platform build dependencies.

- - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/getting-started/authentication/index.html b/site/getting-started/authentication/index.html deleted file mode 100644 index 0ac370c..0000000 --- a/site/getting-started/authentication/index.html +++ /dev/null @@ -1,2181 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Authentication Flow - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Authentication Flow

-

Tryx follows the WhatsApp multi-device pairing flow. The first run links a session, and later runs reuse stored state.

-
-

Note

-

Authentication stability is mostly a storage and ownership problem. Treat backend/session files as critical runtime state.

-
-

Pairing Modes

-
    -
  • QR pairing event: EvPairingQrCode
  • -
  • Numeric pairing event: EvPairingCode
  • -
  • Success event: EvPairSuccess
  • -
  • Failure event: EvPairError
  • -
-

Typical First-Run Sequence

-
    -
  1. Start bot runtime.
  2. -
  3. Wait for EvPairingQrCode or EvPairingCode.
  4. -
  5. Complete pairing from your WhatsApp mobile app.
  6. -
  7. Receive EvPairSuccess.
  8. -
  9. Session credentials are persisted in your backend.
  10. -
-

Event-level Interpretation

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EventMeaningOperator action
EvPairingQrCodeQR challenge issuedscan with mobile app
EvPairingCodecode-based pairing challengeenter code in paired device flow
EvPairSuccesssession linked and persistedcontinue normal operations
EvPairErrorpairing rejected/failedinspect logs and retry pairing
-

Persistence

-

Use a stable backend path:

-
from tryx.backend import SqliteBackend
-
-backend = SqliteBackend("/srv/tryx/session.db")
-
-

If the same backend path is reused, you usually do not need to pair again.

-
-

Single writer rule

-

Avoid multiple runtime instances writing to the same backend path unless you explicitly control ownership.

-
-

Operational Guidance

-
    -
  • Keep one active session owner for a backend path.
  • -
  • Avoid deleting backend files unless resetting account link is intentional.
  • -
  • Back up backend data before infrastructure migration.
  • -
-

Recovery Signals

-
    -
  • EvLoggedOut: account session is no longer valid.
  • -
  • EvStreamReplaced: another login/session replaced your current stream.
  • -
  • EvTemporaryBan: temporary restrictions detected; pause high-volume operations.
  • -
-

Recovery Playbook

-
    -
  1. if EvLoggedOut: re-pair and rotate session artifacts.
  2. -
  3. if EvStreamReplaced: check if another deployment is using the same account/backend.
  4. -
  5. if temporary-ban signal: stop automation burst traffic and re-enable gradually.
  6. -
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/getting-started/installation/index.html b/site/getting-started/installation/index.html deleted file mode 100644 index b47e638..0000000 --- a/site/getting-started/installation/index.html +++ /dev/null @@ -1,2221 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Installation - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Installation

-

This page sets up a local development environment for the Tryx Python bindings backed by Rust.

-
-

Recommended shell flow

-

Use uv to manage the project environment and dependencies consistently.

-
-

Prerequisites

-
    -
  • Python 3.8+
  • -
  • Rust toolchain (stable)
  • -
  • uv
  • -
-

Environment Bootstrap

-
uv sync --group dev
-
-

Local Development Install

-
uv run maturin develop
-
-

This installs the Rust extension module into your active environment in editable mode.

-
-

Fast rebuild loop

-

Re-run uv run maturin develop after Rust binding changes to keep Python runtime artifacts in sync.

-
-

Build Wheel

-
uv run maturin build --release
-
-

Typical wheel output appears under target/wheels/.

-

Verify Installation

-
from tryx.client import Tryx, TryxClient
-from tryx.backend import SqliteBackend
-
-backend = SqliteBackend("whatsapp.db")
-bot = Tryx(backend)
-client = bot.get_client()
-print(type(client).__name__)
-
-

If output shows TryxClient, extension loading is successful.

-

Optional Tools

-
    -
  • uv run mypy ... or pyright for static type checks
  • -
  • uv run --no-project --with ruff==0.11.4 ruff check . for linting (no project build)
  • -
  • uv run pytest for integration test harnesses
  • -
  • uv run pre-commit run --all-files for local gate parity with CI
  • -
-

Common Install Issues

-

Rust compiler not found

-

Install Rust with rustup and reopen your shell.

-

Build fails with linker errors

-

Ensure your platform build tools are installed:

-
    -
  • Linux: build-essential and OpenSSL dev headers
  • -
  • macOS: Xcode command line tools
  • -
  • Windows: MSVC Build Tools
  • -
-

ImportError for extension module

-

Re-run uv run maturin develop in the same project environment where you run Python.

-

Next Step

- - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/getting-started/quickstart/index.html b/site/getting-started/quickstart/index.html deleted file mode 100644 index 1966337..0000000 --- a/site/getting-started/quickstart/index.html +++ /dev/null @@ -1,2147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Quick Start - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - -

Quick Start

-

Build and run a minimal echo bot, then expand it safely.

-
-

Expected outcome

-

You should receive incoming text and reply with an echo message in the same chat.

-
-

Minimal Bot

-
import asyncio
-
-from tryx.backend import SqliteBackend
-from tryx.client import Tryx, TryxClient
-from tryx.events import EvMessage
-from tryx.waproto.whatsapp_pb2 import Message
-
-backend = SqliteBackend("whatsapp.db")
-bot = Tryx(backend)
-
-
-@bot.on(EvMessage)
-async def on_message(client: TryxClient, event: EvMessage) -> None:
-    text = event.data.get_text() or "<non-text>"
-    chat = event.data.message_info.source.chat
-    await client.send_message(chat, Message(conversation=f"Echo: {text}"))
-
-
-async def main() -> None:
-    await bot.run()
-
-
-if __name__ == "__main__":
-    asyncio.run(main())
-
-

How It Works

-
    -
  1. backend persists pairing/session state
  2. -
  3. Tryx runtime wires event dispatcher
  4. -
  5. @bot.on(EvMessage) registers handler
  6. -
  7. TryxClient executes namespace/root API calls
  8. -
-

Runtime Flow

-
    -
  1. Create backend storage.
  2. -
  3. Create Tryx bot instance.
  4. -
  5. Register handlers with @bot.on(EventClass).
  6. -
  7. Start runtime with await bot.run().
  8. -
  9. Use TryxClient inside handlers for API calls.
  10. -
-

First Production Hardening

-
-
-
-
    -
  • deduplicate with message id
  • -
  • bound retries for network operations
  • -
-
-
-
    -
  • validate command input
  • -
  • keep admin-only commands restricted
  • -
-
-
-
    -
  • keep handlers short
  • -
  • offload heavy work to worker queue
  • -
-
-
-
-

Blocking Script Mode

-

For quick scripts without manual event loop management:

-
from tryx.backend import SqliteBackend
-from tryx.client import Tryx
-
-bot = Tryx(SqliteBackend("whatsapp.db"))
-bot.run_blocking()
-
-
-

Warning

-

run_blocking() is convenient for small scripts. Prefer explicit async runtime control for larger systems.

-
-

Next Steps

- - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/index.html b/site/index.html deleted file mode 100644 index 57de1a5..0000000 --- a/site/index.html +++ /dev/null @@ -1,2137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - -

Tryx Documentation

-
-

Build WhatsApp Automations With Rust Speed and Python Ergonomics

-

Tryx combines a Rust runtime core with a typed Python API so you can ship robust bots, integrations, and event-driven workflows without sacrificing performance.

-
- Async-first - Typed stubs (.pyi) - PyO3 bindings - Event-driven architecture -
-
- -
-

Documentation Mode

-

This site is designed as a full path: setup -> architecture -> API namespaces -> tutorials -> production operations.

-
-

What You Can Do

-
-
-

Messaging

-

Send text, photo, audio, document, video, GIF, and sticker content with a clean Python API.

-
-
-

Realtime Events

-

Subscribe to rich event classes for messages, contact updates, sync actions, and lifecycle changes.

-
-
-

Namespace Clients

-

Use dedicated namespaces for contacts, groups, newsletter, status, privacy, polls, presence, and more.

-
-
-

Typed Development

-

Use complete Python stubs for editor intelligence, static checks, and better API discoverability.

-
-
- -

Choose Your Path

-
-
-
-
-
-
    -
  1. Installation
  2. -
  3. Quick Start
  4. -
  5. Authentication Flow
  6. -
  7. Client API Gateway
  8. -
-
-
-
-
-
-
    -
  1. Client Namespaces
  2. -
  3. Events API
  4. -
  5. Types API
  6. -
  7. Tutorials
  8. -
-
-
-
-
-
-
    -
  1. Deployment Guide
  2. -
  3. Reliability
  4. -
  5. Troubleshooting
  6. -
  7. Security
  8. -
- -
    -
  1. Start with Installation.
  2. -
  3. Follow Quick Start to build your first running bot.
  4. -
  5. Understand pairing in Authentication Flow.
  6. -
  7. Learn internals in Architecture and Event Model.
  8. -
  9. Jump into Client API Gateway and namespace deep dives.
  10. -
  11. Use Tutorials for implementation patterns.
  12. -
  13. Use QnA and Troubleshooting when debugging.
  14. -
  15. Finish with Deployment and Reliability before production.
  16. -
-

Project Scope

-

This documentation set focuses on the Python SDK experience first:

-
    -
  • Runtime setup and bot lifecycle
  • -
  • Event payload model and handler patterns
  • -
  • API reference for client/events/types/helpers/wacore
  • -
  • Performance, reliability, and security operations
  • -
  • Practical tutorials and real-world QnA
  • -
-

Rust-internal details remain visible where they directly affect Python usage and behavior.

-

Quick Technical Index

- - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/operations/deployment/index.html b/site/operations/deployment/index.html deleted file mode 100644 index 7d09e08..0000000 --- a/site/operations/deployment/index.html +++ /dev/null @@ -1,2088 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Deployment - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - -

Deployment Guide

-

Deploy Tryx bots safely in production with stable session storage and predictable restarts.

-

Deployment Patterns

-
-
-
-

Best for single-host deployments.

-
[Unit]
-Description=Tryx Bot
-After=network.target
-
-[Service]
-WorkingDirectory=/srv/tryx
-Environment=PYTHONUNBUFFERED=1
-ExecStart=/srv/tryx/.venv/bin/python bot.py
-Restart=always
-RestartSec=5
-User=tryx
-
-[Install]
-WantedBy=multi-user.target
-
-
-
-

Best for reproducible runtime images.

-
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
-
-WORKDIR /app
-COPY . .
-RUN uv sync --group dev
-RUN uv run maturin develop
-
-CMD ["uv", "run", "python", "bot.py"]
-
-
-
-
-

Session Persistence Requirements

-
-

Critical

-

Keep backend/session data on durable storage. Stateless containers without mounted volumes will force re-pairing.

-
-
    -
  • Mount persistent volume for backend path.
  • -
  • Use single active writer per backend path.
  • -
  • Snapshot session data before upgrades.
  • -
-
-Advanced: blue/green rollout note -

During blue/green deploys, ensure only one color actively writes to the session backend. -Dual-writer rollout against the same backend path can trigger stream replacement and churn.

-
-

Release Checklist

-
    -
  1. Build in clean environment.
  2. -
  3. Run smoke command path in staging account.
  4. -
  5. Verify pairing/session reuse behavior.
  6. -
  7. Confirm logs/metrics are emitted.
  8. -
  9. Roll out with gradual traffic.
  10. -
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/operations/performance/index.html b/site/operations/performance/index.html deleted file mode 100644 index 2abd3b4..0000000 --- a/site/operations/performance/index.html +++ /dev/null @@ -1,2126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Performance - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Performance Guide

-

Optimize for predictable latency and stable memory under burst traffic.

-

Handler Design Rules

-
    -
  1. keep event handlers short and non-blocking
  2. -
  3. offload heavy CPU to workers
  4. -
  5. avoid synchronous I/O in async handler path
  6. -
-
-

Target

-

Keep p95 handler latency low enough that user-facing replies remain responsive under burst load.

-
-

Throughput Tactics

-
-
-
-
    -
  • cache repeated lookup results
  • -
  • avoid repeated protobuf parsing for the same payload
  • -
-
-
-
    -
  • batch outbound calls where safe
  • -
  • use bounded worker queues
  • -
-
-
-
    -
  • stream large blobs to disk/object storage
  • -
  • avoid retaining many blobs in process memory
  • -
-
-
-
-

Measurement Baseline

-

Track at minimum:

-
    -
  • event receive timestamp
  • -
  • handler start/end timestamp
  • -
  • outbound API duration
  • -
  • queue depth (if queue used)
  • -
  • memory watermark
  • -
-

Profiling Workflow

-
    -
  1. capture trace under realistic traffic.
  2. -
  3. identify top handler hotspots.
  4. -
  5. optimize one hotspot at a time.
  6. -
  7. rerun same workload and compare metrics.
  8. -
-

Capacity Planning Checklist

-
    -
  • message rate per minute
  • -
  • media download/upload volume
  • -
  • active callback concurrency
  • -
  • reconnect frequency
  • -
-
-

False optimization

-

Optimize after measuring. Guess-based micro-optimizations often increase complexity without improving bottlenecks.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/operations/reliability/index.html b/site/operations/reliability/index.html deleted file mode 100644 index f59e071..0000000 --- a/site/operations/reliability/index.html +++ /dev/null @@ -1,2108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Reliability - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - -

Reliability Playbook

-

This page focuses on idempotency, retry strategy, and safe handler design.

-

Reliability Pillars

- - - - - - - - - - - - - - - - - - - - - - - - - -
PillarWhy
IdempotencyPrevent duplicate side effects
Bounded retriesRecover transient failures safely
Queue delegationKeep event handlers responsive
Structured loggingMake incident triage fast
-

Idempotency Pattern

-
processed: set[str] = set()
-
-
-@bot.on(EvMessage)
-async def reliable_handler(client, event):
-    msg_id = event.data.message_info.id
-    if msg_id in processed:
-        return
-    processed.add(msg_id)
-
-    await client.send_text(event.data.message_info.source.chat, "processed")
-
-

Retry Envelope

-
async def retry(coro_factory, attempts=3):
-    last_exc = None
-    for _ in range(attempts):
-        try:
-            return await coro_factory()
-        except Exception as exc:
-            last_exc = exc
-    raise last_exc
-
-
-

Do not retry everything

-

Structural payload errors should fail fast. Reserve retries for network/transient failures.

-
-

Handler Throughput Pattern

-
    -
  • Parse and validate quickly in event handler.
  • -
  • Enqueue heavy work to background worker.
  • -
  • Acknowledge user quickly with minimal response.
  • -
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/operations/security/index.html b/site/operations/security/index.html deleted file mode 100644 index 910ae5e..0000000 --- a/site/operations/security/index.html +++ /dev/null @@ -1,2170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Security - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Security Practices

-

Secure your bot around four risk zones: session state, operator controls, user input, and outbound behavior.

-

Threat Model Snapshot

- - - - - - - - - - - - - - - - - - - - - - - - - -
SurfaceRisk
Session backendsession hijack or forced re-pair
Command handlersprivilege escalation
Media pipelinespayload abuse / resource exhaustion
Outbound messagingspam behavior and account penalties
-

Session Data Protection

-
    -
  • keep backend storage on protected, durable media
  • -
  • restrict filesystem ACLs to runtime user only
  • -
  • encrypt backups and protect backup key material
  • -
-
-

Do not expose backend files

-

Session artifacts are sensitive. Anyone with unrestricted access may impersonate the runtime.

-
-

Credential and Token Hygiene

-
    -
  • never hardcode secrets in source
  • -
  • load via environment or secret manager
  • -
  • rotate integration credentials periodically
  • -
-

Abuse and Ban Risk Reduction

-
    -
  • avoid repetitive high-frequency outbound sends
  • -
  • enforce explicit user intent for auto-responses
  • -
  • add anti-loop guardrails for bot-to-bot conversations
  • -
-

Input Validation

-
    -
  • treat inbound message text and media metadata as untrusted
  • -
  • validate command argument shape and length
  • -
  • validate media type and size before decode/store
  • -
-

Logging and Audit Safety

-
    -
  • redact sensitive message content by default
  • -
  • log structured metadata instead of raw payload where possible
  • -
  • split production audit logs from verbose debug traces
  • -
-

Security Checklist Before Release

-
    -
  1. admin-only commands protected by allowlist
  2. -
  3. session backend path not world-readable
  4. -
  5. retry loops bounded and monitored
  6. -
  7. logs reviewed for accidental secrets
  8. -
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/operations/troubleshooting/index.html b/site/operations/troubleshooting/index.html deleted file mode 100644 index 67643bc..0000000 --- a/site/operations/troubleshooting/index.html +++ /dev/null @@ -1,2189 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Troubleshooting - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
- -
-
- - - -
-
- - - - - - - - -

Troubleshooting

-

Use this page as a decision tree first, checklist second.

-

Connection Decision Tree

-
flowchart TD
-    A[Bot cannot connect] --> B{Network reachable?}
-    B -- No --> B1[Fix outbound network/DNS/TLS]
-    B -- Yes --> C{Backend path writable?}
-    C -- No --> C1[Fix storage permissions]
-    C -- Yes --> D{Pairing still valid?}
-    D -- No --> D1[Re-pair account]
-    D -- Yes --> E[Inspect EvConnectFailure / EvStreamError payload]
-
-
-

Always check first

-
    -
  1. outbound network
  2. -
  3. backend storage write access
  4. -
  5. session validity
  6. -
-
-

Frequent Reconnects

-

Possible causes:

-
    -
  • unstable network
  • -
  • another active session replacing stream (EvStreamReplaced)
  • -
  • backend corruption or stale state
  • -
-

Action Path

-
    -
  1. log reconnect timestamp and reason event
  2. -
  3. verify if replacement is expected (another device/session)
  4. -
  5. isolate backend path ownership to single runtime instance
  6. -
-

Message Send Fails

-

Fast Checklist

-
    -
  • validate JID target format
  • -
  • ensure client.is_connected() is true
  • -
  • verify protobuf payload shape if using send_message
  • -
  • classify exception (PyPayloadBuildError vs EventDispatchError)
  • -
-
try:
-    await client.send_text(chat_jid, "hello")
-except PyPayloadBuildError:
-    # payload/content issue
-    ...
-except EventDispatchError:
-    # dispatch/runtime issue
-    ...
-
-

Media Download Fails

-
    -
  1. verify media subtype object (image/video/audio/etc.)
  2. -
  3. if direct path expired, call request_media_reupload(...)
  4. -
  5. retry with bounded attempt count
  6. -
-
-

Audit fields

-

Log message_id, chat_jid, and retry counter for every reupload attempt.

-
-

Sync Events Are Confusing

-

Sync events are normal in multi-device behavior.

-

Treat EvArchiveUpdate, EvMarkChatAsReadUpdate, and EvDeleteChatUpdate as state convergence signals.

-

Escalation Path

-

If issue persists:

-
    -
  1. capture event type + metadata snapshot
  2. -
  3. capture backend health and storage checks
  4. -
  5. reduce to minimal reproducible handler
  6. -
  7. compare against QnA and Error Handling
  8. -
- - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/reference/changelog/index.html b/site/reference/changelog/index.html deleted file mode 100644 index f39e52d..0000000 --- a/site/reference/changelog/index.html +++ /dev/null @@ -1,2053 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - Changelog Policy - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - -

Changelog Policy

-

Tryx changelog is generated automatically with python-semantic-release.

-

Generated file: CHANGELOG.md

-

Do not edit generated release sections manually.

-

Source of Truth

-
    -
  • Conventional Commit messages from merged history on main
  • -
  • Semantic version tags in format vX.Y.Z
  • -
-

Version Bump Rules

-
    -
  • feat -> minor bump
  • -
  • fix and perf -> patch bump
  • -
  • ! or BREAKING CHANGE: footer -> major bump
  • -
-

Commits outside release types (docs, chore, ci, etc.) are still tracked in git history but do not necessarily trigger a release.

-

Minimum Entry Rules

-

Each release entry should include:

-
    -
  1. user-facing summary
  2. -
  3. affected modules (client, events, types, etc.)
  4. -
  5. migration notes if behavior changed
  6. -
  7. compatibility impact (if any)
  8. -
-

The release workflow produces these sections from commit metadata.

-

API Surface Notes

-

Whenever a PyO3 class is added or removed:

-
    -
  • update Rust add_class registration
  • -
  • update corresponding .pyi
  • -
  • update API reference docs
  • -
  • include change note in release entry
  • -
- - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/reference/error-handling/index.html b/site/reference/error-handling/index.html deleted file mode 100644 index 7bf146b..0000000 --- a/site/reference/error-handling/index.html +++ /dev/null @@ -1,2139 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Error Handling - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Error Handling

-

Use exception classes and failure classification to decide whether to retry, fail fast, or trigger operator action.

-

Exception Classes

-
    -
  • FailedBuildBot
  • -
  • FailedToDecodeProto
  • -
  • EventDispatchError
  • -
  • PyPayloadBuildError
  • -
  • UnsupportedBackend
  • -
  • UnsupportedEventType
  • -
-

Backward-compatible aliases:

-
    -
  • BuildBotError
  • -
  • UnsupportedBackendError
  • -
  • UnsupportedEventTypeError
  • -
-

Failure Classification

- - - - - - - - - - - - - - - - - - - - - - - - - -
CategoryTypical exceptionsRetry?
Payload/shape issuesPyPayloadBuildError, FailedToDecodeProtoNo (fix input)
Dispatch/runtime issuesEventDispatchErrorSometimes
Configuration issuesUnsupportedBackend, UnsupportedEventTypeNo (fix config/code)
-

Strategy

-
    -
  1. Catch specific Tryx exception classes first.
  2. -
  3. Add contextual logs (chat_jid, message_id, handler name).
  4. -
  5. Use retry only for transient failures.
  6. -
  7. Avoid retry loops on structural payload errors.
  8. -
-

Namespace-aware Guidance

-
    -
  • Messaging and chat actions: validate target JID and payload before retry.
  • -
  • Group/community mutations: inspect per-participant response details.
  • -
  • Poll and media flows: persist context (poll_id, secrets, media metadata) before recovery attempts.
  • -
-

Pattern Example

-
try:
-    await client.send_text(chat, "ok")
-except PyPayloadBuildError as exc:
-    # payload construction issue
-    raise
-except EventDispatchError:
-    # callback dispatch layer issue
-    raise
-
-

Pattern Example With Classification

-
try:
-    await client.send_text(chat_jid, "ok")
-except PyPayloadBuildError:
-    # non-retryable
-    await client.send_text(chat_jid, "payload invalid")
-except EventDispatchError:
-    # retry envelope can be applied
-    await retry(lambda: client.send_text(chat_jid, "ok"), attempts=3)
-
-
-

Incident response

-

Always log message_id, chat_jid, handler name, and exception type for post-mortem analysis.

-
- - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/reference/glossary/index.html b/site/reference/glossary/index.html deleted file mode 100644 index 387a5cd..0000000 --- a/site/reference/glossary/index.html +++ /dev/null @@ -1,2151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Glossary - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - -

Glossary

-

JID

-

A WhatsApp identifier containing user and server segments.

-

LID

-

An alternate addressing identity used in some multi-device contexts.

-

Pairing

-

Initial account linking flow between runtime and WhatsApp account.

-

Sync Action

-

State update events propagated from server/app-state (mute, archive, delete, etc.).

-

EvMessage

-

Main incoming message event class.

-

MessageInfo

-

Metadata wrapper containing source, timestamps, message ID, and related flags.

-

Newsletter

-

Channel-like broadcast construct exposed through client.newsletter.

-

Dispatcher

-

Internal callback registry mapping event classes to Python functions.

-

WACore

-

Low-level protocol-oriented module exposing node/stanza structures.

-

Media Reupload

-

Workflow to refresh media retrieval paths for expired media references.

- - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/reference/roadmap/index.html b/site/reference/roadmap/index.html deleted file mode 100644 index 526ede6..0000000 --- a/site/reference/roadmap/index.html +++ /dev/null @@ -1,2049 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Roadmap - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
- - - - - - - - -

Roadmap

-

Near-Term

-
    -
  • stabilize event payload naming consistency
  • -
  • improve generated API tables from .pyi
  • -
  • expand tutorial coverage for production deployment patterns
  • -
-

Mid-Term

-
    -
  • automated documentation sync checks in CI
  • -
  • richer event filtering utilities
  • -
  • stronger integration examples (webhooks, queues, observability)
  • -
-

Long-Term

-
    -
  • deeper Rust-core technical docs site section
  • -
  • benchmark suite publication with reproducible scripts
  • -
  • formal migration guides per release series
  • -
-

Contribution Direction

-

If you are contributing docs, prioritize:

-
    -
  1. correctness over verbosity
  2. -
  3. runnable examples
  4. -
  5. operational troubleshooting content
  6. -
  7. explicit type signatures
  8. -
- - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/search/search_index.json b/site/search/search_index.json deleted file mode 100644 index f96e623..0000000 --- a/site/search/search_index.json +++ /dev/null @@ -1 +0,0 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Tryx Documentation","text":"Build WhatsApp Automations With Rust Speed and Python Ergonomics

Tryx combines a Rust runtime core with a typed Python API so you can ship robust bots, integrations, and event-driven workflows without sacrificing performance.

Async-first Typed stubs (.pyi) PyO3 bindings Event-driven architecture

Documentation Mode

This site is designed as a full path: setup -> architecture -> API namespaces -> tutorials -> production operations.

"},{"location":"#what-you-can-do","title":"What You Can Do","text":"Messaging

Send text, photo, audio, document, video, GIF, and sticker content with a clean Python API.

Realtime Events

Subscribe to rich event classes for messages, contact updates, sync actions, and lifecycle changes.

Namespace Clients

Use dedicated namespaces for contacts, groups, newsletter, status, privacy, polls, presence, and more.

Typed Development

Use complete Python stubs for editor intelligence, static checks, and better API discoverability.

"},{"location":"#choose-your-path","title":"Choose Your Path","text":"I am New
  1. Installation
  2. Quick Start
  3. Authentication Flow
  4. Client API Gateway
I am Building Features
  1. Client Namespaces
  2. Events API
  3. Types API
  4. Tutorials
I am Deploying
  1. Deployment Guide
  2. Reliability
  3. Troubleshooting
  4. Security
"},{"location":"#recommended-reading-path","title":"Recommended Reading Path","text":"
  1. Start with Installation.
  2. Follow Quick Start to build your first running bot.
  3. Understand pairing in Authentication Flow.
  4. Learn internals in Architecture and Event Model.
  5. Jump into Client API Gateway and namespace deep dives.
  6. Use Tutorials for implementation patterns.
  7. Use QnA and Troubleshooting when debugging.
  8. Finish with Deployment and Reliability before production.
"},{"location":"#project-scope","title":"Project Scope","text":"

This documentation set focuses on the Python SDK experience first:

  • Runtime setup and bot lifecycle
  • Event payload model and handler patterns
  • API reference for client/events/types/helpers/wacore
  • Performance, reliability, and security operations
  • Practical tutorials and real-world QnA

Rust-internal details remain visible where they directly affect Python usage and behavior.

"},{"location":"#quick-technical-index","title":"Quick Technical Index","text":"

Client Namespace Gateway

All namespace clients mapped with deep-dive pages.

Operational Readiness

Deployment, reliability, performance, security, and troubleshooting.

Typed Contracts

Shared value objects and type-first usage patterns.

QnA

Scenario-driven answers for practical problems.

"},{"location":"api/blocking/","title":"Blocking Namespace (client.blocking)","text":"

Manage blocklist lifecycle and block-state checks.

"},{"location":"api/blocking/#methods","title":"Methods","text":"Method Output Notes block(jid) None Block one user unblock(jid) None Remove block get_blocklist() list[BlocklistEntry] Includes timestamp metadata is_blocked(jid) bool Fast single-user check"},{"location":"api/blocking/#runnable-example-auto-quarantine","title":"Runnable Example: Auto-Quarantine","text":"
spam_hits: dict[str, int] = {}\nLIMIT = 5\n\n\n@bot.on(EvMessage)\nasync def anti_spam(client, event):\n    sender = event.data.message_info.source.sender\n    key = sender.user\n\n    spam_hits[key] = spam_hits.get(key, 0) + 1\n    if spam_hits[key] < LIMIT:\n        return\n\n    await client.blocking.block(sender)\n    await client.send_text(event.data.message_info.source.chat, \"User has been blocked\")\n    spam_hits.pop(key, None)\n
"},{"location":"api/blocking/#runnable-example-time-boxed-blocklist-cleanup","title":"Runnable Example: Time-boxed Blocklist Cleanup","text":"
from datetime import datetime, timedelta\n\n\nasync def cleanup_blocklist(client):\n    blocklist = await client.blocking.get_blocklist()\n    cutoff = datetime.utcnow() - timedelta(days=30)\n\n    for row in blocklist:\n        if row.timestamp is None:\n            continue\n        when = datetime.utcfromtimestamp(row.timestamp / 1000)\n        if when < cutoff:\n            await client.blocking.unblock(row.jid)\n

Identity checks

Pair is_blocked with BlockingHelpers.same_user(...) if you work with multiple server variants of the same user identity.

"},{"location":"api/blocking/#related-docs","title":"Related Docs","text":"
  • Helpers API
  • Privacy Namespace
  • Security Practices
"},{"location":"api/chat-actions/","title":"Chat Actions Namespace (client.chat_actions)","text":"

client.chat_actions manages chat state transitions and message-level actions (edit, revoke, react, star, archive, mute).

Why this namespace matters

Many WhatsApp state changes are synchronization events. If your bot writes chat state, subscribe to related events so your local view stays consistent.

"},{"location":"api/chat-actions/#builder-helpers","title":"Builder Helpers","text":""},{"location":"api/chat-actions/#build_message_keyid-remote_jid-from_me-participantnone","title":"build_message_key(id, remote_jid, from_me, participant=None)","text":"

Build a canonical MessageKey used by advanced sync actions.

"},{"location":"api/chat-actions/#build_message_rangelast_message_timestamp-last_system_message_timestamp-messages","title":"build_message_range(last_message_timestamp, last_system_message_timestamp, messages)","text":"

Build SyncActionMessageRange for operations that need explicit message windows.

"},{"location":"api/chat-actions/#method-groups","title":"Method Groups","text":"Chat LevelMessage Level
  • archive_chat(jid, message_range=None)
  • unarchive_chat(jid, message_range=None)
  • pin_chat(jid)
  • unpin_chat(jid)
  • mute_chat(jid)
  • mute_chat_until(jid, mute_end_timestamp_ms)
  • unmute_chat(jid)
  • mark_chat_as_read(jid, read, message_range=None)
  • delete_chat(jid, delete_media, message_range=None)
  • star_message(chat_jid, participant_jid, message_id, from_me)
  • unstar_message(chat_jid, participant_jid, message_id, from_me)
  • delete_message_for_me(chat_jid, participant_jid, message_id, from_me, delete_media, message_timestamp=None)
  • edit_message(chat_jid, original_id, new_message)
  • revoke_message(chat_jid, message_id, original_sender=None)
  • react_message(chat_jid, message_id, reaction, from_me=False, participant_jid=None)
"},{"location":"api/chat-actions/#runnable-example-moderation-utility","title":"Runnable Example: Moderation Utility","text":"
from tryx.events import EvMessage\n\n\n@bot.on(EvMessage)\nasync def moderation_actions(client, event):\n    text = (event.data.get_text() or \"\").strip()\n    chat = event.data.message_info.source.chat\n\n    if text == \"/pin\":\n        await client.chat_actions.pin_chat(chat)\n        await client.send_text(chat, \"Chat pinned\")\n    elif text == \"/unpin\":\n        await client.chat_actions.unpin_chat(chat)\n        await client.send_text(chat, \"Chat unpinned\")\n
"},{"location":"api/chat-actions/#runnable-example-react-revoke-flow","title":"Runnable Example: React + Revoke Flow","text":"
async def resolve_ticket(client, chat_jid, msg_id):\n    await client.chat_actions.react_message(chat_jid, msg_id, \"\u2705\")\n    # Optional follow-up: revoke a stale bot message\n    await client.chat_actions.revoke_message(chat_jid, msg_id)\n
"},{"location":"api/chat-actions/#operational-guidance","title":"Operational Guidance","text":"

Idempotent wrappers

Wrap mutation methods in idempotent helpers in case your handler retries after transient errors.

Message identity

For group messages, include participant identity when needed. Wrong (message_id, participant) combinations may lead to no-op operations.

"},{"location":"api/chat-actions/#related-docs","title":"Related Docs","text":"
  • Events API
  • Types API
  • Groups Namespace
"},{"location":"api/chatstate/","title":"Chatstate Namespace (client.chatstate)","text":"

Use chatstate signals to indicate user-facing activity such as typing or recording.

"},{"location":"api/chatstate/#methods","title":"Methods","text":"Method Purpose send(to, state) Send explicit ChatStateType send_composing(to) Typing indicator send_recording(to) Recording indicator send_paused(to) Pause/stop indicator"},{"location":"api/chatstate/#state-values","title":"State Values","text":"
  • ChatStateType.Composing
  • ChatStateType.Recording
  • ChatStateType.Paused
"},{"location":"api/chatstate/#runnable-example-latency-hiding-reply","title":"Runnable Example: Latency-Hiding Reply","text":"
@bot.on(EvMessage)\nasync def smart_reply(client, event):\n    chat = event.data.message_info.source.chat\n\n    await client.chatstate.send_composing(chat)\n    try:\n        answer = await expensive_lookup(event.data.get_text() or \"\")\n    finally:\n        await client.chatstate.send_paused(chat)\n\n    await client.send_text(chat, answer, quoted=event)\n
"},{"location":"api/chatstate/#runnable-example-voice-pipeline","title":"Runnable Example: Voice Pipeline","text":"
async def send_voice(client, chat, audio_bytes):\n    await client.chatstate.send_recording(chat)\n    await client.send_audio(chat, audio_bytes, ptt=True)\n    await client.chatstate.send_paused(chat)\n

Signal hygiene

If your handler crashes after sending composing/recording, the UX signal may look stale. Wrap long operations in try/finally and always send paused.

"},{"location":"api/chatstate/#related-docs","title":"Related Docs","text":"
  • Presence Namespace
  • Events API
  • Tutorial: Command Bot
"},{"location":"api/client/","title":"Client API Gateway","text":"

TryxClient is the runtime facade passed to every handler, and it exposes a root messaging surface plus 12 namespace clients.

How To Read This Section

  1. Start with this gateway page.
  2. Open the namespace page that matches your task.
  3. Jump to Events API for event contracts and Types API for enum/value-object constraints.
"},{"location":"api/client/#client-topology","title":"Client Topology","text":"
flowchart TD\n    A[TryxClient] --> B[Root send/download/upload methods]\n    A --> C[contact]\n    A --> D[chat_actions]\n    A --> E[community]\n    A --> F[newsletter]\n    A --> G[groups]\n    A --> H[status]\n    A --> I[chatstate]\n    A --> J[blocking]\n    A --> K[polls]\n    A --> L[presence]\n    A --> M[privacy]\n    A --> N[profile]\n
"},{"location":"api/client/#namespace-router","title":"Namespace Router","text":"

Contact Namespace

Find users, check registration state, and fetch profile pictures.

Chat Actions Namespace

Archive, pin, mute, read-state, edit/revoke/react operations.

Community Namespace

Create and manage communities with linked subgroups.

Newsletter Namespace

Join, manage, post, and read newsletter channels.

Groups Namespace

Group lifecycle, membership approval, and participant administration.

Status Namespace

Post/revoke statuses and manage status audience privacy.

Chatstate Namespace

Typing and recording state signaling.

Blocking Namespace

Blocklist management and identity checks.

Polls Namespace

Poll creation, encrypted vote operations, and tally aggregation.

Presence Namespace

Presence state updates and subscription controls.

Privacy Namespace

Privacy categories, values, and disallowed-list updates.

Profile Namespace

Push name, status text, and profile picture lifecycle.

"},{"location":"api/client/#root-transport-methods","title":"Root Transport Methods","text":"

These methods stay on TryxClient directly because they are cross-domain primitives.

Method Purpose Typical usage is_connected() -> bool Connection health check Guard before sends in long-running jobs download_media(message) -> bytes Download media blob from message proto media node Save image/audio/document payloads upload_file(path, media_type) -> UploadResponse Upload file path for later message/status usage Status media workflows upload(data, media_type) -> UploadResponse Upload in-memory bytes Transform pipelines send_message(to, message) -> SendResult Raw protobuf message send Advanced custom payloads send_text(...) -> SendResult Text helper Most command handlers send_photo(...) -> SendResult Image helper Bot replies with screenshots/posters send_document(...) -> SendResult File helper Reports, exports, invoices send_audio(...) -> SendResult Audio helper Voice notes / TTS send_video(...) -> SendResult Video helper Clips, demos send_gif(...) -> SendResult GIF helper Motion responses send_sticker(...) -> SendResult Sticker helper Lightweight reactions request_media_reupload(...) -> MediaReuploadResult Recover stale media references Retry failed media downloads

Reconnect-safe Pattern

Avoid caching TryxClient on global module state across runtime restarts. Always use the client object injected in the current handler call.

"},{"location":"api/client/#practical-flow-by-goal","title":"Practical Flow By Goal","text":"Message BotModeration BotBroadcast/Channel Bot

Use root send methods + chat_actions + chatstate.

  1. Parse incoming event.
  2. Signal typing with client.chatstate.send_composing(chat).
  3. Send reply with client.send_text(...).
  4. Optional message edit/revoke via client.chat_actions.

Use groups, blocking, privacy.

  1. Resolve sender via Types API.
  2. Apply participant actions (promote, remove, approve request).
  3. Enforce policy with blocklist/privacy settings.

Use status, newsletter, polls.

  1. Upload content or build text payload.
  2. Publish status/newsletter message.
  3. Track engagement using polls and reactions.
"},{"location":"api/client/#cross-references","title":"Cross-References","text":"
  • Event contracts: Events API
  • Shared value objects: Types API
  • Builders and utility helpers: Helpers API
  • End-to-end bot composition: Tutorial: Command Bot
"},{"location":"api/community/","title":"Community Namespace (client.community)","text":"

Use client.community to create and manage communities, link subgroups, and query topology details.

Data model

Community operations are graph-like: one parent community can own multiple linked groups with different participant sets.

"},{"location":"api/community/#method-matrix","title":"Method Matrix","text":"Method Purpose classify_group(metadata) Determine logical group type create(options) Create a community deactivate(community_jid) Deactivate community link_subgroups(community_jid, subgroup_jids) Attach existing groups unlink_subgroups(community_jid, subgroup_jids, remove_orphan_members) Detach linked groups get_subgroups(community_jid) List linked subgroup metadata get_subgroup_participant_counts(community_jid) Participant count by subgroup query_linked_group(community_jid, subgroup_jid) Query one linked subgroup join_subgroup(community_jid, subgroup_jid) Join a subgroup through community context get_linked_groups_participants(community_jid) Aggregate participants"},{"location":"api/community/#runnable-example-create-and-link","title":"Runnable Example: Create and Link","text":"
from tryx.client import CreateCommunityOptions\n\n\nasync def bootstrap_community(client, subgroup_jids):\n    options = CreateCommunityOptions(\n        name=\"Engineering Org\",\n        description=\"Platform and Product teams\",\n        closed=False,\n        allow_non_admin_sub_group_creation=False,\n        create_general_chat=True,\n    )\n\n    created = await client.community.create(options)\n    result = await client.community.link_subgroups(created.gid, subgroup_jids)\n    return created.gid, result.linked_jids, result.failed_groups\n
"},{"location":"api/community/#runnable-example-topology-audit","title":"Runnable Example: Topology Audit","text":"
async def audit_topology(client, community_jid):\n    groups = await client.community.get_subgroups(community_jid)\n    counts = await client.community.get_subgroup_participant_counts(community_jid)\n    by_jid = {jid.user: count for jid, count in counts}\n\n    report = []\n    for group in groups:\n        report.append(\n            {\n                \"id\": group.id.user,\n                \"subject\": group.subject,\n                \"participants\": by_jid.get(group.id.user, group.participant_count),\n                \"is_general\": group.is_general_chat,\n            }\n        )\n    return report\n

Link failures

LinkSubgroupsResult.failed_groups and UnlinkSubgroupsResult.failed_groups are first-class outcomes. Always inspect them and avoid assuming all subgroup operations succeeded.

"},{"location":"api/community/#related-docs","title":"Related Docs","text":"
  • Groups Namespace
  • Types API
  • Tutorial: Group Automation
"},{"location":"api/contact/","title":"Contact Namespace (client.contact)","text":"

Use this namespace for user discovery, registration checks, and profile picture metadata.

When to use this namespace

Use client.contact before sending high-value outbound messages so you can validate registration and enrich context.

"},{"location":"api/contact/#method-matrix","title":"Method Matrix","text":"Method Input Output Notes get_info(phones) list[str] (phone numbers) list[ContactInfo] Batch phone lookup get_user_info(jid) JID dict[JID, UserInfo] Rich user profile map get_profile_picture(jid, preview) JID, bool ProfilePicture Preview/full modes is_on_whatsapp(jids) list[JID] list[IsOnWhatsAppResult] Registration verification"},{"location":"api/contact/#technical-notes","title":"Technical Notes","text":"Input RulesOutput Semantics
  • Keep phone values normalized (E.164-style digits without separators where possible).
  • Use JID(user=\"<phone>\", server=\"s.whatsapp.net\") for direct identity checks.
  • Batch operations are better than one-by-one calls for throughput.
  • ContactInfo may include status and business flags.
  • UserInfo returns richer metadata and can include lid mappings.
  • ProfilePicture may contain URLs and identifier metadata; treat missing fields as valid state.
"},{"location":"api/contact/#runnable-example-registration-gate","title":"Runnable Example: Registration Gate","text":"
from tryx.events import EvMessage\nfrom tryx.types import JID\n\n\n@bot.on(EvMessage)\nasync def on_lookup(client, event):\n    text = (event.data.get_text() or \"\").strip()\n    if not text.startswith(\"/check \"):\n        return\n\n    phone = text.split(maxsplit=1)[1]\n    target = JID(user=phone, server=\"s.whatsapp.net\")\n\n    result = await client.contact.is_on_whatsapp([target])\n    row = result[0]\n\n    chat = event.data.message_info.source.chat\n    if row.is_registered:\n        await client.send_text(chat, f\"{phone} is registered\")\n    else:\n        await client.send_text(chat, f\"{phone} is not registered\")\n
"},{"location":"api/contact/#advanced-example-enrichment-before-outreach","title":"Advanced Example: Enrichment Before Outreach","text":"
async def enrich_contacts(client, phones: list[str]) -> dict[str, str]:\n    rows = await client.contact.get_info(phones)\n    out = {}\n    for row in rows:\n        kind = \"business\" if row.is_business else \"personal\"\n        out[row.jid.user] = f\"{kind} | status={row.status or '-'}\"\n    return out\n

Common Pitfalls

  • Do not assume every lookup returns a profile picture.
  • Avoid repeated single-item calls in loops; use batch methods.
  • Treat optional fields (status, picture_id, lid) as nullable.
"},{"location":"api/contact/#related-docs","title":"Related Docs","text":"
  • Types API
  • Profile Namespace
  • Tutorial: Command Bot
"},{"location":"api/events/","title":"Events API","text":"

This page maps event classes in tryx.events to practical handler strategies.

"},{"location":"api/events/#dispatcher-contract","title":"Dispatcher Contract","text":"

Dispatcher is used internally by Tryx and by @bot.on(EventClass) registration.

@bot.on(EvMessage)\nasync def on_message(client, event):\n    ...\n

Handler model

Keep handlers small, push expensive work into background tasks, and treat incoming event payloads as typed contracts.

"},{"location":"api/events/#event-taxonomy","title":"Event Taxonomy","text":""},{"location":"api/events/#lifecycle","title":"Lifecycle","text":"
  • EvConnected
  • EvDisconnected
  • EvLoggedOut
  • EvStreamReplaced
  • EvClientOutDated
"},{"location":"api/events/#pairing","title":"Pairing","text":"
  • EvPairingQrCode
  • EvPairingCode
  • EvPairSuccess
  • EvPairError
"},{"location":"api/events/#messaging","title":"Messaging","text":"
  • EvMessage
  • EvReceipt
  • EvUndecryptableMessage
  • EvNotification
"},{"location":"api/events/#sync-actions","title":"Sync Actions","text":"
  • EvPinUpdate
  • EvMuteUpdate
  • EvArchiveUpdate
  • EvMarkChatAsReadUpdate
  • EvDeleteChatUpdate
  • EvDeleteMessageForMeUpdate
  • EvStarUpdate
  • EvContactUpdate
"},{"location":"api/events/#contact-profile-presence","title":"Contact, Profile, Presence","text":"
  • EvPushNameUpdate
  • EvSelfPushNameUpdated
  • EvUserAboutUpdate
  • EvPictureUpdate
  • EvPresence
  • EvChatPresence
  • EvContactUpdated
  • EvContactNumberChanged
  • EvContactSyncRequested
"},{"location":"api/events/#device-and-business","title":"Device and Business","text":"
  • EvDeviceListUpdate
  • EvBusinessStatusUpdate
"},{"location":"api/events/#group-and-newsletter","title":"Group and Newsletter","text":"
  • EvJoinedGroup
  • EvGroupInfoUpdate
  • EvGroupUpdate
  • EvNewsletterLiveUpdate
"},{"location":"api/events/#event-to-namespace-mapping","title":"Event-to-Namespace Mapping","text":"Event family Namespace actions usually paired Messaging Chat Actions, Contact, root send methods Group updates Groups, Community Newsletter updates Newsletter, Polls Presence updates Presence, Chatstate Profile updates Profile, Privacy"},{"location":"api/events/#payload-discipline","title":"Payload Discipline","text":"RecommendedAvoid
  • Read typed fields from event.data.
  • Guard optional values (None) before usage.
  • Log identity metadata (chat_jid, sender, message_id) for observability.
  • Parsing raw protobuf bytes when typed fields already exist.
  • Long blocking work inside handler coroutine.
  • Assuming strict order between unrelated event classes.
"},{"location":"api/events/#example-safe-event-router","title":"Example: Safe Event Router","text":"
from tryx.events import EvMessage, EvPresence\n\n\n@bot.on(EvMessage)\nasync def on_message(client, event):\n    chat = event.data.message_info.source.chat\n    text = event.data.get_text() or \"\"\n    if text == \"/ping\":\n        await client.send_text(chat, \"pong\", quoted=event)\n\n\n@bot.on(EvPresence)\nasync def on_presence(client, event):\n    # keep side effects minimal; enqueue heavy processing\n    pass\n
"},{"location":"api/events/#enum-like-support-types","title":"Enum-like Support Types","text":"

Common reason/state classes used by event payloads:

  • TempBanReason
  • ReceiptType
  • UnavailableType
  • DecryptFailMode
  • ChatPresence, ChatPresenceMedia
  • DeviceListUpdateType
  • BusinessStatusUpdateType
  • GroupNotificationAction

Reliability

Treat sync events as convergence signals, not anomalies. They are expected in multi-device behavior.

"},{"location":"api/groups/","title":"Groups Namespace (client.groups)","text":"

client.groups covers group lifecycle, membership controls, invite flows, and moderation primitives.

Scope

Use this namespace for normal groups. For community-parent orchestration, pair this page with Community Namespace.

"},{"location":"api/groups/#method-families","title":"Method Families","text":"LifecycleMetadataParticipantsInvites
  • create_group(options)
  • leave(jid)
  • query_info(jid)
  • get_participating()
  • get_metadata(jid)
  • set_subject(jid, subject)
  • set_description(jid, description=None, prev=None)
  • set_locked(jid, locked)
  • set_announce(jid, announce)
  • set_ephemeral(jid, expiration)
  • set_member_add_mode(jid, mode)
  • set_membership_approval(jid, mode)
  • add_participants(jid, participants)
  • remove_participants(jid, participants)
  • promote_participants(jid, participants)
  • demote_participants(jid, participants)
  • get_membership_requests(jid)
  • approve_membership_requests(jid, participants)
  • reject_membership_requests(jid, participants)
  • get_invite_link(jid, reset)
  • join_with_invite_code(code)
  • join_with_invite_v4(group_jid, code, expiration, admin_jid)
  • get_invite_info(code)
"},{"location":"api/groups/#runnable-example-group-setup-playbook","title":"Runnable Example: Group Setup Playbook","text":"
from tryx.client import CreateGroupOptions, GroupParticipantOptions, MembershipApprovalMode\n\n\nasync def setup_group(client, title, member_jids):\n    participants = [GroupParticipantOptions(jid=jid) for jid in member_jids]\n    options = CreateGroupOptions(subject=title, participants=participants)\n\n    created = await client.groups.create_group(options)\n    gid = created.gid\n\n    await client.groups.set_announce(gid, True)\n    await client.groups.set_membership_approval(gid, MembershipApprovalMode.On)\n    await client.groups.set_ephemeral(gid, 604800)\n    return gid\n
"},{"location":"api/groups/#runnable-example-membership-queue-handler","title":"Runnable Example: Membership Queue Handler","text":"
async def process_requests(client, group_jid):\n    pending = await client.groups.get_membership_requests(group_jid)\n    if not pending:\n        return {\"approved\": 0, \"rejected\": 0}\n\n    approve = [row.jid for row in pending[:10]]\n    reject = [row.jid for row in pending[10:]]\n\n    await client.groups.approve_membership_requests(group_jid, approve)\n    if reject:\n        await client.groups.reject_membership_requests(group_jid, reject)\n\n    return {\"approved\": len(approve), \"rejected\": len(reject)}\n

Partial success is valid

Participant mutations can return per-user status via ParticipantChangeResponse. Always inspect each response item and do not treat list-returning calls as all-or-nothing.

"},{"location":"api/groups/#related-docs","title":"Related Docs","text":"
  • Community Namespace
  • Helpers API
  • Tutorial: Group Automation
"},{"location":"api/helpers/","title":"Helpers API","text":"

Helpers in tryx.helpers are stateless utility surfaces for builders, enum defaults, and payload conversion.

Design intent

Use helpers for deterministic object construction and conversion logic. Keep side effects in client namespace calls.

"},{"location":"api/helpers/#newsletterhelpers","title":"NewsletterHelpers","text":"Method Return parse_message(data) MessageProto serialize_message(message) bytes build_text_message(text) MessageProto
from tryx.helpers import NewsletterHelpers\n\nproto = NewsletterHelpers.build_text_message(\"Release update\")\nblob = NewsletterHelpers.serialize_message(proto)\nrestored = NewsletterHelpers.parse_message(blob)\n
"},{"location":"api/helpers/#groupshelpers","title":"GroupsHelpers","text":"Method Purpose strip_invite_url(code) Normalize invite URL/code build_participant(...) Build GroupParticipantOptions build_create_options(...) Build CreateGroupOptions
from tryx.helpers import GroupsHelpers\n\nparticipant = GroupsHelpers.build_participant(jid=target_jid)\nopts = GroupsHelpers.build_create_options(subject=\"Ops Room\", participants=[participant])\nresult = await client.groups.create_group(opts)\n
"},{"location":"api/helpers/#statushelpers","title":"StatusHelpers","text":"Method Return build_send_options(privacy=...) StatusSendOptions default_privacy() StatusPrivacySetting
from tryx.helpers import StatusHelpers\n\noptions = StatusHelpers.build_send_options()\nawait client.status.send_text(\"status\", 0xFF1F9D86, 1, recipients, options=options)\n
"},{"location":"api/helpers/#chatstatehelpers","title":"ChatstateHelpers","text":"Method Return composing() ChatStateType.Composing recording() ChatStateType.Recording paused() ChatStateType.Paused
from tryx.helpers import ChatstateHelpers\n\nawait client.chatstate.send(chat_jid, ChatstateHelpers.composing())\n
"},{"location":"api/helpers/#blockinghelpers","title":"BlockingHelpers","text":"Method Return same_user(a, b) bool
from tryx.helpers import BlockingHelpers\n\nif BlockingHelpers.same_user(a, b):\n    print(\"Equivalent identity\")\n
"},{"location":"api/helpers/#pollshelpers","title":"PollsHelpers","text":"Method Return decrypt_vote(...) list[bytes] aggregate_votes(...) list[PollOptionResult]
from tryx.helpers import PollsHelpers\n\ndecoded = PollsHelpers.decrypt_vote(enc_payload, enc_iv, secret, poll_id, creator_jid, voter_jid)\n
"},{"location":"api/helpers/#presencehelpers","title":"PresenceHelpers","text":"Method Return default_status() PresenceStatus
from tryx.helpers import PresenceHelpers\n\nawait client.presence.set(PresenceHelpers.default_status())\n
"},{"location":"api/helpers/#integration-map","title":"Integration Map","text":"Builder HeavyCrypto and PayloadSignal Defaults

Use helpers before calling: - Groups Namespace - Status Namespace

Use helpers with: - Polls Namespace - Newsletter Namespace

Use helpers with: - Chatstate Namespace - Presence Namespace

Avoid mixing concerns

Helpers should not replace runtime validation. Keep business rules in handler/service layers.

"},{"location":"api/newsletter/","title":"Newsletter Namespace (client.newsletter)","text":"

client.newsletter manages newsletter/channel discovery, join/leave, messaging, reactions, and message history.

"},{"location":"api/newsletter/#method-matrix","title":"Method Matrix","text":"Method Purpose list_subscribed() List subscriptions get_metadata(jid) Metadata by newsletter JID get_metadata_by_invite(invite_code) Metadata via invite code create(name, description=None) Create a newsletter join(jid) / leave(jid) Membership lifecycle update(jid, name=None, description=None) Edit metadata subscribe_live_updates(jid) Enable live updates stream send_message(jid, message) Publish message send_reaction(jid, server_id, reaction) React to a message get_messages(jid, count, before=None) Fetch history window"},{"location":"api/newsletter/#runnable-example-subscribe-and-post","title":"Runnable Example: Subscribe and Post","text":"
from tryx.helpers import NewsletterHelpers\n\n\nasync def post_update(client, invite_code: str, text: str):\n    metadata = await client.newsletter.get_metadata_by_invite(invite_code)\n    await client.newsletter.join(metadata.jid)\n\n    message = NewsletterHelpers.build_text_message(text)\n    server_message_id = await client.newsletter.send_message(metadata.jid, message)\n    return metadata.name, server_message_id\n
"},{"location":"api/newsletter/#runnable-example-history-query-window","title":"Runnable Example: History Query Window","text":"
async def pull_recent(client, newsletter_jid, count=20):\n    rows = await client.newsletter.get_messages(newsletter_jid, count)\n    return [\n        {\n            \"server_id\": row.server_id,\n            \"type\": row.message_type,\n            \"timestamp\": row.timestamp,\n        }\n        for row in rows\n    ]\n
"},{"location":"api/newsletter/#technical-guidance","title":"Technical Guidance","text":"PublishingHistory
  • Build protobuf messages using Helpers API when possible.
  • Keep content idempotent if handlers might retry.
  • Use before cursor for backfill pagination.
  • Treat message type variants as dynamic; not every row is plain text.

Live updates

Pair subscribe_live_updates with event handlers so your process can react to new newsletter activity without polling loops.

"},{"location":"api/newsletter/#related-docs","title":"Related Docs","text":"
  • Helpers API
  • Events API
  • Polls Namespace
"},{"location":"api/polls/","title":"Polls Namespace (client.polls)","text":"

client.polls supports encrypted poll workflows: create, vote, decrypt, and aggregate.

Crypto lifecycle

create(...) returns (poll_msg_id, message_secret). Persist both values if you plan to decrypt and aggregate votes later.

"},{"location":"api/polls/#method-matrix","title":"Method Matrix","text":"Method Purpose create(to, name, options, selectable_count) Create poll and return secret vote(chat_jid, poll_msg_id, poll_creator_jid, message_secret, option_names) Submit encrypted vote decrypt_vote(...) Decrypt one encrypted vote payload aggregate_votes(...) Compute per-option tally from encrypted vote rows"},{"location":"api/polls/#runnable-example-create-vote","title":"Runnable Example: Create + Vote","text":"
from tryx.types import JID\n\n\nasync def create_poll(client, chat: JID):\n    poll_id, secret = await client.polls.create(\n        to=chat,\n        name=\"Deploy window?\",\n        options=[\"Tonight\", \"Tomorrow\", \"Next week\"],\n        selectable_count=1,\n    )\n    return poll_id, secret\n\n\nasync def cast_vote(client, chat, poll_id, creator_jid, secret):\n    return await client.polls.vote(\n        chat_jid=chat,\n        poll_msg_id=poll_id,\n        poll_creator_jid=creator_jid,\n        message_secret=secret,\n        option_names=[\"Tomorrow\"],\n    )\n
"},{"location":"api/polls/#runnable-example-aggregate-encrypted-votes","title":"Runnable Example: Aggregate Encrypted Votes","text":"
from tryx.types import JID\n\n\nasync def tally(client, poll_options, encrypted_rows, secret, poll_id, creator_jid: JID):\n    # encrypted_rows: list[tuple[JID, bytes, bytes]]\n    return client.polls.aggregate_votes(\n        poll_options=poll_options,\n        votes=encrypted_rows,\n        message_secret=secret,\n        poll_msg_id=poll_id,\n        poll_creator_jid=creator_jid,\n    )\n
"},{"location":"api/polls/#pitfalls-and-controls","title":"Pitfalls and Controls","text":"

Secret management

If message_secret is lost, vote decryption and tallying are no longer possible for that poll.

Storage strategy

Store (poll_msg_id, message_secret) in durable backend storage keyed by chat and poll creator identity.

"},{"location":"api/polls/#related-docs","title":"Related Docs","text":"
  • Helpers API
  • Types API
  • Tutorial: Poll Survey Workflow
"},{"location":"api/presence/","title":"Presence Namespace (client.presence)","text":"

client.presence publishes your presence state and subscribes to contact presence updates.

"},{"location":"api/presence/#methods","title":"Methods","text":"Method Purpose set(status) Explicitly set PresenceStatus set_available() Shortcut to available set_unavailable() Shortcut to unavailable subscribe(jid) Subscribe to one user's presence unsubscribe(jid) Stop receiving presence updates"},{"location":"api/presence/#presence-status-values","title":"Presence Status Values","text":"
  • PresenceStatus.Available
  • PresenceStatus.Unavailable
"},{"location":"api/presence/#runnable-example-presence-monitoring","title":"Runnable Example: Presence Monitoring","text":"
from tryx.events import EvMessage\nfrom tryx.types import JID\n\n\n@bot.on(EvMessage)\nasync def monitor_presence(client, event):\n    text = (event.data.get_text() or \"\").strip()\n    chat = event.data.message_info.source.chat\n\n    if text.startswith(\"/presence watch \"):\n        phone = text.split(maxsplit=2)[2]\n        target = JID(user=phone, server=\"s.whatsapp.net\")\n        await client.presence.subscribe(target)\n        await client.send_text(chat, f\"Subscribed to {phone} presence\")\n    elif text.startswith(\"/presence unwatch \"):\n        phone = text.split(maxsplit=2)[2]\n        target = JID(user=phone, server=\"s.whatsapp.net\")\n        await client.presence.unsubscribe(target)\n        await client.send_text(chat, f\"Unsubscribed {phone}\")\n
"},{"location":"api/presence/#operational-guidance","title":"Operational Guidance","text":"StartupShutdown

Set your own baseline status explicitly on service start.

await client.presence.set_available()\n

Mark unavailable during graceful shutdown to reduce stale online state.

await client.presence.set_unavailable()\n

Subscription lifecycle

Reconnect flows can invalidate active subscriptions. Re-apply subscriptions after connection restoration.

"},{"location":"api/presence/#related-docs","title":"Related Docs","text":"
  • Events API
  • Chatstate Namespace
  • Security Practices
"},{"location":"api/privacy/","title":"Privacy Namespace (client.privacy)","text":"

Use client.privacy to read and mutate account privacy categories, disallowed lists, and default disappearing mode.

"},{"location":"api/privacy/#methods","title":"Methods","text":"Method Purpose fetch_settings() Retrieve privacy category/value pairs set_setting(category, value) Set one category privacy mode set_disallowed_list(category, update) Add/remove disallowed users set_default_disappearing_mode(duration_seconds) Set default disappearing timer"},{"location":"api/privacy/#core-enums","title":"Core Enums","text":""},{"location":"api/privacy/#privacycategory","title":"PrivacyCategory","text":"

Last, Online, Profile, Status, GroupAdd, ReadReceipts, CallAdd, Messages, DefenseMode, Other

"},{"location":"api/privacy/#privacyvalue","title":"PrivacyValue","text":"

All, Contacts, None_, ContactBlacklist, MatchLastSeen, Known, Off, OnStandard, Other

"},{"location":"api/privacy/#disallowedlistaction","title":"DisallowedListAction","text":"

Add, Remove

"},{"location":"api/privacy/#runnable-example-fetch-and-render","title":"Runnable Example: Fetch and Render","text":"
async def dump_privacy(client):\n    rows = await client.privacy.fetch_settings()\n    return {str(row.category): str(row.value) for row in rows}\n
"},{"location":"api/privacy/#runnable-example-category-disallowed-update","title":"Runnable Example: Category + Disallowed Update","text":"
from tryx.client import DisallowedListAction, DisallowedListUpdate, DisallowedListUserEntry\n\n\nasync def hide_status_from(client, target_jid):\n    await client.privacy.set_setting(category=PrivacyCategory.Status, value=PrivacyValue.ContactBlacklist)\n\n    update = DisallowedListUpdate(\n        dhash=\"\",\n        users=[\n            DisallowedListUserEntry(\n                action=DisallowedListAction.Add,\n                jid=target_jid,\n            )\n        ],\n    )\n    await client.privacy.set_disallowed_list(PrivacyCategory.Status, update)\n
"},{"location":"api/privacy/#runnable-example-default-disappearing-mode","title":"Runnable Example: Default Disappearing Mode","text":"
# 0 = off, 86400 = 1 day, 604800 = 1 week, 7776000 = 90 days\nawait client.privacy.set_default_disappearing_mode(604800)\n

Race-safe updates

Keep track of list versioning strategy (dhash) in your own domain logic when doing frequent disallowed-list writes.

Do not hardcode assumptions

Category/value compatibility can evolve. Validate behavior in staging before broad production rollout.

Advanced: dhash handling strategy

For high-frequency disallowed-list writes, keep the latest successful dhash per PrivacyCategory. If server-side conflict appears, refresh settings and retry once with an updated list snapshot.

"},{"location":"api/privacy/#related-docs","title":"Related Docs","text":"
  • Types API
  • Profile Namespace
  • Tutorial: Profile and Privacy
"},{"location":"api/profile/","title":"Profile Namespace (client.profile)","text":"

client.profile controls account-facing profile presentation.

"},{"location":"api/profile/#methods","title":"Methods","text":"Method Purpose set_push_name(name) Update display/push name set_status_text(text) Update profile status/about text set_profile_picture(image_data) Upload and set profile picture remove_profile_picture() Remove profile picture"},{"location":"api/profile/#runnable-example-admin-profile-commands","title":"Runnable Example: Admin Profile Commands","text":"
from tryx.events import EvMessage\n\n\n@bot.on(EvMessage)\nasync def profile_admin(client, event):\n    text = (event.data.get_text() or \"\").strip()\n    chat = event.data.message_info.source.chat\n\n    if text.startswith(\"/profile name \"):\n        value = text.split(maxsplit=2)[2]\n        await client.profile.set_push_name(value)\n        await client.send_text(chat, \"Push name updated\")\n\n    elif text.startswith(\"/profile status \"):\n        value = text.split(maxsplit=2)[2]\n        await client.profile.set_status_text(value)\n        await client.send_text(chat, \"Status text updated\")\n
"},{"location":"api/profile/#runnable-example-picture-rotation","title":"Runnable Example: Picture Rotation","text":"
async def rotate_profile_picture(client, image_bytes):\n    pic_id = await client.profile.set_profile_picture(image_bytes)\n    return {\"picture_id\": pic_id}\n
"},{"location":"api/profile/#operational-notes","title":"Operational Notes","text":"LifecycleSafety
  1. Read desired profile state from config.
  2. Apply updates during startup.
  3. Use explicit admin commands for runtime changes.
  • Keep raw image bytes validated and size-limited before upload.
  • Log profile mutations with operator identity.

Consistency

Couple profile changes with privacy policy reviews if your bot identity is user-facing.

"},{"location":"api/profile/#related-docs","title":"Related Docs","text":"
  • Privacy Namespace
  • Security Practices
  • Tutorial: Profile and Privacy
"},{"location":"api/status/","title":"Status Namespace (client.status)","text":"

Use client.status to publish ephemeral status content and control audience privacy.

"},{"location":"api/status/#core-types","title":"Core Types","text":"
  • StatusPrivacySetting: Contacts, AllowList, DenyList
  • StatusSendOptions(privacy=...)
"},{"location":"api/status/#method-matrix","title":"Method Matrix","text":"Method Purpose send_text(text, background_argb, font, recipients, options=None) Publish text status send_image(upload, thumbnail, recipients, caption=None, options=None) Publish image status send_video(upload, thumbnail, duration_seconds, recipients, caption=None, options=None) Publish video status send_raw(message, recipients, options=None) Publish custom raw message payload revoke(message_id, recipients, options=None) Revoke previously published status default_privacy() Default privacy helper"},{"location":"api/status/#runnable-example-text-status-broadcast","title":"Runnable Example: Text Status Broadcast","text":"
from tryx.client import StatusSendOptions, StatusPrivacySetting\n\n\nasync def publish_status(client, recipients, text):\n    options = StatusSendOptions(privacy=StatusPrivacySetting.Contacts)\n    message_id = await client.status.send_text(\n        text=text,\n        background_argb=0xFF1F9D86,\n        font=1,\n        recipients=recipients,\n        options=options,\n    )\n    return message_id\n
"},{"location":"api/status/#runnable-example-media-status","title":"Runnable Example: Media Status","text":"
from tryx.wacore import MediaType\n\n\nasync def publish_image_status(client, recipients, image_path, thumbnail_bytes):\n    upload = await client.upload_file(image_path, MediaType.Image)\n    return await client.status.send_image(\n        upload=upload,\n        thumbnail=thumbnail_bytes,\n        recipients=recipients,\n        caption=\"Weekly update\",\n    )\n

Privacy-first workflow

Fetch and enforce your privacy model before status publication, especially in mixed audiences.

"},{"location":"api/status/#related-docs","title":"Related Docs","text":"
  • Privacy Namespace
  • Helpers API
  • Tutorial: Media Workflows
"},{"location":"api/types/","title":"Types API","text":"

Core value objects in tryx.types define identity, message metadata, and result contracts used across client namespaces.

"},{"location":"api/types/#identity-and-source-types","title":"Identity and Source Types","text":""},{"location":"api/types/#jid","title":"JID","text":"

Canonical WhatsApp identifier:

  • user: account or group numeric/opaque id
  • server: domain segment (s.whatsapp.net, g.us, etc.)
"},{"location":"api/types/#messagesource","title":"MessageSource","text":"

Routing context for a message:

  • sender identity
  • target chat identity
  • from-me and group flags
  • alternate identity hints for multi-device routing
"},{"location":"api/types/#messageinfo","title":"MessageInfo","text":"

Message metadata envelope:

  • id
  • type
  • timestamp
  • source
  • edit and verification metadata
"},{"location":"api/types/#send-and-media-result-types","title":"Send and Media Result Types","text":"Type Produced by UploadResponse upload, upload_file SendResult send_* methods MediaReuploadResult request_media_reupload ProfilePicture client.contact.get_profile_picture"},{"location":"api/types/#advanced-metadata-types","title":"Advanced Metadata Types","text":"
  • MsgBotInfo
  • MsgMetaInfo
  • DeviceSentMeta

These are useful when building sync-aware systems and diagnostics.

"},{"location":"api/types/#practical-typed-patterns","title":"Practical Typed Patterns","text":"Event extractionResult-safe send
from tryx.events import EvMessage\nfrom tryx.types import JID\n\n\ndef source_chat(event: EvMessage) -> JID:\n    return event.data.message_info.source.chat\n
async def send_with_audit(client, chat, text):\n    result = await client.send_text(chat, text)\n    return {\"message_id\": result.id, \"ts\": result.timestamp}\n
"},{"location":"api/types/#privacy-type-bridge","title":"Privacy Type Bridge","text":"

Privacy and status workflows (documented in Privacy Namespace and Status Namespace) rely on typed enums from the client surface, including:

  • PrivacyCategory
  • PrivacyValue
  • DisallowedListAction
  • StatusPrivacySetting

Type-first architecture

Keep handler boundaries typed. Convert external payloads into typed objects early, and keep business logic free of ad-hoc dict parsing.

"},{"location":"api/wacore/","title":"WACore API","text":"

tryx.wacore exposes lower-level protocol-facing types.

"},{"location":"api/wacore/#mediatype","title":"MediaType","text":"

Enum for media upload/download classification.

"},{"location":"api/wacore/#node-tree-types","title":"Node Tree Types","text":"
  • NodeValue
  • NodeContent
  • Attrs
  • Node

These are useful for advanced debugging or when you need access to protocol node shape in events such as stream errors or notifications.

"},{"location":"api/wacore/#business-and-key-metadata","title":"Business and Key Metadata","text":"
  • KeyIndexInfo
  • BusinessSubscription

These appear in device/business sync event payloads.

"},{"location":"api/wacore/#when-to-use-wacore-types","title":"When to Use WACore Types","text":"

Use these types only when high-level client/event abstractions are not enough. For normal bot logic, prefer typed event payload objects and client namespace methods.

"},{"location":"core-concepts/architecture/","title":"Architecture","text":"

Tryx intentionally splits protocol-heavy runtime responsibilities and Python-facing ergonomics.

"},{"location":"core-concepts/architecture/#layered-design","title":"Layered Design","text":"

Tryx uses a two-layer model:

  1. Rust core layer
  2. Python API layer
"},{"location":"core-concepts/architecture/#rust-core-layer","title":"Rust Core Layer","text":"

The Rust side handles:

  • protocol parsing
  • transport/runtime state
  • heavy event transformations
  • media and protobuf conversions

Additional responsibilities:

  • connection lifecycle and stream state
  • event normalization and serialization boundaries
  • low-level protocol node handling
"},{"location":"core-concepts/architecture/#python-api-layer","title":"Python API Layer","text":"

The Python side provides:

  • ergonomic async API
  • namespace-based clients (contact, groups, privacy, etc.)
  • typed stubs for IDE and static analysis
  • callback registration via decorators

Additional responsibilities:

  • namespace-driven domain APIs (client.groups, client.privacy, etc.)
  • handler orchestration and business logic composition
  • integration with third-party systems (DB, queues, APIs)
"},{"location":"core-concepts/architecture/#why-this-design-works","title":"Why This Design Works","text":"
  • Performance-sensitive logic stays in Rust.
  • Product logic stays simple in Python.
  • Event payloads are structured classes, not ad-hoc dicts.
"},{"location":"core-concepts/architecture/#runtime-boundary-principle","title":"Runtime Boundary Principle","text":"

Tip

Keep protocol assumptions in Rust-backed typed models and keep product/business policy in Python handlers.

"},{"location":"core-concepts/architecture/#data-flow","title":"Data Flow","text":"
flowchart LR\n    A[WhatsApp Stream] --> B[Rust Runtime]\n    B --> C[Event Conversion]\n    C --> D[PyO3 Classes]\n    D --> E[Python Handler]\n    E --> F[TryxClient API Calls]\n    F --> B\n
"},{"location":"core-concepts/architecture/#module-map","title":"Module Map","text":"
  • src/lib.rs: submodule registration and class exports
  • src/clients/*: client methods exposed to Python
  • src/events/*: event classes and dispatcher
  • src/types.rs: shared data classes (JID, MessageInfo, etc.)
  • src/wacore/*: low-level node and stanza models
  • python/tryx/*.py: runtime re-export wrappers
  • python/tryx/*.pyi: typed API contracts
"},{"location":"core-concepts/architecture/#practical-implication","title":"Practical Implication","text":"

You can safely treat Python classes as stable contracts while trusting Rust internals for throughput and protocol-heavy work.

"},{"location":"core-concepts/architecture/#related-docs","title":"Related Docs","text":"
  • Event Model
  • Type System
  • Client API Gateway
"},{"location":"core-concepts/event-model/","title":"Event Model","text":"

Tryx emits typed event classes from tryx.events. Every event has a known payload shape.

"},{"location":"core-concepts/event-model/#dispatch-contract","title":"Dispatch Contract","text":"

Handlers are registered by event class and receive (client, event).

Note

Event flow is asynchronous and stateful. Design handlers for retries and replay-like conditions.

"},{"location":"core-concepts/event-model/#handler-registration","title":"Handler Registration","text":"
@bot.on(EvMessage)\nasync def on_message(client: TryxClient, event: EvMessage) -> None:\n    ...\n
"},{"location":"core-concepts/event-model/#event-categories","title":"Event Categories","text":"
  • Lifecycle: EvConnected, EvDisconnected, EvLoggedOut
  • Pairing: EvPairingQrCode, EvPairingCode, EvPairSuccess, EvPairError
  • Messaging: EvMessage, EvReceipt, EvUndecryptableMessage
  • Chat actions sync: archive, mute, mark-read, delete-chat, delete-for-me
  • Presence and profile: chat presence, availability, picture, push-name, about
  • Contact and device sync: contact update, device list update
  • Group and newsletter updates

For full taxonomy, see Events API.

"},{"location":"core-concepts/event-model/#event-payload-pattern","title":"Event Payload Pattern","text":"

Many events expose a lazy data property:

  • event.data returns a rich typed object
  • conversion from Rust internals happens on demand
  • repeated access often reuses cached object instances
"},{"location":"core-concepts/event-model/#important-reliability-notes","title":"Important Reliability Notes","text":"
  • Callback execution order is event-driven; do not assume strict timing between different event classes.
  • Keep handlers short and non-blocking.
  • For expensive work, queue to background tasks.

Ordering assumptions

Do not assume strict global ordering between all event types. Build idempotent handlers using message identifiers.

"},{"location":"core-concepts/event-model/#best-practices","title":"Best Practices","text":"
  1. Validate optional fields before use.
  2. Prefer exact event classes over broad dynamic checks.
  3. Log enough metadata (jid, message_id, timestamps) for debugging.
  4. Treat undecryptable and sync events as normal runtime states, not always errors.
"},{"location":"core-concepts/event-model/#event-to-action-mapping","title":"Event-to-Action Mapping","text":"Event Example Typical Namespace Follow-up EvMessage root send methods, Chat Actions EvGroupUpdate Groups, Community EvPresence Presence, Chatstate EvNewsletterLiveUpdate Newsletter, Polls"},{"location":"core-concepts/event-model/#related-docs","title":"Related Docs","text":"
  • Client API Gateway
  • Reliability
"},{"location":"core-concepts/type-system/","title":"Type System","text":"

Tryx ships with .pyi stubs and py.typed, enabling full editor and type-checker support.

Why this matters

Typed contracts make event handling safer, API discovery faster, and refactors less risky.

"},{"location":"core-concepts/type-system/#core-types","title":"Core Types","text":"
  • JID: canonical address object
  • MessageSource: message origin and routing context
  • MessageInfo: metadata for message identity and attributes
  • UploadResponse: media upload output
  • SendResult: send operation result
  • MediaReuploadResult: media retry result
  • ProfilePicture: profile picture metadata
"},{"location":"core-concepts/type-system/#event-types","title":"Event Types","text":"

Event classes define explicit payload contracts:

  • no guessing with nested dict keys
  • discoverable through IDE autocomplete
  • easier static checks in large projects
"},{"location":"core-concepts/type-system/#enum-heavy-domains","title":"Enum-heavy Domains","text":"

Key domains with enum-like constraints:

  • privacy and disallowed-list management
  • status audience control
  • chatstate and presence signaling
  • group/community policy modes
"},{"location":"core-concepts/type-system/#enum-style-classes","title":"Enum-Style Classes","text":"

Several Rust enums are exposed as Python classes with fixed attributes (for example status/privacy and event reason classes).

"},{"location":"core-concepts/type-system/#suggested-typing-workflow","title":"Suggested Typing Workflow","text":"
  1. Keep handler function signatures explicit.
  2. Annotate helper functions returning event-derived data.
  3. Run static analysis in CI (mypy or pyright).
"},{"location":"core-concepts/type-system/#type-boundary-pattern","title":"Type Boundary Pattern","text":"
from tryx.events import EvMessage\nfrom tryx.types import JID\n\n\ndef extract_sender(event: EvMessage) -> JID:\n    return event.data.message_info.source.sender\n

Then keep your service layer function signatures strictly typed as well.

"},{"location":"core-concepts/type-system/#example","title":"Example","text":"
from tryx.events import EvMessage\nfrom tryx.types import JID\n\n\ndef extract_chat(event: EvMessage) -> JID:\n    return event.data.message_info.source.chat\n
"},{"location":"core-concepts/type-system/#related-docs","title":"Related Docs","text":"
  • Types API
  • Privacy Namespace
  • Status Namespace
"},{"location":"faq/qna/","title":"QnA","text":"

Use this page for quick decisions, then jump to linked technical pages for implementation details.

"},{"location":"faq/qna/#general","title":"General","text":""},{"location":"faq/qna/#what-is-tryx","title":"What is Tryx?","text":"

Tryx is a Rust-powered Python SDK for event-driven WhatsApp automation.

"},{"location":"faq/qna/#why-not-pure-python","title":"Why not pure Python?","text":"

Rust handles protocol-heavy runtime work for better throughput and lower overhead, while Python keeps app logic easy to write.

"},{"location":"faq/qna/#is-tryx-synchronous-or-asynchronous","title":"Is Tryx synchronous or asynchronous?","text":"

Both: async-first (await bot.run()), plus blocking convenience (bot.run_blocking()).

See Quick Start.

"},{"location":"faq/qna/#pairing-and-session","title":"Pairing and Session","text":""},{"location":"faq/qna/#do-i-need-to-pair-every-time","title":"Do I need to pair every time?","text":"

No. If backend storage is preserved, session data is reused.

"},{"location":"faq/qna/#what-does-evstreamreplaced-mean","title":"What does EvStreamReplaced mean?","text":"

Another session replaced your active stream. Re-check device/session ownership.

"},{"location":"faq/qna/#what-should-i-do-on-evloggedout","title":"What should I do on EvLoggedOut?","text":"

Treat it as session invalidation. Re-pair and refresh persisted state.

See Authentication Flow.

"},{"location":"faq/qna/#event-handling","title":"Event Handling","text":""},{"location":"faq/qna/#can-i-register-multiple-handlers-for-one-event","title":"Can I register multiple handlers for one event?","text":"

Yes. Dispatcher stores callbacks per event class.

"},{"location":"faq/qna/#why-does-an-event-have-data-property-instead-of-direct-fields","title":"Why does an event have data property instead of direct fields?","text":"

Many event payloads are lazily materialized for efficiency.

"},{"location":"faq/qna/#should-i-process-heavy-logic-directly-in-handlers","title":"Should I process heavy logic directly in handlers?","text":"

Prefer short handlers that delegate expensive work to background tasks.

See Reliability and Performance.

"},{"location":"faq/qna/#messaging-and-media","title":"Messaging and Media","text":""},{"location":"faq/qna/#which-media-types-can-tryx-send","title":"Which media types can Tryx send?","text":"

Text, photo, document, audio, video, GIF, sticker, and protobuf-raw messages.

"},{"location":"faq/qna/#when-should-i-call-request_media_reupload","title":"When should I call request_media_reupload?","text":"

When media direct path is stale or unavailable and normal download fails.

"},{"location":"faq/qna/#can-i-quote-a-message-in-replies","title":"Can I quote a message in replies?","text":"

Yes, pass the original EvMessage to send helpers that support quoted.

See Media Workflows.

"},{"location":"faq/qna/#groups-and-privacy","title":"Groups and Privacy","text":""},{"location":"faq/qna/#can-i-automate-group-moderation","title":"Can I automate group moderation?","text":"

Yes, use client.groups.* and handle EvGroupUpdate for state feedback.

"},{"location":"faq/qna/#can-i-modify-privacy-settings","title":"Can I modify privacy settings?","text":"

Yes, use client.privacy.fetch_settings() and set_setting(...).

See Privacy Namespace and Profile and Privacy Tutorial.

"},{"location":"faq/qna/#deployment-and-operations","title":"Deployment and Operations","text":""},{"location":"faq/qna/#what-is-the-minimum-production-checklist","title":"What is the minimum production checklist?","text":"
  1. durable backend/session storage
  2. bounded retry strategy
  3. idempotent message processing
  4. basic security controls (admin-only commands, secret management)

See Deployment Guide.

"},{"location":"faq/qna/#how-do-i-troubleshoot-reconnect-loops-quickly","title":"How do I troubleshoot reconnect loops quickly?","text":"

Use the connection decision tree in Troubleshooting and verify single-writer backend ownership.

"},{"location":"faq/qna/#typing-and-tooling","title":"Typing and Tooling","text":""},{"location":"faq/qna/#are-stubs-complete","title":"Are stubs complete?","text":"

Tryx ships .pyi stubs for public modules including events and low-level wacore types.

"},{"location":"faq/qna/#can-i-use-mypy-or-pyright","title":"Can I use mypy or pyright?","text":"

Yes, the package includes py.typed for static analysis integration.

"},{"location":"faq/qna/#reliability","title":"Reliability","text":""},{"location":"faq/qna/#how-should-i-handle-temporary-bans","title":"How should I handle temporary bans?","text":"

Listen to EvTemporaryBan, pause high-frequency operations, and avoid aggressive retries.

"},{"location":"faq/qna/#how-can-i-make-my-bot-idempotent","title":"How can I make my bot idempotent?","text":"

Store processed message IDs and guard side effects before calling external systems.

See Reliability.

"},{"location":"faq/qna/#compatibility","title":"Compatibility","text":""},{"location":"faq/qna/#which-python-versions-are-supported","title":"Which Python versions are supported?","text":"

Python 3.8 and newer.

"},{"location":"faq/qna/#does-tryx-support-linuxmacoswindows","title":"Does Tryx support Linux/macOS/Windows?","text":"

Yes, with proper Rust toolchain and platform build dependencies.

"},{"location":"getting-started/authentication/","title":"Authentication Flow","text":"

Tryx follows the WhatsApp multi-device pairing flow. The first run links a session, and later runs reuse stored state.

Note

Authentication stability is mostly a storage and ownership problem. Treat backend/session files as critical runtime state.

"},{"location":"getting-started/authentication/#pairing-modes","title":"Pairing Modes","text":"
  • QR pairing event: EvPairingQrCode
  • Numeric pairing event: EvPairingCode
  • Success event: EvPairSuccess
  • Failure event: EvPairError
"},{"location":"getting-started/authentication/#typical-first-run-sequence","title":"Typical First-Run Sequence","text":"
  1. Start bot runtime.
  2. Wait for EvPairingQrCode or EvPairingCode.
  3. Complete pairing from your WhatsApp mobile app.
  4. Receive EvPairSuccess.
  5. Session credentials are persisted in your backend.
"},{"location":"getting-started/authentication/#event-level-interpretation","title":"Event-level Interpretation","text":"Event Meaning Operator action EvPairingQrCode QR challenge issued scan with mobile app EvPairingCode code-based pairing challenge enter code in paired device flow EvPairSuccess session linked and persisted continue normal operations EvPairError pairing rejected/failed inspect logs and retry pairing"},{"location":"getting-started/authentication/#persistence","title":"Persistence","text":"

Use a stable backend path:

from tryx.backend import SqliteBackend\n\nbackend = SqliteBackend(\"/srv/tryx/session.db\")\n

If the same backend path is reused, you usually do not need to pair again.

Single writer rule

Avoid multiple runtime instances writing to the same backend path unless you explicitly control ownership.

"},{"location":"getting-started/authentication/#operational-guidance","title":"Operational Guidance","text":"
  • Keep one active session owner for a backend path.
  • Avoid deleting backend files unless resetting account link is intentional.
  • Back up backend data before infrastructure migration.
"},{"location":"getting-started/authentication/#recovery-signals","title":"Recovery Signals","text":"
  • EvLoggedOut: account session is no longer valid.
  • EvStreamReplaced: another login/session replaced your current stream.
  • EvTemporaryBan: temporary restrictions detected; pause high-volume operations.
"},{"location":"getting-started/authentication/#recovery-playbook","title":"Recovery Playbook","text":"
  1. if EvLoggedOut: re-pair and rotate session artifacts.
  2. if EvStreamReplaced: check if another deployment is using the same account/backend.
  3. if temporary-ban signal: stop automation burst traffic and re-enable gradually.
"},{"location":"getting-started/authentication/#related-docs","title":"Related Docs","text":"
  • Deployment Guide
  • Troubleshooting
"},{"location":"getting-started/contributing/","title":"Contributing Guide","text":"

This page describes how to contribute to Tryx using the project standards for tooling, commits, and pull requests.

"},{"location":"getting-started/contributing/#local-setup","title":"Local Setup","text":"
uv sync --group dev --group docs\nuv run maturin develop\nuv run pre-commit install --hook-type pre-commit --hook-type commit-msg\n
"},{"location":"getting-started/contributing/#required-checks","title":"Required Checks","text":"
uv run --no-project --with ruff==0.11.4 ruff check .\nuv run --no-project --with ruff==0.11.4 ruff format --check .\nuv run python scripts/check_stub_parity.py\n
"},{"location":"getting-started/contributing/#commit-message-standard","title":"Commit Message Standard","text":"

Tryx uses Conventional Commits.

Pattern:

type(scope): summary\ntype(scope)!: summary\n

Scope is optional.

Allowed type: - feat - fix - perf - refactor - docs - test - build - ci - chore - style

Release impact: - feat -> minor bump - fix / perf -> patch bump - ! or BREAKING CHANGE: -> major bump

Examples: - feat(groups): add participant count helper - fix(profile): validate image bytes before upload - feat(status)!: change default privacy behavior

"},{"location":"getting-started/contributing/#pull-requests","title":"Pull Requests","text":"
  1. Use the PR template.
  2. Keep title in Conventional Commit format.
  3. Link relevant issue(s).
  4. Add tests/docs updates when behavior changes.
  5. Ensure CI is green before requesting review.
"},{"location":"getting-started/contributing/#issues","title":"Issues","text":"

Use issue templates for: - Bug reports - Feature requests

High-quality issues include: - clear reproduction steps - expected and actual results - logs or traceback snippets - OS / Python / Tryx version details

"},{"location":"getting-started/contributing/#additional-recommendations","title":"Additional Recommendations","text":"
  • Prefer squash merge for consistent release history.
  • Keep PR size under review-friendly scope.
  • Update docs and stubs together with API changes.
"},{"location":"getting-started/installation/","title":"Installation","text":"

This page sets up a local development environment for the Tryx Python bindings backed by Rust.

Recommended shell flow

Use uv to manage the project environment and dependencies consistently.

"},{"location":"getting-started/installation/#prerequisites","title":"Prerequisites","text":"
  • Python 3.8+
  • Rust toolchain (stable)
  • uv
"},{"location":"getting-started/installation/#environment-bootstrap","title":"Environment Bootstrap","text":"
uv sync --group dev\n
"},{"location":"getting-started/installation/#local-development-install","title":"Local Development Install","text":"
uv run maturin develop\n

This installs the Rust extension module into your active environment in editable mode.

Fast rebuild loop

Re-run uv run maturin develop after Rust binding changes to keep Python runtime artifacts in sync.

"},{"location":"getting-started/installation/#build-wheel","title":"Build Wheel","text":"
uv run maturin build --release\n

Typical wheel output appears under target/wheels/.

"},{"location":"getting-started/installation/#verify-installation","title":"Verify Installation","text":"
from tryx.client import Tryx, TryxClient\nfrom tryx.backend import SqliteBackend\n\nbackend = SqliteBackend(\"whatsapp.db\")\nbot = Tryx(backend)\nclient = bot.get_client()\nprint(type(client).__name__)\n

If output shows TryxClient, extension loading is successful.

"},{"location":"getting-started/installation/#optional-tools","title":"Optional Tools","text":"
  • uv run mypy ... or pyright for static type checks
  • uv run --no-project --with ruff==0.11.4 ruff check . for linting (no project build)
  • uv run pytest for integration test harnesses
  • uv run pre-commit run --all-files for local gate parity with CI
"},{"location":"getting-started/installation/#common-install-issues","title":"Common Install Issues","text":""},{"location":"getting-started/installation/#rust-compiler-not-found","title":"Rust compiler not found","text":"

Install Rust with rustup and reopen your shell.

"},{"location":"getting-started/installation/#build-fails-with-linker-errors","title":"Build fails with linker errors","text":"

Ensure your platform build tools are installed:

  • Linux: build-essential and OpenSSL dev headers
  • macOS: Xcode command line tools
  • Windows: MSVC Build Tools
"},{"location":"getting-started/installation/#importerror-for-extension-module","title":"ImportError for extension module","text":"

Re-run uv run maturin develop in the same project environment where you run Python.

"},{"location":"getting-started/installation/#next-step","title":"Next Step","text":"
  • Continue to Quick Start
  • Then configure pairing in Authentication Flow
"},{"location":"getting-started/quickstart/","title":"Quick Start","text":"

Build and run a minimal echo bot, then expand it safely.

Expected outcome

You should receive incoming text and reply with an echo message in the same chat.

"},{"location":"getting-started/quickstart/#minimal-bot","title":"Minimal Bot","text":"
import asyncio\n\nfrom tryx.backend import SqliteBackend\nfrom tryx.client import Tryx, TryxClient\nfrom tryx.events import EvMessage\nfrom tryx.waproto.whatsapp_pb2 import Message\n\nbackend = SqliteBackend(\"whatsapp.db\")\nbot = Tryx(backend)\n\n\n@bot.on(EvMessage)\nasync def on_message(client: TryxClient, event: EvMessage) -> None:\n    text = event.data.get_text() or \"<non-text>\"\n    chat = event.data.message_info.source.chat\n    await client.send_message(chat, Message(conversation=f\"Echo: {text}\"))\n\n\nasync def main() -> None:\n    await bot.run()\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n
"},{"location":"getting-started/quickstart/#how-it-works","title":"How It Works","text":"
  1. backend persists pairing/session state
  2. Tryx runtime wires event dispatcher
  3. @bot.on(EvMessage) registers handler
  4. TryxClient executes namespace/root API calls
"},{"location":"getting-started/quickstart/#runtime-flow","title":"Runtime Flow","text":"
  1. Create backend storage.
  2. Create Tryx bot instance.
  3. Register handlers with @bot.on(EventClass).
  4. Start runtime with await bot.run().
  5. Use TryxClient inside handlers for API calls.
"},{"location":"getting-started/quickstart/#first-production-hardening","title":"First Production Hardening","text":"ReliabilitySafetyPerformance
  • deduplicate with message id
  • bound retries for network operations
  • validate command input
  • keep admin-only commands restricted
  • keep handlers short
  • offload heavy work to worker queue
"},{"location":"getting-started/quickstart/#blocking-script-mode","title":"Blocking Script Mode","text":"

For quick scripts without manual event loop management:

from tryx.backend import SqliteBackend\nfrom tryx.client import Tryx\n\nbot = Tryx(SqliteBackend(\"whatsapp.db\"))\nbot.run_blocking()\n

Warning

run_blocking() is convenient for small scripts. Prefer explicit async runtime control for larger systems.

"},{"location":"getting-started/quickstart/#next-steps","title":"Next Steps","text":"
  • Read Authentication Flow to understand pairing and session persistence.
  • Explore Client API Gateway for all namespace methods.
  • Review Event Model before building complex logic.
  • Continue with Tutorial: Command Bot.
"},{"location":"operations/deployment/","title":"Deployment Guide","text":"

Deploy Tryx bots safely in production with stable session storage and predictable restarts.

"},{"location":"operations/deployment/#deployment-patterns","title":"Deployment Patterns","text":"Systemd ServiceContainer

Best for single-host deployments.

[Unit]\nDescription=Tryx Bot\nAfter=network.target\n\n[Service]\nWorkingDirectory=/srv/tryx\nEnvironment=PYTHONUNBUFFERED=1\nExecStart=/srv/tryx/.venv/bin/python bot.py\nRestart=always\nRestartSec=5\nUser=tryx\n\n[Install]\nWantedBy=multi-user.target\n

Best for reproducible runtime images.

FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim\n\nWORKDIR /app\nCOPY . .\nRUN uv sync --group dev\nRUN uv run maturin develop\n\nCMD [\"uv\", \"run\", \"python\", \"bot.py\"]\n
"},{"location":"operations/deployment/#session-persistence-requirements","title":"Session Persistence Requirements","text":"

Critical

Keep backend/session data on durable storage. Stateless containers without mounted volumes will force re-pairing.

  • Mount persistent volume for backend path.
  • Use single active writer per backend path.
  • Snapshot session data before upgrades.
Advanced: blue/green rollout note

During blue/green deploys, ensure only one color actively writes to the session backend. Dual-writer rollout against the same backend path can trigger stream replacement and churn.

"},{"location":"operations/deployment/#release-checklist","title":"Release Checklist","text":"
  1. Build in clean environment.
  2. Run smoke command path in staging account.
  3. Verify pairing/session reuse behavior.
  4. Confirm logs/metrics are emitted.
  5. Roll out with gradual traffic.
"},{"location":"operations/deployment/#related-docs","title":"Related Docs","text":"
  • Authentication Flow
  • Reliability
  • Troubleshooting
"},{"location":"operations/performance/","title":"Performance Guide","text":"

Optimize for predictable latency and stable memory under burst traffic.

"},{"location":"operations/performance/#handler-design-rules","title":"Handler Design Rules","text":"
  1. keep event handlers short and non-blocking
  2. offload heavy CPU to workers
  3. avoid synchronous I/O in async handler path

Target

Keep p95 handler latency low enough that user-facing replies remain responsive under burst load.

"},{"location":"operations/performance/#throughput-tactics","title":"Throughput Tactics","text":"ComputeI/OMedia
  • cache repeated lookup results
  • avoid repeated protobuf parsing for the same payload
  • batch outbound calls where safe
  • use bounded worker queues
  • stream large blobs to disk/object storage
  • avoid retaining many blobs in process memory
"},{"location":"operations/performance/#measurement-baseline","title":"Measurement Baseline","text":"

Track at minimum:

  • event receive timestamp
  • handler start/end timestamp
  • outbound API duration
  • queue depth (if queue used)
  • memory watermark
"},{"location":"operations/performance/#profiling-workflow","title":"Profiling Workflow","text":"
  1. capture trace under realistic traffic.
  2. identify top handler hotspots.
  3. optimize one hotspot at a time.
  4. rerun same workload and compare metrics.
"},{"location":"operations/performance/#capacity-planning-checklist","title":"Capacity Planning Checklist","text":"
  • message rate per minute
  • media download/upload volume
  • active callback concurrency
  • reconnect frequency

False optimization

Optimize after measuring. Guess-based micro-optimizations often increase complexity without improving bottlenecks.

"},{"location":"operations/performance/#related-docs","title":"Related Docs","text":"
  • Reliability
  • Media Workflows
  • Security Practices
"},{"location":"operations/reliability/","title":"Reliability Playbook","text":"

This page focuses on idempotency, retry strategy, and safe handler design.

"},{"location":"operations/reliability/#reliability-pillars","title":"Reliability Pillars","text":"Pillar Why Idempotency Prevent duplicate side effects Bounded retries Recover transient failures safely Queue delegation Keep event handlers responsive Structured logging Make incident triage fast"},{"location":"operations/reliability/#idempotency-pattern","title":"Idempotency Pattern","text":"
processed: set[str] = set()\n\n\n@bot.on(EvMessage)\nasync def reliable_handler(client, event):\n    msg_id = event.data.message_info.id\n    if msg_id in processed:\n        return\n    processed.add(msg_id)\n\n    await client.send_text(event.data.message_info.source.chat, \"processed\")\n
"},{"location":"operations/reliability/#retry-envelope","title":"Retry Envelope","text":"
async def retry(coro_factory, attempts=3):\n    last_exc = None\n    for _ in range(attempts):\n        try:\n            return await coro_factory()\n        except Exception as exc:\n            last_exc = exc\n    raise last_exc\n

Do not retry everything

Structural payload errors should fail fast. Reserve retries for network/transient failures.

"},{"location":"operations/reliability/#handler-throughput-pattern","title":"Handler Throughput Pattern","text":"
  • Parse and validate quickly in event handler.
  • Enqueue heavy work to background worker.
  • Acknowledge user quickly with minimal response.
"},{"location":"operations/reliability/#related-docs","title":"Related Docs","text":"
  • Command Bot Tutorial
  • Performance Guide
  • Error Handling
"},{"location":"operations/security/","title":"Security Practices","text":"

Secure your bot around four risk zones: session state, operator controls, user input, and outbound behavior.

"},{"location":"operations/security/#threat-model-snapshot","title":"Threat Model Snapshot","text":"Surface Risk Session backend session hijack or forced re-pair Command handlers privilege escalation Media pipelines payload abuse / resource exhaustion Outbound messaging spam behavior and account penalties"},{"location":"operations/security/#session-data-protection","title":"Session Data Protection","text":"
  • keep backend storage on protected, durable media
  • restrict filesystem ACLs to runtime user only
  • encrypt backups and protect backup key material

Do not expose backend files

Session artifacts are sensitive. Anyone with unrestricted access may impersonate the runtime.

"},{"location":"operations/security/#credential-and-token-hygiene","title":"Credential and Token Hygiene","text":"
  • never hardcode secrets in source
  • load via environment or secret manager
  • rotate integration credentials periodically
"},{"location":"operations/security/#abuse-and-ban-risk-reduction","title":"Abuse and Ban Risk Reduction","text":"
  • avoid repetitive high-frequency outbound sends
  • enforce explicit user intent for auto-responses
  • add anti-loop guardrails for bot-to-bot conversations
"},{"location":"operations/security/#input-validation","title":"Input Validation","text":"
  • treat inbound message text and media metadata as untrusted
  • validate command argument shape and length
  • validate media type and size before decode/store
"},{"location":"operations/security/#logging-and-audit-safety","title":"Logging and Audit Safety","text":"
  • redact sensitive message content by default
  • log structured metadata instead of raw payload where possible
  • split production audit logs from verbose debug traces
"},{"location":"operations/security/#security-checklist-before-release","title":"Security Checklist Before Release","text":"
  1. admin-only commands protected by allowlist
  2. session backend path not world-readable
  3. retry loops bounded and monitored
  4. logs reviewed for accidental secrets
"},{"location":"operations/security/#related-docs","title":"Related Docs","text":"
  • Deployment Guide
  • Reliability
  • Privacy Namespace
"},{"location":"operations/troubleshooting/","title":"Troubleshooting","text":"

Use this page as a decision tree first, checklist second.

"},{"location":"operations/troubleshooting/#connection-decision-tree","title":"Connection Decision Tree","text":"
flowchart TD\n    A[Bot cannot connect] --> B{Network reachable?}\n    B -- No --> B1[Fix outbound network/DNS/TLS]\n    B -- Yes --> C{Backend path writable?}\n    C -- No --> C1[Fix storage permissions]\n    C -- Yes --> D{Pairing still valid?}\n    D -- No --> D1[Re-pair account]\n    D -- Yes --> E[Inspect EvConnectFailure / EvStreamError payload]\n

Always check first

  1. outbound network
  2. backend storage write access
  3. session validity
"},{"location":"operations/troubleshooting/#frequent-reconnects","title":"Frequent Reconnects","text":"

Possible causes:

  • unstable network
  • another active session replacing stream (EvStreamReplaced)
  • backend corruption or stale state
"},{"location":"operations/troubleshooting/#action-path","title":"Action Path","text":"
  1. log reconnect timestamp and reason event
  2. verify if replacement is expected (another device/session)
  3. isolate backend path ownership to single runtime instance
"},{"location":"operations/troubleshooting/#message-send-fails","title":"Message Send Fails","text":""},{"location":"operations/troubleshooting/#fast-checklist","title":"Fast Checklist","text":"
  • validate JID target format
  • ensure client.is_connected() is true
  • verify protobuf payload shape if using send_message
  • classify exception (PyPayloadBuildError vs EventDispatchError)
try:\n    await client.send_text(chat_jid, \"hello\")\nexcept PyPayloadBuildError:\n    # payload/content issue\n    ...\nexcept EventDispatchError:\n    # dispatch/runtime issue\n    ...\n
"},{"location":"operations/troubleshooting/#media-download-fails","title":"Media Download Fails","text":"
  1. verify media subtype object (image/video/audio/etc.)
  2. if direct path expired, call request_media_reupload(...)
  3. retry with bounded attempt count

Audit fields

Log message_id, chat_jid, and retry counter for every reupload attempt.

"},{"location":"operations/troubleshooting/#sync-events-are-confusing","title":"Sync Events Are Confusing","text":"

Sync events are normal in multi-device behavior.

Treat EvArchiveUpdate, EvMarkChatAsReadUpdate, and EvDeleteChatUpdate as state convergence signals.

"},{"location":"operations/troubleshooting/#escalation-path","title":"Escalation Path","text":"

If issue persists:

  1. capture event type + metadata snapshot
  2. capture backend health and storage checks
  3. reduce to minimal reproducible handler
  4. compare against QnA and Error Handling
"},{"location":"reference/changelog/","title":"Changelog Policy","text":"

Tryx changelog is generated automatically with python-semantic-release.

Generated file: CHANGELOG.md

Do not edit generated release sections manually.

"},{"location":"reference/changelog/#source-of-truth","title":"Source of Truth","text":"
  • Conventional Commit messages from merged history on main
  • Semantic version tags in format vX.Y.Z
"},{"location":"reference/changelog/#version-bump-rules","title":"Version Bump Rules","text":"
  • feat -> minor bump
  • fix and perf -> patch bump
  • ! or BREAKING CHANGE: footer -> major bump

Commits outside release types (docs, chore, ci, etc.) are still tracked in git history but do not necessarily trigger a release.

"},{"location":"reference/changelog/#minimum-entry-rules","title":"Minimum Entry Rules","text":"

Each release entry should include:

  1. user-facing summary
  2. affected modules (client, events, types, etc.)
  3. migration notes if behavior changed
  4. compatibility impact (if any)

The release workflow produces these sections from commit metadata.

"},{"location":"reference/changelog/#api-surface-notes","title":"API Surface Notes","text":"

Whenever a PyO3 class is added or removed:

  • update Rust add_class registration
  • update corresponding .pyi
  • update API reference docs
  • include change note in release entry
"},{"location":"reference/error-handling/","title":"Error Handling","text":"

Use exception classes and failure classification to decide whether to retry, fail fast, or trigger operator action.

"},{"location":"reference/error-handling/#exception-classes","title":"Exception Classes","text":"
  • FailedBuildBot
  • FailedToDecodeProto
  • EventDispatchError
  • PyPayloadBuildError
  • UnsupportedBackend
  • UnsupportedEventType

Backward-compatible aliases:

  • BuildBotError
  • UnsupportedBackendError
  • UnsupportedEventTypeError
"},{"location":"reference/error-handling/#failure-classification","title":"Failure Classification","text":"Category Typical exceptions Retry? Payload/shape issues PyPayloadBuildError, FailedToDecodeProto No (fix input) Dispatch/runtime issues EventDispatchError Sometimes Configuration issues UnsupportedBackend, UnsupportedEventType No (fix config/code)"},{"location":"reference/error-handling/#strategy","title":"Strategy","text":"
  1. Catch specific Tryx exception classes first.
  2. Add contextual logs (chat_jid, message_id, handler name).
  3. Use retry only for transient failures.
  4. Avoid retry loops on structural payload errors.
"},{"location":"reference/error-handling/#namespace-aware-guidance","title":"Namespace-aware Guidance","text":"
  • Messaging and chat actions: validate target JID and payload before retry.
  • Group/community mutations: inspect per-participant response details.
  • Poll and media flows: persist context (poll_id, secrets, media metadata) before recovery attempts.
"},{"location":"reference/error-handling/#pattern-example","title":"Pattern Example","text":"
try:\n    await client.send_text(chat, \"ok\")\nexcept PyPayloadBuildError as exc:\n    # payload construction issue\n    raise\nexcept EventDispatchError:\n    # callback dispatch layer issue\n    raise\n
"},{"location":"reference/error-handling/#pattern-example-with-classification","title":"Pattern Example With Classification","text":"
try:\n    await client.send_text(chat_jid, \"ok\")\nexcept PyPayloadBuildError:\n    # non-retryable\n    await client.send_text(chat_jid, \"payload invalid\")\nexcept EventDispatchError:\n    # retry envelope can be applied\n    await retry(lambda: client.send_text(chat_jid, \"ok\"), attempts=3)\n

Incident response

Always log message_id, chat_jid, handler name, and exception type for post-mortem analysis.

"},{"location":"reference/glossary/","title":"Glossary","text":""},{"location":"reference/glossary/#jid","title":"JID","text":"

A WhatsApp identifier containing user and server segments.

"},{"location":"reference/glossary/#lid","title":"LID","text":"

An alternate addressing identity used in some multi-device contexts.

"},{"location":"reference/glossary/#pairing","title":"Pairing","text":"

Initial account linking flow between runtime and WhatsApp account.

"},{"location":"reference/glossary/#sync-action","title":"Sync Action","text":"

State update events propagated from server/app-state (mute, archive, delete, etc.).

"},{"location":"reference/glossary/#evmessage","title":"EvMessage","text":"

Main incoming message event class.

"},{"location":"reference/glossary/#messageinfo","title":"MessageInfo","text":"

Metadata wrapper containing source, timestamps, message ID, and related flags.

"},{"location":"reference/glossary/#newsletter","title":"Newsletter","text":"

Channel-like broadcast construct exposed through client.newsletter.

"},{"location":"reference/glossary/#dispatcher","title":"Dispatcher","text":"

Internal callback registry mapping event classes to Python functions.

"},{"location":"reference/glossary/#wacore","title":"WACore","text":"

Low-level protocol-oriented module exposing node/stanza structures.

"},{"location":"reference/glossary/#media-reupload","title":"Media Reupload","text":"

Workflow to refresh media retrieval paths for expired media references.

"},{"location":"reference/roadmap/","title":"Roadmap","text":""},{"location":"reference/roadmap/#near-term","title":"Near-Term","text":"
  • stabilize event payload naming consistency
  • improve generated API tables from .pyi
  • expand tutorial coverage for production deployment patterns
"},{"location":"reference/roadmap/#mid-term","title":"Mid-Term","text":"
  • automated documentation sync checks in CI
  • richer event filtering utilities
  • stronger integration examples (webhooks, queues, observability)
"},{"location":"reference/roadmap/#long-term","title":"Long-Term","text":"
  • deeper Rust-core technical docs site section
  • benchmark suite publication with reproducible scripts
  • formal migration guides per release series
"},{"location":"reference/roadmap/#contribution-direction","title":"Contribution Direction","text":"

If you are contributing docs, prioritize:

  1. correctness over verbosity
  2. runnable examples
  3. operational troubleshooting content
  4. explicit type signatures
"},{"location":"tutorials/command-bot/","title":"Tutorial: Command Bot","text":"

Build a command-driven bot that stays maintainable as command count grows.

Outcome

At the end of this tutorial you will have: - clean command parser - command dispatch table - production-safe error handling and idempotency guard

"},{"location":"tutorials/command-bot/#level-1-basic-command-router","title":"Level 1: Basic Command Router","text":"
import asyncio\n\nfrom tryx.backend import SqliteBackend\nfrom tryx.client import Tryx, TryxClient\nfrom tryx.events import EvMessage\n\nbackend = SqliteBackend(\"whatsapp.db\")\nbot = Tryx(backend)\n\n\ndef normalize(text: str | None) -> str:\n    return (text or \"\").strip().lower()\n\n\n@bot.on(EvMessage)\nasync def on_message(client: TryxClient, event: EvMessage) -> None:\n    text = normalize(event.data.get_text())\n    chat = event.data.message_info.source.chat\n\n    if text == \"ping\":\n        await client.send_text(chat, \"pong\", quoted=event)\n    elif text == \"help\":\n        await client.send_text(chat, \"commands: ping, help\", quoted=event)\n\n\nasyncio.run(bot.run())\n
"},{"location":"tutorials/command-bot/#level-2-table-driven-commands","title":"Level 2: Table-driven Commands","text":"
from collections.abc import Awaitable, Callable\n\nCommandHandler = Callable[[TryxClient, EvMessage, list[str]], Awaitable[None]]\n\n\nasync def cmd_ping(client: TryxClient, event: EvMessage, args: list[str]) -> None:\n    chat = event.data.message_info.source.chat\n    await client.send_text(chat, \"pong\", quoted=event)\n\n\nasync def cmd_echo(client: TryxClient, event: EvMessage, args: list[str]) -> None:\n    chat = event.data.message_info.source.chat\n    await client.send_text(chat, \" \".join(args) or \"(empty)\", quoted=event)\n\n\nCOMMANDS: dict[str, CommandHandler] = {\n    \"ping\": cmd_ping,\n    \"echo\": cmd_echo,\n}\n\n\n@bot.on(EvMessage)\nasync def on_command(client: TryxClient, event: EvMessage) -> None:\n    text = (event.data.get_text() or \"\").strip()\n    if not text.startswith(\"/\"):\n        return\n\n    parts = text[1:].split()\n    name, args = parts[0].lower(), parts[1:]\n    fn = COMMANDS.get(name)\n    if fn is None:\n        await client.send_text(event.data.message_info.source.chat, f\"Unknown command: {name}\")\n        return\n    await fn(client, event, args)\n
"},{"location":"tutorials/command-bot/#level-3-production-pattern","title":"Level 3: Production Pattern","text":"ReliabilitySafetyUX
  • Add per-message idempotency key from event.data.message_info.id.
  • Separate command parsing from side effects.
  • Add structured logging (command, chat, message_id).
  • Use allowlist for admin-only commands.
  • Validate argument length/type before action.
  • Wrap outbound mutations with retry policy for transient failures.
  • Send client.chatstate.send_composing(chat) during slow command execution.
  • Return explicit error message for invalid command arguments.
"},{"location":"tutorials/command-bot/#production-example-idempotent-dispatch","title":"Production Example: Idempotent Dispatch","text":"
seen_ids: set[str] = set()\n\n\n@bot.on(EvMessage)\nasync def on_idempotent(client: TryxClient, event: EvMessage) -> None:\n    message_id = event.data.message_info.id\n    if message_id in seen_ids:\n        return\n    seen_ids.add(message_id)\n\n    # dispatch command here\n
Advanced: plugin command registry

For larger bots, store command handlers in module-level plugins and register them into a central command registry at startup. This keeps each command domain isolated and testable.

Memory growth

If you store processed IDs in memory, add TTL eviction or persist compact dedupe state.

"},{"location":"tutorials/command-bot/#where-to-go-next","title":"Where To Go Next","text":"
  • Chat Actions Namespace
  • Profile and Privacy Tutorial
  • Reliability Operations
"},{"location":"tutorials/group-automation/","title":"Tutorial: Group Automation","text":"

Automate full group lifecycle with safe participant governance.

"},{"location":"tutorials/group-automation/#common-workflows","title":"Common Workflows","text":"
  • create and configure group
  • manage participants (add/remove/promote/demote)
  • handle membership approvals
  • keep chat policy aligned (announce/locked/ephemeral)
"},{"location":"tutorials/group-automation/#basic-create-configure","title":"Basic: Create + Configure","text":"
from tryx.client import CreateGroupOptions, GroupParticipantOptions\n\n\nparticipants = [GroupParticipantOptions(jid=jid) for jid in initial_members]\noptions = CreateGroupOptions(subject=\"Engineering Room\", participants=participants)\ncreated = await client.groups.create_group(options)\n\nawait client.groups.set_subject(created.gid, \"Engineering Room\")\nawait client.groups.set_announce(created.gid, True)\nawait client.groups.set_locked(created.gid, True)\n
"},{"location":"tutorials/group-automation/#intermediate-membership-queue","title":"Intermediate: Membership Queue","text":"
pending = await client.groups.get_membership_requests(group_jid)\n\napprove = [row.jid for row in pending if row.jid.user in trusted_users]\nreject = [row.jid for row in pending if row.jid.user not in trusted_users]\n\nif approve:\n    await client.groups.approve_membership_requests(group_jid, approve)\nif reject:\n    await client.groups.reject_membership_requests(group_jid, reject)\n
"},{"location":"tutorials/group-automation/#production-state-reconciliation-loop","title":"Production: State Reconciliation Loop","text":"
async def reconcile_group(client, group_jid):\n    metadata = await client.groups.get_metadata(group_jid)\n\n    # enforce policy\n    if not metadata.is_announcement:\n        await client.groups.set_announce(group_jid, True)\n\n    if metadata.ephemeral_expiration != 604800:\n        await client.groups.set_ephemeral(group_jid, 604800)\n
"},{"location":"tutorials/group-automation/#operational-safety-rules","title":"Operational Safety Rules","text":"

Warning

Always verify the bot has required admin privileges before participant mutation.

Tip

Write audit logs for every moderator action: actor, target group, participant, action, timestamp.

"},{"location":"tutorials/group-automation/#related-docs","title":"Related Docs","text":"
  • Groups Namespace
  • Community Namespace
  • Troubleshooting
"},{"location":"tutorials/media-workflows/","title":"Tutorial: Media Workflows","text":"

This tutorial covers send, download, and recovery flows for media-heavy bots.

"},{"location":"tutorials/media-workflows/#step-1-upload-and-send","title":"Step 1: Upload and Send","text":"
from tryx.wacore import MediaType\n\nupload = await client.upload_file(\"image.jpg\", MediaType.Image)\nawait client.send_photo(chat_jid, photo_data=image_bytes, caption=\"report\")\n

Tip

Use upload_file when media already exists on disk. Use upload for in-memory transformed bytes.

"},{"location":"tutorials/media-workflows/#step-2-download-media","title":"Step 2: Download Media","text":"
if message := event.data.raw_proto:\n    if message.image_message:\n        blob = await client.download_media(message.image_message)\n        with open(\"downloaded.jpg\", \"wb\") as fp:\n            fp.write(blob)\n
"},{"location":"tutorials/media-workflows/#step-3-reupload-recovery","title":"Step 3: Reupload Recovery","text":"

When direct media path is stale:

  1. collect metadata: message_id, chat_jid, media_key, optional participant
  2. call request_media_reupload(...)
  3. retry download
result = await client.request_media_reupload(\n    message_id=message_id,\n    chat_jid=chat_jid,\n    media_key=media_key,\n    is_from_me=False,\n    participant=participant_jid,\n)\n
"},{"location":"tutorials/media-workflows/#step-4-production-safe-retry-pattern","title":"Step 4: Production-safe Retry Pattern","text":"
async def download_with_retry(client, media_node, retries=3):\n    last_exc = None\n    for _ in range(retries):\n        try:\n            return await client.download_media(media_node)\n        except Exception as exc:\n            last_exc = exc\n    raise last_exc\n
"},{"location":"tutorials/media-workflows/#checklist","title":"Checklist","text":"CorrectnessPerformanceObservability
  • validate media subtype before download
  • preserve original metadata for retry
  • stream large blobs to disk/object storage
  • avoid storing many large payloads in memory simultaneously
  • log message id, chat id, payload size, and retry count
"},{"location":"tutorials/media-workflows/#related-docs","title":"Related Docs","text":"
  • WACore API
  • Poll Survey Tutorial
  • Performance Operations
"},{"location":"tutorials/poll-survey/","title":"Tutorial: Poll Survey Workflow","text":"

Create poll surveys, collect encrypted votes, and aggregate results.

"},{"location":"tutorials/poll-survey/#step-1-create-poll","title":"Step 1: Create Poll","text":"
poll_id, secret = await client.polls.create(\n    to=chat_jid,\n    name=\"Deploy this week?\",\n    options=[\"Yes\", \"No\"],\n    selectable_count=1,\n)\n

Store poll_id and secret in persistent storage.

Warning

Without secret, encrypted vote payloads cannot be decrypted later.

"},{"location":"tutorials/poll-survey/#step-2-cast-vote","title":"Step 2: Cast Vote","text":"
await client.polls.vote(\n    chat_jid=chat_jid,\n    poll_msg_id=poll_id,\n    poll_creator_jid=creator_jid,\n    message_secret=secret,\n    option_names=[\"Yes\"],\n)\n
"},{"location":"tutorials/poll-survey/#step-3-aggregate-vote-rows","title":"Step 3: Aggregate Vote Rows","text":"
# encrypted_rows: list[tuple[JID, bytes, bytes]]\nresults = client.polls.aggregate_votes(\n    poll_options=[\"Yes\", \"No\"],\n    votes=encrypted_rows,\n    message_secret=secret,\n    poll_msg_id=poll_id,\n    poll_creator_jid=creator_jid,\n)\n
"},{"location":"tutorials/poll-survey/#display-results","title":"Display Results","text":"
lines = [f\"{row.name}: {len(row.voters)}\" for row in results]\nawait client.send_text(chat_jid, \"\\n\".join(lines))\n
"},{"location":"tutorials/poll-survey/#production-checklist","title":"Production Checklist","text":"
  • Persist poll metadata (poll_id, secret, creator identity).
  • Validate option names before vote submission.
  • Keep vote aggregation idempotent.
  • Record processing checkpoint to avoid duplicate tally updates.
"},{"location":"tutorials/poll-survey/#related-docs","title":"Related Docs","text":"
  • Polls Namespace
  • Helpers API
  • Reliability
"},{"location":"tutorials/profile-privacy/","title":"Tutorial: Profile and Privacy","text":"

Build admin-controlled profile and privacy management commands.

Use case

This pattern is useful for multi-operator bots that need strict control over account identity and visibility rules.

"},{"location":"tutorials/profile-privacy/#step-1-profile-commands","title":"Step 1: Profile Commands","text":"
from tryx.events import EvMessage\n\nADMIN = \"1234567890\"\n\n\n@bot.on(EvMessage)\nasync def profile_commands(client, event):\n    sender = event.data.message_info.source.sender.user\n    if sender != ADMIN:\n        return\n\n    text = (event.data.get_text() or \"\").strip()\n    chat = event.data.message_info.source.chat\n\n    if text.startswith(\"/profile name \"):\n        await client.profile.set_push_name(text.split(maxsplit=2)[2])\n        await client.send_text(chat, \"Name updated\")\n\n    elif text.startswith(\"/profile status \"):\n        await client.profile.set_status_text(text.split(maxsplit=2)[2])\n        await client.send_text(chat, \"Status updated\")\n
"},{"location":"tutorials/profile-privacy/#step-2-privacy-category-commands","title":"Step 2: Privacy Category Commands","text":"
from tryx.client import PrivacyCategory, PrivacyValue\n\n\n@bot.on(EvMessage)\nasync def privacy_commands(client, event):\n    text = (event.data.get_text() or \"\").strip()\n    chat = event.data.message_info.source.chat\n\n    if text == \"/privacy list\":\n        rows = await client.privacy.fetch_settings()\n        lines = [f\"{row.category}: {row.value}\" for row in rows]\n        await client.send_text(chat, \"\\n\".join(lines))\n\n    elif text == \"/privacy status contacts\":\n        await client.privacy.set_setting(PrivacyCategory.Status, PrivacyValue.Contacts)\n        await client.send_text(chat, \"Status visibility set to contacts\")\n
"},{"location":"tutorials/profile-privacy/#step-3-disallowed-list-example","title":"Step 3: Disallowed List Example","text":"
from tryx.client import DisallowedListAction, DisallowedListUpdate, DisallowedListUserEntry\n\n\nasync def block_visibility_for(client, target_jid):\n    update = DisallowedListUpdate(\n        dhash=\"\",\n        users=[DisallowedListUserEntry(action=DisallowedListAction.Add, jid=target_jid)],\n    )\n    await client.privacy.set_disallowed_list(PrivacyCategory.Status, update)\n
"},{"location":"tutorials/profile-privacy/#operational-guidance","title":"Operational Guidance","text":"GovernanceSafety
  • Keep profile/privacy commands admin-only.
  • Log every policy change.
  • Validate category/value command input before applying.
  • Rate-limit mutation commands.
"},{"location":"tutorials/profile-privacy/#related-docs","title":"Related Docs","text":"
  • Privacy Namespace
  • Profile Namespace
  • Security Practices
"}]} \ No newline at end of file diff --git a/site/sitemap.xml b/site/sitemap.xml deleted file mode 100644 index 0f8724e..0000000 --- a/site/sitemap.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/site/sitemap.xml.gz b/site/sitemap.xml.gz deleted file mode 100644 index 734652164ddd6f92a20e0e10875b7b0280988bf9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 127 zcmV-_0D%7=iwFpi{mW?r|8r?{Wo=<_E_iKh04<9_3V)_WXo8&M?ytk3HC}0~zlG)Vu - - - - - - - - - - - - - - - - - - - - - - - - - Command Bot - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Tutorial: Command Bot

-

Build a command-driven bot that stays maintainable as command count grows.

-
-

Outcome

-

At the end of this tutorial you will have: -- clean command parser -- command dispatch table -- production-safe error handling and idempotency guard

-
-

Level 1: Basic Command Router

-
import asyncio
-
-from tryx.backend import SqliteBackend
-from tryx.client import Tryx, TryxClient
-from tryx.events import EvMessage
-
-backend = SqliteBackend("whatsapp.db")
-bot = Tryx(backend)
-
-
-def normalize(text: str | None) -> str:
-    return (text or "").strip().lower()
-
-
-@bot.on(EvMessage)
-async def on_message(client: TryxClient, event: EvMessage) -> None:
-    text = normalize(event.data.get_text())
-    chat = event.data.message_info.source.chat
-
-    if text == "ping":
-        await client.send_text(chat, "pong", quoted=event)
-    elif text == "help":
-        await client.send_text(chat, "commands: ping, help", quoted=event)
-
-
-asyncio.run(bot.run())
-
-

Level 2: Table-driven Commands

-
from collections.abc import Awaitable, Callable
-
-CommandHandler = Callable[[TryxClient, EvMessage, list[str]], Awaitable[None]]
-
-
-async def cmd_ping(client: TryxClient, event: EvMessage, args: list[str]) -> None:
-    chat = event.data.message_info.source.chat
-    await client.send_text(chat, "pong", quoted=event)
-
-
-async def cmd_echo(client: TryxClient, event: EvMessage, args: list[str]) -> None:
-    chat = event.data.message_info.source.chat
-    await client.send_text(chat, " ".join(args) or "(empty)", quoted=event)
-
-
-COMMANDS: dict[str, CommandHandler] = {
-    "ping": cmd_ping,
-    "echo": cmd_echo,
-}
-
-
-@bot.on(EvMessage)
-async def on_command(client: TryxClient, event: EvMessage) -> None:
-    text = (event.data.get_text() or "").strip()
-    if not text.startswith("/"):
-        return
-
-    parts = text[1:].split()
-    name, args = parts[0].lower(), parts[1:]
-    fn = COMMANDS.get(name)
-    if fn is None:
-        await client.send_text(event.data.message_info.source.chat, f"Unknown command: {name}")
-        return
-    await fn(client, event, args)
-
-

Level 3: Production Pattern

-
-
-
-
    -
  • Add per-message idempotency key from event.data.message_info.id.
  • -
  • Separate command parsing from side effects.
  • -
  • Add structured logging (command, chat, message_id).
  • -
-
-
-
    -
  • Use allowlist for admin-only commands.
  • -
  • Validate argument length/type before action.
  • -
  • Wrap outbound mutations with retry policy for transient failures.
  • -
-
-
-
    -
  • Send client.chatstate.send_composing(chat) during slow command execution.
  • -
  • Return explicit error message for invalid command arguments.
  • -
-
-
-
-

Production Example: Idempotent Dispatch

-
seen_ids: set[str] = set()
-
-
-@bot.on(EvMessage)
-async def on_idempotent(client: TryxClient, event: EvMessage) -> None:
-    message_id = event.data.message_info.id
-    if message_id in seen_ids:
-        return
-    seen_ids.add(message_id)
-
-    # dispatch command here
-
-
-Advanced: plugin command registry -

For larger bots, store command handlers in module-level plugins and register them into a central command registry at startup. -This keeps each command domain isolated and testable.

-
-
-

Memory growth

-

If you store processed IDs in memory, add TTL eviction or persist compact dedupe state.

-
-

Where To Go Next

- - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/tutorials/group-automation/index.html b/site/tutorials/group-automation/index.html deleted file mode 100644 index eebb84d..0000000 --- a/site/tutorials/group-automation/index.html +++ /dev/null @@ -1,2116 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Group Automation - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Tutorial: Group Automation

-

Automate full group lifecycle with safe participant governance.

-

Common Workflows

-
    -
  • create and configure group
  • -
  • manage participants (add/remove/promote/demote)
  • -
  • handle membership approvals
  • -
  • keep chat policy aligned (announce/locked/ephemeral)
  • -
-

Basic: Create + Configure

-
from tryx.client import CreateGroupOptions, GroupParticipantOptions
-
-
-participants = [GroupParticipantOptions(jid=jid) for jid in initial_members]
-options = CreateGroupOptions(subject="Engineering Room", participants=participants)
-created = await client.groups.create_group(options)
-
-await client.groups.set_subject(created.gid, "Engineering Room")
-await client.groups.set_announce(created.gid, True)
-await client.groups.set_locked(created.gid, True)
-
-

Intermediate: Membership Queue

-
pending = await client.groups.get_membership_requests(group_jid)
-
-approve = [row.jid for row in pending if row.jid.user in trusted_users]
-reject = [row.jid for row in pending if row.jid.user not in trusted_users]
-
-if approve:
-    await client.groups.approve_membership_requests(group_jid, approve)
-if reject:
-    await client.groups.reject_membership_requests(group_jid, reject)
-
-

Production: State Reconciliation Loop

-
async def reconcile_group(client, group_jid):
-    metadata = await client.groups.get_metadata(group_jid)
-
-    # enforce policy
-    if not metadata.is_announcement:
-        await client.groups.set_announce(group_jid, True)
-
-    if metadata.ephemeral_expiration != 604800:
-        await client.groups.set_ephemeral(group_jid, 604800)
-
-

Operational Safety Rules

-
-

Warning

-

Always verify the bot has required admin privileges before participant mutation.

-
-
-

Tip

-

Write audit logs for every moderator action: actor, target group, participant, action, timestamp.

-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/tutorials/media-workflows/index.html b/site/tutorials/media-workflows/index.html deleted file mode 100644 index 6541f73..0000000 --- a/site/tutorials/media-workflows/index.html +++ /dev/null @@ -1,2130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Media Workflows - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Tutorial: Media Workflows

-

This tutorial covers send, download, and recovery flows for media-heavy bots.

-

Step 1: Upload and Send

-
from tryx.wacore import MediaType
-
-upload = await client.upload_file("image.jpg", MediaType.Image)
-await client.send_photo(chat_jid, photo_data=image_bytes, caption="report")
-
-
-

Tip

-

Use upload_file when media already exists on disk. Use upload for in-memory transformed bytes.

-
-

Step 2: Download Media

-
if message := event.data.raw_proto:
-    if message.image_message:
-        blob = await client.download_media(message.image_message)
-        with open("downloaded.jpg", "wb") as fp:
-            fp.write(blob)
-
-

Step 3: Reupload Recovery

-

When direct media path is stale:

-
    -
  1. collect metadata: message_id, chat_jid, media_key, optional participant
  2. -
  3. call request_media_reupload(...)
  4. -
  5. retry download
  6. -
-
result = await client.request_media_reupload(
-    message_id=message_id,
-    chat_jid=chat_jid,
-    media_key=media_key,
-    is_from_me=False,
-    participant=participant_jid,
-)
-
-

Step 4: Production-safe Retry Pattern

-
async def download_with_retry(client, media_node, retries=3):
-    last_exc = None
-    for _ in range(retries):
-        try:
-            return await client.download_media(media_node)
-        except Exception as exc:
-            last_exc = exc
-    raise last_exc
-
-

Checklist

-
-
-
-
    -
  • validate media subtype before download
  • -
  • preserve original metadata for retry
  • -
-
-
-
    -
  • stream large blobs to disk/object storage
  • -
  • avoid storing many large payloads in memory simultaneously
  • -
-
-
-
    -
  • log message id, chat id, payload size, and retry count
  • -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/tutorials/poll-survey/index.html b/site/tutorials/poll-survey/index.html deleted file mode 100644 index 7bc8c73..0000000 --- a/site/tutorials/poll-survey/index.html +++ /dev/null @@ -1,2109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Poll Survey Workflow - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - -
- -
- - - -
-
- - - - - - - - -

Tutorial: Poll Survey Workflow

-

Create poll surveys, collect encrypted votes, and aggregate results.

-

Step 1: Create Poll

-
poll_id, secret = await client.polls.create(
-    to=chat_jid,
-    name="Deploy this week?",
-    options=["Yes", "No"],
-    selectable_count=1,
-)
-
-

Store poll_id and secret in persistent storage.

-
-

Warning

-

Without secret, encrypted vote payloads cannot be decrypted later.

-
-

Step 2: Cast Vote

-
await client.polls.vote(
-    chat_jid=chat_jid,
-    poll_msg_id=poll_id,
-    poll_creator_jid=creator_jid,
-    message_secret=secret,
-    option_names=["Yes"],
-)
-
-

Step 3: Aggregate Vote Rows

-
# encrypted_rows: list[tuple[JID, bytes, bytes]]
-results = client.polls.aggregate_votes(
-    poll_options=["Yes", "No"],
-    votes=encrypted_rows,
-    message_secret=secret,
-    poll_msg_id=poll_id,
-    poll_creator_jid=creator_jid,
-)
-
-

Display Results

-
lines = [f"{row.name}: {len(row.voters)}" for row in results]
-await client.send_text(chat_jid, "\n".join(lines))
-
-

Production Checklist

-
    -
  • Persist poll metadata (poll_id, secret, creator identity).
  • -
  • Validate option names before vote submission.
  • -
  • Keep vote aggregation idempotent.
  • -
  • Record processing checkpoint to avoid duplicate tally updates.
  • -
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file diff --git a/site/tutorials/profile-privacy/index.html b/site/tutorials/profile-privacy/index.html deleted file mode 100644 index e416516..0000000 --- a/site/tutorials/profile-privacy/index.html +++ /dev/null @@ -1,2121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Profile and Privacy - Tryx Documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- - - - - - - -
- -
- - - - -
-
- - - -
-
-
- - - - - - - -
-
-
- - - - - - - -
-
- - - - - - - - -

Tutorial: Profile and Privacy

-

Build admin-controlled profile and privacy management commands.

-
-

Use case

-

This pattern is useful for multi-operator bots that need strict control over account identity and visibility rules.

-
-

Step 1: Profile Commands

-
from tryx.events import EvMessage
-
-ADMIN = "1234567890"
-
-
-@bot.on(EvMessage)
-async def profile_commands(client, event):
-    sender = event.data.message_info.source.sender.user
-    if sender != ADMIN:
-        return
-
-    text = (event.data.get_text() or "").strip()
-    chat = event.data.message_info.source.chat
-
-    if text.startswith("/profile name "):
-        await client.profile.set_push_name(text.split(maxsplit=2)[2])
-        await client.send_text(chat, "Name updated")
-
-    elif text.startswith("/profile status "):
-        await client.profile.set_status_text(text.split(maxsplit=2)[2])
-        await client.send_text(chat, "Status updated")
-
-

Step 2: Privacy Category Commands

-
from tryx.client import PrivacyCategory, PrivacyValue
-
-
-@bot.on(EvMessage)
-async def privacy_commands(client, event):
-    text = (event.data.get_text() or "").strip()
-    chat = event.data.message_info.source.chat
-
-    if text == "/privacy list":
-        rows = await client.privacy.fetch_settings()
-        lines = [f"{row.category}: {row.value}" for row in rows]
-        await client.send_text(chat, "\n".join(lines))
-
-    elif text == "/privacy status contacts":
-        await client.privacy.set_setting(PrivacyCategory.Status, PrivacyValue.Contacts)
-        await client.send_text(chat, "Status visibility set to contacts")
-
-

Step 3: Disallowed List Example

-
from tryx.client import DisallowedListAction, DisallowedListUpdate, DisallowedListUserEntry
-
-
-async def block_visibility_for(client, target_jid):
-    update = DisallowedListUpdate(
-        dhash="",
-        users=[DisallowedListUserEntry(action=DisallowedListAction.Add, jid=target_jid)],
-    )
-    await client.privacy.set_disallowed_list(PrivacyCategory.Status, update)
-
-

Operational Guidance

-
-
-
-
    -
  • Keep profile/privacy commands admin-only.
  • -
  • Log every policy change.
  • -
-
-
-
    -
  • Validate category/value command input before applying.
  • -
  • Rate-limit mutation commands.
  • -
-
-
-
- - - - - - - - - - - - - - - -
-
- - - - - -
- - - -
- - - -
-
-
-
- - - - - - - - - - \ No newline at end of file From 0d9ecc63ed4ba76424e1f40e2086e1864ee0f07e Mon Sep 17 00:00:00 2001 From: krypton-byte Date: Wed, 1 Apr 2026 21:31:14 +0700 Subject: [PATCH 07/11] fix(workflow): update branch references from 'main' to 'master' in documentation workflow --- .github/workflows/docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3cc81b7..ab365da 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,7 +3,7 @@ name: Documentation on: push: branches: - - main + - master paths: - "docs/**" - "mkdocs.yml" @@ -45,7 +45,7 @@ jobs: deploy: name: Deploy docs - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + if: github.event_name == 'push' && github.ref == 'refs/heads/master' needs: build runs-on: ubuntu-latest environment: From 6bd891e87b8befcf3468bd516d5f2ad403320e86 Mon Sep 17 00:00:00 2001 From: krypton-byte Date: Wed, 1 Apr 2026 21:32:44 +0700 Subject: [PATCH 08/11] chore(deps): update tryx version from 0.2.0 to 0.3.0 in Cargo.lock --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 9e157f0..dcfb39b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "tryx" -version = "0.2.0" +version = "0.3.0" dependencies = [ "async-trait", "chrono", From b477e44ac37b3f5b2d200de9cd5e46155094de3a Mon Sep 17 00:00:00 2001 From: krypton-byte Date: Wed, 1 Apr 2026 20:08:55 +0700 Subject: [PATCH 09/11] feat(release): enhance workflow dispatch with release type options and improve documentation --- .github/workflows/release.yml | 1 + CONTRIBUTING.md | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f74906e..c1e4cfe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,7 @@ jobs: echo "ref=${GITHUB_REF}" echo "actor=${GITHUB_ACTOR}" echo "default_branch=${{ github.event.repository.default_branch }}" + echo "release_type=${{ github.event.inputs.release_type || 'auto' }}" - uses: actions/checkout@v4 with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d8e871..539e312 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -110,10 +110,11 @@ Use this rule of thumb for automatic versioning: How to trigger semantic release until publish to PyPI: 1. Push commits to default branch (direct push or merged PR), using Conventional Commit messages. -2. Open GitHub Actions and run `Semantic Release` on default branch. -3. Workflow evaluates commits and creates tag `vX.Y.Z` when releasable commits exist. -4. Workflow creates the corresponding GitHub Release. -5. CI workflow runs on that tag and publishes artifacts to PyPI. +2. Open GitHub Actions and run `Semantic Release` on the default branch. +3. Choose `release_type`: `auto` (default) for commit-based bump, or `patch`/`minor`/`major` to force bump manually. +4. Workflow evaluates commits and creates tag `vX.Y.Z` when releasable commits exist. +5. Workflow creates the corresponding GitHub Release. +6. CI workflow runs on that tag and publishes artifacts to PyPI. Manual fallback (if needed): From 2e3667a8a2801c8fb083a6e38b8d28cc8379ef49 Mon Sep 17 00:00:00 2001 From: krypton-byte Date: Wed, 1 Apr 2026 21:37:37 +0700 Subject: [PATCH 10/11] fix(workflow): remove duplicate ref line in release workflow --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1e4cfe..a074bdc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,6 @@ jobs: - uses: actions/checkout@v4 with: - ref: ${{ github.event.repository.default_branch }} ref: ${{ github.event.repository.default_branch }} fetch-depth: 0 submodules: recursive From 32fcaec8caf5d074ee257c4d29762645f0233cec Mon Sep 17 00:00:00 2001 From: krypton-byte Date: Wed, 1 Apr 2026 22:11:18 +0700 Subject: [PATCH 11/11] refactor(README): streamline content and enhance clarity by removing redundant sections --- README.md | 525 +++++++----------------------------------------------- 1 file changed, 60 insertions(+), 465 deletions(-) diff --git a/README.md b/README.md index c54c46b..a8c62f2 100644 --- a/README.md +++ b/README.md @@ -1,142 +1,37 @@ # Tryx -Tryx is a Rust-powered Python SDK for building WhatsApp automations with an async-first developer experience, typed APIs, and high runtime efficiency. +[![CI](https://img.shields.io/github/actions/workflow/status/krypton-byte/tryx/CI.yml?label=CI&style=for-the-badge&logo=githubactions)](https://github.com/krypton-byte/tryx/actions/workflows/CI.yml) +[![Release](https://img.shields.io/github/actions/workflow/status/krypton-byte/tryx/release.yml?label=Release&style=for-the-badge&logo=githubactions)](https://github.com/krypton-byte/tryx/actions/workflows/release.yml) +[![Docs](https://img.shields.io/badge/Docs-Live-0ea5e9?style=for-the-badge&logo=readthedocs&logoColor=white)](http://krypton-byte.tech/tryx/) +[![Python](https://img.shields.io/badge/Python-3.8%2B-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/) +[![Rust](https://img.shields.io/badge/Rust-Stable-000000?style=for-the-badge&logo=rust)](https://www.rust-lang.org/) +[![Typed](https://img.shields.io/badge/Typing-PEP%20561-0ea5e9?style=for-the-badge)](https://peps.python.org/pep-0561/) +[![License](https://img.shields.io/github/license/krypton-byte/tryx?style=for-the-badge)](LICENSE) + +Tryx is a Rust-powered Python SDK for building WhatsApp automations with an async-first API, strong typing, and production-focused performance. It combines: -- Rust for protocol, transport, and runtime-heavy work + +- Rust for protocol and runtime-heavy paths - PyO3 for Python bindings - Tokio for async orchestration -- Protobuf interop via generated WhatsApp Python types - -## Why Tryx - -- Low-latency runtime path for event processing -- Python-friendly API surface for application logic -- Structured event model with explicit classes -- Optional blocking mode for script-style execution -- Typed package distribution with `.pyi` and `py.typed` - -## Key Features - -- Async bot lifecycle: `await bot.run()` -- Blocking lifecycle for simple scripts: `bot.run_blocking()` -- Event registration decorator: `@bot.on(EventType)` -- Messaging API (text, media upload, media download) -- Dedicated contact namespace: `client.contact.*` -- Dedicated chat-actions namespace: `client.chat_actions.*` -- Dedicated community namespace: `client.community.*` -- Dedicated newsletter namespace: `client.newsletter.*` -- Dedicated groups namespace: `client.groups.*` -- Dedicated status namespace: `client.status.*` -- Dedicated chatstate namespace: `client.chatstate.*` -- Dedicated blocking namespace: `client.blocking.*` -- Dedicated polls namespace: `client.polls.*` -- Dedicated presence namespace: `client.presence.*` -- Dedicated helper namespace: `tryx.helpers.*` -- Rich event payload classes with lazy conversion where possible - -## Architecture Overview - -Tryx is split into two layers: - -1. Core (Rust) -- Transport, protocol state, and event stream integration -- WhatsApp runtime from submodule stack in `libs/whatsapp-rust` -- PyO3 bindings in `src/` - -2. Interface (Python) -- Dynamic re-export modules in `python/tryx/*.py` -- Type stubs in `python/tryx/*.pyi` -- Generated protobuf package in `python/tryx/waproto` - -## Native Binding Advantages (Rust + PyO3) - -Tryx uses native Rust bindings instead of a pure-Python protocol implementation. -This gives concrete benefits for this specific project: - -- Lower CPU overhead on hot paths such as event parsing and media/protobuf conversion. -- Better memory behavior because heavy objects stay in Rust and are exposed to Python only when needed. -- Async safety and runtime control from Tokio while keeping Python application code simple. -- Ability to cache expensive Python type lookups once (PyOnceLock) and reuse them across events. -- Cleaner separation: Rust handles protocol/runtime mechanics, Python handles business logic and integrations. - -In practical terms, this means Python callbacks remain expressive while most protocol-heavy work stays fast and predictable. - -## Centralized PyOnceLock Cache - -Event protobuf type caches are centralized in `src/events/proto_cache.rs`. - -Why this helps: -- All static PyOnceLock declarations are in one file. -- All cache lookup helpers are in one place. -- Easier maintenance and code search when adding/removing protobuf-backed fields. -- Lower risk of duplicated cache logic in multiple event files. - -The event layer now consumes cache helpers from this module, keeping event structs focused on payload mapping instead of cache plumbing. - -## Concurrency and Overhead Model - -Tryx currently uses `watch::Receiver>>` to expose the active client across binding objects. - -Why this is a good default for PyO3 async bindings: -- `watch::Receiver` is read-optimized and cheap to clone. -- Stored value is `Arc`, so clone cost is minimal (atomic refcount). -- Works naturally with Tokio async context. -- Avoids explicit lock management in Python-exposed methods. - -Compared to `RwLock>>`: -- `RwLock` adds lock acquisition on every read path. -- It can increase contention under frequent method calls. -- In mixed Python/Rust workloads, lock handoff can be noisier than `watch` read snapshots. - -Recommendation: -- Keep `watch::Receiver>>` for low overhead and async safety. -- Use `RwLock` only if you need mutable shared state beyond swapping client snapshots. - -## Contact Client Design - -Tryx now exposes contact APIs through a dedicated `ContactClient` pyclass: - -- `client.contact.get_info(...)` -- `client.contact.get_user_info(...)` -- `client.contact.get_profile_picture(...)` -- `client.contact.is_on_whatsapp(...)` - -This keeps `TryxClient` focused on messaging/media and keeps contacts grouped by responsibility with no extra heavy synchronization cost. - -## Project Structure - -- `src/lib.rs`: PyO3 module bootstrap and submodule registration -- `src/clients/tryx.rs`: main `Tryx` runtime wrapper -- `src/clients/tryx_client.rs`: messaging/media client methods -- `src/clients/contacts.rs`: contact-specific client methods -- `src/events/`: dispatcher and event payload classes -- `src/types.rs`: core Python-exposed value types (`JID`, `MessageInfo`, ...) -- `python/tryx/`: Python package surface and stubs -- `python/tryx/waproto/`: generated protobuf Python files -- `libs/whatsapp-rust/`: embedded rust stack dependencies - -## Documentation Site (MkDocs Material) - -A full documentation site is provided with MkDocs Material. - -Install docs dependencies: +- Typed Python package distribution (`.pyi` + `py.typed`) -```bash -uv sync --group docs -``` +> Note: This project is an independent developer SDK and is not affiliated with WhatsApp or Meta. -Run local docs server: +## Why Tryx -```bash -uv run mkdocs serve -``` +- Async-first architecture for event-driven bots +- Python-friendly API with namespace-based clients +- High-performance native core for protocol and transport workloads +- Typed interfaces for better editor support and safer integrations +- Supports both async and blocking runtime styles -Build docs in strict mode: +## Quick Links -```bash -uv run mkdocs build --strict -``` +- Documentation: http://krypton-byte.tech/tryx/ +- Contributing Guide: [CONTRIBUTING.md](CONTRIBUTING.md) +- Command Bot Example: [examples/command_bot.py](examples/command_bot.py) ## Installation @@ -146,21 +41,19 @@ uv run mkdocs build --strict - Rust stable toolchain - `uv` -### Development install (editable) +### Development Install (Editable) ```bash uv sync --group dev uv run maturin develop ``` -### Build wheel +### Build Wheels ```bash uv run maturin build --release ``` -Wheels are produced under `target/wheels` or project-specific wheel output depending on command options. - ## Quick Start ```python @@ -186,365 +79,67 @@ if __name__ == "__main__": asyncio.run(main()) ``` -## Command Bot Example (examples) - -Contoh siap pakai tersedia di `examples/command_bot.py`. +## Feature Overview -Fitur contoh: -- command router berbasis `EvMessage` -- quoted reply pada semua balasan command -- download profile picture pengirim, lalu kirim kembali ke chat -- ambil pushname dari metadata pesan -- ambil bio/about dari contact API -- log update pushname dan bio realtime (`EvPushNameUpdate`, `EvUserAboutUpdate`) +- Event-based handlers via `@bot.on(...)` +- Runtime client namespaces: + - `contact`, `chat_actions`, `community`, `newsletter`, `groups` + - `status`, `chatstate`, `blocking`, `polls`, `presence`, `privacy`, `profile` +- Media upload/download and message sending helpers +- Typed helper utilities under `tryx.helpers` -Command yang tersedia: -- `ping` -> `pong` -- `pp` -> kirim ulang profile picture pengirim -- `pushname` -> tampilkan pushname pengirim -- `bio` -> tampilkan bio/about pengirim -- `help` / `menu` -> tampilkan daftar command +For complete API coverage, see the docs site and generated API pages. -Run: - -```bash -uv run python examples/command_bot.py -``` +## Project Layout -Opsional env: -- `TRYX_DB_PATH` (default `whatsapp.db`) - -## Python API Reference (High Level) - -### Backend - -- `SqliteBackend(path: str)` - -### Bot controller - -- `Tryx(backend)` -- `Tryx.on(event_type)` -- `await Tryx.run()` -- `Tryx.run_blocking()` -- `Tryx.get_client() -> TryxClient` - -### Runtime client - -- `TryxClient.contact -> ContactClient` -- `TryxClient.chat_actions -> ChatActionsClient` -- `TryxClient.community -> CommunityClient` -- `TryxClient.newsletter -> NewsletterClient` -- `TryxClient.groups -> GroupsClient` -- `TryxClient.status -> StatusClient` -- `TryxClient.chatstate -> ChatstateClient` -- `TryxClient.blocking -> BlockingClient` -- `TryxClient.polls -> PollsClient` -- `TryxClient.presence -> PresenceClient` -- `TryxClient.privacy -> PrivacyClient` -- `TryxClient.profile -> ProfileClient` -- `TryxClient.send_message(...)` -- `TryxClient.send_text(...)` -- `TryxClient.send_photo(...)` -- `TryxClient.send_document(...)` -- `TryxClient.send_audio(...)` -- `TryxClient.send_video(...)` -- `TryxClient.send_gif(...)` -- `TryxClient.send_sticker(...)` -- `TryxClient.request_media_reupload(...)` -- `TryxClient.download_media(...)` -- `TryxClient.upload(...)` -- `TryxClient.upload_file(...)` - -Return value penting: -- `send_message/send_text/send_photo/send_document/send_audio/send_video/send_gif/send_sticker` mengembalikan `SendResult`. -- `request_media_reupload` mengembalikan `MediaReuploadResult`. - -### Contact namespace - -- `ContactClient.get_info(phones)` -- `ContactClient.get_user_info(jid)` -- `ContactClient.get_profile_picture(jid, preview)` -- `ContactClient.is_on_whatsapp(jids)` - -### Chat actions namespace - -- `ChatActionsClient.archive_chat(jid, message_range=None)` -- `ChatActionsClient.unarchive_chat(jid, message_range=None)` -- `ChatActionsClient.pin_chat(jid)` -- `ChatActionsClient.unpin_chat(jid)` -- `ChatActionsClient.mute_chat(jid)` -- `ChatActionsClient.mute_chat_until(jid, mute_end_timestamp_ms)` -- `ChatActionsClient.unmute_chat(jid)` -- `ChatActionsClient.star_message(chat_jid, participant_jid, message_id, from_me)` -- `ChatActionsClient.unstar_message(chat_jid, participant_jid, message_id, from_me)` -- `ChatActionsClient.mark_chat_as_read(jid, read, message_range=None)` -- `ChatActionsClient.delete_chat(jid, delete_media, message_range=None)` -- `ChatActionsClient.delete_message_for_me(chat_jid, participant_jid, message_id, from_me, delete_media, message_timestamp=None)` -- `ChatActionsClient.build_message_key(...)` -- `ChatActionsClient.build_message_range(...)` - -### Community namespace - -- `CommunityClient.create(options)` -- `CommunityClient.deactivate(community_jid)` -- `CommunityClient.link_subgroups(community_jid, subgroup_jids)` -- `CommunityClient.unlink_subgroups(community_jid, subgroup_jids, remove_orphan_members)` -- `CommunityClient.get_subgroups(community_jid)` -- `CommunityClient.get_subgroup_participant_counts(community_jid)` -- `CommunityClient.query_linked_group(community_jid, subgroup_jid)` -- `CommunityClient.join_subgroup(community_jid, subgroup_jid)` -- `CommunityClient.get_linked_groups_participants(community_jid)` - -### Newsletter namespace - -- `NewsletterClient.list_subscribed()` -- `NewsletterClient.get_metadata(jid)` -- `NewsletterClient.get_metadata_by_invite(invite_code)` -- `NewsletterClient.create(name, description=None)` -- `NewsletterClient.join(jid)` -- `NewsletterClient.leave(jid)` -- `NewsletterClient.update(jid, name=None, description=None)` -- `NewsletterClient.subscribe_live_updates(jid)` -- `NewsletterClient.send_message(jid, message)` -- `NewsletterClient.send_reaction(jid, server_id, reaction)` -- `NewsletterClient.get_messages(jid, count, before=None)` - -### Groups namespace - -- `GroupsClient.query_info(jid)` -- `GroupsClient.get_participating()` -- `GroupsClient.get_metadata(jid)` -- `GroupsClient.create_group(options)` -- `GroupsClient.set_subject(jid, subject)` -- `GroupsClient.set_description(jid, description=None, prev=None)` -- `GroupsClient.leave(jid)` -- `GroupsClient.add_participants(jid, participants)` -- `GroupsClient.remove_participants(jid, participants)` -- `GroupsClient.promote_participants(jid, participants)` -- `GroupsClient.demote_participants(jid, participants)` -- `GroupsClient.get_invite_link(jid, reset)` -- `GroupsClient.set_locked(jid, locked)` -- `GroupsClient.set_announce(jid, announce)` -- `GroupsClient.set_ephemeral(jid, expiration)` -- `GroupsClient.set_membership_approval(jid, mode)` -- `GroupsClient.join_with_invite_code(code)` -- `GroupsClient.join_with_invite_v4(group_jid, code, expiration, admin_jid)` -- `GroupsClient.get_invite_info(code)` -- `GroupsClient.get_membership_requests(jid)` -- `GroupsClient.approve_membership_requests(jid, participants)` -- `GroupsClient.reject_membership_requests(jid, participants)` -- `GroupsClient.set_member_add_mode(jid, mode)` - -### Status namespace - -- `StatusClient.send_text(text, background_argb, font, recipients, options=None)` -- `StatusClient.send_image(upload, thumbnail, recipients, caption=None, options=None)` -- `StatusClient.send_video(upload, thumbnail, duration_seconds, recipients, caption=None, options=None)` -- `StatusClient.send_raw(message, recipients, options=None)` -- `StatusClient.revoke(message_id, recipients, options=None)` - -### Chatstate namespace - -- `ChatstateClient.send(to, state)` -- `ChatstateClient.send_composing(to)` -- `ChatstateClient.send_recording(to)` -- `ChatstateClient.send_paused(to)` - -### Blocking namespace - -- `BlockingClient.block(jid)` -- `BlockingClient.unblock(jid)` -- `BlockingClient.get_blocklist()` -- `BlockingClient.is_blocked(jid)` - -### Polls namespace - -- `PollsClient.create(to, name, options, selectable_count)` -- `PollsClient.vote(chat_jid, poll_msg_id, poll_creator_jid, message_secret, option_names)` -- `PollsClient.decrypt_vote(enc_payload, enc_iv, message_secret, poll_msg_id, poll_creator_jid, voter_jid)` -- `PollsClient.aggregate_votes(poll_options, votes, message_secret, poll_msg_id, poll_creator_jid)` - -### Presence namespace - -- `PresenceClient.set(status)` -- `PresenceClient.set_available()` -- `PresenceClient.set_unavailable()` -- `PresenceClient.subscribe(jid)` -- `PresenceClient.unsubscribe(jid)` - -### Profile namespace - -- `ProfileClient.set_push_name(name)` -- `ProfileClient.set_status_text(text)` -- `ProfileClient.set_profile_picture(image_data)` -- `ProfileClient.remove_profile_picture()` - -### Privacy namespace - -- `PrivacyClient.fetch_settings()` -- `PrivacyClient.set_setting(category, value)` -- `PrivacyClient.set_disallowed_list(category, update)` -- `PrivacyClient.set_default_disappearing_mode(duration_seconds)` - -### Helper namespace - -- `NewsletterHelpers.parse_message(data)` -- `NewsletterHelpers.serialize_message(message)` -- `NewsletterHelpers.build_text_message(text)` -- `GroupsHelpers.strip_invite_url(code)` -- `GroupsHelpers.build_participant(...)` -- `GroupsHelpers.build_create_options(...)` -- `StatusHelpers.build_send_options(privacy=...)` -- `StatusHelpers.default_privacy()` -- `ChatstateHelpers.composing()` -- `ChatstateHelpers.recording()` -- `ChatstateHelpers.paused()` -- `BlockingHelpers.same_user(a, b)` -- `PollsHelpers.decrypt_vote(...)` -- `PollsHelpers.aggregate_votes(...)` -- `PresenceHelpers.default_status()` - -Related typed models: - -- `CreateCommunityOptions` -- `CreateCommunityResult` -- `CommunitySubgroup` -- `LinkSubgroupsResult` -- `UnlinkSubgroupsResult` -- `GroupParticipant` -- `GroupMetadata` -- `GroupType` -- `NewsletterVerification` -- `NewsletterState` -- `NewsletterRole` -- `NewsletterReactionCount` -- `NewsletterMetadata` -- `NewsletterMessage` -- `MemberLinkMode` -- `MemberAddMode` -- `MembershipApprovalMode` -- `GroupParticipantOptions` -- `CreateGroupOptions` -- `CreateGroupResult` -- `JoinGroupResult` -- `ParticipantChangeResponse` -- `MembershipRequest` -- `GroupInfo` -- `StatusPrivacySetting` -- `StatusSendOptions` -- `ChatStateType` -- `BlocklistEntry` -- `PollOptionResult` -- `PresenceStatus` -- `SendResult` -- `MediaReuploadResult` - -## Typing Support - -Tryx ships as a typed Python package: -- Stub files in `python/tryx/*.pyi` -- Marker file `python/tryx/py.typed` - -Recommended type checkers: -- Pyright -- Mypy -- Pylance - -## Events - -Event classes are generated from Rust-side event payloads and exposed under `tryx.events`. - -Common patterns: -- `event.data` for structured payload -- lazy-converted proto fields (for lower eager conversion overhead) -- datetime and typed references where available - -## Error Handling - -Tryx exposes binding-level exceptions in `tryx.exceptions`, including: -- `FailedBuildBot` -- `EventDispatchError` -- `UnsupportedBackend` -- `UnsupportedEventType` - -Backward-compatible aliases are also available for older names. +- `src/`: Rust core bindings and runtime integration +- `python/tryx/`: Python package surface and type stubs +- `python/tryx/waproto/`: generated protobuf Python modules +- `examples/`: runnable usage examples +- `docs/`: MkDocs sources ## Development Workflow -### Rust checks - ```bash -cargo check -``` +# Lint and format check +uv run ruff check . +uv run ruff format --check . -### Python package sanity +# Validate stubs +uv run python scripts/check_stub_parity.py -```bash -uv run python -c "import tryx; print('ok')" -``` - -### Type checking example - -```bash -uv run pyright -# or -uv run mypy examples/command_bot.py -``` - -### Pre-commit hooks - -```bash -uv run pre-commit install --hook-type pre-commit --hook-type commit-msg -uv run pre-commit run --all-files +# Build docs locally +uv sync --group docs +uv run mkdocs serve ``` -## Performance Notes +## Release Workflow (Maintainers) -- Avoid creating Python objects before `.await` points in Rust async methods. -- Construct Python values inside `Python::attach(...)` after async IO completes. -- Return owned `Py` from futures when required by `Send` bounds. -- Keep payload conversion lazy when field access is infrequent. -- Centralize Python type/proto caches to minimize repeated import/lookups. +- Release is triggered manually via GitHub Actions (`Semantic Release`). +- Version bump is automatic from Conventional Commits: + - `feat` -> minor + - `fix` / `perf` -> patch + - breaking change -> major +- The workflow creates a Git tag (`vX.Y.Z`), creates a GitHub Release, then triggers CI for publish. ## Troubleshooting -### Import error for native module +### Native Module Import Error -Symptom: -- `ModuleNotFoundError: No module named 'tryx._tryx'` - -Fix: +If you see `ModuleNotFoundError: No module named 'tryx._tryx'`: ```bash uv run maturin develop --release ``` -### Bot is not running - -Symptom: -- Python methods raise runtime error before run/start - -Fix: -- Ensure bot is started (`run`/`run_blocking`) and connected before invoking runtime client methods. - -### Type checker not reading stubs - -Fix: -- Ensure local install is active in your environment -- Confirm `py.typed` is included in installed package -- Restart language server - -## Security and Compliance +### Bot Not Running -- Keep secrets and session files outside version control -- Use WhatsApp automation responsibly and within platform policy -- Audit message handling callbacks before deploying production bots +Ensure the bot runtime is started (`run` or `run_blocking`) before calling runtime client methods. ## Contributing -- Contribution guideline: `CONTRIBUTING.md` -- Docs page: `docs/getting-started/contributing.md` +See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution and release guidelines. ## License -See `LICENSE` for license terms. +This project is licensed under the terms in [LICENSE](LICENSE).